pub mod error;
pub mod plugin;
pub mod registry;
pub mod types;
pub use error::DriverError;
pub use plugin::{BuiltinDriverPlugin, DriverPlugin, PluginError, PluginRegistry};
pub use registry::DriverRegistry;
pub use types::{DiffHunk, DiffHunkType, DiffSummary, VisualDiff};
pub trait SutureDriver: Send + Sync {
fn name(&self) -> &str;
fn supported_extensions(&self) -> &[&str];
fn diff(
&self,
base_content: Option<&str>,
new_content: &str,
) -> Result<Vec<SemanticChange>, DriverError>;
fn format_diff(
&self,
base_content: Option<&str>,
new_content: &str,
) -> Result<String, DriverError>;
fn merge(
&self,
_base: &str,
_ours: &str,
_theirs: &str,
) -> Result<Option<String>, DriverError> {
Ok(None)
}
}
#[derive(Debug, Clone, PartialEq)]
pub enum SemanticChange {
Added { path: String, value: String },
Removed { path: String, old_value: String },
Modified {
path: String,
old_value: String,
new_value: String,
},
Moved {
old_path: String,
new_path: String,
value: String,
},
}