mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-12-01 11:37:29 +08:00
feat(panel): add VS Code extension, Remote-SSH, and remote CLI support
- Auto-discover and provision standard VS Code / VS Code Insiders argv.json without touching Antigravity Desktop port files - Add independent vsCodeMountMode (default: Input Box / composer, optional: Top Bar / dual; omit Sidebar Only in VS Code host) - Support Remote-SSH endpoint isolation for VS Code Antigravity extension and instant conversation following via passive route watcher + /api/bridge-route-ping - Add remote-cli-bridge to detect remote agy CLI usage-monitor plugin and auto-mount on Top Bar over on-demand SSH loopback tunnels (tier1Only), skipping hosts with neither plugin - Optimize background CDP polling and remote idle polling cadence - Update README.md / README.zh-CN.md and add regression tests
This commit is contained in:
@@ -54,3 +54,17 @@ export const BRIDGE_API_PATHS = Object.freeze(BRIDGE_API_ROUTE_DEFS.map((r) => r
|
||||
export function readInjectedWindowBridge() {
|
||||
return typeof window === 'undefined' ? undefined : window[WINDOW_BRIDGE_KEY];
|
||||
}
|
||||
|
||||
export function isVsCodeExtensionHost() {
|
||||
const bridge = readInjectedWindowBridge();
|
||||
if (bridge?.isVsCodeHost === true) return true;
|
||||
if (typeof window !== 'undefined') {
|
||||
const search = String(window.location?.search || '');
|
||||
if (/[?&]extensionVariant=vs-code/i.test(search)) return true;
|
||||
const href = String(window.location?.href || '');
|
||||
if (/(?:Visual(?:%20|\s)Studio(?:%20|\s)Code|Code(?:\s|%20)-?(?:\s|%20)Insiders)/i.test(href)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user