Files
SnowLuma/packages/bridge/package.json
T
DrSmoothl 58e8081420 refactor(oidb): migrate misc.ts OIDB cmds to namespaces
3 OIDB cmds migrated; the 1 non-OIDB cmd (getMiniAppArk via
LightAppSvc) stays on the facade unchanged.

  - TranslateEnToZh           (0x990_2)
  - ClickInlineKeyboardButton (0x112E_1)
  - SendGroupSign             (0xEB7_1) — preserves historic UPPERCASE
                                          EB7 wire name via the new
                                          `wireName` override (the only
                                          cmd in the codebase with this
                                          quirk; every other cmd uses
                                          the default lowercase).

Tests:
  - misc.test.ts moved to bridge.sendRawPacket assertion model
  - 18 new namespace-level tests covering serialize, deserialize edge
    cases, magic constants, BigInt widening, and the EB7 case quirk

Verification:
  - typecheck green
  - @snowluma/bridge: 18 files / 153 tests
  - @snowluma/core: 302 tests
Wire bytes unchanged.
2026-05-22 23:37:41 +08:00

205 lines
7.7 KiB
JSON

{
"name": "@snowluma/bridge",
"version": "1.9.1",
"private": true,
"type": "module",
"description": "SnowLuma bridge — the protocol-layer between QQ wire bytes and typed events. Owns: identity service (uid↔uin cache with SQLite persistence), event bus, packet pipeline (incoming SSO packet → QQEventVariant), msg-push decoders, element-builder (MessageElement → wire elems[]), highway upload protocol (file/image/video/ptt), OIDB envelope helper, and the event/notice/request type vocabulary. Consumers (@snowluma/core, @snowluma/onebot) talk to this package through `BridgeContext` for runtime calls and the standalone classes (IdentityService, BridgeEventBus, IncomingPacketPipeline) for composition. Per-file subpath exports mirror the legacy `core/src/bridge/*` layout 1:1 so the previous `import { …} from '../bridge/<x>'` collapses to `import { … } from '@snowluma/bridge/<x>'`.",
"main": "./src/index.ts",
"types": "./src/index.ts",
"exports": {
".": {
"types": "./src/index.ts",
"default": "./src/index.ts"
},
"./events": {
"types": "./src/events.ts",
"default": "./src/events.ts"
},
"./event-bus": {
"types": "./src/event-bus.ts",
"default": "./src/event-bus.ts"
},
"./identity-service": {
"types": "./src/identity-service.ts",
"default": "./src/identity-service.ts"
},
"./packet-pipeline": {
"types": "./src/packet-pipeline.ts",
"default": "./src/packet-pipeline.ts"
},
"./element-builder": {
"types": "./src/element-builder.ts",
"default": "./src/element-builder.ts"
},
"./bridge-oidb": {
"types": "./src/bridge-oidb.ts",
"default": "./src/bridge-oidb.ts"
},
"./oidb-service": {
"types": "./src/oidb-service.ts",
"default": "./src/oidb-service.ts"
},
"./oidb-services/reaction/set-reaction": {
"types": "./src/oidb-services/reaction/set-reaction.ts",
"default": "./src/oidb-services/reaction/set-reaction.ts"
},
"./oidb-services/reaction/fetch-reaction-summary": {
"types": "./src/oidb-services/reaction/fetch-reaction-summary.ts",
"default": "./src/oidb-services/reaction/fetch-reaction-summary.ts"
},
"./oidb-services/reaction/get-emoji-likes": {
"types": "./src/oidb-services/reaction/get-emoji-likes.ts",
"default": "./src/oidb-services/reaction/get-emoji-likes.ts"
},
"./oidb-services/interaction/send-poke": {
"types": "./src/oidb-services/interaction/send-poke.ts",
"default": "./src/oidb-services/interaction/send-poke.ts"
},
"./oidb-services/interaction/send-like": {
"types": "./src/oidb-services/interaction/send-like.ts",
"default": "./src/oidb-services/interaction/send-like.ts"
},
"./oidb-services/interaction/set-essence": {
"types": "./src/oidb-services/interaction/set-essence.ts",
"default": "./src/oidb-services/interaction/set-essence.ts"
},
"./oidb-services/profile/set-profile": {
"types": "./src/oidb-services/profile/set-profile.ts",
"default": "./src/oidb-services/profile/set-profile.ts"
},
"./oidb-services/profile/set-self-long-nick": {
"types": "./src/oidb-services/profile/set-self-long-nick.ts",
"default": "./src/oidb-services/profile/set-self-long-nick.ts"
},
"./oidb-services/profile/set-input-status": {
"types": "./src/oidb-services/profile/set-input-status.ts",
"default": "./src/oidb-services/profile/set-input-status.ts"
},
"./oidb-services/profile/get-like": {
"types": "./src/oidb-services/profile/get-like.ts",
"default": "./src/oidb-services/profile/get-like.ts"
},
"./oidb-services/profile/get-unidirectional-friend-list": {
"types": "./src/oidb-services/profile/get-unidirectional-friend-list.ts",
"default": "./src/oidb-services/profile/get-unidirectional-friend-list.ts"
},
"./oidb-services/friend/handle-friend-request": {
"types": "./src/oidb-services/friend/handle-friend-request.ts",
"default": "./src/oidb-services/friend/handle-friend-request.ts"
},
"./oidb-services/friend/delete-friend": {
"types": "./src/oidb-services/friend/delete-friend.ts",
"default": "./src/oidb-services/friend/delete-friend.ts"
},
"./oidb-services/friend/set-friend-remark": {
"types": "./src/oidb-services/friend/set-friend-remark.ts",
"default": "./src/oidb-services/friend/set-friend-remark.ts"
},
"./oidb-services/misc/translate-en-to-zh": {
"types": "./src/oidb-services/misc/translate-en-to-zh.ts",
"default": "./src/oidb-services/misc/translate-en-to-zh.ts"
},
"./oidb-services/misc/click-inline-keyboard-button": {
"types": "./src/oidb-services/misc/click-inline-keyboard-button.ts",
"default": "./src/oidb-services/misc/click-inline-keyboard-button.ts"
},
"./oidb-services/misc/send-group-sign": {
"types": "./src/oidb-services/misc/send-group-sign.ts",
"default": "./src/oidb-services/misc/send-group-sign.ts"
},
"./bridge-context": {
"types": "./src/bridge-context.ts",
"default": "./src/bridge-context.ts"
},
"./qq-info": {
"types": "./src/qq-info.ts",
"default": "./src/qq-info.ts"
},
"./format": {
"types": "./src/format.ts",
"default": "./src/format.ts"
},
"./msg-push": {
"types": "./src/msg-push/index.ts",
"default": "./src/msg-push/index.ts"
},
"./msg-push/registry": {
"types": "./src/msg-push/registry.ts",
"default": "./src/msg-push/registry.ts"
},
"./msg-push/context": {
"types": "./src/msg-push/context.ts",
"default": "./src/msg-push/context.ts"
},
"./msg-push/decoders/event-0x2dc": {
"types": "./src/msg-push/decoders/event-0x2dc.ts",
"default": "./src/msg-push/decoders/event-0x2dc.ts"
},
"./highway": {
"types": "./src/highway/highway-client.ts",
"default": "./src/highway/highway-client.ts"
},
"./highway/utils": {
"types": "./src/highway/utils.ts",
"default": "./src/highway/utils.ts"
},
"./highway/pipeline": {
"types": "./src/highway/pipeline.ts",
"default": "./src/highway/pipeline.ts"
},
"./highway/image-upload": {
"types": "./src/highway/image-upload.ts",
"default": "./src/highway/image-upload.ts"
},
"./highway/ptt-upload": {
"types": "./src/highway/ptt-upload.ts",
"default": "./src/highway/ptt-upload.ts"
},
"./highway/video-upload": {
"types": "./src/highway/video-upload.ts",
"default": "./src/highway/video-upload.ts"
},
"./highway/ffmpeg-addon": {
"types": "./src/highway/ffmpeg-addon.ts",
"default": "./src/highway/ffmpeg-addon.ts"
},
"./web/group-album": {
"types": "./src/web/group-album.ts",
"default": "./src/web/group-album.ts"
},
"./web/group-essence": {
"types": "./src/web/group-essence.ts",
"default": "./src/web/group-essence.ts"
},
"./web/group-honor": {
"types": "./src/web/group-honor.ts",
"default": "./src/web/group-honor.ts"
},
"./web/group-notice": {
"types": "./src/web/group-notice.ts",
"default": "./src/web/group-notice.ts"
},
"./web/request-util": {
"types": "./src/web/request-util.ts",
"default": "./src/web/request-util.ts"
}
},
"scripts": {
"test": "vitest run",
"bench": "vitest bench --run",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@snowluma/common": "workspace:*",
"@snowluma/proto-defs": "workspace:*",
"@snowluma/proton": "workspace:*",
"@snowluma/sqlite": "workspace:*"
},
"devDependencies": {
"@types/node": "^24.12.2",
"typescript": "catalog:",
"vite": "catalog:",
"vitest": "^4.1.4"
}
}