antigravity

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package antigravity provides the Antigravity CLI source for agentwatch.

An AntigravitySource discovers sessions by scanning a directory of Antigravity CLI session files (typically ~/.antigravitycli). Each session is stored as a <uuid>.json file that Antigravity rewrites in full on every update — unlike Claude, which appends to JSONL files.

Because Antigravity rewrites files rather than appending, the source uses file mtime as its cursor instead of a byte offset. The cursor also encodes previous message and tool-call totals so that deltas can be computed correctly across rewrites.

Use New with WithRoot to configure the session root directory. Process scanning for working directory detection is source-private in v1.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts ...Option) (source.Source, error)

New returns a new AntigravitySource configured by opts.

func Register

func Register(r *source.Registry, opts ...Option) error

Register adds an AntigravitySource constructor to r under the name "antigravity".

Types

type AntigravitySource

type AntigravitySource struct {
	// contains filtered or unexported fields
}

AntigravitySource discovers and parses Antigravity CLI session files. The zero value is usable but discovers no sessions until configured with a non-empty root via WithRoot.

func (*AntigravitySource) Discover

Discover scans the configured root for Antigravity CLI session files. Each *.json file is returned as a SessionHandle. The session ID is the filename stem (the UUID). WorkingDir is populated via process inspection when a matching agy process is found; otherwise it is left empty.

func (*AntigravitySource) Name

func (s *AntigravitySource) Name() string

Name returns "antigravity".

func (*AntigravitySource) Parse

Parse reads the session's JSON file and returns a SourceUpdate.

Because Antigravity rewrites the file on every update, the cursor encodes both the file mtime and the message/tool counts observed on the previous poll. If the mtime has not changed since the last cursor, no new data is returned. When the file is rewritten, Parse re-reads the entire file and returns only the delta relative to what the cursor recorded.

type Option

type Option func(*AntigravitySource)

Option configures an AntigravitySource.

func WithDiscoverWindow

func WithDiscoverWindow(d time.Duration) Option

WithDiscoverWindow limits discovery to session files whose modification time is within d of the current time. Zero disables age filtering.

func WithRoot

func WithRoot(path string) Option

WithRoot sets the root directory to scan for Antigravity CLI session files. Discover walks this directory for *.json files, treating each file as a session keyed by its filename stem (the Antigravity session UUID). If root is empty, Discover returns no sessions.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL