mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-27 01:19:25 +08:00
feat(panel): add worker hot-reload, sticky bridge lease, custom token combos, trimmed model IDs, and adaptive popover width
- Isolate SidecarApp /api/* backend runtime inside a hot-swappable Worker thread (sidecar-worker.mjs) with 3s disk-drift detection and queued request handoff so live plugin updates never drop the host-assigned SidecarApp port - Persist and reuse sticky loopback bridge port/token leases across bridge-daemon and worker reloads, pre-bind the bridge server on boot, allow /api/cache/rebuild on the bridge, and self-heal poisoned CDP fallback states back to HTTP - Add billing-aligned In / Out / Cache (tokens_io_cache) preset with per-segment USD hover breakdown and custom format DSL (tokens_custom + stepTokenComboFormat, e.g. context:new:cache, in:out:cache) - Add 3-way model name format (short / upstream / upstream_compact) stripping gemini-, claude-, and gpt- prefixes while protecting compaction suffixes from ellipsis truncation - Add adaptive content-fit popover width (auto up to viewport bounds on wide step tables) alongside custom fixed width (440-1080 px)
This commit is contained in:
@@ -18,16 +18,22 @@ import {
|
||||
DEFAULT_HOVER_MODULES,
|
||||
DEFAULT_OVERVIEW_METRICS,
|
||||
DEFAULT_OVERVIEW_MODULES,
|
||||
DEFAULT_POPOVER_WIDTH,
|
||||
DEFAULT_SETTINGS_SCHEMA,
|
||||
DEFAULT_STEP_TABLE_COLUMNS,
|
||||
DEFAULT_STEP_TOKEN_COMBO_FORMAT,
|
||||
DEFAULT_TOPBAR_SLOTS,
|
||||
FONT_SCALE_KEYS,
|
||||
MAX_POPOVER_WIDTH,
|
||||
MAX_TOPBAR_SLOTS,
|
||||
MIN_POPOVER_WIDTH,
|
||||
MIN_TOPBAR_SLOTS,
|
||||
MODEL_DISPLAY_MODES,
|
||||
ORCHESTRATOR_ID_MODES,
|
||||
OVERVIEW_METRIC_KEYS,
|
||||
OVERVIEW_MODULE_KEYS,
|
||||
PLUGIN_UPDATE_MODES,
|
||||
POPOVER_WIDTH_MODES,
|
||||
STEP_TABLE_COLUMN_KEYS,
|
||||
SUPPORTED_LANGUAGES,
|
||||
THEME_ACCENT_KEYS,
|
||||
@@ -38,32 +44,43 @@ import {
|
||||
normalizeFullSettings,
|
||||
normalizeHoverModules,
|
||||
normalizeLanguageSetting,
|
||||
normalizeModelDisplayMode,
|
||||
normalizeOrchestratorIdMode,
|
||||
normalizeOverviewMetrics,
|
||||
normalizeOverviewModules,
|
||||
normalizePluginUpdateMode,
|
||||
normalizePopoverWidth,
|
||||
normalizePopoverWidthMode,
|
||||
normalizeStandalonePort,
|
||||
normalizeStepTableColumns,
|
||||
normalizeStepTokenComboFormat,
|
||||
normalizeThemeAccent,
|
||||
normalizeTopbarCapsuleSlots,
|
||||
normalizeWeeklyLimitMode,
|
||||
normalizeWindowMountMode,
|
||||
parseStepTokenComboSegments,
|
||||
} from './settings-schema.mjs';
|
||||
|
||||
export {
|
||||
DEFAULT_HOVER_MODULES,
|
||||
DEFAULT_OVERVIEW_METRICS,
|
||||
DEFAULT_OVERVIEW_MODULES,
|
||||
DEFAULT_POPOVER_WIDTH,
|
||||
DEFAULT_SETTINGS_SCHEMA,
|
||||
DEFAULT_STEP_TABLE_COLUMNS,
|
||||
DEFAULT_STEP_TOKEN_COMBO_FORMAT,
|
||||
DEFAULT_TOPBAR_SLOTS,
|
||||
FONT_SCALE_KEYS,
|
||||
MAX_POPOVER_WIDTH,
|
||||
MAX_TOPBAR_SLOTS,
|
||||
MIN_POPOVER_WIDTH,
|
||||
MIN_TOPBAR_SLOTS,
|
||||
MODEL_DISPLAY_MODES,
|
||||
ORCHESTRATOR_ID_MODES,
|
||||
OVERVIEW_METRIC_KEYS,
|
||||
OVERVIEW_MODULE_KEYS,
|
||||
PLUGIN_UPDATE_MODES,
|
||||
POPOVER_WIDTH_MODES,
|
||||
STEP_TABLE_COLUMN_KEYS,
|
||||
SUPPORTED_LANGUAGES,
|
||||
THEME_ACCENT_KEYS,
|
||||
@@ -74,16 +91,21 @@ export {
|
||||
normalizeFullSettings,
|
||||
normalizeHoverModules,
|
||||
normalizeLanguageSetting,
|
||||
normalizeModelDisplayMode,
|
||||
normalizeOrchestratorIdMode,
|
||||
normalizeOverviewMetrics,
|
||||
normalizeOverviewModules,
|
||||
normalizePluginUpdateMode,
|
||||
normalizePopoverWidth,
|
||||
normalizePopoverWidthMode,
|
||||
normalizeStandalonePort,
|
||||
normalizeStepTableColumns,
|
||||
normalizeStepTokenComboFormat,
|
||||
normalizeThemeAccent,
|
||||
normalizeTopbarCapsuleSlots,
|
||||
normalizeWeeklyLimitMode,
|
||||
normalizeWindowMountMode,
|
||||
parseStepTokenComboSegments,
|
||||
} from './settings-schema.mjs';
|
||||
|
||||
/**
|
||||
@@ -292,7 +314,7 @@ export function loadJson(filePath, fallback) {
|
||||
*/
|
||||
export function saveJson(filePath, data) {
|
||||
try {
|
||||
mkdirSync(DATA_DIR, { recursive: true });
|
||||
mkdirSync(dirname(filePath), { recursive: true });
|
||||
if (filePath === CACHE_FILE) {
|
||||
writeTrajectoryCacheFile(filePath, data);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user