Merge pull request #6666 from Aqr-K/feat/plugin-instance-target-enablement

feat(plugin): 插件实例默认调用目标与启停,未指定实例时不再兜底取第一个
This commit is contained in:
Aqr-K
2026-09-13 16:37:27 +08:00
committed by GitHub
parent 30d6d9e146
commit d44480d739
54 changed files with 2853 additions and 73 deletions

View File

@@ -2,7 +2,7 @@
"disposition_counts": {
"alternate-auth-duplicate": 11,
"consolidated": 71,
"gateway": 221,
"gateway": 224,
"provider-skill": 12,
"stream_or_binary": 10,
"transport_or_identity": 66,
@@ -18,10 +18,10 @@
"reason": "The executor validates and expands this bounded source placeholder to one of tmdb, douban, bangumi, or anilist before calling the corresponding concrete OpenAPI route."
}
],
"gateway_http_route_count": 222,
"gateway_operation_count": 224,
"matched_gateway_http_route_count": 221,
"openapi_operation_count": 404,
"gateway_http_route_count": 225,
"gateway_operation_count": 227,
"matched_gateway_http_route_count": 224,
"openapi_operation_count": 407,
"operations": [
{
"disposition": "consolidated",
@@ -2255,6 +2255,48 @@
"plugin"
]
},
{
"disposition": "gateway",
"method": "POST",
"operation_ids": [
"plugin.instance.set_enabled"
],
"owner": "moviepilot-api",
"path": "/api/v1/plugin/instance/{instance_id}/enabled",
"reason": "Executable through moviepilot_api; exact inputs are generated into MCP tools/list and SKILL.md.",
"summary": "启用或停用插件实例",
"tags": [
"plugin"
]
},
{
"disposition": "gateway",
"method": "DELETE",
"operation_ids": [
"plugin.default_target.clear"
],
"owner": "moviepilot-api",
"path": "/api/v1/plugin/instances/{plugin_id}/{instance_id}/default_target",
"reason": "Executable through moviepilot_api; exact inputs are generated into MCP tools/list and SKILL.md.",
"summary": "清除插件实例的默认调用目标",
"tags": [
"plugin"
]
},
{
"disposition": "gateway",
"method": "PUT",
"operation_ids": [
"plugin.default_target.set"
],
"owner": "moviepilot-api",
"path": "/api/v1/plugin/instances/{plugin_id}/{instance_id}/default_target",
"reason": "Executable through moviepilot_api; exact inputs are generated into MCP tools/list and SKILL.md.",
"summary": "设置插件实例的默认调用目标",
"tags": [
"plugin"
]
},
{
"disposition": "gateway",
"method": "GET",

View File

@@ -5,10 +5,10 @@
## Result
- OpenAPI HTTP operations: **404**
- Stable `moviepilot_api` operations: **224**
- Exact HTTP routes used by the gateway: **222**
- OpenAPI routes matched directly by the gateway: **221**
- OpenAPI HTTP operations: **407**
- Stable `moviepilot_api` operations: **227**
- Exact HTTP routes used by the gateway: **225**
- OpenAPI routes matched directly by the gateway: **224**
- Bounded dynamic gateway routes: **1**
- Every gateway operation has a generated English oneOf input contract in MCP `tools/list` and `skills/moviepilot-api/SKILL.md`.
- Every non-gateway OpenAPI operation is listed below with an explicit ownership boundary; it is not silently callable through arbitrary URL/method input.
@@ -19,7 +19,7 @@
| :--- | ---: | :--- |
| `alternate-auth-duplicate` | 11 | API-token compatibility duplicate of a bearer-authenticated capability. |
| `consolidated` | 71 | Source/UI route represented by a stable aggregate Agent operation. |
| `gateway` | 221 | Approved structured MoviePilot Agent operation. |
| `gateway` | 224 | Approved structured MoviePilot Agent operation. |
| `provider-skill` | 12 | Low-level downloader or media-server capability owned by a provider Skill. |
| `stream_or_binary` | 10 | Streaming or binary response owned by a direct client transport. |
| `transport_or_identity` | 66 | Authentication, protocol, callback, account, or conversation transport boundary. |
@@ -209,6 +209,9 @@
| `GET` | `/api/v1/plugin/history/{plugin_id}` | plugin | `gateway` | plugin.history | 获取插件更新说明 |
| `GET` | `/api/v1/plugin/install/{plugin_id}` | plugin | `gateway` | plugin.install | 安装插件 |
| `GET` | `/api/v1/plugin/installed` | plugin | `consolidated` | plugin.installed | 已安装插件 |
| `POST` | `/api/v1/plugin/instance/{instance_id}/enabled` | plugin | `gateway` | plugin.instance.set_enabled | 启用或停用插件实例 |
| `DELETE` | `/api/v1/plugin/instances/{plugin_id}/{instance_id}/default_target` | plugin | `gateway` | plugin.default_target.clear | 清除插件实例的默认调用目标 |
| `PUT` | `/api/v1/plugin/instances/{plugin_id}/{instance_id}/default_target` | plugin | `gateway` | plugin.default_target.set | 设置插件实例的默认调用目标 |
| `GET` | `/api/v1/plugin/loglevel/{plugin_id}` | plugin | `gateway` | plugin.loglevel.get | 查询插件全部实例的日志等级设置 |
| `DELETE` | `/api/v1/plugin/loglevel/{plugin_id}/{instance_id}` | plugin | `gateway` | plugin.loglevel.clear | 清除插件实例的日志等级覆盖 |
| `PUT` | `/api/v1/plugin/loglevel/{plugin_id}/{instance_id}` | plugin | `gateway` | plugin.loglevel.set | 设置插件实例的日志等级覆盖 |

View File

@@ -94,7 +94,7 @@ ARCH-201 至 ARCH-204 均达到实现、验证、提交、推送和远端门禁
| 指标 | 当前值 | 解释 |
|---|---:|---|
| 宿主 Python 模块 / 内部依赖边 | 1014 / 8,614 | `dependency-baseline.json` 当前快照;分类、下载资源归类、订阅搜索、整理恢复、Agent 计划、工具视觉、终端生命周期与终端作用域模块的受控依赖 |
| 宿主 Python 模块 / 内部依赖边 | 1016 / 8,630 | `dependency-baseline.json` 当前快照;分类、下载资源归类、订阅搜索、整理恢复、Agent 计划、工具视觉、终端生命周期与终端作用域模块的受控依赖 |
| 非平凡 SCC | 1 | 仅保留精确 containment 的 29 模块 TMDB 移植包环 |
| 跨层 DB 边界债务 | 0 | Application、Chain、API、Agent、Runtime、Workflow 到 DB 的受控债务均为零 |
| Model/Oper 事务债务 | 0 | 自建 Session、自动事务装饰器、直接 commit/rollback 等基线均为零 |