pub struct AgentInfo {
pub peer_id: PeerId,
pub name: Option<String>,
pub storage_path: PathBuf,
pub dashboard_url: String,
pub ed25519_public_key_hex: String,
pub x25519_public_key_hex: String,
pub claim_token: Option<String>,
}Expand description
Lightweight agent information that can be read without starting the runtime.
Use this for CLI info commands, status checks, or any scenario where you need agent metadata without spawning the full actor system.
Fields§
§peer_id: PeerIdUnique agent identifier derived from Ed25519 public key
name: Option<String>Human-readable 3-word name (e.g., “conscious-jade-mongoose”) None if agent hasn’t registered with the server yet
storage_path: PathBufPath to agent storage directory
dashboard_url: StringDashboard URL for this agent
ed25519_public_key_hex: StringEd25519 public key in hex format
x25519_public_key_hex: StringX25519 public key in hex format (for future encrypted communication)
claim_token: Option<String>Workspace claim token if agent is claimed
Implementations§
Source§impl AgentInfo
impl AgentInfo
Sourcepub fn read(storage_path: &Path, api_url: Option<&str>) -> Result<Self>
pub fn read(storage_path: &Path, api_url: Option<&str>) -> Result<Self>
Read agent info from storage without starting the runtime.
This is a lightweight operation that only reads files from disk. No actors, databases, or network connections are started.
Tries TOML format first (agent.toml), then falls back to legacy
separate files (agent_id.key, claim_token, agent_name).
§Arguments
storage_path- Path to the agent’s storage directoryapi_url- Optional API URL override for computing the dashboard URL. If None, uses the default from constants::api_url().
§Returns
Returns AgentInfo if the identity file exists, or an error if the
agent has not been initialized yet.
§Example
use elo::AgentInfo;
use std::path::Path;
let info = AgentInfo::read(Path::new("/var/lib/loa"), None)?;
println!("Agent: {} ({})", info.name, info.peer_id);
println!("Dashboard: {}", info.dashboard_url);