proxy

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interceptor

type Interceptor struct {
	Calls        chan RecordedCall
	SampledCalls chan SampledCall
	// contains filtered or unexported fields
}

Interceptor tees two io streams, correlates tools/call pairs, and emits RecordedCall values on the Calls channel.

func NewInterceptor

func NewInterceptor() *Interceptor

func (*Interceptor) Close

func (ic *Interceptor) Close()

Close signals that no more calls will arrive.

func (*Interceptor) TeeClientToServer

func (ic *Interceptor) TeeClientToServer(dst io.Writer, src io.Reader)

TeeClientToServer copies from client (host stdin) to server stdin, recording tools/call requests and sampling/createMessage responses.

func (*Interceptor) TeeServerToClient

func (ic *Interceptor) TeeServerToClient(dst io.Writer, src io.Reader)

TeeServerToClient copies from server stdout to client (host stdout), recording tools/call responses and sampling/createMessage requests. Non-JSON lines (e.g. server startup logs) are redirected to stderr to avoid corrupting the stream.

type RecordedCall

type RecordedCall struct {
	Tool   string
	Args   map[string]any
	Result json.RawMessage // raw result from server
}

RecordedCall is a single matched tools/call request + response.

type SampledCall

type SampledCall struct {
	Params json.RawMessage
	Result json.RawMessage
}

SampledCall is a matched sampling/createMessage request + response. Params is the request from the server; Result is the client's LLM response.

Jump to

Keyboard shortcuts

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