refactor(packages): rename @snowluma/bridge → @snowluma/protocol

The package previously named "bridge" houses the protocol-byte layer
(OIDB cmds, msg-push decoders, highway uploaders, element-builder,
event bus). The name "bridge" suggested transport/lifecycle, which it
isn't — that role lives in core/hook and core/bridge/manager. Rename
to match what's actually inside.

This is a pure rename: zero logic changes, all 73 import sites updated
mechanically and TS-verified. core/onebot dependencies key updated.
ESLint override path adjusted for the moved oidb-services directory.

Rename detection threshold: git log --find-renames=20% recommended
when following history across this commit — content-replacement
(@snowluma/bridge → @snowluma/protocol) dropped per-file similarity
below git's default 50% on import-heavy files.
This commit is contained in:
DrSmoothl committed 2026-05-23 23:31:03 +08:00
1 parent 98296fcec5
commit c16064d7e3
238 files changed
+247 -284

No files matched your search

@@ -7,7 +7,7 @@ import { describe, expect, it, vi } from 'vitest';
import type { BridgeInterface } from '../../src/bridge/bridge-interface';
import type {
FriendInfo, GroupMemberInfo, QQGroupInfo, UserProfileInfo,
} from '@snowluma/bridge/qq-info';
} from '@snowluma/protocol/qq-info';
import {
getFriendList,
getGroupInfo,
@@ -16,7 +16,7 @@ import type {
MessageElement,
QQEventVariant,
TempMessage,
} from '@snowluma/bridge/events';
} from '@snowluma/protocol/events';
const SELF_ID = 10001;
const PEER_UIN = 22222;
+2 -2
View File
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from 'vitest';
import { BridgeEventBus } from '@snowluma/bridge/event-bus';
import { BridgeEventBus } from '@snowluma/protocol/event-bus';
// Wrap convertEvent in a vi.fn that delegates to the real impl by
// default, so one test can override it to return null without making
@@ -18,7 +18,7 @@ import type {
GroupMemberJoin,
TempMessage,
QQEventVariant,
} from '@snowluma/bridge/events';
} from '@snowluma/protocol/events';
import type { JsonObject, MessageMeta } from '../src/types';
const SELF_UIN = '10001';
@@ -7,7 +7,7 @@
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { ApiHandler, type ApiActionContext } from '../src/api-handler';
import type { BridgeInterface } from '../../src/bridge/bridge-interface';
import type { GroupRequestInfo } from '@snowluma/bridge/qq-info';
import type { GroupRequestInfo } from '@snowluma/protocol/qq-info';
import type { MessageMeta } from '../src/types';
function fakeMeta(overrides: Partial<MessageMeta> = {}): MessageMeta {
@@ -8,13 +8,13 @@
import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import { protobuf_encode } from '@snowluma/proton';
import type { GroupReactNotify } from '@snowluma/proto-defs/notify';
import { decodeEvent0x2DC } from '@snowluma/bridge/msg-push/decoders/event-0x2dc';
import type { MsgPushContext } from '@snowluma/bridge/msg-push/context';
import { IdentityService } from '@snowluma/bridge/identity-service';
import type { GroupMsgEmojiLikeEvent, QQEventVariant } from '@snowluma/bridge/events';
import { decodeEvent0x2DC } from '@snowluma/protocol/msg-push/decoders/event-0x2dc';
import type { MsgPushContext } from '@snowluma/protocol/msg-push/context';
import { IdentityService } from '@snowluma/protocol/identity-service';
import type { GroupMsgEmojiLikeEvent, QQEventVariant } from '@snowluma/protocol/events';
import { convertGroupMsgEmojiLike } from '../src/event-converter/to-notice';
import { GROUP_MESSAGE_EVENT, hashMessageIdInt32 } from '../src/message-id';
import { formatEvent } from '@snowluma/bridge/format';
import { formatEvent } from '@snowluma/protocol/format';
import { subscribeLogs, type LogEntry } from '@snowluma/common/logger';
const SELF_UIN = '10001';
+1 -1
View File
@@ -1,6 +1,6 @@
import { describe, it, expect, vi } from 'vitest';
import { MediaIndexer } from '../src/media-indexer';
import type { MessageElement } from '@snowluma/bridge/events';
import type { MessageElement } from '@snowluma/protocol/events';
function makeMediaStore() {
return {
+1 -1
View File
@@ -3,7 +3,7 @@ import fs from 'fs';
import path from 'path';
import { MediaStore } from '../src/media-store';
import { convertEvent, type ConverterContext } from '../src/event-converter';
import type { GroupMessage, FriendMessage, MessageElement } from '@snowluma/bridge/events';
import type { GroupMessage, FriendMessage, MessageElement } from '@snowluma/protocol/events';
const SELF_ID = 10001;
const PEER_UIN = 22222;
@@ -1,6 +1,6 @@
import { describe, it, expect, vi, beforeEach } from 'vitest';
import { MediaUrlResolver } from '../src/media-url-resolver';
import type { MessageElement } from '@snowluma/bridge/events';
import type { MessageElement } from '@snowluma/protocol/events';
// Minimal stand-ins for the two collaborators. Each test wires whatever
// subset of Bridge methods the element type exercises.
+1 -1
View File
@@ -4,7 +4,7 @@ import path from 'path';
import { describe, it, expect, vi } from 'vitest';
import { protobuf_decode, protobuf_encode } from '@snowluma/proton';
import { parseMessage } from '../src/message-parser';
import { buildSendElems } from '@snowluma/bridge/element-builder';
import { buildSendElems } from '@snowluma/protocol/element-builder';
import type { MentionExtraSend } from '@snowluma/proto-defs/action';
import type { OidbBase } from '@snowluma/proto-defs/oidb';
import type { NTV2UploadRichMediaResp } from '@snowluma/proto-defs/highway';
@@ -1,7 +1,7 @@
import { describe, expect, it, vi } from 'vitest';
import { handleGroupAddRequest } from '../src/modules/request-actions';
import type { BridgeInterface } from '../../src/bridge/bridge-interface';
import type { GroupRequestInfo } from '@snowluma/bridge/qq-info';
import type { GroupRequestInfo } from '@snowluma/protocol/qq-info';
// See `contact-actions.test.ts` for the auto-promotion rationale.
const APIS_ROUTING: Record<string, string> = {