feat(skills): 技能库 - 内置技能目录迁移为 Markdown 包

This commit is contained in:
ddcat666
2026-09-27 08:14:27 +08:00
parent eb43d3754f
commit 1080b22196
107 changed files with 15402 additions and 3667 deletions

View File

@@ -25,6 +25,7 @@ tags:
- name: models
- name: agent
- name: admin
- name: skills
paths:
/admin/settings/appearance/live2d:
post:
@@ -123,6 +124,79 @@ paths:
"200":
description: 标准信封 data 为 presets 数组;预设只引用公开且启用的种子技能
"500": {$ref: "#/components/responses/Error"}
/skills:
get:
tags: [skills]
summary: 列出技能;在个人技能视图按技能库分类筛选
parameters:
- {in: query, name: scope, schema: {type: string, enum: [public, mine, created, favorites], default: public}}
- {in: query, name: libraryCategoryId, description: 用户技能库分类 ID,仅支持 mine 或 created 视图;与 libraryUncategorized 互斥, schema: {type: string}}
- {in: query, name: libraryUncategorized, description: 仅列出未归类技能,仅支持 mine 或 created 视图;与 libraryCategoryId 互斥, schema: {type: boolean}}
responses:
"200": {description: 标准信封 data 为技能列表及分页信息;categories 含共享分类 value、label 和技能广场公开技能 count}
"400": {$ref: "#/components/responses/Error"}
"401": {$ref: "#/components/responses/Error"}
"403": {$ref: "#/components/responses/Error"}
"404": {$ref: "#/components/responses/Error"}
/skills/library-categories:
get:
tags: [skills]
summary: 获取当前用户可见的技能库分类和数量
parameters:
- {in: query, name: scope, schema: {type: string, enum: [mine, created], default: mine}}
responses:
"200": {description: 标准信封 data 为 categories、totalCount、uncategorizedCount;分类含 id、name、scope、count}
"401": {$ref: "#/components/responses/Error"}
post:
tags: [skills]
summary: 创建个人或平台技能库分类
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [name]
properties:
name: {type: string, minLength: 1, maxLength: 64}
scope: {type: string, enum: [personal, platform], default: personal}
responses:
"200": {description: 标准信封 data.category 为新分类}
"400": {$ref: "#/components/responses/Error"}
"401": {$ref: "#/components/responses/Error"}
"403": {$ref: "#/components/responses/Error"}
/skills/library-categories/{id}:
parameters:
- {in: path, name: id, required: true, schema: {type: string}}
delete:
tags: [skills]
summary: 删除技能库分类并解除相关技能归类,不删除技能
responses:
"200": {description: "标准信封 data 为 {deleted: true}"}
"401": {$ref: "#/components/responses/Error"}
"403": {$ref: "#/components/responses/Error"}
"404": {$ref: "#/components/responses/Error"}
/skills/{id}/library-category:
parameters:
- {in: path, name: id, required: true, description: 技能 ID, schema: {type: string}}
patch:
tags: [skills]
summary: 为当前用户已加入或自建的技能设置/清除技能库分类
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [categoryId]
properties:
categoryId: {type: string, description: 个人分类或可见平台分类 ID;空字符串表示取消归类}
responses:
"200": {description: 标准信封 data.skill 为更新后的技能}
"400": {$ref: "#/components/responses/Error"}
"401": {$ref: "#/components/responses/Error"}
"403": {$ref: "#/components/responses/Error"}
"404": {$ref: "#/components/responses/Error"}
/tools/{id}:
parameters:
- {in: path, name: id, required: true, schema: {type: integer, format: int64, minimum: 1}}