agent-cid 0.1.0

Content-addressed artifact manifest for AI agents (Rust port of @p-vbordei/agent-cid)
Documentation
1
2
3
4
5
6
7
8
use serde_json::Value;

use crate::error::Error;

pub fn canonical_encode(value: &Value) -> Result<Vec<u8>, Error> {
    let s = serde_jcs::to_string(value).map_err(|e| Error::Invalid(format!("jcs: {e}")))?;
    Ok(s.into_bytes())
}