context-monitor_context-monitor
by caodung0712
README.md
# Antigravity Context Monitor
Plugin theo dõi **Context Window**, **MCP Tools / Memory Files**, **Connectors** và **Quota Gemini Models (5h & Weekly)** theo thời gian thực ngay bên trong **Google Antigravity**.
[English version below](#english)
---
## Tiếng Việt
### Tính năng chính
* **Theo dõi Context Window theo thời gian thực**: Hiển thị phần trăm đã dùng (`/ 1M`), thanh tiến trình phân đoạn nhiều màu và chi tiết theo từng thành phần (*Messages*, *Skills*, *MCP tools*, *Memory files*, *MCP server instructions*, *Free space*, *MCP tools deferred*).
* **Tự động nhận diện hội thoại đang mở**: Tự động cập nhật theo conversation bạn đang thao tác (làm mới mỗi 3 giây), đồng thời hỗ trợ chọn thủ công các conversation gần đây.
* **Chi tiết MCP & Memory**: Mở rộng danh sách server MCP (số lượng tool và dung lượng schema) và các file memory/rules (`AGENTS.md`, `GEMINI.md`).
* **Connectors**: Hiển thị gọn 3 connector đầu tiên kèm nút `See more` để mở rộng.
* **Quota Gemini Models (5h & Weekly)**: Lấy trực tiếp từ Antigravity Language Server (`RetrieveUserQuotaSummary`), hiển thị đồng thời cả 2 thanh tiến trình **5h** và **Weekly** kèm phần trăm còn lại và thời gian reset.
### Yêu cầu
* **Google Antigravity** (macOS / Linux)
* **Node.js** >= 18
### Cài đặt nhanh
Repo đã build sẵn `dist/server.js` và `dist/app.html`, bạn chỉ cần clone thẳng vào thư mục plugins của Antigravity:
```bash
git clone https://github.com/caodung0712/antigravity-context-monitor.git ~/.gemini/config/plugins/context-monitor
```
Plugin sẽ được Antigravity tự động nhận diện mà không cần khởi động lại.
### Cách mở trong Antigravity
1. **Ở Side Pane**: Bấm nút **`+`** ở thanh tab bên phải và chọn **Context**.
2. **Ở Sidebar bên trái**: Chọn mục **Context** để mở toàn màn hình.
3. **Trong khung chat**: Nhắn với agent `"Open Context Monitor"`.
### Phát triển / Tự build lại
Nếu bạn muốn chỉnh sửa giao diện (`src/app.ts`, `build.mjs`) hoặc bộ thu thập dữ liệu (`src/collector.ts`):
```bash
cd ~/.gemini/config/plugins/context-monitor
npm install
npm run build
```
Sau khi build xong, hãy làm mới MCP server `context-monitor_context-monitor` trong phần cài đặt MCP Servers của Antigravity.
---
<a id="english"></a>
## English
A real-time **Context Window**, **MCP Tools / Memory Files**, **Connectors**, and **Gemini Models Quota (5h & Weekly)** monitor plugin built natively for **Google Antigravity** using MCP Apps.
### Features
* **Live Context Window Breakdown**: Displays percentage used (`/ 1M`), a color-coded segmented progress bar, and real token measurements for *Messages*, *Skills*, *MCP tools*, *Memory files*, *MCP server instructions*, *Free space*, and *MCP tools (deferred)*.
* **Auto-Follows Active Conversation**: Automatically detects and tracks whichever conversation you are currently working in (polls every 3 seconds), with an optional dropdown to inspect recent conversations.
* **Expandable MCP & Memory Details**: Accordion views for cached MCP servers (tool counts & deferred schema sizes) and loaded memory/rule files (`AGENTS.md`, `GEMINI.md`).
* **Compact Connectors List**: Shows the top 3 connectors by default with a `See more` toggle.
* **Live Gemini Models Quota (5h & Weekly)**: Queries the local Antigravity Language Server (`RetrieveUserQuotaSummary`) to display both **5h** and **Weekly** remaining quota bars, percentages, and reset countdowns.
### Requirements
* **Google Antigravity** (macOS / Linux)
* **Node.js** >= 18
### Quick Install
`dist/server.js` and `dist/app.html` are pre-bundled with zero runtime dependencies, so you can install with a single command:
```bash
git clone https://github.com/caodung0712/antigravity-context-monitor.git ~/.gemini/config/plugins/context-monitor
```
Antigravity automatically discovers the plugin without requiring a restart.
### How to Open
1. **Side Pane**: Click the **`+`** button in the side pane and select **Context**.
2. **Left Sidebar**: Click **Context** for the full-page view.
3. **Chat**: Ask the agent to `"Open Context Monitor"`.
### Development & Build
To customize the UI (`src/app.ts`, `build.mjs`) or data collector (`src/collector.ts`):
```bash
cd ~/.gemini/config/plugins/context-monitor
npm install
npm run build
```
After rebuilding, refresh the `context-monitor_context-monitor` server in Antigravity's MCP Servers settings.
## License
MIT
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues