codetether-agent 4.7.0-a-002.2

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
use crate::tool::computer_use::input::ComputerUseInput;

pub fn coords(input: &ComputerUseInput) -> anyhow::Result<(i32, i32)> {
    Ok((coord(input.x, "x")?, coord(input.y, "y")?))
}

pub fn coord(value: Option<f64>, name: &str) -> anyhow::Result<i32> {
    let value = value.ok_or_else(|| anyhow::anyhow!("{name} is required"))?;
    anyhow::ensure!(value.is_finite(), "{name} must be finite");
    anyhow::ensure!(
        value >= i32::MIN as f64 && value <= i32::MAX as f64,
        "{name} out of range"
    );
    Ok(value.round() as i32)
}