54 Commits

Author SHA1 Message Date
jxxghp
d9afaba8dd feat(plugin): expose documentation before installation (#7222) 2026-10-27 21:37:00 +08:00
jxxghp
6d4ce83837 fix(types): clear host mypy debt and prevent typing regressions
严格检查全部宿主源码,清零类型错误预算并移除按模块类型豁免。
按原因、所属方法、错误码及语法指纹锁定必要兼容例外和站点类型桩,
CI 阻断新增忽略、检查范围退化、本地桩替代真实接口及新的类型错误。

修复空值、异步和供应方类型边界,保持插件与 API 兼容合同,
并补充存储、订阅、通知、Agent 和工作流边界的回归覆盖。
2026-10-21 22:03:18 +08:00
DDSRem
e0642eafa7 chore(types): reduce v3 host mypy debt (#7057)
* chore(types): clear AniList endpoint mypy debt

* chore(types): clear Douban endpoint mypy debt

* chore(types): clear recommendation endpoint mypy debt

* chore(types): clear subscription notification mypy debt

* chore(types): clear SDK string compatibility mypy debt

* chore(types): ratchet v3 host mypy across remaining files

* chore(types): reduce v3 host mypy debt and retire ledger

* chore(types): reconcile host snapshot with upstream HTTP pool

* test(types): cover host paths exposed by mypy cleanup
2026-10-18 09:37:49 +08:00
DDSRem
2de976f6b3 Merge pull request #7050 from DDSRem-Dev/codex-comment-migration
docs: 统一全项目中文注释和结构化契约说明
2026-10-17 19:26:29 +08:00
jxxghp
01301b887a fix(plugin): accept underscore IDs in instance validation (#6962) 2026-10-11 13:59:38 +08:00
InfinityPacer
d9ac4cc429 feat(plugin): expose remote entry and version on agent pets
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 04:08:15 +08:00
InfinityPacer
e97f64e777 feat(plugin): add avatar to agent pet declarations
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 04:08:15 +08:00
InfinityPacer
25aaf3a32b feat(plugin): add agent pet extension contract
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 04:08:15 +08:00
InfinityPacer
19e062c178 feat(plugin): attribute free-threaded GIL fallback to plugins (#6767)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-23 13:12:02 +08:00
InfinityPacer
0238351071 fix(plugin): v3t 下不再隐藏不兼容插件,改为提示不支持 (#6760)
* feat(plugin): surface v3t incompatibility instead of hiding plugins

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* chore(architecture): refresh dependency baseline after plugin gate split

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(plugin): keep runtime-incompatible plugins out of startup sync

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(plugin): annotate runtime compatibility ports without bare dict

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 00:35:20 +08:00
Aqr-K
57fb96fc3c feat(plugin): 分身后缀可留空自动分配,并支持按后缀恢复已停用的分身 (#6673) 2026-09-14 07:00:31 +08:00
Aqr-K
5fd04505c1 feat(plugin): 分身彻底清理,并按包含性校验收口插件数据目录解析 (#6671) 2026-09-13 21:05:04 +08:00
Aqr-K
d44480d739 Merge pull request #6666 from Aqr-K/feat/plugin-instance-target-enablement
feat(plugin): 插件实例默认调用目标与启停,未指定实例时不再兜底取第一个
2026-09-13 16:37:27 +08:00
Aqr-K
e47d7defe7 feat(plugin): 插件本体与分身可各自设置独立日志等级
全局日志等级是一个开关,调试单个插件时只能整体下调。一旦下调,被调试插件那几行
日志会淹没在其他几十个插件与宿主自身的 DEBUG 输出里,找不出来;不下调又什么都
看不见。插件实例数量只会继续增长,这个矛盾不会自己消失。

因此把等级下放到实例:plugininstance 行加 log_level / log_expires_at 两列,本体与
分身共用同一张表、同一套语义。等级落在实例自己那一行而不是另起一张按实例 ID 索引
的表——它和业务参数一样是用户按实例设置的东西,同一个生命周期,实例被删时应当随行
一起消失。清除覆盖后若本体行只剩一对身份列,整行按 carries_only_identity 回收,与
清空业务参数同一规则。

覆盖带失效时间,因为它是调试设置不是长期配置:开了 DEBUG 忘记关,下次谁也想不起
某个插件为什么一直在刷日志。过期判定在读取时惰性执行并就地清理,不另起后台线程去
扫一张最多几十条的表。expires_at 在写入侧先归一到 UTC 再分发给缓存与落盘两处:客户端
提交的时间可能不带时区,两处各按进程时区折算一次,就会与读取口返回的 UTC 值差出一个
时区,表现为「提交的失效时刻和读回来的对不上」。

运行期用 ContextVar 在宿主自己控制的四类调用点绑定当前实例——构造与 init_plugin、
事件处理器、定时服务回调、插件声明的 HTTP 端点——而不是沿用 logger() 已有的栈帧内省。
内省认的是栈顶的模块与类,插件通过宿主公共方法转发调用时栈顶是宿主而不是发起调用的
插件,会把日志记到错误的来源上;分身更甚:分身共享源码,类的 __qualname__ 保持源类名
不变,内省根本分不出是哪一个分身在打日志。内省结果继续只用于文件路由,不参与等级判定。

等级过滤必须排在全局等级判定之前。官方现状是先按全局等级短路、之后才做内省,先短路
就会把实例调低的等级挡在门外,后面再怎么识别来源都看不到这条日志。

回调在注册时被捕获、稍后才由调度器或 FastAPI 调用,那时已经不在任何绑定作用域内,
故这两处改用 wrap_for_plugin_instance 把绑定包进回调自身;同一实例重复包装直接返回
原对象,避免插件缓存声明时包装链随重载次数无限增长。

进程内覆盖表按实例 ID 常驻,删分身时必须一并清掉:只删库里那一行的话,同一进程内用
相同后缀重建的分身会继承上一个分身的等级,界面显示「跟随全局」而实际仍按旧等级输出。
进程重启后反向从库预热缓存。

迁移链在 F1 之后追加:c4e1a7b9d2f6(3.0.35)-> 487f7e681955(3.0.36 加两列)。

顺带补了 agent 策略里缺失的 media.classification.policy.get 的 template 字段说明:
少了它,api_mcp_schema.json 与技能文档的两个生成脚本都跑不起来。
2026-09-12 19:05:05 -04:00
Aqr-K
4dbb8b8204 feat(plugin): 插件配置与实例描述符迁入独立表
插件配置此前寄存在 systemconfig 的 plugin.<实例ID> 单键下,实例描述符则整份挤在
PluginInstances 这一个 JSON 键里,两者都不成立:

- plugin.<ID> 是裸字符串 key,而仓库规则本身禁止用裸字符串做 SystemConfig key,
  只允许先定义 SystemConfigKey 枚举项;插件 ID 由用户安装决定,永远枚举不出常量。
  条目数随安装量增长,混在系统设置表里会把主程序自己的设置项淹掉。
- 那个键存的其实是实例 ID,表里没有任何一列说得出它属于哪个插件,想列出某个插件
  的全部实例配置只能靠字符串前缀去猜。
- 实例描述符整份读出再整份写回,改一个分身要重写全部分身。

改为 plugininstance 一实例一行:instance_id 与 source_plugin_id 构成身份,本体与
分身由两者是否相等派生而不设模式列——模式列会是这个等式的冗余副本,两者一旦失步
同一行就会在不同读取口被判成不同角色。展示信息与业务参数同存一行,属于同一个
生命周期,分表只会让建分身、删分身退化成两张表之间的协调问题。

读写路由落在 SystemConfigOper.get/set/delete,而不是在各个调用方各改一处:第三方
插件可能直接用 self.systemconfig.get("plugin.xxx") 读写自己的配置,只改
PluginConfigStore 与 _PluginBase.get_config/update_config 必然漏掉它们。路由只做
前缀识别,插入、更新与空本体行回收都委托 PluginInstanceOper,不在配置层重抄一遍。

PluginInstances 旧键迁移后不删,留作回滚依据,并以
SystemConfigKey.PluginInstancesImported 标志防止重复导入;判据不能是「表当前为空」,
否则用户把分身全部删光后,下次启动会把它们整批导回来。

迁移链:b2d4f6a8c1e3 -> 281965691a20(3.0.34 建表并搬描述符)
-> c4e1a7b9d2f6(3.0.35 加 config_data 并搬 plugin.* 配置)。

依赖基线与启动模块数随两个新模块重算,架构文档与数据库技能表目录同步登记新表。
2026-09-12 17:39:36 -04:00
InfinityPacer
747f9f921f fix(plugin): prioritize local plugin sources 2026-09-12 19:11:08 +08:00
jxxghp
e656793aa5 refactor(api): split management endpoint routers 2026-09-05 16:05:27 +08:00
jxxghp
f00853de2a feat(api): expose frontend-safe management capabilities 2026-09-05 15:11:02 +08:00
jxxghp
6d4d7331d1 refactor: complete agent skill API contracts 2026-09-01 01:19:45 +08:00
jxxghp
7941fd921d refactor(chain): split download orchestration package 2026-08-29 06:41:15 +08:00
InfinityPacer
92066dfad4 feat: 完成插件原生依赖重启激活闭环 (#6491)
* feat(plugins): track native dependency activation

* fix(plugins): finalize native restart state lifecycle
2026-08-29 02:10:50 +08:00
jxxghp
e9de149dbf refactor(transfer): complete durable recovery state machine 2026-08-28 00:03:36 +08:00
jxxghp
988b425510 fix(plugin): preserve market package generation 2026-08-27 22:46:03 +08:00
InfinityPacer
627775c090 fix(plugin): 按绑定仓库保留更新候选 (#6474)
* fix(plugin): preserve repository update candidates

* chore(ci): sync architecture ratchet baselines

* chore(ci): align canonical coverage baseline

* chore(ci): align coverage ratchet baseline
2026-08-27 06:56:33 +08:00
InfinityPacer
d24c52ea97 fix(plugin): 按绑定仓库处理插件更新 (#6472) 2026-08-26 21:35:16 +08:00
InfinityPacer
71db425c07 feat(plugin): 建立可信来源准入与安装恢复 (#6462) 2026-08-26 07:52:00 +08:00
jxxghp
7b9499fc5b feat(plugin): add virtual plugin instances 2026-08-22 09:40:38 +08:00
InfinityPacer
b9bbc8913c fix: 完善插件恢复与运行态收敛 (#6376) 2026-08-21 18:09:29 +08:00
jxxghp
4de4fa4391 fix: 插件文件夹响应模型兼容新版对象格式
GET /plugin/folders 的响应模型 PluginFoldersData 只能校验旧版
数组格式,前端实际保存的是含展示配置的对象格式,导致建文件夹/
移入插件后刷新时响应校验失败(500),文件夹恢复为空。改为同时
兼容新旧两种格式。
2026-08-13 22:06:22 +08:00
jxxghp
baf8850d63 refactor(api): standardize responses and restore media config contracts 2026-08-12 23:15:13 +08:00
jxxghp
48852350a0 feat(plugin): add centralized rating APIs 2026-07-31 13:41:29 +08:00
InfinityPacer
69ed70cc66 feat(plugin): support installing release versions (#5964) 2026-06-18 15:47:07 +08:00
jxxghp
c52ccaf75f feat: add plugin system version compatibility checks 2026-05-20 19:55:44 +08:00
DDSRem
fd6c9d5d34 feat(plugin): 聚合插件侧栏导航
- PluginManager.get_plugin_sidebar_nav:已启用 Vue 插件且实现 get_sidebar_nav
- schemas.PluginSidebarNavItem 与 verify_token 鉴权接口
2026-04-09 08:03:30 +08:00
jxxghp
ed294d3ea4 Revert "fix schemas"
This reverts commit a5e7483870.
2025-11-17 11:48:18 +08:00
jxxghp
a5e7483870 fix schemas 2025-11-17 10:58:24 +08:00
jxxghp
724c15a68c add 插件内存统计API 2025-08-22 09:46:11 +08:00
jxxghp
d2e5367dc6 fix plugins 2025-05-06 11:44:23 +08:00
jxxghp
c692a3c80e feat:支持vue原生插件页面 2025-05-03 10:03:44 +08:00
jxxghp
d45d49edbd fix schemas default_factory 2024-12-23 11:35:38 +08:00
jxxghp
1f87bc643a sync main 2024-08-19 13:06:39 +08:00
Allen
a6714d3712 一个插件支持透出多个仪表板控件,并兼容历史 2024-05-24 14:54:46 +08:00
jxxghp
5c9039e6d0 feat:插件仪表板API 2024-05-08 20:58:28 +08:00
jxxghp
43f594393c feat:插件增加排序字段 2024-04-30 08:34:37 +08:00
jxxghp
f726130c31 feat:插件读取Label 2024-04-28 13:35:47 +08:00
jxxghp
d0e596c93c feat: 插件更新历史 2024-04-10 16:44:08 +08:00
jxxghp
cf259af2d1 feat:插件安装统计 2024-03-25 18:02:57 +08:00
jxxghp
9e5d401a85 remove plugin_color 2023-11-29 12:07:54 +08:00
jxxghp
fbe306ba90 feat 在线仓库插件安装 2023-11-01 20:56:38 +08:00
jxxghp
678638e9f1 feat 插件API 2023-09-08 15:38:32 +08:00