修复 Admin Skills 安装区块不显示,并支持卸载 _workspace/public lane。

同时补齐 _workspace/public 目录约定、公共技能免绑定规则,并为 run_command 增加默认禁用开关与回归测试。

Made-with: Cursor
This commit is contained in:
oliver 2026-05-01 03:34:32 +08:00
parent da2413afad
commit 5d67303d22
11 changed files with 118 additions and 5 deletions

View file

@ -148,6 +148,28 @@ def discover_workspace_skill_manifests(skills_root: str | Path | None = None) ->
return tuple(out)
def discover_public_workspace_skill_names(skills_root: str | Path | None = None) -> set[str]:
"""Skill names under `<skills_root>/_workspace/public/<skill>/SKILL.md`.
These skills are treated as public and do not require role binding.
"""
base = Path(skills_root).resolve() if skills_root else default_skills_root()
public_root = (base / "_workspace" / "public").resolve()
if not public_root.exists() or not public_root.is_dir():
return set()
out: set[str] = set()
try:
for md in public_root.rglob("SKILL.md"):
if not md.is_file():
continue
m = load_skill_manifest(md.parent)
if m and str(m.name or "").strip():
out.add(str(m.name).strip())
except Exception:
return set()
return out
def _tool_origin(tool: "ToolSpec") -> str:
nm = str(getattr(tool, "name", "") or "")
if nm.startswith("mcp__"):