agyproxy

package
v0.0.373 Latest Latest
Warning

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

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

Documentation

Overview

Package agyproxy contains the temporary request-filter compatibility layer needed while agy cannot combine MCP with an empty native-tool set.

Keep this package independent of internal/llm. Once agy supports that combination directly, the provider can replace its agyToolIsolation implementation and this package can be deleted.

Index

Constants

View Source
const (
	CloudCodeHost = "daily-cloudcode-pa.googleapis.com"

	// GenerationTraceFileEnv enables an opt-in JSONL trace containing the exact
	// generation request received from agy and the artifact-rehydrated, tool-
	// filtered request sent upstream. These requests contain full conversation
	// content and must be treated as sensitive.
	GenerationTraceFileEnv = "TERM_LLM_AGY_PROXY_TRACE_FILE"
)

Variables

This section is empty.

Functions

func ExpandGenerationArtifacts added in v0.0.373

func ExpandGenerationArtifacts(body []byte, artifactRoot string) ([]byte, error)

ExpandGenerationArtifacts replaces agy's private spill-file notices in the model request with their original contents. Only regular output.txt files in <artifactRoot>/<conversation>/.system_generated/steps/<number>/ are eligible; missing, malformed, oversized, symlinked, or external paths are left intact.

func FilterGenerationRequest

func FilterGenerationRequest(body []byte, requireMCP bool) ([]byte, error)

FilterGenerationRequest removes every function declaration except the real agy MCP dispatcher. Unknown fields are preserved.

Types

type Server

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

Server is a loopback-only HTTPS forward proxy. It intercepts only the Cloud Code host; CONNECT requests for every other host are tunneled without TLS termination.

func (*Server) BeginTurn

func (s *Server) BeginTurn(requireMCP bool)

BeginTurn resets interception evidence and configures dispatcher enforcement.

func (*Server) FilteredGenerations

func (s *Server) FilteredGenerations() int64

FilteredGenerations reports successfully rewritten generation requests in the current turn.

func (*Server) SetArtifactRoot added in v0.0.373

func (s *Server) SetArtifactRoot(root string)

SetArtifactRoot restricts agy spill-file rehydration to the provider's private antigravity-cli/brain directory. The directory may not exist yet when configured; every candidate is resolved and containment-checked at read time.

func (*Server) SetRequireMCP

func (s *Server) SetRequireMCP(required bool)

SetRequireMCP controls whether generation requests lacking call_mcp_tool are rejected. Providers should enable this for turns exposing term-llm tools.

func (*Server) Start

func (s *Server) Start() (proxyURL, caPath string, err error)

Start starts the proxy and writes its public CA certificate to a private temporary file. The CA private key remains in memory.

func (*Server) Stop

func (s *Server) Stop(ctx context.Context) error

Stop shuts down the proxy and removes its temporary CA material.

Jump to

Keyboard shortcuts

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