1use crate::error::Result;
4use std::collections::HashMap;
5
6#[derive(Debug, Clone)]
8pub struct AgentConfig {
9 pub agent_did: String,
11
12 pub security_mode: Option<String>,
14
15 pub debug: bool,
17
18 pub timeout_seconds: Option<u64>,
20
21 pub parameters: HashMap<String, String>,
23}
24
25impl AgentConfig {
26 pub fn new(did: String) -> Self {
29 Self {
30 agent_did: did,
31 security_mode: Some("SIGNED".to_string()),
32 debug: false,
33 timeout_seconds: Some(30),
34 parameters: HashMap::new(),
35 }
36 }
37
38 pub fn set_parameter(&mut self, key: &str, value: &str) {
40 self.parameters.insert(key.to_string(), value.to_string());
41 }
42
43 pub fn get_parameter(&self, key: &str) -> Option<&String> {
45 self.parameters.get(key)
46 }
47
48 pub fn with_security_mode(mut self, mode: &str) -> Self {
50 self.security_mode = Some(mode.to_string());
51 self
52 }
53
54 pub fn with_debug(mut self, debug: bool) -> Self {
56 self.debug = debug;
57 self
58 }
59}
60
61impl Default for AgentConfig {
62 fn default() -> Self {
63 Self::new("default_did".to_string())
64 }
65}
66
67pub fn validate(_config: &AgentConfig) -> Result<()> {
69 Ok(())
71}