INNER CODE UNIT · Python

path

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

        path = path / part
        if path.is_symlink():
            raise ValueError(f"refusing to follow skill symlink: {path}")
    return path


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)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…