#[non_exhaustive]pub struct AgentConfig {
pub agent_id: String,
pub name: String,
pub policy: SandboxPolicy,
pub capabilities: Capabilities,
pub workspace: Option<WorkspaceConfig>,
pub lifecycle: LifecycleConfig,
pub env: HashMap<String, String>,
pub image: Option<String>,
}Expand description
Configuration for registering an agent.
Defines the agent’s identity, sandbox policy, capabilities, and lifecycle rules. Submitted via the agent registration API.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.agent_id: StringUnique agent identifier (alphanumeric + hyphens, max 64 chars).
name: StringHuman-readable display name.
policy: SandboxPolicySandbox policy for this agent’s container. Defaults to WasmOnly.
capabilities: CapabilitiesCapabilities (network, credentials, resources).
workspace: Option<WorkspaceConfig>Workspace mount configuration. None for no persistent workspace.
lifecycle: LifecycleConfigLifecycle configuration (idle timeout, restart policy).
env: HashMap<String, String>Extra environment variables injected into the agent’s container.
image: Option<String>Docker image override. None uses the server default.
Implementations§
Source§impl AgentConfig
impl AgentConfig
Sourcepub fn new(agent_id: impl Into<String>, name: impl Into<String>) -> Self
pub fn new(agent_id: impl Into<String>, name: impl Into<String>) -> Self
Create an agent config with the given ID and name, using defaults for everything else.
Sourcepub fn with_policy(self, policy: SandboxPolicy) -> Self
pub fn with_policy(self, policy: SandboxPolicy) -> Self
Set the sandbox policy.
Sourcepub fn with_capabilities(self, capabilities: Capabilities) -> Self
pub fn with_capabilities(self, capabilities: Capabilities) -> Self
Set capabilities.
Sourcepub fn with_workspace(self, workspace: WorkspaceConfig) -> Self
pub fn with_workspace(self, workspace: WorkspaceConfig) -> Self
Set workspace configuration.
Sourcepub fn with_lifecycle(self, lifecycle: LifecycleConfig) -> Self
pub fn with_lifecycle(self, lifecycle: LifecycleConfig) -> Self
Set lifecycle configuration.
Sourcepub fn with_image(self, image: impl Into<String>) -> Self
pub fn with_image(self, image: impl Into<String>) -> Self
Set the Docker image.
Trait Implementations§
Source§impl Clone for AgentConfig
impl Clone for AgentConfig
Source§fn clone(&self) -> AgentConfig
fn clone(&self) -> AgentConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more