RoadMap: tick off #6 after the OneBot-side ctx slim-down lands

#6 was the "API层挂到ctx" item — Core side delivered the 13 typed
Api classes back in the e8d1af4...f4c6838 commit series; this turn
finished the OneBot side via the 4 ctx slim-down commits
(cb698d2 / 4c4ce60 / 8bf2ff3 / d983635).

ApiActionContext shrank from 90+ fields → ~30. Removed surfaces:
  - groupAdmin / groupFile / groupAlbum / friend / interaction /
    message / profile / web — all moved to direct
    `ctx.bridge.apis.<area>.method()` invocations.
Kept surfaces (real composition, not pass-through):
  - instance state: bridge / getLoginInfo / isOnline / getMessage*
  - module helpers: sendXxxMessage / sendXxxForwardMsg / forwardSingle /
    deleteMessage / setEssenceMsg / setMsgEmojiLike / handleGroupRequest
  - cache-backed reads: getFriendList / getGroupList / getGroupInfo
    /Member* / getStrangerInfo / getGroupFiles / get*MsgHistory /
    handleGetGroupSystemMsg / getDownloadRKeys
  - media store reads: getImageInfo / getRecordInfo

Full NapCat class-per-action conversion (TypeBox schemas / actionName
enum / auto-register decorator / 170 single-file classes) deliberately
not pursued — the metadata-driven design is meaningful only with
downstream doc/test tooling that consumes it, which SnowLuma doesn't
ship today. Marked as a follow-up under the same item if/when that
tooling appears.
This commit is contained in:
DrSmoothl committed 2026-05-21 09:32:07 +08:00
1 parent d983635c8f
commit 450b551701
1 file changed
+2 -2
+2 -2
View File
@@ -4,6 +4,6 @@
- [x] 拆分core,架构为Common(公共能力) OneBot(外层封装 协议转换),Core(Api raw能力,基础能力等功能),Bridge(封装和关键解析能力和Event message/sent group/member_add ...)
- [x] 剥离ProtocolBuffer定义到单独package。
- [ ] 整理发送和解析消息链路,提高性能。
- [~] 对齐NapCat设计采用Api层,挂到ctx,Core与Onebot都这么设计。
- [x] 对齐NapCat设计采用Api层,挂到ctx,Core与Onebot都这么设计。
- [x] Core 侧:13 个 Api 类(message/contacts/groupAdmin/groupFile/groupAlbum/interaction/friend/profile/forward/misc/extras/web)已挂到 `bridge.apis.<area>.method()`,`BridgeInterface` + `actions/*` 全部删除。
- [ ] OneBot 侧:仍用 `ApiActionContext` 注入函数 + `ctx.bridge.apis.*` 直调,没有独立的 OneBot Api 类层。
- [x] OneBot 侧:`ApiActionContext` 砍掉 ~40 个纯转发字段(groupAdmin / groupFile / groupAlbum / friend / interaction / message / profile / web 八区),actions 直接 `ctx.bridge.apis.<area>.method(...)` 调用 Core 的 Api 层。保留的 ~30 个字段全是真组合 helper(module-level send/forward、message store reads、meta-lookup composers)。完全 NapCat 化(class-per-action / TypeBox schema / actionName 枚举 / auto-register decorator)暂未做——profile 文档/工具链需求出现后再做。