antigravity

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package antigravity is the Source adapter for Google Antigravity (AGY) session transcripts under ~/.gemini/antigravity-cli/brain/<uuid> (or $ANTIGRAVITY_HOME/brain/<uuid>): one brain directory per conversation, transcript in .system_generated/logs/transcript.jsonl (or transcript_full.jsonl), and workspace associations tracked in history.jsonl.

Subagents spawned via invoke_subagent are lineage-tracked so the index hides them by default and collapses them to their parent session — the same treatment Claude and Codex subagents receive. Antigravity step records carry step indices, from which this adapter mints deterministic, source-stable message uuids.

Index

Constants

View Source
const ID = "antigravity"

ID is the stable source name (source_tool column, --source flag).

Variables

This section is empty.

Functions

func BrainRoot

func BrainRoot(cfgDir string) string

BrainRoot returns the brain directory under the given config dir.

func ConfigDir

func ConfigDir() string

ConfigDir returns the Antigravity config directory: $ANTIGRAVITY_HOME if set, else ~/.gemini/antigravity-cli.

func GlobalConfigDir

func GlobalConfigDir() string

GlobalConfigDir returns the Antigravity global customization config directory. On disk the config dir is a SIBLING of the CLI state dir, not a child: ~/.gemini/config sits beside ~/.gemini/antigravity-cli (verified against a live install's builtin hooks doc). A plain join under ANTIGRAVITY_HOME — the Codex shape — would therefore point at the wrong tree, so the basename sniff below maps whichever of the two dirs ANTIGRAVITY_HOME names to its config sibling.

func MintUUID added in v0.10.0

func MintUUID(sessionID string, stepIndex, ordinal int) string

MintUUID derives a stable per-message id from the session id + step index + line ordinal.

func NormalizeRecord added in v0.10.0

func NormalizeRecord(rec map[string]any) (role, text string, ok bool)

NormalizeRecord maps one transcript step to (role, flattened-text, ok).

func Registration

func Registration() source.Registration

Registration wires the Antigravity adapter into the source registry.

Types

type Adapter

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

Adapter reads Antigravity transcripts.

func New

func New() *Adapter

New returns a ready Antigravity adapter using the default config directory.

func NewRoot

func NewRoot(root string) *Adapter

NewRoot returns an adapter over an explicit config root (useful in tests).

func (*Adapter) Discover

func (a *Adapter) Discover() ([]source.Container, error)

Discover enumerates every Antigravity conversation under BrainRoot(a.root). Returns (nil, nil) when the brain directory is absent.

func (*Adapter) DiscoverRoot

func (a *Adapter) DiscoverRoot(brainDir string) ([]source.Container, error)

DiscoverRoot enumerates Antigravity sessions under an explicit brain directory.

func (*Adapter) Messages

func (a *Adapter) Messages(c source.Container) ([]model.Message, error)

Messages flattens one Antigravity transcript into normalized messages in file order.

Jump to

Keyboard shortcuts

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