antigravity

package
v0.2.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 14 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package antigravity is the Antigravity CLI (`agy`) adapter. Flags, the stream format and the permission rules come from the spike on agy 1.4.2 (docs/claude-code-runner.md, "Spike findings: Antigravity CLI, subscription"); the recorded streams are in testdata/.

Index

Constants

View Source
const MinVersion = "1.5.9"

MinVersion is the first agy release DD verified with session --settings (2026-11-14). The stream fixtures in testdata were recorded on 1.4.2; the event format did not change in the 1.5.9 probe.

Variables

This section is empty.

Functions

func ConversationID

func ConversationID(s string) bool

ConversationID reports a UUID-shaped conversation id.

func Permissions

func Permissions(t aa.Task, home string) (allow, deny []string)

Permissions is the permissions block DD writes for t.

  • allow: command(git) plus the first word of each verify command; wildcards (command(*)) are refused by the CLI's own guidance.
  • deny: the agy home's .gemini dir for the file tools (the OAuth token is readable without it: probe 5), every unneeded tool, and for the reviewer writes to the handoff and the worktrees.

func Settings

func Settings(t aa.Task, home string) ([]byte, error)

Settings is the --settings document for t. agy 1.5.x starts headless runs with no saved mode in Auto, which approves edits and sandboxed commands, so the reviewer pins Default (agentMode ""), where a headless edit is auto-denied; the implementer passes --mode accept-edits.

func SettingsPath

func SettingsPath(t aa.Task) string

SettingsPath is the session settings file for t, in DD's per-job state dir (beside the handoff, never in it). agy 1.5.x reads it with --settings and never saves it, so DD writes nothing into the agy home.

Types

type Adapter

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

Adapter is the Antigravity CLI.

func New

func New(cfg Config) *Adapter

New returns the Antigravity adapter.

func (*Adapter) Bin

func (a *Adapter) Bin() string

func (*Adapter) Command

func (a *Adapter) Command(t aa.Task) (aa.Command, error)

Command builds `agy -p`. Always --sandbox and --settings; never --dangerously-skip-permissions. The implementer runs --mode accept-edits; the reviewer runs Default mode (pinned in its settings file), where headless edits are auto-denied.

func (*Adapter) CredentialEnv

func (a *Adapter) CredentialEnv() []string

func (*Adapter) Denied

func (a *Adapter) Denied(events [][]byte, end aa.End) (string, bool)

Denied blocks a reviewer lens on result.denied_actions, or on a tool step that failed its permission check (a deny rule refuses without listing a denied action).

func (*Adapter) FilterStderr

func (a *Adapter) FilterStderr(line string) string

FilterStderr never forwards agy's stderr raw: signed out it prints a sign-in URL and an interactive prompt, and a headless denial suggests --dangerously-skip-permissions, which DD never uses.

func (*Adapter) HostUnsupported

func (a *Adapter) HostUnsupported() string

HostUnsupported names why this host cannot run agy jobs. On macOS agy 1.5.x keeps its sign-in in the login Keychain, which a separate HOME cannot reach: the CLI then shows the owner a Keychain dialog. The adapter targets Linux workers (the maintainers, 2026-11-14); on the Mac use claude.

func (*Adapter) LogSource

func (a *Adapter) LogSource() string

func (*Adapter) MinVersion

func (a *Adapter) MinVersion() string

func (*Adapter) Name

func (a *Adapter) Name() aa.Name

func (*Adapter) NewDecoder

func (a *Adapter) NewDecoder() aa.Decoder

NewDecoder returns a fresh decoder (it remembers whether prose streamed).

func (*Adapter) Prepare

func (a *Adapter) Prepare(t aa.Task) error

Prepare writes the session settings file before every spawn, so the file is always DD's.

func (*Adapter) Ready

func (a *Adapter) Ready(ctx context.Context, t aa.Task) error

Ready runs `agy models` under the job env. Signed out it prints "Please sign in to view available models".

func (*Adapter) ResumeID

func (a *Adapter) ResumeID(_, stored string) (string, bool)

ResumeID is the conversation id stored from the last result.

func (*Adapter) ResumesByID

func (a *Adapter) ResumesByID() bool

func (*Adapter) ReviewEvidence

func (a *Adapter) ReviewEvidence(events [][]byte, worktrees []string) bool

ReviewEvidence wants a run_command step whose command line is a git diff of a worktree, finished DONE (not ERROR).

func (*Adapter) SupportsSimulator

func (a *Adapter) SupportsSimulator() bool

func (*Adapter) VersionArgs

func (a *Adapter) VersionArgs() []string

type Config

type Config struct {
	// Bin is the resolved agy binary ("" when not installed).
	Bin string
	// Home is the DD-only HOME the owner signed in under. agy has no
	// config-dir variable: its config, conversations and OAuth token live in
	// $HOME/.gemini/antigravity-cli/, so the child's HOME is the only lever.
	Home string
	// Model is passed as --model when set.
	Model string
	// GOOS is the host OS; "" is runtime.GOOS. Tests set it.
	GOOS string
}

Config is what the caller resolved.

type Decoder

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

Decoder decodes `agy --output-format stream-json`: init, step_update and result events.

func (*Decoder) Decode

func (d *Decoder) Decode(line []byte) []aa.Event

Decode maps one line. Tool steps become tool events, agent_response text_delta becomes prose, and result becomes End. agy reports no cost: End carries the token total instead.

Jump to

Keyboard shortcuts

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