Skip to main content

agent_doc/
lib.rs

1//! agent-doc library — shared components for CLI, FFI, and editor plugins.
2//!
3//! Re-exports the core document manipulation modules that are shared between
4//! the CLI binary and native plugin bindings (JNI, napi-rs).
5
6pub mod component;
7pub mod crdt;
8pub mod ffi;
9pub mod frontmatter;
10pub mod merge;
11pub mod template;
12
13/// Default number of hex characters for boundary IDs.
14pub const BOUNDARY_ID_LEN: usize = 8;
15
16/// Generate a new boundary ID (short hex string from UUID v4).
17pub fn new_boundary_id() -> String {
18    let full = uuid::Uuid::new_v4().to_string().replace('-', "");
19    full[..BOUNDARY_ID_LEN.min(full.len())].to_string()
20}
21
22/// Format a boundary marker comment.
23pub fn format_boundary_marker(id: &str) -> String {
24    format!("<!-- agent:boundary:{} -->", id)
25}