mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
refactor(panel): unify settings and bridge contracts, prune dead code, and rename trajectory metrics
- Share settings normalization and window-bridge protocol contracts across frontend and backend - Encapsulate trajectory cache accessors inside config.mjs and validate bundle imports/syntax before writing - Remove dead selectors, unused symbols, duplicate re-export imports, and unmounted account tab instantiation - Rename speed-metrics.mjs to trajectory-metrics.mjs and audit-fixes.test.mjs to cross-module-regressions.test.mjs
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
* (Sidecar Webview `window.sidecar.fetch` + Main Window Loopback Bridge).
|
||||
*/
|
||||
|
||||
import { readInjectedWindowBridge } from '../../shared/window-bridge-protocol.mjs';
|
||||
|
||||
const inFlightGets = new Map();
|
||||
const activeControllers = new Map();
|
||||
|
||||
@@ -13,8 +15,7 @@ const activeControllers = new Map();
|
||||
* @returns {{ port: number, token: string, bundleVersion?: string, stylesCss?: string } | null}
|
||||
*/
|
||||
export function getWindowBridgeConfig() {
|
||||
if (typeof window === 'undefined') return null;
|
||||
const br = window.__AGUsageMonitorBridge;
|
||||
const br = readInjectedWindowBridge();
|
||||
const port = Number(br?.port || 0);
|
||||
if (br && Number.isInteger(port) && port > 0 && typeof br.token === 'string' && br.token) {
|
||||
return br;
|
||||
|
||||
Reference in New Issue
Block a user