codetether-agent 4.7.0-a-002.4

A2A-native AI coding agent for the CodeTether ecosystem
Documentation
use serde_json::json;

use crate::tool::Tool;
use crate::tool::tetherscript::TetherScriptPluginTool;

#[tokio::test]
async fn executes_inline_tetherscript_hook_through_tool_trait() {
    let tool = TetherScriptPluginTool::new();
    let result = tool
        .execute(json!({
            "source": r#"
fn validate(name) {
    println("tetherscript saw " + name)
    return Ok("hello " + name)
}
"#,
            "hook": "validate",
            "args": ["codetether"]
        }))
        .await
        .unwrap();

    assert!(result.success);
    assert!(result.output.contains("tetherscript saw codetether"));
    assert!(result.output.contains("Ok(hello codetether)"));
    assert_eq!(
        result.metadata.get("value"),
        Some(&json!({"ok": "hello codetether"}))
    );
}