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

+1 -1
View File
@@ -1,7 +1,7 @@
import type { ApiHandler, ApiActionContext } from '../api-handler';
import { asNumber, asBoolean, asString } from '../api-handler';
import { RETCODE, failedResponse, okResponse } from '../types';
import { WebHonorType } from '@snowluma/bridge/web/group-honor';
import { WebHonorType } from '@snowluma/protocol/web/group-honor';
export function register(h: ApiHandler, ctx: ApiActionContext): void {
h.registerAction('get_group_list', async (params) => {
+1 -1
View File
@@ -17,7 +17,7 @@ import { register as registerRequest } from './actions/request';
import { register as registerExtended } from './actions/extended';
import { register as registerGroupAlbum } from './actions/group-album';
import { WebHonorType } from '@snowluma/bridge/web/group-honor';
import { WebHonorType } from '@snowluma/protocol/web/group-honor';
import type { ClientKeyInfo } from '@snowluma/core/bridge';
export interface MessageSendResult {
+1 -1
View File
@@ -1,4 +1,4 @@
import type { MessageElement, QQEventVariant } from '@snowluma/bridge/events';
import type { MessageElement, QQEventVariant } from '@snowluma/protocol/events';
import type { JsonObject } from '../types';
import {
convertFriendMessage,
@@ -1,4 +1,4 @@
import type { QQEventVariant } from '@snowluma/bridge/events';
import type { QQEventVariant } from '@snowluma/protocol/events';
import { GROUP_MESSAGE_EVENT, PRIVATE_MESSAGE_EVENT } from '../message-id';
import type { JsonObject } from '../types';
import type { ConverterContext } from './index';
@@ -1,4 +1,4 @@
import type { QQEventVariant } from '@snowluma/bridge/events';
import type { QQEventVariant } from '@snowluma/protocol/events';
import { GROUP_MESSAGE_EVENT, PRIVATE_MESSAGE_EVENT } from '../message-id';
import type { JsonObject } from '../types';
import type { ConverterContext } from './index';
@@ -1,4 +1,4 @@
import type { QQEventVariant } from '@snowluma/bridge/events';
import type { QQEventVariant } from '@snowluma/protocol/events';
import type { JsonObject } from '../types';
import type { ConverterContext } from './index';
@@ -1,4 +1,4 @@
import type { MessageElement } from '@snowluma/bridge/events';
import type { MessageElement } from '@snowluma/protocol/events';
import type { JsonArray, JsonObject } from '../types';
import type {
ImageUrlResolver,
+1 -1
View File
@@ -1,4 +1,4 @@
import type { QQEventVariant } from '@snowluma/bridge/events';
import type { QQEventVariant } from '@snowluma/protocol/events';
import { convertEvent } from './event-converter';
import type { OneBotInstanceContext } from './instance-context';
import { GROUP_MESSAGE_EVENT, PRIVATE_MESSAGE_EVENT, hashMessageIdInt32 } from './message-id';
+1 -1
View File
@@ -1,4 +1,4 @@
import type { WebHonorType } from '@snowluma/bridge/web/group-honor';
import type { WebHonorType } from '@snowluma/protocol/web/group-honor';
import type { Bridge } from '@snowluma/core/bridge';
import type { ApiActionContext } from './api-handler';
import type { ConverterContext } from './event-converter';
+1 -1
View File
@@ -1,4 +1,4 @@
import type { MessageElement } from '@snowluma/bridge/events';
import type { MessageElement } from '@snowluma/protocol/events';
import type { DownloadRKeyInfo } from '@snowluma/core/bridge';
import type { BridgeInterface } from '@snowluma/core/bridge-interface';
import { createLogger } from '@snowluma/common/logger';
+1 -1
View File
@@ -21,7 +21,7 @@ import {
type NetworkAdapterContext,
} from './network';
import { createLogger, type Logger } from '@snowluma/common/logger';
import { formatGroup, formatMessageSegments, formatReply, formatUser } from '@snowluma/bridge/format';
import { formatGroup, formatMessageSegments, formatReply, formatUser } from '@snowluma/protocol/format';
const moduleLog = createLogger('Event');
+1 -1
View File
@@ -2,7 +2,7 @@
// segment emitted by the event converter and writes a row into the
// MediaStore so later `get_image` / `get_record` OneBot actions can
import type { MessageElement } from '@snowluma/bridge/events';
import type { MessageElement } from '@snowluma/protocol/events';
import type { MediaStore } from './media-store';
import type { JsonObject } from './types';
+1 -1
View File
@@ -8,7 +8,7 @@ import fs from 'fs';
import Database, { type Database as DatabaseType, type Statement } from '@snowluma/sqlite';
import path from 'path';
import type { MessageElement } from '@snowluma/bridge/events';
import type { MessageElement } from '@snowluma/protocol/events';
export interface CachedImage {
/** Primary `data.file` value as exposed in the OneBot segment. */
+1 -1
View File
@@ -1,5 +1,5 @@
import type { BridgeInterface } from '@snowluma/core/bridge-interface';
import type { MessageElement } from '@snowluma/bridge/events';
import type { MessageElement } from '@snowluma/protocol/events';
import type { RKeyCache } from './instance-rkey';
export class MediaUrlResolver {
+1 -1
View File
@@ -1,4 +1,4 @@
import type { MessageElement } from '@snowluma/bridge/events';
import type { MessageElement } from '@snowluma/protocol/events';
import { createLogger } from '@snowluma/common/logger';
import type { JsonValue } from './types';
@@ -1,5 +1,5 @@
import type { BridgeInterface } from '@snowluma/core/bridge-interface';
import type { IdentityService } from '@snowluma/bridge/identity-service';
import type { IdentityService } from '@snowluma/protocol/identity-service';
import type { OneBotInstanceContext } from '../instance-context';
import type { JsonObject } from '../types';
@@ -1,5 +1,5 @@
import type { BridgeInterface } from '@snowluma/core/bridge-interface';
import type { ForwardNodePayload, MessageElement } from '@snowluma/bridge/events';
import type { ForwardNodePayload, MessageElement } from '@snowluma/protocol/events';
import { createLogger } from '@snowluma/common/logger';
import type { MessageSendResult } from '../api-handler';
import { elementsToOneBotSegments } from '../event-converter';
+1 -1
View File
@@ -1,4 +1,4 @@
// Plain JSON types now live in @snowluma/common/json so @snowluma/bridge
// Plain JSON types now live in @snowluma/common/json so @snowluma/protocol
// (event-format / receive parsers) can talk about JSON payloads without
// importing OneBot. Re-exported here so the legacy import shape stays
// supported — `import { JsonValue } from '<…>/onebot/types'` keeps working.