mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-26 17:09:28 +08:00
docs(readme): refresh documentation, unify surface previews, and re-render v1.5 gallery
This commit is contained in:
@@ -1,95 +1,147 @@
|
||||
<div align="center">
|
||||
|
||||
<img src="assets/logo.svg" alt="Antigravity Usage & Speed Monitor Logo" width="84" />
|
||||
|
||||
# Antigravity Usage & Speed Monitor
|
||||
|
||||
English | [简体中文](README.zh-CN.md)
|
||||
Local usage, speed, context, and quota monitor for Google Antigravity 2.0, Antigravity IDE, and Antigravity CLI, with no external npm dependencies.
|
||||
|
||||
**Real-time usage & speed monitor for Google Antigravity 2.0, IDE, and CLI.**<br>
|
||||
Track token generation speed (TPS), time-to-first-token (TTFT), context window usage, official model quotas, subagent activity, and historical token consumption — across Windows, macOS, Linux, and headless CLI servers.
|
||||
[](https://github.com/yuhuan-dev/antigravity-usage-monitor/releases/latest)
|
||||
[](https://github.com/yuhuan-dev/antigravity-usage-monitor/releases)
|
||||
[](https://github.com/yuhuan-dev/antigravity-usage-monitor/stargazers)
|
||||
[](LICENSE)
|
||||
[](#local-development)
|
||||
[](#client-support)
|
||||
|
||||

|
||||
English · [简体中文](README.zh-CN.md)
|
||||
|
||||
**[Download Latest Release](https://github.com/yuhuan-dev/antigravity-usage-monitor/releases/latest)** · **[Download ZIP (`usage-monitor.zip`)](https://github.com/yuhuan-dev/antigravity-usage-monitor/releases/latest/download/usage-monitor.zip)**
|
||||
[Features](#features) · [Screenshots](#screenshots) · [Client Support](#client-support) · [Installation](#installation) · [Usage](#usage) · [Development](#local-development)
|
||||
|
||||
## Features
|
||||
<br />
|
||||
|
||||
- **Real-time Speed Monitoring** — Track live TPS, TTFT, session average generation speed, and estimated step/session API cost.
|
||||
- **10-Channel Context Window Analysis** — Visualize active context usage across assistant replies, tool results, user messages, subagent notifications, compaction summaries, system prompts, system tools, MCP tools, Skills, and user rules.
|
||||
- **Model Quota Tracking** — Monitor 5-hour and weekly official quotas across `Gemini`, `Gemini 4 Argon`, `Gemini 4 Carbon`, and `Claude & GPT` pools with live reset countdowns.
|
||||
- **Subagent Analytics** — Inspect main-agent and subagent calls, context windows, and compaction steps independently or in aggregate.
|
||||
- **Token Usage Statistics** — Explore historical consumption, cache hit efficiency & savings, interactive trend charts, and model rankings.
|
||||
- **Dual-Mount Interface** — Run the compact top-bar floating capsule alongside the right-hand side-panel dashboard without modifying `app.asar`.
|
||||
- **Built-in Cloud Sync & Updates** — Dynamically sync model pricing catalogs and manage 3-tier update modes (`manual` / `auto` / `off`).
|
||||
<img src="assets/preview.png" alt="Antigravity Usage Monitor Preview" width="100%" />
|
||||
|
||||
### Token Usage Analytics
|
||||
<br />
|
||||
|
||||

|
||||
[Latest Release](https://github.com/yuhuan-dev/antigravity-usage-monitor/releases/latest) · [Download ZIP (`usage-monitor.zip`)](https://github.com/yuhuan-dev/antigravity-usage-monitor/releases/latest/download/usage-monitor.zip)
|
||||
|
||||
### Context Window & Quota Monitoring
|
||||
|
||||

|
||||
|
||||
### Subagent & Step-by-Step Call Details
|
||||
|
||||

|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
## Panel Overview
|
||||
## Features
|
||||
|
||||
The dashboard is organized into four tabs, with a top header to switch conversations, filter by **All / Main Agent / Subagent**, or manually refresh quotas:
|
||||
- **Live Metrics & Customizable Layout**: Tracks output speed (`tok/s`), time-to-first-token (`TTFT`), session average speed, step/session USD cost, cache hit rate, tightest remaining quota, and session tokens. You can choose and reorder the overview metric cards (4 shown by default out of 9 options) and section blocks.
|
||||
- **10-Category Context Breakdown**: Shows the token breakdown of the latest request across assistant replies, tool results, user messages, subagent notifications, checkpoints, system prompts, system tools, MCP tools, skills, and user rules, with a switcher between the main agent and spawned subagents.
|
||||
- **Quota Pool Tracking**: Reads 5-hour and weekly quotas, reset timers, and cycle consumption across `Gemini`, `Gemini 4 Argon`, `Gemini 4 Carbon`, and `Claude & GPT` pools, preserving cached pool status with a stale badge when upstream quota data is temporarily unavailable.
|
||||
- **Main Agent, Subagents & Multi-Session Views**: Merges main agent and subagent steps in chronological order (or filters by individual agent), renders optional turn rails, expands running subagent tasks inline, and provides a recent-conversation selector in the header.
|
||||
- **Call Details & Custom Token Formats**: Includes **By Step** and **By Model** tabs (with multi-model throughput charts). Supports 2–14 configurable columns, optional speed color grading, preset `Ctx / Think / Reply` and `In / Out / Cache` columns, and custom token combination strings such as `context:new:cache` or `in:out:cache`.
|
||||
- **Historical Usage & Breakdowns**: Summarizes tokens, uncached input vs. cache-read savings, thinking/output split, hourly/daily trend curves, model rankings, client attribution (`Desktop App` / `IDE` / `CLI`), and monthly bar charts across `Today`, `1d`, `7d`, `14d`, `30d`, `All`, or custom date/time ranges.
|
||||
- **Multi-Client Capsules & Hover Popover**: Integrates as a titlebar or composer capsule and auxiliary sidebar in Antigravity 2.0, a titlebar/composer capsule in Antigravity IDE, a single-line 24-bit ANSI `statusLine` in Antigravity CLI (`agy`), and a standalone local web UI. Supports 1–5 customizable capsule slots, configurable hover cards, and `Auto Fit` or fixed (`440–1080 px`) popover widths.
|
||||
- **No `app.asar` Modification**: Titlebar/composer injection and context request hooks run in memory over local CDP (`DevToolsActivePort`). On Antigravity IDE, the only host file updated is adding `"remote-debugging-port": "0"` to `~/.antigravity-ide/argv.json`; installation binaries and `app.asar` are never altered.
|
||||
- **Per-Model Context Windows**: Sets context window limits per model series (across thinking levels) or follows host defaults under Settings. Desktop/IDE applies rules at runtime on outbound requests; CLI applies `AGY_CLI_AUTO_COMPACT_OVERRIDE`.
|
||||
- **Appearance, Offline Storage & Cloud Updates**: Supports `zh-CN` / `en-US` / host language, `sm / md / lg / xl` font scaling, 6 theme accents plus host matching, offline reading from CLI SQLite + WAL, `annotations/*.pbtxt`, `transcript.jsonl`, and `.deep_stats_cache.json`, GitHub [`pricing-catalog.json`](pricing-catalog.json) sync, in-panel release updates (`manual` / `auto` / `off`), and cache rebuild/settings reset tools.
|
||||
|
||||
- **Live Overview**
|
||||
- **Core Metrics**: Output speed (TPS), TTFT, average generation speed, latest step cost, and cumulative session cost (viewable per main agent, per subagent, or combined).
|
||||
- **Context Window**: Switchable per agent, decomposed into 10 sources dynamically ordered by token footprint: assistant replies, tool results, user messages, subagent notifications, compaction summaries, system prompts, system tools, MCP tools, Skills, and user rules.
|
||||
- **Quota Pools**: Displays 5-hour and weekly limits with reset countdowns for `Gemini`, `Gemini 4 Argon`, `Gemini 4 Carbon` (dedicated pools on Pro accounts), and `Claude & GPT`, plus live multi-session execution cards.
|
||||
- **Usage Analytics**
|
||||
- Filter by Today, 1d, 7d, 14d, 30d, All, or custom date-time ranges.
|
||||
- Summarizes total tokens, API-equivalent cost, and cache hit rate, breaking down uncached input, cache reads (including estimated USD saved), and output + thinking usage.
|
||||
- Includes an interactive usage trend chart, model rankings, client source distribution, and monthly breakdown bars.
|
||||
- **Call Details**
|
||||
- **By Step**: Lists every step in the selected conversation with its model, TPS, TTFT, context/output tokens, cache hit rate, and step cost.
|
||||
- **By Model**: Aggregates call counts, mean speed, total tokens, and cost per model within the current session and selected agent scope.
|
||||
- **Preferences**
|
||||
- **Mount Mode & Popover Width**: Choose Dual-mount (Top Bar + Sidebar), Composer mount, or Sidebar only; the floating popover defaults to **Auto Fit** (expanding automatically on wide step tables within viewport bounds to avoid horizontal scrolling) or accepts a custom fixed width (`440–1080 px`).
|
||||
- **Top-Bar & CLI Capsule Customization**: Independently toggle the live running-sessions indicator and the Antigravity CLI bottom status capsule (auto-provisioned via `~/.gemini/antigravity-cli/settings.json` `statusLine`), and customize 1 to 5 metric slots and their left-to-right order (defaulting to Output Speed, TTFT, and Context Usage).
|
||||
- **Call Details & Custom Token Combos**: Under **Structure -> Step Table**, independently toggle main/subagent badges, the turn rail (off by default), and **Speed Multi-Color** grading (off by default); keep the default `Ctx / Think / Reply` combo column, switch to the billing-aligned `In / Out / Cache` preset (with per-segment cost breakdown on hover), or enter a custom format string such as `context:new:cache` or `in:out:cache`.
|
||||
- **Model Name Format**: Choose among Compact short alias (e.g. `argon-4-high`), full raw upstream ID, or Trimmed raw ID (hiding `gemini-`, `claude-`, and `gpt-` prefixes to save single-line space, e.g. `3.8-flash-n`, `sonnet-4-6`, `5.4-mini`), with compaction suffixes (`·compact`) protected from ellipsis truncation; Orchestrator series IDs remain independently configurable.
|
||||
- **Per-model context windows**: In **Other → Model Context Settings**, choose a shared limit for all thinking levels of a model or select **Follow host settings**. The model list shows the saved limit and the most recent value reported by the host. At startup, the App / IDE window bridge reads the latest model catalog and reapplies saved limits to future messages. The CLI uses `AGY_CLI_AUTO_COMPACT_OVERRIDE`.
|
||||
- **Version Updates & Pricing Sync**: Dynamically sync [`pricing-catalog.json`](pricing-catalog.json) from GitHub, with three update modes: *Notify only, manual update* (default), *Auto update*, and *Off*.
|
||||
---
|
||||
|
||||
## Model Identification & Cost Accounting
|
||||
## Screenshots
|
||||
|
||||
Model identity is resolved directly from each step's raw usage or matching generator metadata. Automatic context compaction may use a separate model; explicitly recorded models are never overwritten. When a compaction step lacks an explicit model, it is inferred from known steps in the same conversation — preferring preceding, then following provider-compatible steps before relaxing provider constraints. Inferred models are used for display and cost estimation rather than claiming server-confirmed compaction identity; when no evidence is available, the step is marked as unknown compaction.
|
||||
### IDE & CLI
|
||||
|
||||
When a model or its pricing cannot be confirmed, single-step cost is shown as pending while tokens are still counted; aggregate totals sum all steps with confirmed rates. Catalogued models are calculated using public API per-million-token rates for local cost reference only — this does not represent subscription quota deduction ratios.
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<img src="assets/ide-preview.png" alt="Antigravity IDE Titlebar Capsule and Hover Overview" width="100%" />
|
||||
<br />
|
||||
<b>Antigravity IDE</b>
|
||||
<br />
|
||||
<sub>Titlebar capsule and hover popover showing step cost, context usage, and pool quotas</sub>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<img src="assets/cli-preview.png" alt="Antigravity CLI Native statusLine Capsule" width="100%" />
|
||||
<br />
|
||||
<b>Antigravity CLI (<code>agy</code>)</b>
|
||||
<br />
|
||||
<sub>Single-line transparent 24-bit ANSI bottom <code>statusLine</code> with active count, TPS, TTFT, and context percentage</sub>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
On upgrade, historical cached entries are re-verified against raw trajectory records. Ambiguous default Argon labels from legacy caches remain unresolved if raw records are temporarily unavailable, while preserving token counts and valid timings. Compaction steps display full-request TPS in step tables but are excluded from session speed and TTFT averages.
|
||||
### Panel Tabs
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center" width="33.3%">
|
||||
<img src="assets/context.png" alt="Live Overview and Quotas" />
|
||||
<br />
|
||||
<b>Live Overview</b>
|
||||
<br />
|
||||
<sub>TPS, TTFT, 10-category context bar, quota pools, and active tasks</sub>
|
||||
</td>
|
||||
<td align="center" width="33.3%">
|
||||
<img src="assets/analytics.png" alt="Usage Statistics" />
|
||||
<br />
|
||||
<b>Usage Statistics</b>
|
||||
<br />
|
||||
<sub>Token totals, cache hit rate, trend chart, and model breakdown</sub>
|
||||
</td>
|
||||
<td align="center" width="33.3%">
|
||||
<img src="assets/subagents.png" alt="Call Details and Subagents" />
|
||||
<br />
|
||||
<b>Call Details</b>
|
||||
<br />
|
||||
<sub>Step-by-step agent badge, model, speed, TTFT, tokens, and cost</sub>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
## Client Support
|
||||
|
||||
| Client | Status Capsule / Bar | Panel UI | Offline SQLite & Logs | Per-Model Context Limit | Modifies `app.asar` |
|
||||
| :--- | :---: | :---: | :---: | :---: | :---: |
|
||||
| **Antigravity 2.0 (Desktop)** | Titlebar / Composer | Popover + Right Sidebar | Yes | Window Request Hook | No |
|
||||
| **Antigravity IDE** | Titlebar / Composer | Capsule Popover | Yes | Window Request Hook | No |
|
||||
| **Antigravity CLI (`agy`)** | Native ANSI `statusLine` | Standalone Web (`--port`) | Yes (`node:sqlite` + `.pbtxt`) | `AGY_CLI_AUTO_COMPACT_OVERRIDE` | No |
|
||||
| **Remote / Headless Linux** | Native ANSI `statusLine` | SSH Tunnel / `--token` Web | Yes | `AGY_CLI_AUTO_COMPACT_OVERRIDE` | No |
|
||||
|
||||
> [!NOTE]
|
||||
> On **Antigravity IDE**, enabling the plugin automatically adds `"remote-debugging-port": "0"` to `~/.antigravity-ide/argv.json` (preserving comments and existing keys) via a zero-tool MCP keep-alive entry (`0` context tokens). Restart Antigravity IDE once after the first activation so the titlebar capsule can attach.
|
||||
|
||||
---
|
||||
|
||||
## Installation
|
||||
|
||||
Keep the plugin folder named `usage-monitor`. No `npm install` is required.
|
||||
Keep the folder name as `usage-monitor`. **No `npm install` is needed.**
|
||||
|
||||
### Option 1: Clone via Git
|
||||
### Option 1: Git Clone
|
||||
|
||||
**Windows (PowerShell)**
|
||||
```powershell
|
||||
# Windows (PowerShell)
|
||||
git clone https://github.com/yuhuan-dev/antigravity-usage-monitor.git "$env:USERPROFILE\.gemini\config\plugins\usage-monitor"
|
||||
```
|
||||
|
||||
**macOS / Linux**
|
||||
```bash
|
||||
# macOS / Linux
|
||||
git clone https://github.com/yuhuan-dev/antigravity-usage-monitor.git ~/.gemini/config/plugins/usage-monitor
|
||||
```
|
||||
|
||||
Or ask Antigravity directly in chat:
|
||||
Or ask Antigravity directly:
|
||||
|
||||
```text
|
||||
Clone https://github.com/yuhuan-dev/antigravity-usage-monitor to ~/.gemini/config/plugins/usage-monitor and enable the plugin
|
||||
```
|
||||
|
||||
### Option 2: Download & Extract ZIP
|
||||
### Option 2: Release ZIP
|
||||
|
||||
Download [`usage-monitor.zip`](https://github.com/yuhuan-dev/antigravity-usage-monitor/releases/latest/download/usage-monitor.zip) and extract it into `~/.gemini/config/plugins/`.
|
||||
Download [`usage-monitor.zip`](https://github.com/yuhuan-dev/antigravity-usage-monitor/releases/latest/download/usage-monitor.zip) and extract it into `~/.gemini/config/plugins/` so the directory path is `~/.gemini/config/plugins/usage-monitor`.
|
||||
|
||||
<details>
|
||||
<summary>Windows PowerShell command for ZIP installation</summary>
|
||||
|
||||
**Windows PowerShell:**
|
||||
```powershell
|
||||
$pluginsDir = "$env:USERPROFILE\.gemini\config\plugins"
|
||||
New-Item -ItemType Directory -Path $pluginsDir -Force | Out-Null
|
||||
@@ -97,57 +149,104 @@ Invoke-WebRequest -Uri "https://github.com/yuhuan-dev/antigravity-usage-monitor/
|
||||
Expand-Archive -Path "$env:TEMP\usage-monitor.zip" -DestinationPath $pluginsDir -Force
|
||||
```
|
||||
|
||||
## Enabling & Opening the Panel
|
||||
</details>
|
||||
|
||||
1. Open **Customizations** in the left sidebar, switch to the **Installed** tab, locate `usage-monitor`, and toggle it on.
|
||||
2. **Top-Bar Floating Capsule (enabled by default on both Antigravity 2.0 & Antigravity IDE)**:
|
||||
- **Antigravity 2.0 App**: Immediately mounts a live status & metric capsule in the top-right bar of the main chat window (hover for quick overview, left-click to expand the full 4-tab panel, right-click to force refresh) without modifying `app.asar`.
|
||||
- **Antigravity IDE**: On first enable, the background sidecar automatically adds `"remote-debugging-port": "0"` to `~/.antigravity-ide/argv.json` (preserving comments and existing settings). **Restart Antigravity IDE once**, and the capsule will dock into the top-right IDE window titlebar on every launch. Because Antigravity IDE does not currently expose the right-hand UI Sidecar auxiliary pane, keep **Mount Mode** set to *Dual-mount* in IDE and click the top-bar capsule to open the 4-tab dashboard.
|
||||
3. **Right-Hand Sidebar Panel (Antigravity 2.0)**: Open the auxiliary sidebar menu in the chat window to dock **Usage & Speed Monitor** on the right, or switch **Mount Mode** between *Top Bar + Sidebar* and *Sidebar only* in Preferences.
|
||||
4. **Antigravity CLI Bottom Status Capsule & Headless Standalone Web Mode**:
|
||||
- **CLI Bottom Status Capsule (`statusLine`, enabled by default)**: When `~/.gemini/antigravity-cli` is present, the plugin automatically configures native `statusLine` in `settings.json` (any existing custom third-party `statusLine.command` is strictly preserved) to render a single-line transparent 24-bit ANSI status bar at the bottom of `agy` (keeping `? for shortcuts` on the left, live metrics such as `● 1 active 38.1 t/s | 0.85s | ◎ 17%` centered, and mode/model/effort on the right). Toggle it anytime via `/statusline` in the CLI or **Preferences -> Mount & Capsule Bar**.
|
||||
- **Offline Transcript Fallback & Auto-Upgrade**: On terminal-only machines or remote Linux servers, the backend automatically discovers `~/.gemini/antigravity-cli` (`daemon/hub_*.json`, SQLite `.db` trajectories, and `transcript.jsonl`). When `agy` is offline, historical sessions and token accounting still load from local records and automatically upgrade to full live RPC telemetry once `agy` starts.
|
||||
- **Manual launch (recommended with SSH port forwarding)**:
|
||||
```bash
|
||||
# On the remote server (binds strictly to 127.0.0.1:8787 by default)
|
||||
node ~/.gemini/config/plugins/usage-monitor/sidecars/panel/standalone.mjs --port 8787
|
||||
---
|
||||
|
||||
# Forward from your local machine, then open http://localhost:8787
|
||||
ssh -L 8787:127.0.0.1:8787 user@your-server
|
||||
```
|
||||
- **Auto-host alongside `agy`**: Set `USAGE_MONITOR_STANDALONE_PORT=8787` or `"standalonePort": 8787` in `~/.gemini/antigravity-cli/sidecar_data/usage-monitor/panel/data/settings.json` to host the standalone Web UI automatically whenever the plugin's MCP supervisor starts.
|
||||
- **Token-protected non-loopback access**: Binding to `0.0.0.0` or a LAN IP requires `--token <secret>` (or `USAGE_MONITOR_STANDALONE_TOKEN`); unauthenticated non-loopback startup is refused.
|
||||
## Usage
|
||||
|
||||
## Updating
|
||||
|
||||
The plugin includes built-in cloud version checks and one-click self-updating:
|
||||
- When a new release is available, a subtle update badge appears next to the top-bar capsule and inside the panel header — click it to pull the update and reload automatically, or manage update behavior and pricing catalog sync in **Preferences -> Version Updates**.
|
||||
|
||||
To update manually from the command line:
|
||||
- **Git installations** — pull the latest fast-forward commits and toggle the plugin off/on in **Customizations -> Installed**:
|
||||
|
||||
```powershell
|
||||
# Windows PowerShell
|
||||
git -C "$env:USERPROFILE\.gemini\config\plugins\usage-monitor" pull --ff-only
|
||||
```
|
||||
1. Open **Customizations → Installed** in the left sidebar and enable `usage-monitor`.
|
||||
2. **Antigravity 2.0 (Desktop)**:
|
||||
- Mounts a capsule in the top-right titlebar (**hover** for summary, **click** for the 4-tab popover, **right-click** to refresh), alongside the right auxiliary sidebar pane.
|
||||
3. **Antigravity IDE**:
|
||||
- **Restart Antigravity IDE once** after enabling for the first time. Keep **Mount Mode** on **Dual-mount** and click the top-bar capsule to open the panel.
|
||||
4. **Antigravity CLI (`agy`)**:
|
||||
- When `~/.gemini/antigravity-cli` exists, `statusLine` in `settings.json` is configured automatically (existing third-party `statusLine.command` entries are left untouched) to render a single-line ANSI bar (`● 1 active 38.1 t/s | 0.85s | ◎ 17%`).
|
||||
- Toggle via `/statusline` in `agy` or **Preferences → Structure → Mount & Capsule Bar**.
|
||||
5. **Standalone Web Server (Headless / Remote)**:
|
||||
|
||||
```bash
|
||||
# macOS / Linux
|
||||
git -C ~/.gemini/config/plugins/usage-monitor pull --ff-only
|
||||
# 1. Start on the host (listens on 127.0.0.1:8787 by default)
|
||||
node ~/.gemini/config/plugins/usage-monitor/sidecars/panel/standalone.mjs --port 8787
|
||||
|
||||
# 2. Forward the port locally and open http://localhost:8787
|
||||
ssh -L 8787:127.0.0.1:8787 user@your-server
|
||||
```
|
||||
|
||||
- **ZIP installations** — download the new `usage-monitor.zip`, extract over the existing folder, and toggle the plugin off/on. Local caches and user settings are stored separately in `~/.gemini/antigravity/sidecar_data/usage-monitor/` (or `sidecars/panel/.data/` when run standalone), so updating never erases historical usage data.
|
||||
<details>
|
||||
<summary>Standalone CLI flags, background auto-start, and non-loopback token auth</summary>
|
||||
|
||||
- **Auto-start with `agy`**: Set `USAGE_MONITOR_STANDALONE_PORT=8787` or `"standalonePort": 8787` in `~/.gemini/antigravity-cli/sidecar_data/usage-monitor/panel/data/settings.json` to start the web UI together with the MCP sidecar supervisor.
|
||||
- **Non-loopback auth**: Binding to `0.0.0.0` or a LAN address requires `--token <secret>` (or `USAGE_MONITOR_STANDALONE_TOKEN`); starting on a non-loopback address without a token is rejected.
|
||||
- **Overrides**: Supports `--data-dir`, `--app-data-dir`, `--gemini-dir`, `--ls-addr`, and `--csrf-token`.
|
||||
- **Offline fallback**: When `agy` is not running, the backend reads `~/.gemini/antigravity-cli` (`conversation_summaries.db`, `conversations/*.db`, `annotations/*.pbtxt`, and `transcript.jsonl`) and switches to live RPC once `agy` starts.
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
## Configuration & Calculation Notes
|
||||
|
||||
<details>
|
||||
<summary>UI options: mount mode, capsule slots, token formats, model IDs, and context limits</summary>
|
||||
|
||||
- **Mount Mode & Width**: Switch between **Dual-mount (Top Bar + Sidebar)**, **Composer**, and **Sidebar only**. Popover width defaults to **Auto Fit** (expands within window bounds for wide tables) or a fixed width (`440–1080 px`).
|
||||
- **Capsule Slots**: Choose 1–5 metric slots and reorder them (default: Output Speed, TTFT, Context Usage), plus an optional toggle for the active-session indicator.
|
||||
- **Call Details Table & Token Format**: Toggle agent badges, turn rail (off by default), and speed color grading (off by default). Choose `Ctx / Think / Reply`, `In / Out / Cache` (with per-item USD tooltips), or custom format strings like `context:new:cache` or `in:out:cache`.
|
||||
- **Model Name Format**: Choose **Compact short alias** (`argon-4-high`), **Full raw ID**, or **Trimmed raw ID** (strips `gemini-` / `claude-` / `gpt-` prefixes while keeping `·compact` suffixes intact). Orchestrator series IDs have a separate setting.
|
||||
- **Per-Model Context Limits**: Configure limits per model across thinking levels or follow host defaults under **Preferences → Other → Model Context Settings**. App/IDE applies saved rules at startup; CLI sets `AGY_CLI_AUTO_COMPACT_OVERRIDE`.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Model identification, compaction inference, and cost estimation rules</summary>
|
||||
|
||||
- **Model Resolution**: Read from each step's raw usage payload or matching generator metadata; explicit models are never overwritten. When an automatic compaction step omits the model field, it is inferred from adjacent steps in the same conversation (checking prior steps first, then following steps, preferring the same provider) for display and estimation, or shown as unknown compaction if none exist.
|
||||
- **Cost Calculation**: If a model or price entry cannot be resolved, step cost is shown as pending while tokens still count toward totals; session totals sum all resolved steps. USD numbers are estimated from public per-million-token API pricing in [`pricing-catalog.json`](pricing-catalog.json) for reference only and do **not** reflect subscription quota consumption.
|
||||
- **Cache & Speed Averages**: Upgrading re-checks cached entries against raw trajectory data while preserving token counts and valid timings. Compaction steps display request TPS in step tables but are excluded from session speed and TTFT averages.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary>Updating and data directory</summary>
|
||||
|
||||
- **In-Panel Update**: When a new GitHub release is available, a version badge appears next to the capsule and in the panel header. Update mode (`Manual` / `Auto` / `Off`) and price catalog sync can be configured under **Preferences → Other**.
|
||||
- **Manual Git Update**:
|
||||
- Windows: `git -C "$env:USERPROFILE\.gemini\config\plugins\usage-monitor" pull --ff-only`
|
||||
- macOS / Linux: `git -C ~/.gemini/config/plugins/usage-monitor pull --ff-only`
|
||||
- Toggle the plugin off and back on in **Customizations → Installed**.
|
||||
- **Data Persistence**: Settings and parsed caches live in `~/.gemini/antigravity/sidecar_data/usage-monitor/` (or `sidecars/panel/.data/` in standalone mode), so updates keep existing history intact.
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
## Local Development
|
||||
|
||||
After editing frontend source files under `sidecars/panel/src/`, rebuild `app.js` and `styles.css` from `sidecars/panel`:
|
||||
All backend and frontend modules use Node.js ESM and native Web Components with **no external npm dependencies** (Node.js 22.5+ is recommended for built-in `node:sqlite`).
|
||||
|
||||
```bash
|
||||
cd sidecars/panel
|
||||
|
||||
# Rebuild app.js and styles.css after modifying src/
|
||||
npm run build
|
||||
```
|
||||
|
||||
Run the model identity, cache migration, quota pool, and timing regression test suite (zero external dependencies required):
|
||||
|
||||
```bash
|
||||
# Run unit and integration tests
|
||||
npm test
|
||||
```
|
||||
|
||||
## Contributing & License
|
||||
|
||||
Issues and pull requests are welcome. If you modify files under `sidecars/panel/src/`, please rebuild via `npm run build` and make sure `npm test` passes.
|
||||
|
||||
Licensed under the [GNU General Public License v3.0](LICENSE).
|
||||
|
||||
## Star History
|
||||
|
||||
<a href="https://www.star-history.com/#yuhuan-dev/antigravity-usage-monitor&Date">
|
||||
<picture>
|
||||
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=yuhuan-dev/antigravity-usage-monitor&type=Date&theme=dark" />
|
||||
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=yuhuan-dev/antigravity-usage-monitor&type=Date" />
|
||||
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=yuhuan-dev/antigravity-usage-monitor&type=Date" />
|
||||
</picture>
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user