agyproxy

package
v0.0.370 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 24 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"
)

Variables

This section is empty.

Functions

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) 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