diff --git a/app/main.py b/app/main.py index e58ddce..749c7e7 100644 --- a/app/main.py +++ b/app/main.py @@ -144,3 +144,21 @@ async def admin_spa(rest: str): return FileResponse(file_path) # SPA 客户端路由兜底 return FileResponse(spa_dir / "index.html", media_type="text/html") + + +# AI Agent Skill 压缩包(用于 Agent 上传文档与检索),随 ./app 卷挂载,restart 即生效 +_AGENT_SKILL_ZIP = _STATIC_DIR / "agent-skill" / "QMDSearch-Agent-Skill.zip" + + +@app.get("/agent-skill", include_in_schema=False) +async def agent_skill_download() -> FileResponse | JSONResponse: + """下载 AI Agent Skill 压缩包(qmdsearch-agent skill,含 SKILL.md 与示例)""" + if not _AGENT_SKILL_ZIP.is_file(): + return JSONResponse( + status_code=404, content={"code": 1002, "message": "Skill 包不存在"} + ) + return FileResponse( + _AGENT_SKILL_ZIP, + media_type="application/zip", + filename="QMDSearch-Agent-Skill.zip", + ) diff --git a/app/static/agent-skill/QMDSearch-Agent-Skill.zip b/app/static/agent-skill/QMDSearch-Agent-Skill.zip new file mode 100644 index 0000000..d3e2ba3 Binary files /dev/null and b/app/static/agent-skill/QMDSearch-Agent-Skill.zip differ diff --git a/frontend/src/views/ApiDocs.vue b/frontend/src/views/ApiDocs.vue index cb625bd..b94948c 100644 --- a/frontend/src/views/ApiDocs.vue +++ b/frontend/src/views/ApiDocs.vue @@ -1,6 +1,6 @@