Returns True if the directory contains a single agent configuration or file.
(path: Path | str)
| 41 | |
| 42 | |
| 43 | def is_single_agent_directory(path: Path | str) -> bool: |
| 44 | """Returns True if the directory contains a single agent configuration or file.""" |
| 45 | p = Path(path).resolve() |
| 46 | return ( |
| 47 | p.joinpath("agent.py").is_file() |
| 48 | or p.joinpath("root_agent.yaml").is_file() |
| 49 | ) |
| 50 | |
| 51 | |
| 52 | # Special agents directory for agents with names starting with double underscore |