ai-agent 0.13.4

Idiomatic agent sdk inspired by the claude code source leak
Documentation
// Source: /data/home/swei/claudecode/openclaudecode/src/components/FeedbackSurvey/utils.ts
pub struct TypeUtils;

impl TypeUtils {
    pub fn is_defined<T>(value: &Option<T>) -> bool {
        value.is_some()
    }

    pub fn is_undefined<T>(value: &Option<T>) -> bool {
        value.is_none()
    }

    pub fn coalesce<T>(a: Option<T>, b: T) -> T {
        a.unwrap_or(b)
    }

    pub fn map_or<T, U>(opt: Option<T>, f: impl FnOnce(T) -> U, default: U) -> U {
        opt.map(f).unwrap_or(default)
    }
}