codetether-agent 4.7.0-a-002.4

A2A-native AI coding agent for the CodeTether ecosystem
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::super::{lines, types::*};

pub fn file(path: &str, old: Option<&str>, new: &str, limit: usize) -> GuardFile {
    GuardFile {
        path: path.into(),
        status: if old.is_some() {
            FileStatus::Modified
        } else {
            FileStatus::Added
        },
        old_code_lines: old.map(lines::code_lines),
        new_code_lines: lines::code_lines(new),
        limit,
        wrapper_target: super::super::wrapper::target(path, new),
        old_text: old.map(str::to_string),
        new_text: new.into(),
    }
}