Skip to main content
Glama
README.md
# AGY Pulse

<p align="center">
  <img src="assets/logo.svg" alt="AGY Pulse Logo" width="72" height="72" />
</p>

<p align="center">
  <strong>Zero-injection local telemetry, model usage analytics, tool-call insights, and official CLI quota dashboard for Google Antigravity.</strong>
</p>

<p align="center">
  English | <a href="./README.zh-CN.md">简体中文</a>
</p>

<p align="center">
  <img alt="Version" src="https://img.shields.io/badge/version-1.5.1-2563eb" />
  <img alt="Zero Injection" src="https://img.shields.io/badge/architecture-zero--injection%20MCP%20App-10b981" />
  <img alt="Node.js" src="https://img.shields.io/badge/node-%3E%3D22.5-339933" />
  <img alt="License" src="https://img.shields.io/badge/license-MIT-64748b" />
</p>

---

## Why AGY Pulse?

**AGY Pulse** is a pure-local, zero-dependency-runtime **Antigravity MCP App (`SEP-1865`)** plugin. It gives you deep visibility into your Antigravity sessions, token economics, model request distribution, tool-call patterns, and official quota pools — **without patching `app.asar`, without Electron injection, without CDP debugging ports, and without probing undocumented RPCs**.

- **Zero Injection**: Runs strictly through Antigravity's official Plugin + MCP App contract. Desktop updates never break it.
- **Zero Runtime `node_modules`**: The MCP server runs directly on built-in Node.js modules (`node:sqlite`, `node:fs`, `node:child_process`) with a self-contained single-file `ui.html`.
- **100% Local**: Reads your local Antigravity session metadata/transcripts read-only and optionally invokes the official `agy -p /usage` CLI. No telemetry ever leaves your machine.

---

## Features

### 1. Analytics & Models (Default View)
- **Time Windows**: Switch smoothly between `Today`, `7D`, `30D`, and `All`.
- **Core Metrics**: Total tokens (Input / Cache Read / Output), cache hit rate, model request counts, tool calls, and estimated API-equivalent cost.
- **Per-Model Breakdown**: Inspect token share, request counts, and click any model card for flicker-free in-place session filtering.
- **Adaptive Activity Visuals**: Hourly/daily activity charts tailored to the active window plus a compact 6-month contribution heatmap with smooth hover zoom.
- **Workspace Distribution & Session Explorer**: Clean workspace breakdown, live search, subagent toggle, and one-click jump into any session.

### 2. Live Session
- **Context Window Gauge**: Real-time context usage percentage and remaining capacity for the active or selected session.
- **Performance Telemetry**: Cache hit rate, median decode speed (`tok/s`), per-step token breakdown, and model/tool timeline.
- **Silent Auto-Sync**: Switching local tabs or returning focus from chat automatically refreshes local telemetry in the background (2s throttle, zero flicker, never triggers `agy` CLI).

### 3. Tool Calls
- **Interactive Donut & Bar Breakdown**: Visualize tool-call distribution across either the selected time window or the active session.

### 4. CLI Quota (Official `agy` Hook)
- **Official Quota Sync**: Queries `agy -p /usage` (official Antigravity CLI) when installed, displaying Gemini and Claude/GPT Weekly & 5-Hour remaining pools with live reset countdowns.
- **On-Demand & Quiet Caching**: 3-minute memory/disk cache (`quota-cache.json`) with strictly on-demand syncing — only queries `agy` when you open the **CLI Quota** tab with an expired cache or click Refresh. Zero background polling and zero console flashes when browsing other tabs.

### 5. Direct Disk Export & Bilingual UI
- **Real `.md` & `.csv` Export**: Writes timestamped reports directly to disk (default: your system `Downloads` folder, with UTF-8 BOM on CSV so Excel displays Chinese cleanly).
- **Editable Export Folder**: Click the folder icon next to `MD` / `CSV` to enter any custom directory or pick quick presets (`Downloads`, `Desktop`, `Documents`, `Plugin Folder`).
- **EN / 中文 Toggle**: Instant bilingual interface with persisted preferences (`prefs.json`).

