From 450b551701dbc2a6a90fb9094a0af89a96f33a63 Mon Sep 17 00:00:00 2001 From: DrSmoothl <1787882683@qq.com> Date: Thu, 21 May 2026 09:32:07 +0800 Subject: [PATCH] RoadMap: tick off #6 after the OneBot-side ctx slim-down lands MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #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..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. --- RoadMap.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RoadMap.md b/RoadMap.md index e33fb993..d3f0bb14 100644 --- a/RoadMap.md +++ b/RoadMap.md @@ -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..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..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 文档/工具链需求出现后再做。