#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct WriteOutput {
pub r#type: &'static str,
pub status: &'static str,
pub path: String,
pub bytes_written: u64,
pub checksum: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub checksum_before: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub backup_path: Option<String>,
pub elapsed_ms: u64,
pub stdin_bytes_read: u64,
pub wal_policy: &'static str,
pub platform: PlatformInfo,
#[serde(skip_serializing_if = "Option::is_none")]
pub mtime_preserved: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub risk_assessment: Option<WriteRiskAssessment>,
}
#[derive(Debug, Clone, PartialEq, Serialize, JsonSchema)]
pub struct Submatch {
pub r#match: String,
pub start: usize,
pub end: usize,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct SearchEnd {
pub r#type: &'static str,
pub path: String,
pub stats: FileStats,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct SearchCount {
pub r#type: &'static str,
pub path: String,
pub count: u64,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct Summary {
pub r#type: &'static str,
pub files_visited: u64,
pub files_matched: u64,
#[serde(skip_serializing_if = "Option::is_none")]
pub files_modified: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub files_skipped: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub total_matches: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub total_replacements: Option<u64>,
pub elapsed_ms: u64,
}
#[derive(Debug, Clone, PartialEq, Serialize, JsonSchema)]
pub struct BestCandidate {
#[serde(skip_serializing_if = "Option::is_none")]
pub text: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub line: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub column: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub similarity: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub strategy: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub diff_preview: Option<String>,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct DryRunPlan {
pub r#type: &'static str,
pub operation: String,
pub path: String,
pub would_modify: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub details: Option<String>,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct ListSummary {
pub r#type: &'static str,
pub files: u64,
pub dirs: u64,
pub symlinks: u64,
#[serde(skip_serializing_if = "Option::is_none")]
pub total_bytes: Option<u64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub by_extension: Option<std::collections::BTreeMap<String, u64>>,
pub elapsed_ms: u64,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct RegexOutput {
pub r#type: &'static str,
pub regex: String,
pub examples: u64,
pub anchored: bool,
pub elapsed_ms: u64,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct ScopeResult {
pub r#type: &'static str,
pub path: String,
pub language: String,
pub query: String,
pub action: String,
pub scopes_matched: u64,
pub bytes_before: u64,
pub bytes_after: u64,
pub checksum_before: String,
pub checksum_after: String,
pub elapsed_ms: u64,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct ApplyResult {
pub r#type: &'static str,
pub path: String,
pub format_detected: String,
pub hunks_applied: u64,
pub bytes_before: u64,
pub bytes_after: u64,
pub checksum_before: String,
pub checksum_after: String,
pub elapsed_ms: u64,
}
#[derive(Debug, Serialize, JsonSchema)]
pub struct DiffStatOutput {
pub r#type: &'static str,
pub identical: bool,
pub file_a: String,
pub file_b: String,
pub insertions: u64,
pub deletions: u64,
pub similarity_ratio: f32,
pub elapsed_ms: u64,
}
#[derive(Debug, Serialize, JsonSchema)]
pub struct DiffChangeOutput<'a> {
pub r#type: &'static str,
pub tag: &'static str,
pub line: usize,
pub text: &'a str,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct TransferPlan {
pub r#type: &'static str,
pub operation: &'static str,
pub source: String,
pub target: String,
pub would_modify: bool,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct CopyOutput {
pub r#type: &'static str,
pub source: String,
pub target: String,
pub bytes: usize,
pub checksum: String,
pub verified: bool,
pub elapsed_ms: u64,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct CountByExtOutput {
pub r#type: &'static str,
pub mode: &'static str,
pub by_extension: std::collections::BTreeMap<String, ExtCountOutput>,
pub elapsed_ms: u64,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct SizeEntry {
pub path: String,
pub bytes: u64,
}
#[derive(Default, Debug, PartialEq, Serialize, JsonSchema)]
pub struct ExtCountOutput {
pub files: u64,
pub lines: u64,
pub blank: u64,
pub bytes: u64,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct RollbackPlan {
pub r#type: &'static str,
pub operation: &'static str,
pub path: String,
pub restore_from: String,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct ReplaceErrorEvent {
pub status: &'static str,
pub path: String,
pub message: String,
pub error_class: &'static str,
pub retryable: bool,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct PruneBackupEntry {
pub r#type: &'static str,
pub path: String,
pub reason: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option<String>,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct FileMatchEvent {
pub r#type: &'static str,
pub path: String,
pub name: String,
pub target: &'static str,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct SemanticIndexToken {
pub t: String,
pub p: String,
pub l: u64,
pub s: String,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct QueryMatchEvent {
pub r#type: &'static str,
pub path: String,
pub language: String,
pub kind: String,
pub is_named: bool,
pub text: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub capture_name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub start_byte: Option<usize>,
#[serde(skip_serializing_if = "Option::is_none")]
pub end_byte: Option<usize>,
#[serde(skip_serializing_if = "Option::is_none")]
pub start_line: Option<usize>,
#[serde(skip_serializing_if = "Option::is_none")]
pub start_column: Option<usize>,
#[serde(skip_serializing_if = "Option::is_none")]
pub end_line: Option<usize>,
#[serde(skip_serializing_if = "Option::is_none")]
pub end_column: Option<usize>,
}
#[derive(Debug, PartialEq, Serialize, JsonSchema)]
pub struct SparseReadEvent {
pub r#type: &'static str,
pub path: String,
pub head: String,
pub lines: u64,
}