Refactor bridge modules: imports & cleanup

Standardize and reorganize imports, type usages and minor formatting across the bridge modules. This commit moves protobuf helpers, makeOidbEnvelope/runOidb, OidbBase and logger imports into consistent places, reorders and groups action/contacts exports in Bridge, removes or trims file-level comments, and fixes whitespace/logic ordering in several highway, element-builder and msg-push files. These are refactors and import/type adjustments across many files under packages/core/src (bridge, highway, msg-push, webui, utils, etc.) with no intended behavioral changes.
This commit is contained in:
手瓜一十雪 committed 2026-05-20 19:35:09 +08:00
1 parent c49ae1c8d9
commit b56868878c
83 files changed
+356 -919

No files matched your search

+2 -6
View File
@@ -1,12 +1,8 @@
import type { ApiHandler, ApiActionContext } from '../api-handler';
import { asMessage, asNumber, asString, asBoolean } from '../api-handler';
import type { ApiActionContext, ApiHandler } from '../api-handler';
import { asBoolean, asMessage, asNumber, asString } from '../api-handler';
import type { ForwardPreviewMeta } from '../modules/message-actions';
import { RETCODE, failedResponse, okResponse } from '../types';
// Bounded download for the OneBot `download_file` action. An authenticated
// client could otherwise hand us a multi-GB URL (or chunked response with
// no Content-Length) and OOM the bot — `await response.arrayBuffer()`
// happily allocates the whole payload before any size check fires.
const DOWNLOAD_FILE_MAX_BYTES = 1024 * 1024 * 1024; // 1 GiB
const DOWNLOAD_FILE_TIMEOUT_MS = 60_000;