hooks

package
v0.20.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package hooks implements pre-invocation interception rules for Antigravity tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Intercept

func Intercept()

Intercept reads the tool payload from standard input, evaluates it against the rules, and outputs the decision to standard output.

Types

type HookPayload

type HookPayload struct {
	ToolCall              ToolCall `json:"toolCall"`
	StepIdx               int      `json:"stepIdx"`
	ConversationID        string   `json:"conversationId"`
	WorkspacePaths        []string `json:"workspacePaths"`
	TranscriptPath        string   `json:"transcriptPath"`
	ArtifactDirectoryPath string   `json:"artifactDirectoryPath"`
}

HookPayload represents the JSON payload sent by Antigravity CLI to the hook via stdin.

type HookResponse

type HookResponse struct {
	Decision      string `json:"decision"`
	Reason        string `json:"reason,omitempty"`
	SystemMessage string `json:"systemMessage,omitempty"`
}

HookResponse represents the decision returned to Antigravity CLI via stdout.

type ToolCall added in v0.18.0

type ToolCall struct {
	Name string         `json:"name"`
	Args map[string]any `json:"args"`
}

ToolCall represents the actual tool invocation being checked.

Jump to

Keyboard shortcuts

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