---

## Screenshots

### Analytics & Models
![Analytics & Models — KPI overview, 6-month token heatmap, per-model breakdown, and local telemetry footprint](docs/screenshots/analytics.png)

### Recent Sessions Explorer
![Recent Sessions — Searchable session table with subagent badges, model tags, context size, and token totals](docs/screenshots/sessions.png)

### Live Session
![Live Session — Real-time context gauge, token breakdown, 24-step cache trend, and per-step metrics](docs/screenshots/session.png)

### Tool Calls
![Tool Calls — Tool category donut chart, call density metrics, and top-used tool ranking](docs/screenshots/tools.png)

### Official CLI Quota
![Official Quota — Real-time Gemini and Claude/GPT quota pools fetched via the official agy CLI](docs/screenshots/quota.png)

---

## Requirements

- **Google Antigravity** (Desktop or IDE supporting MCP Apps)
- **Node.js `>= 22.5`** (uses built-in `node:sqlite`, zero native compilation required)
- *(Optional)* **Official Antigravity CLI (`agy`)** installed in `PATH` if you want to use the **CLI Quota** tab

---

## Installation

### Option 1: Clone directly into Antigravity's plugin folder (Recommended)

**Windows (PowerShell):**
```powershell
git clone https://github.com/213za-we/agy-pulse.git "$env:USERPROFILE\.gemini\config\plugins\agy-pulse"
```

**macOS / Linux:**
```bash
git clone https://github.com/213za-we/agy-pulse.git "$HOME/.gemini/config/plugins/agy-pulse"
```

Then restart Antigravity (or refresh MCP servers) and open **AGY Pulse** from the sidebar / aux pane, or ask the agent:
> `Open AGY Pulse dashboard`

### Option 2: Download Release Archive

1. Download the latest release from [Releases](https://github.com/213za-we/agy-pulse/releases).
2. Extract it into `~/.gemini/config/plugins/agy-pulse/` (ensure `plugin.json` sits directly inside that folder).
3. Restart Antigravity.

---

## Runtime Files & Data Locations

Only 6 files are required at runtime:

| File | Purpose |
| :--- | :--- |
| `plugin.json` | Antigravity plugin manifest |
| `mcp_config.json` | Stdio MCP server definition (`node --no-warnings server.mjs`) |
| `server.mjs` | Zero-dependency MCP Apps (`SEP-1865`) stdio server |
| `collector.mjs` | Read-only local SQLite + transcript telemetry collector & CLI quota parser |
| `ui.html` | Self-contained bundled dashboard UI |
| `assets/logo.svg` | Plugin icon |

User preferences and quota cache are stored outside the plugin code directory in Antigravity's `${PLUGIN_DATA}` folder (`~/.gemini/antigravity/plugin_data/agy-pulse/`):
- `prefs.json` — saved UI language (`en` / `zh`) and custom export directory
- `quota-cache.json` — last official `agy -p /usage` snapshot (3-minute soft TTL)

---

## Development & Building from Source

The compiled `ui.html` is checked into the repo so users can install without running `npm install`. To modify the frontend UI:

```bash
npm install
# Edit src/app.mjs or styles inside scripts/build-ui.mjs
npm run build
# Optionally sync the 6 runtime files to your local Antigravity plugins folder
npm run sync:local
```

---

## Privacy & Security

- Read-only access to local Antigravity conversation metadata and transcripts.
- Never modifies Antigravity binaries, `app.asar`, or user settings outside `${PLUGIN_DATA}`.
- No external network requests from `server.mjs` or `ui.html` (the only network call happens inside the official `agy` binary when you check CLI quota).

## License

[MIT](./LICENSE)