DrSmoothl e6b609dd4e refactor(bridge): extract BridgeInterface as the OneBot-facing seam
OneBot used to depend on the concrete Bridge class — 778 lines, ~99
public methods including PID management, raw packet dispatch, and cmd
handler registration that no external consumer should touch. Add an
explicit BridgeInterface (bridge/bridge-interface.ts) enumerating only
the surface OneBot actually reads (verified by grepping every bridge.*
access in onebot/), and have Bridge `implements BridgeInterface` so the
compiler enforces alignment.

Net effect at runtime: zero — Bridge's methods, fields, and bodies are
unchanged; the interface is a TypeScript-only declaration. Net effect
for typing: the OneBot package (instance, instance-context,
instance-rkey, manager, media-url-resolver, and the modules under
onebot/modules/) now imports `BridgeInterface` instead of `Bridge`, so
tests / fakes can satisfy the interface without subclassing or pulling
in the SQLite/native bits.

In-tree bridge actions (actions/*, bridge-contacts, highway) keep their
concrete `Bridge` typing — they legitimately need sendRawPacket and
other low-level entry points that intentionally stay off the
interface.
2026-05-15 01:12:40 +08:00
2026-05-03 14:02:29 +08:00
2026-05-09 14:58:37 +08:00

❄️ SnowLuma

Next Remote Protocol Framework.

关于项目

项目处于开发初期,仅支持部分功能,高速迭代中,随时可能出现破坏性更新。

鸣谢

LagrangeV2 - Proto

NapCatQQ - Scaner/Packet

辅助编程

推荐 Opus4.6 + Gemini3.1pro 对本项目辅助开发

本项目大量使用Ai技术。

加入我们

SnowLuma-QQ

SnowLuma-TG

S
Description
No description provided
Readme
64 MiB
Languages
TypeScript 98.9%
CSS 0.5%
JavaScript 0.5%