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 ¶
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 ¶
func (s *AntigravitySource) Discover(ctx context.Context) ([]source.SessionHandle, error)
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 ¶
func (s *AntigravitySource) Parse(ctx context.Context, h source.SessionHandle, c source.Cursor) (source.SourceUpdate, source.Cursor, error)
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 ¶
WithDiscoverWindow limits discovery to session files whose modification time is within d of the current time. Zero disables age filtering.