INNER CODE UNIT · Python
extract_paths
softaworks/agent-toolkit · scripts/build_plugins.py:42
def extract_paths(plugin: dict) -> list[tuple[str, str]]:
"""Extract (source_path, type) pairs from a plugin entry.
Returns list of (relative_path, component_type) where component_type
is 'skill_dir', 'agent_file', or 'command_file'.
"""
paths = []
for skill_path in plugin.get("skills", []):
# "./skills/mermaid-diagrams" -> "skills/mermaid-diagrams"
clean = skill_path.lstrip("./")
paths.append((clean, "skill_dir"))
for agent_path in plugin.get("agents", []):
# "./agents/ui-ux-designer.md" -> "agents/ui-ux-designer.md"
clean = agent_path.lstrip("./")
paths.append((clean, "agent_file"))