"""SKILL.md 读取服务。 文档本身不含固定模型名,模型清单一律来自 discover_models 的实时返回。 """ from __future__ import annotations from datetime import datetime from .. import config def _read() -> str: if config.SKILL_PATH.is_file(): return config.SKILL_PATH.read_text(encoding="utf-8") return "" def get_skill() -> dict[str, str]: body = _read() stat = config.SKILL_PATH.stat() if config.SKILL_PATH.is_file() else None if stat: mtime = datetime.fromtimestamp(stat.st_mtime) updated_at = mtime.strftime("%Y-%m-%d %H:%M") version = mtime.strftime("%Y-%m-%d") else: updated_at = "—" version = "—" return {"version": version, "updated_at": updated_at, "body": body}