mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-12-02 00:46:27 +08:00
feat(agent): prepare central knowledge client
This commit is contained in:
@@ -850,11 +850,11 @@ flowchart LR
|
||||
|
||||
| 指标 | 当前值 |
|
||||
|---|---:|
|
||||
| Python 模块 | 1181 |
|
||||
| 内部导入边 | 10,349 |
|
||||
| Python 模块 | 1184 |
|
||||
| 内部导入边 | 10,363 |
|
||||
| 非平凡 SCC | 1(29 个模块的 TMDB vendor 精确 containment) |
|
||||
| Application / Chain 具体 Adapter 直连 | 0 / 0 |
|
||||
| Direct egress | 51(精确 policy 准入,Application / Chain 均为 0) |
|
||||
| Direct egress | 52(精确 policy 准入,Application / Chain 均为 0;本知识 Adapter 仍复用宿主 HTTP 层) |
|
||||
| Module Contract V2 spec | 237(其中 223 个方法进入 `run_module` 观察面) |
|
||||
| Event Contract | 53 |
|
||||
| Event producer / consumer | 76(74 静态、2 动态)/ 19(18 静态、1 动态) |
|
||||
|
||||
@@ -677,6 +677,25 @@ Emby、Jellyfin、Plex、Navidrome 的目录、条目、搜索、季集和活动
|
||||
(如调用时指定),不要依赖空闲回收及时释放资源。宿主关停或启动失败回滚时,TaskRegistry
|
||||
只停止扫描并等待已投递的关闭,不提前全关活动会话;最终全关仍由模块关闭阶段负责。
|
||||
|
||||
### 4.5 私有知识配置基础
|
||||
|
||||
`SystemConfigKey.AIAgentKnowledge` 保存独立知识中心的 `enabled`、`origin`、`token`,默认关闭。
|
||||
`origin` 必须是显式 HTTPS 源,不能带路径、查询、片段或 URL 凭据;`token` 使用该源签发的独立
|
||||
`mpk_` 读取令牌。该配置不使用 `MP_SERVER_HOST` 回退,也不使用本地 API Key、后台 Cookie 或站点 Cookie。
|
||||
|
||||
管理员通过受保护的系统设置入口整体替换该配置;不支持合并字段。普通查询、Agent 即使使用
|
||||
`show_secrets=true`、批量明文查询以及更新回执均只显示脱敏值并保留开关状态;不能将 `***` 当原值保存。
|
||||
更换中心时须重新提供该中心的完整配置,不把旧中心令牌带去试探。
|
||||
配置持久化沿用系统凭据存储,备份和数据库权限也须按凭据保护。不要在对话中粘贴令牌让模型代填。
|
||||
|
||||
只读基础每次请求重新验证配置,固定 `/knowledge/v1/search` 与 `/knowledge/v1/read`,校验 TLS、
|
||||
不跟随重定向、不自动重放 POST;总预算 3 秒,无跨请求正文缓存。搜索最多 3 条、每条 1600 字符,
|
||||
补读最多 1 条 4000 字符;中心总正文预算 6000 字符。96 KiB 响应检查发生在宿主 HTTP 层缓冲之后,
|
||||
不代表传输前的硬内存上限。已知凭据形态在发送查询前拒绝,这不替代提炼短问题和秘密保护。
|
||||
|
||||
未命中、不适用、冲突与鉴权失败、引用失效、限流、暂不可用分别处理;请求途中配置改变会丢弃迟到结果。
|
||||
本阶段只提供默认关闭的配置及协议基础,尚未把知识工具注册到 Agent、MCP 或代码执行环境;工具启用另行验收。
|
||||
|
||||
## 5. 组合业务调用
|
||||
|
||||
以下是调用顺序指引。具体参数仍按各 operation 的 Schema 构造,不将顺序中的操作全部默认执行。
|
||||
|
||||
@@ -155,6 +155,11 @@ Entrypoints (app/api, app/command, app/monitor, app/scheduler, app/agent, app/wo
|
||||
temporary content. Summarization inputs and state commands redact it at their
|
||||
producer boundary, while history and recovery remove local references.
|
||||
Evidence never grants tool authority or becomes a cross-turn result cache.
|
||||
- `app/application/knowledge.py` owns the default-off read-only knowledge use
|
||||
case and technical Port. `app/adapters/external/knowledge.py` implements the
|
||||
protocol through the host HTTP layer; shared configuration and response DTOs
|
||||
live in `app/schemas/knowledge.py`. Explicit center credentials never fall back
|
||||
to `MP_SERVER_HOST`, and no response body is cached by this capability.
|
||||
|
||||
### DB, Repository, Outbox and Durable Transfer Layer
|
||||
|
||||
|
||||
Reference in New Issue
Block a user