feat(panel): add standalone Web monitor mode and full Antigravity CLI 1.5.9 telemetry support

- Add zero-SDK standalone HTTP server (`standalone.mjs` / `standalone-server.mjs`) with responsive centered Web shell, `127.0.0.1` default loopback guard, mandatory `--token` enforcement on non-loopback binds (`HttpOnly; SameSite=Strict` cookie + `Bearer` auth), and optional background auto-hosting via `standalonePort` / `USAGE_MONITOR_STANDALONE_PORT`.
- Extend multi-root data discovery across `~/.gemini/antigravity` and `~/.gemini/antigravity-cli`, plus `daemon/hub_*.json` and `/proc` + `ss` Language Server endpoint discovery on minimal headless Linux hosts without `lsof`.
- Add read-only `node:sqlite` + lightweight protobuf wire reader (`cli-sqlite-reader.mjs`) to recover CLI session titles (`annotations/*.pbtxt` & `conversation_summaries.db`), nanosecond request duration/TPS, native TTFT, thinking/response token split, 10-channel context breakdown, and `Antigravity CLI` source attribution.
- Add regression tests (124 passing) and bilingual CLI / SSH tunnel / `--token` documentation in `README.zh-CN.md` and `README.md`.

Closes #18
This commit is contained in:
fish
2026-11-16 02:28:34 +09:00
parent 8968e03adb
commit 76669d5cc7
23 changed files with 3631 additions and 110 deletions
@@ -342,6 +342,19 @@ export function normalizeModelContextWindows(value) {
);
}
/**
* 归一化独立 Web 服务自动托管端口(`0` 表示关闭自动拉起,合法监听端口范围 `1024..65535`)。
*
* @param {unknown} port
* @returns {number}
*/
export function normalizeStandalonePort(port) {
const num = Number(port);
if (!Number.isInteger(num) || num <= 0) return 0;
if (num >= 1024 && num <= 65535) return num;
return 0;
}
export const DEFAULT_SETTINGS_SCHEMA = Object.freeze({
language: 'zh-CN',
themeAccent: 'host',
@@ -355,6 +368,7 @@ export const DEFAULT_SETTINGS_SCHEMA = Object.freeze({
autoUpdatePlugin: false,
windowMountMode: 'dual',
enableWindowOverlay: true,
standalonePort: 0,
showTopbarMultiSession: true,
topbarCapsuleSlots: DEFAULT_TOPBAR_SLOTS,
hoverModules: DEFAULT_HOVER_MODULES,
@@ -383,6 +397,7 @@ export function createDefaultSettingsObject() {
autoUpdatePlugin: DEFAULT_SETTINGS_SCHEMA.autoUpdatePlugin,
windowMountMode: DEFAULT_SETTINGS_SCHEMA.windowMountMode,
enableWindowOverlay: DEFAULT_SETTINGS_SCHEMA.enableWindowOverlay,
standalonePort: DEFAULT_SETTINGS_SCHEMA.standalonePort,
showTopbarMultiSession: DEFAULT_SETTINGS_SCHEMA.showTopbarMultiSession,
topbarCapsuleSlots: [...DEFAULT_TOPBAR_SLOTS],
hoverModules: [...DEFAULT_HOVER_MODULES],
@@ -429,6 +444,7 @@ export function normalizeFullSettings(rawInput) {
autoUpdatePlugin: pluginUpdateMode === 'auto',
windowMountMode,
enableWindowOverlay: windowMountMode !== 'sidebar',
standalonePort: normalizeStandalonePort(safeRaw.standalonePort),
showTopbarMultiSession: safeRaw.showTopbarMultiSession !== false,
topbarCapsuleSlots: normalizeTopbarCapsuleSlots(safeRaw.topbarCapsuleSlots),
hoverModules: normalizeHoverModules(safeRaw.hoverModules),