INNER CODE UNIT · Rust
new
xuzhougeng/wisp-science · crates/wisp-acp/src/lib.rs:50
pub fn new(
id: impl Into<String>,
label: impl Into<String>,
command: impl Into<PathBuf>,
args: Vec<String>,
) -> Self {
Self {
id: id.into(),
label: label.into(),
command: command.into(),
args,
env: BTreeMap::new(),
}
}
fn validate(&self) -> Result<(), AcpError> {
if self.id.trim().is_empty() {
return Err(AcpError::InvalidProfile("agent id is empty"));