mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
feat(panel): add inline CLI statusLine capsule, step speed color toggle, and refined defaults
- Auto-provision native Antigravity CLI `statusLine` (`stack_with_default: false`) in `~/.gemini/antigravity-cli/settings.json` while strictly preserving custom third-party `statusLine.command` scripts, using zero-double-quote Windows commands compatible with Go `syscall.EscapeArg` under `cmd /c` - Add `cli-statusline.mjs` and `cli-statusline-config.mjs` to render a single-line transparent 24-bit ANSI footer (`? for shortcuts` left, live multi-session & 1..5 capsule metrics centered, deduplicated `mode · model · effort` right) with responsive narrow-terminal fallbacks and `stdin` quota fallback - Persist `cli-status-snapshot.json` during telemetry builds and self-heal sidecar restarts inside `executeTelemetryAction` error paths when `computeRuntimeCodeVersion()` advances - Add `enableCliStatusLine` and `showStepSpeedColor` preferences in Settings -> Structure, rename the mount sub-tab/section label in `zh-CN` to `挂载胶囊`, set default `topbarCapsuleSlots` to `['tps', 'ttft', 'context']`, and default `showStepTurnRail` and `showStepSpeedColor` to `false` - Add unit and end-to-end tests across `backend.test.mjs` and `window-bridge.test.mjs`, and update `README.md` / `README.zh-CN.md`
This commit is contained in:
@@ -47,6 +47,7 @@ import {
|
||||
notifyWindowOverlaySetting,
|
||||
startDefaultWindowBridge,
|
||||
} from './window-bridge.mjs';
|
||||
import { ensureCliStatusLineConfigured } from './cli-statusline-config.mjs';
|
||||
|
||||
export const bootBundleVersion = computeRuntimeCodeVersion();
|
||||
|
||||
@@ -222,7 +223,23 @@ export async function executeTelemetryAction(data, { onRestart = null } = {}) {
|
||||
startMs: sanitizePositiveFiniteMs(data?.startMs),
|
||||
endMs: sanitizePositiveFiniteMs(data?.endMs),
|
||||
};
|
||||
const payload = await buildTelemetryPayload(convId, force, filterOpts);
|
||||
let payload;
|
||||
try {
|
||||
payload = await buildTelemetryPayload(convId, force, filterOpts);
|
||||
} catch (err) {
|
||||
if (
|
||||
lsRuntimeEndpoint.addr !== 'test.invalid' &&
|
||||
bootBundleVersion &&
|
||||
String(computeRuntimeCodeVersion()) !== String(bootBundleVersion)
|
||||
) {
|
||||
if (typeof onRestart === 'function') {
|
||||
onRestart();
|
||||
} else {
|
||||
scheduleSidecarRestart(150);
|
||||
}
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
if (
|
||||
bootBundleVersion &&
|
||||
payload.uiBundleVersion &&
|
||||
@@ -305,6 +322,9 @@ export function executeSettingsAction(data) {
|
||||
) {
|
||||
void notifyWindowOverlaySetting(updated.enableWindowOverlay);
|
||||
}
|
||||
if ((updated.enableCliStatusLine !== false) !== (current.enableCliStatusLine !== false)) {
|
||||
ensureCliStatusLineConfigured({ enabled: updated.enableCliStatusLine !== false });
|
||||
}
|
||||
if (
|
||||
typeof standalonePortListener === 'function' &&
|
||||
Number(updated.standalonePort || 0) !== Number(current.standalonePort || 0)
|
||||
@@ -387,6 +407,9 @@ export function executeResetSettingsAction() {
|
||||
} else if (Object.keys(current.modelContextWindows).length) {
|
||||
void notifyModelContextWindowsChanged();
|
||||
}
|
||||
if ((updated.enableCliStatusLine !== false) !== (current.enableCliStatusLine !== false)) {
|
||||
ensureCliStatusLineConfigured({ enabled: updated.enableCliStatusLine !== false });
|
||||
}
|
||||
if (
|
||||
typeof standalonePortListener === 'function' &&
|
||||
Number(updated.standalonePort || 0) !== Number(current.standalonePort || 0)
|
||||
@@ -501,6 +524,8 @@ export function bootWindowBridgeRuntime({ allowDynamicLs = false, onRestart = nu
|
||||
if (lsRuntimeEndpoint.addr === 'test.invalid') return null;
|
||||
if (!allowDynamicLs && !lsRuntimeEndpoint.addr) return null;
|
||||
|
||||
ensureCliStatusLineConfigured({ enabled: loadSettings().enableCliStatusLine !== false });
|
||||
|
||||
const triggerRestart =
|
||||
typeof onRestart === 'function' ? onRestart : () => scheduleSidecarRestart(150);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user