feat: 完成项目助手与监控演示并修复聊天及云部署配置
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"""Skills Scanner — Scan skills/ directory and generate SKILLS_SNAPSHOT.md."""
|
||||
|
||||
from pathlib import Path
|
||||
from hashlib import sha256
|
||||
|
||||
import yaml
|
||||
|
||||
@@ -21,8 +22,21 @@ def discover_skills(base_dir: Path) -> list[dict]:
|
||||
meta = yaml.safe_load(parts[1]) if len(parts) == 3 else None
|
||||
if not isinstance(meta, dict):
|
||||
continue
|
||||
entries.append({"id":file.relative_to(root).as_posix(),"name":str(meta.get("name",file.parent.name)),"description":str(meta.get("description","")),"content":content})
|
||||
except (OSError, ValueError, yaml.YAMLError):
|
||||
legacy_id = file.relative_to(root).as_posix()
|
||||
entries.append({
|
||||
"id": legacy_id,
|
||||
"component_id": str(meta.get("id", legacy_id)),
|
||||
"legacy_id": legacy_id,
|
||||
"kind": str(meta.get("kind", "skill")),
|
||||
"version": str(meta.get("version", "legacy")),
|
||||
"schema_version": int(meta.get("schema_version", 1)),
|
||||
"status": str(meta.get("status", "published")),
|
||||
"name": str(meta.get("name", file.parent.name)),
|
||||
"description": str(meta.get("description", "")),
|
||||
"content_hash": sha256(content.encode("utf-8")).hexdigest(),
|
||||
"content": content,
|
||||
})
|
||||
except (OSError, ValueError, TypeError, yaml.YAMLError):
|
||||
continue
|
||||
return entries
|
||||
|
||||
@@ -35,7 +49,7 @@ def scan_skills(base_dir: Path) -> str:
|
||||
if not skills_dir.exists():
|
||||
skills_dir.mkdir(parents=True)
|
||||
|
||||
skills = [{**s, "location":f"./backend/skills/{s['id']}"} for s in discover_skills(base_dir)]
|
||||
skills = [{**s, "location":f"./backend/skills/{s['legacy_id']}"} for s in discover_skills(base_dir)]
|
||||
|
||||
# Build XML-style snapshot
|
||||
lines = ["<available_skills>"]
|
||||
|
||||
Reference in New Issue
Block a user