agentic_jujutsu/
lib.rs

1//! # Agentic-Jujutsu
2//!
3//! WASM-enabled Jujutsu VCS wrapper for AI agent collaboration and learning.
4//!
5//! ## Features
6//!
7//! - Zero-copy jj CLI operations
8//! - Operation log parsing and tracking
9//! - Conflict detection and resolution
10//! - WASM bindings for JavaScript/TypeScript
11//! - AgentDB integration
12
13#![warn(missing_docs)]
14#![deny(unsafe_code)]
15
16pub mod agentdb_sync;
17pub mod config;
18pub mod error;
19pub mod hooks;
20pub mod operations;
21pub mod types;
22pub mod wrapper;
23
24// MCP module only available on native (uses reqwest)
25#[cfg(not(target_arch = "wasm32"))]
26pub mod mcp;
27
28// Native module only available on native targets
29#[cfg(not(target_arch = "wasm32"))]
30pub mod native;
31
32// WASM module only available for WASM targets
33#[cfg(target_arch = "wasm32")]
34pub mod wasm;
35
36// Re-exports
37pub use agentdb_sync::{AgentDBEpisode, AgentDBSync, TaskStatistics};
38pub use config::JJConfig;
39pub use error::{JJError, Result};
40pub use hooks::{HookContext, HookEventType, JJHookEvent, JJHooksIntegration};
41pub use operations::{JJOperation, JJOperationLog, OperationType};
42pub use types::{JJBranch, JJCommit, JJConflict, JJResult};
43pub use wrapper::JJWrapper;
44
45/// Initialize panic hook for better error messages in WASM
46#[cfg(target_arch = "wasm32")]
47pub fn init() {
48    use wasm_bindgen::prelude::*;
49    console_error_panic_hook::set_once();
50}
51
52/// Version of the agentic-jujutsu crate
53pub const VERSION: &str = env!("CARGO_PKG_VERSION");
54
55#[cfg(test)]
56mod tests {
57    use super::*;
58
59    #[test]
60    fn test_version() {
61        assert!(!VERSION.is_empty());
62    }
63}