@chronova/antigravity-plugin
v1.0.2
Published
Chronova heartbeat tracking plugin for Antigravity — sends coding activity to your Chronova dashboard via chronova-cli
Maintainers
Readme
chronova-antigravity-plugin
Chronova heartbeat tracking plugin for Google Antigravity (Antigravity 2.0, Antigravity IDE, and Antigravity CLI).
Automatically sends coding activity heartbeats to your Chronova dashboard via chronova-cli — a high-performance, drop-in replacement for wakatime-cli.
Features
- Automatic tracking — Intercepts Antigravity tool calls (
view_file,write_to_file,replace_file_content,multi_replace_file_content,read_resource, MCP tools) - Zero latency overhead — Responds to lifecycle hooks immediately (
decision: "allow") while spawning heartbeats detached (unref()) in the background - Rate limiting — 1 heartbeat per minute per project workspace, persisted across CLI hook executions in
~/.chronova-antigravity-plugin/state/ - Force flush on session completion — All queued file changes are force-flushed on session end via the
Stoplifecycle hook - Path & URI safety — Handles home directory expansion (
~), strips line selectors (:50-56), normalizesfile://URLs, and rejects non-file URIs (artifact://,memory://,ssh://)
Prerequisites
- Google Antigravity (Antigravity 2.0 / Antigravity IDE /
agyCLI) - chronova-cli installed at
~/.local/bin/chronova-cli(or inPATH) - A Chronova account with API key configured in
~/.chronova.cfg
Installation
Recommended: Global Installation via Bun (User-wide)
Install the package globally using Bun:
bun add -g @chronova/antigravity-pluginLink the globally installed plugin into your global Antigravity configuration directory:
mkdir -p ~/.gemini/config/plugins
ln -sfn ~/.bun/install/global/node_modules/@chronova/antigravity-plugin ~/.gemini/config/plugins/chronova-antigravity-pluginOr install directly into your global Antigravity plugins directory:
mkdir -p ~/.gemini/config/plugins/chronova-antigravity-plugin
cd ~/.gemini/config/plugins/chronova-antigravity-plugin
bun add @chronova/antigravity-pluginAntigravity automatically discovers and activates all plugins located in ~/.gemini/config/plugins/.
Project Workspace Installation
To install for a specific project/repository:
mkdir -p .agents/plugins/chronova-antigravity-plugin
cd .agents/plugins/chronova-antigravity-plugin
bun add @chronova/antigravity-pluginOr declare it in your .agents/plugins.json:
{
"entries": [
{ "path": "node_modules/@chronova/antigravity-plugin" }
]
}Configuration
The plugin reads your API key from ~/.chronova.cfg automatically (the same configuration file used by chronova-cli and wakatime-cli). No separate plugin configuration is needed.
Debug Logging
Set CHRONOVA_ANTIGRAVITY_DEBUG=1 in your environment or add debug = true to ~/.chronova.cfg to enable verbose logging to ~/.chronova-antigravity-plugin/plugin.log.
How It Works
- Antigravity discovers the plugin via
plugin.jsonand registers lifecycle hooks fromhooks.json. - On
PreToolUseevents:- Tool calls are inspected to identify file operations:
view_file/read_resource→ tracked as view / readwrite_to_file/replace_file_content/multi_replace_file_content→ tracked as write (--write)
- The hook responds immediately with
{"decision": "allow"}so the agent loop is never delayed. - If the per-project rate limit allows (60s cooldown), the heartbeat is dispatched to
chronova-cli. If rate-limited, the change is queued in persistent state.
- Tool calls are inspected to identify file operations:
- On
Stopevents (agent turn / session completion):- Any pending queued changes are force-flushed to
chronova-cli.
- Any pending queued changes are force-flushed to
chronova-cli Arguments
chronova-cli \
--entity <absolute-file-path> \
--entity-type file \
--project-folder <project-directory> \
--plugin "antigravity/2.0 chronova-antigravity-plugin/<version>" \
--category coding \
[--write]Project Structure
├── plugin.json # Antigravity plugin manifest
├── hooks.json # Antigravity lifecycle hook definitions
├── package.json # NPM package configuration
├── tsconfig.json # TypeScript build configuration
├── eslint.config.js # ESLint flat configuration
├── src/
│ ├── index.ts # Hook CLI entrypoint & event routing
│ ├── tracker.ts # ToolCall extraction, URI & path sanitization
│ ├── heartbeat.ts # chronova-cli invocation & argument builder
│ ├── state.ts # Persistent file-based project state & queue
│ ├── logger.ts # Safe debug logging to ~/.chronova-antigravity-plugin/plugin.log
│ └── types.ts # TypeScript interfaces for hook contracts
└── tests/ # Vitest unit & integration test suiteDevelopment
# Install dependencies
bun install
# Run unit tests
bun test
# Type check
bun run type-check
# Lint code
bun run lint
# Build production bundle
bun run build
# Pack npm tarball
bun run packLicense
MIT © NX Solutions UG (haftungsbeschränkt)
