pub struct AgentManifest {
pub metadata: AgentMetadata,
pub requirements: Option<Requirements>,
pub config: HashMap<String, Value>,
}Expand description
Agent configuration manifest.
Represents the complete configuration for a AGPM agent, including metadata, requirements, and custom configuration. This structure can be loaded from standalone TOML files or extracted from Markdown frontmatter.
§Structure
metadata: Core information about the agentrequirements: Optional dependency and platform requirementsconfig: Custom configuration as key-value pairs
§Examples
§Minimal Agent
use agpm_cli::config::{AgentManifest, AgentMetadata};
use std::collections::HashMap;
let manifest = AgentManifest {
metadata: AgentMetadata {
name: "simple-agent".to_string(),
description: "A simple agent".to_string(),
author: "Developer".to_string(),
license: "MIT".to_string(),
homepage: None,
repository: None,
keywords: vec![],
categories: vec![],
},
requirements: None,
config: HashMap::new(),
};§Loading from File
use agpm_cli::config::AgentManifest;
use std::path::Path;
let manifest = AgentManifest::load(Path::new("my-agent.toml"))?;
println!("Loaded agent: {}", manifest.metadata.name);Fields§
§metadata: AgentMetadataCore metadata about the agent.
Contains essential information like name, description, author, and categorization. This metadata is used for discovery, documentation, and dependency resolution.
requirements: Option<Requirements>Optional requirements and dependencies.
Specifies version requirements, platform constraints, and dependencies on other
resources. If None, the agent has no special requirements.
config: HashMap<String, Value>Custom configuration values.
Arbitrary key-value pairs that can be used by the agent for configuration. Values can be any valid TOML type (string, number, boolean, array, table).
§Examples
[config]
max_tokens = 4000
style = "verbose"
features = ["linting", "formatting"]
[config.advanced]
retry_attempts = 3
timeout_seconds = 30Implementations§
Source§impl AgentManifest
impl AgentManifest
Sourcepub fn load(path: &Path) -> Result<Self>
pub fn load(path: &Path) -> Result<Self>
Load agent manifest from a TOML file.
Reads and parses an agent configuration file from the specified path.
§Parameters
path: Path to the TOML configuration file
§Examples
use agpm_cli::config::AgentManifest;
use std::path::Path;
let manifest = AgentManifest::load(Path::new("agents/rust-expert.toml"))?;
println!("Agent: {}", manifest.metadata.name);§Errors
Returns an error if:
- The file cannot be read (not found, permissions, etc.)
- The file contains invalid TOML syntax
- The TOML structure doesn’t match the expected schema
Trait Implementations§
Source§impl Clone for AgentManifest
impl Clone for AgentManifest
Source§fn clone(&self) -> AgentManifest
fn clone(&self) -> AgentManifest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more