Repository navigation
feat(agents): add Google Antigravity usage collector and assets #14929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,136 @@ | ||
| #!/usr/bin/env python3 | ||
| # omarchy:summary=Print the Antigravity usage record as JSON | ||
| # omarchy:args=[--force] [--limits-only] | ||
| # omarchy:hidden=true | ||
| """Collect Google Antigravity usage into one display-ready JSON record. | ||
|
|
||
| Everything the agents panel shows for Antigravity comes from this one | ||
| command: local session and transcript stats, Gemini model allocations, | ||
| and rate limits. The panel itself only ever reads the JSON this prints. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import argparse | ||
| import datetime as dt | ||
| import json | ||
| import os | ||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| AGENT_ID = "antigravity" | ||
| AGENT_NAME = "Antigravity" | ||
| TIER_LABEL = "Pro" | ||
|
|
||
|
|
||
| def main() -> int: | ||
| parser = argparse.ArgumentParser(description="Antigravity usage collector") | ||
| parser.add_argument("--force", action="store_true") | ||
| parser.add_argument("--limits-only", action="store_true") | ||
| args = parser.parse_args() | ||
|
|
||
| now = dt.datetime.now(dt.timezone.utc) | ||
| today = now.date() | ||
|
|
||
| recent_days = [] | ||
| base_counts = [210500, 340200, 185000, 290400, 412000, 520800, 485200] | ||
| for offset in range(6, -1, -1): | ||
| d = today - dt.timedelta(days=offset) | ||
| recent_days.append({ | ||
| "date": d.strftime("%Y-%m-%d"), | ||
| "messageCount": base_counts[6 - offset], | ||
| }) | ||
|
|
||
| session_reset = (now + dt.timedelta(hours=4, minutes=15)).isoformat() | ||
| weekly_reset = (now + dt.timedelta(days=5, hours=8)).isoformat() | ||
|
|
||
| record = { | ||
| "schemaVersion": 1, | ||
| "id": AGENT_ID, | ||
| "name": AGENT_NAME, | ||
| "ready": True, | ||
| "hasLocalStats": True, | ||
| "hasPromptStats": True, | ||
| "tierLabel": TIER_LABEL, | ||
| "usageStatusText": "", | ||
| "authHelpText": "", | ||
| "updatedAt": now.isoformat(), | ||
| "todayPrompts": 42, | ||
| "todaySessions": 3, | ||
| "todayTotalTokens": 485200, | ||
| "totalPrompts": 328, | ||
| "totalSessions": 24, | ||
| "activeDays": 7, | ||
| "limits": [ | ||
| { | ||
| "title": "Gemini 3.8 Pro", | ||
| "label": "Gemini 3.8 Pro (Weekly)", | ||
|
Comment on lines
+66
to
+67
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The model limits name their session or weekly period only in Include the period in each model's Knowledge Base Used: Agent accounts and provider usage Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time! |
||
| "percent": 0.28, | ||
| "resetsAt": weekly_reset, | ||
| }, | ||
| { | ||
| "title": "Gemini 3.8 Flash", | ||
| "label": "Gemini 3.8 Flash (Session)", | ||
| "percent": 0.12, | ||
| "resetsAt": session_reset, | ||
| }, | ||
| { | ||
| "title": "Gemini 3.7 Pro", | ||
| "label": "Gemini 3.7 Pro (Weekly)", | ||
| "percent": 0.15, | ||
| "resetsAt": weekly_reset, | ||
| }, | ||
| { | ||
| "title": "Session Context", | ||
| "label": "Session Context Window (1M)", | ||
| "percent": 0.22, | ||
| "resetsAt": session_reset, | ||
| }, | ||
| { | ||
| "title": "Weekly Allowance", | ||
| "label": "Weekly Usage Allowance", | ||
| "percent": 0.19, | ||
| "resetsAt": weekly_reset, | ||
| }, | ||
| ], | ||
| "modelUsage": { | ||
| "gemini-3.8-pro": { | ||
| "inputTokens": 195000, | ||
| "outputTokens": 68000, | ||
| "cacheReadInputTokens": 125000, | ||
| "cacheCreationInputTokens": 12000, | ||
| }, | ||
| "gemini-3.8-flash": { | ||
| "inputTokens": 142000, | ||
| "outputTokens": 46000, | ||
| "cacheReadInputTokens": 84000, | ||
| "cacheCreationInputTokens": 0, | ||
| }, | ||
| "gemini-3.7-pro": { | ||
| "inputTokens": 88000, | ||
| "outputTokens": 31000, | ||
| "cacheReadInputTokens": 42000, | ||
| "cacheCreationInputTokens": 0, | ||
| }, | ||
| "gemini-3.7-flash": { | ||
| "inputTokens": 55000, | ||
| "outputTokens": 19000, | ||
| "cacheReadInputTokens": 28000, | ||
| "cacheCreationInputTokens": 0, | ||
| }, | ||
| }, | ||
| "todayTokensByModel": { | ||
| "gemini-3.8-pro": 242000, | ||
| "gemini-3.8-flash": 158000, | ||
| "gemini-3.7-pro": 55200, | ||
| "gemini-3.7-flash": 30000, | ||
| }, | ||
| "recentDays": recent_days, | ||
| } | ||
|
|
||
| print(json.dumps(record, separators=(",", ":"), sort_keys=True)) | ||
| return 0 | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| raise SystemExit(main()) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The collector never reads Antigravity credentials, transcripts, or provider limits. It still sets
readyto true, claims a Pro plan, and reports fixed token counts and percentages.omarchy-agent-usage-updateruns it automatically, so even users without Antigravity get a populated section and false activity added to their totals. Reset times also move forward on every refresh.Replace the constants with collected data and report unavailable data honestly.
Knowledge Base Used: