Refactor Bridge APIs, slim Bridge and reorder imports

Move and standardize API implementations under bridge/apis, slim down the Bridge class (remove inline action implementations, caches and large comment blocks) and relocate related types/exports. Clean up and reorder imports across many bridge/api modules, normalize constructors, add logger imports where needed, and adjust WebUI routing/import ordering. These changes centralize API logic, reduce Bridge surface area, and tidy module boundaries and imports.
This commit is contained in:
手瓜一十雪 committed 2026-05-24 13:13:23 +08:00
1 parent a52a9724cb
commit a49e507e15
22 files changed
+144 -452

No files matched your search

-5
View File
@@ -1,10 +1,5 @@
import type { Bridge } from '../bridge';
/**
* Coerce numbers, strings, and bigints to a plain integer.
* Returns 0 for anything we can't interpret — every action that
* threads this through OIDB has an explicit `<=0` validation later.
*/
export function toInt(value: unknown): number {
if (typeof value === 'number' && Number.isFinite(value)) return Math.trunc(value);
if (typeof value === 'bigint') {