ai-agent 0.13.4

Idiomatic agent sdk inspired by the claude code source leak
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Source: /data/home/swei/claudecode/openclaudecode/src/utils/errors.ts
pub fn error_message(error: &dyn std::error::Error) -> String {
    error.to_string()
}

pub fn to_error<T: std::fmt::Display>(err: T) -> std::boxed::Box<dyn std::error::Error> {
    std::boxed::Box::new(err.to_string())
}

pub fn is_enoent(error: &dyn std::error::Error) -> bool {
    error
        .downcast_ref::<std::io::Error>()
        .map(|e| e.kind() == std::io::ErrorKind::NotFound)
        .unwrap_or(false)
}