rho-coding-agent 3.12.0

A fast Rust agent harness with a small footprint and opinionated defaults
Documentation
use std::path::PathBuf;

use pretty_assertions::assert_eq;

use super::*;

fn skill(name: &str, source: SkillSource, disable_model_invocation: bool) -> Skill {
    Skill {
        name: name.to_owned(),
        description: format!("{name} skill"),
        disable_model_invocation,
        source,
        contents: String::new(),
    }
}

// Covers: the skills rho lists for an agent on another runtime are those
// it may load and does not find itself: agy reads the loose
// `.agents/skills` folders, so it is listed only rho's built-in and plugin
// skills, while Claude Code is listed every one; a skill only a person may
// start is listed to neither.
// Owner: agent session instructions (skill listing).
#[test]
fn an_agent_is_listed_the_skills_it_does_not_find_itself() {
    let skills = vec![
        skill("built-in", SkillSource::BuiltIn, false),
        skill(
            "loose",
            SkillSource::Filesystem {
                skill_file: PathBuf::from("/home/user/.agents/skills/loose/SKILL.md"),
                owner: None,
            },
            false,
        ),
        skill(
            "plugin",
            SkillSource::plugin(
                PathBuf::from("/home/user/.agents/plugins/kit/skills/plugin/SKILL.md"),
                "kit".to_owned(),
            ),
            false,
        ),
        skill("person-only", SkillSource::BuiltIn, true),
    ];
    let names = |files: SkillFiles| -> Vec<String> {
        listed_skills(&skills, files)
            .into_iter()
            .map(|skill| skill.name)
            .collect()
    };

    assert_eq!(
        [
            names(SkillFiles::FromRho),
            names(SkillFiles::LooseReadByAgent)
        ],
        [
            vec![
                "built-in".to_owned(),
                "loose".to_owned(),
                "plugin".to_owned()
            ],
            vec!["built-in".to_owned(), "plugin".to_owned()],
        ]
    );
}