DrSmoothl 8e173cf7d7 refactor(onebot): merge element toSegment/fromSegment into one codec table
阶段 2(零行为改动):把「同一种消息元素」的两个 onebot 方向——收·转
(to-segment) 与 发·解(message-parser)——从两个文件各写各的分支,合并到一张
按元素类型索引的 ELEMENT_CODECS 表,每种类型一条 { toSegment?, fromSegment? }。

- 新增 event-converter/element-codecs.ts:13 类 toSegment + 14 类 fromSegment
  逐字平移自原实现;私有 helper intOr/marketFaceElement/pickMediaSource 移来并导出。
- to-segment.ts:elementToSegment 改查表 + 保留原 default 透传兜底。
- message-parser.ts:segmentToElement 保留 9 个纯输入糖 case 作前置 normalize,
  真实类型改查表,末尾保留原 unsupported warn。
- onebot 对账测试升级为按表键核对 S/P(比正则更硬),并断言真实类型 case 不再
  残留于 parser、输入糖仍在。

行为 byte 级不变:onebot 全量 513 全绿、typecheck 干净;对抗性 Agent 逐字比对
确认无漂移、无运行时循环依赖。
2026-07-01 15:48:04 +08:00
2026-05-03 14:02:29 +08:00
2026-06-19 02:15:54 +08:00
2026-06-30 20:38:37 +08:00
2026-06-19 02:15:54 +08:00

SnowLuma

Next Remote Protocol Framework.

Release Build NPM Stars

Releases · Issues · QQ 群 · Telegram


SnowLuma 是一个基于 TypeScript 的协议转换框架,旨在为 QQ 客户端提供 OneBot v11 标准接口,支持 WebSocket/HTTP 适配、多账号并行及 WebUI 管理。

⚠️ 免责声明:SnowLuma 是独立的第三方互操作项目,与腾讯 / QQ 无任何隶属或授权关系。本项目仅供学习与技术研究,请遵守《QQ 用户协议》及适用法律;软件按"现状"提供、不附带任何担保,使用风险自负。详见 EULA.md。

⚠️ Disclaimer: SnowLuma is an independent, third-party interoperability project with no affiliation with or endorsement by Tencent / QQ, provided for study and research only, "as is" without warranty. Comply with the QQ User Agreement and applicable law; use at your own risk. See EULA.md.

特性

  • OneBot v11 兼容:支持文本、音视频、Markdown、JSON 等消息格式。
  • 高性能架构:TypeScript 全栈,基于 pnpm monorepo 管理,核心逻辑分离。
  • 现代化管理:内置 WebUI 面板,支持实时日志、密码热更、多账号管理。
  • 多适配器支持:WebSocket (Server/Client)、HTTP (Server/Post)。
  • 数据持久化:使用 SQLite 存储好友、群组等关系数据。

快速开始

  1. 从 Releases 下载最新发布包并解压。
  2. 运行 ./launcher.bat (Windows) 或 ./launcher.sh (Linux)。
  3. 访问 http://localhost:5099 (初始账号 admin,密码见控制台输出)。

许可 / License

SnowLuma 采用 源码可见非商业许可(SnowLuma Source-Available Non-Commercial License),见 LICENSE。这不是 OSI 开源许可:源码公开供查看、学习与非商业自托管,但禁止任何商业使用(出售、转售、付费托管 / 代搭 / 代运营等),公开发布修改版须事先书面授权。随附的原生附加组件(snowluma-*.node 等)为专有组件,不在本许可范围内。二进制发行包另受 EULA.md 约束;商业授权请联系 motricseven@foxmail.com。参与贡献请阅读 CONTRIBUTING.md。

SnowLuma is under a source-available, non-commercial license (see LICENSE) — NOT an OSI open-source license. The source is published for study and non-commercial self-hosting; commercial use is prohibited without prior written permission, and the bundled native addon (snowluma-*.node) is proprietary and not covered by this license.

鸣谢

参考了 LagrangeV2 的协议定义与 NapCatQQ 的实现思路。


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