Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions mcp_host_skills_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}

MANIFEST_PATHS = {
"claude": Path("claude/plugin.json"),
"claude": Path("claude/.claude-plugin/plugin.json"),
"codex": Path("codex/.codex-plugin/plugin.json"),
}

Expand All @@ -62,15 +62,20 @@ def _read_json(path: Path) -> dict[str, object]:
return json.loads((PLUGIN_ROOT / path).read_text())


def _manifest_skill_path(mcp_host_root: Path, raw_path: str) -> Path:
skill_path = (mcp_host_root / raw_path.removeprefix("./")).resolve()
if skill_path.name != "SKILL.md":
skill_path /= "SKILL.md"
return skill_path


def _manifest_skill_paths(mcp_host: str) -> list[Path]:
manifest = _read_json(MANIFEST_PATHS[mcp_host])
skills = manifest.get("skills", [])
mcp_host_root = PLUGIN_ROOT / mcp_host

if isinstance(skills, list):
return [
(mcp_host_root / skill.removeprefix("./")).resolve() for skill in skills
]
return [_manifest_skill_path(mcp_host_root, skill) for skill in skills]

if isinstance(skills, str):
skill_dir = mcp_host_root / skills.removeprefix("./")
Expand Down
2 changes: 1 addition & 1 deletion package_validation_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}

MANIFEST_PATHS = [
Path("claude/plugin.json"),
Path("claude/.claude-plugin/plugin.json"),
Path("codex/.codex-plugin/plugin.json"),
]

Expand Down
Loading