INNER CODE UNIT · Python

_destinations

faridrashidi/cnsplots · src/cnsplots/_cli.py:78

def _destinations(agent: str, base_dir: Path) -> tuple[tuple[str, Path], ...]:
    names = tuple(_AGENT_SKILL_DIRS) if agent == "all" else (agent,)
    root = base_dir.resolve()
    destinations = []
    for name in names:
        if name not in _AGENT_SKILL_DIRS:
            raise ValueError(f"unsupported agent: {name}")
        path = _checked_path(root, (_AGENT_SKILL_DIRS[name] / "cnsplots").as_posix())
        if path.exists() and not path.is_dir():
            raise NotADirectoryError(f"not a skill directory: {path}")
        destinations.append((name, path))
    return tuple(destinations)


def _packaged_files() -> dict[str, bytes]:
    files: dict[str, bytes] = {}

    def read_tree(source: Traversable, prefix: str = "") -> None:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…