Documentation
¶
Overview ¶
Package capture runs a command with its LLM traffic redirected to a local HTTP server and records every request/response exchange as JSONL.
Index ¶
Constants ¶
const DefaultOutputPath = "/tmp/llm-proxy-capture.jsonl"
DefaultOutputPath is the JSONL destination used when -o/--output is absent.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Output string
Port int
NoRedact bool
EnvCommandCode bool
Target string
Args []string
}
Config is a parsed capture invocation.
type ExitError ¶
type ExitError struct {
Code int
}
ExitError carries the wrapped command's exit code so the caller can exit with it.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the local capture HTTP server.
func Start ¶
func Start(opts ServerOptions) (*Server, error)
Start binds the capture server on loopback and serves until Close.
func (*Server) Redactions ¶
Redactions returns the number of sensitive header values masked in the log.
type ServerOptions ¶
type ServerOptions struct {
// Port is the listen port; 0 picks a random free port on loopback.
Port int
// OutputPath is the JSONL file exchanges are appended to.
OutputPath string
// Redact masks sensitive request/response headers in the log.
Redact bool
}
ServerOptions configures the capture server.