Documentation
¶
Overview ¶
Package wrap implements `squoze wrap CMD`: run an agent command with its provider base URLs pointed at an in-process squoze proxy. The agent needs zero configuration — env injection is the whole trick.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var BaseURLEnvs = []string{
"ANTHROPIC_BASE_URL",
"OPENAI_BASE_URL",
"OPENAI_API_BASE",
}
BaseURLEnvs lists the environment variables agents commonly honor for provider endpoints. Setting all of them covers Claude Code, OpenAI SDKs, Codex and most OpenAI-compatible clients.
Functions ¶
Types ¶
type ExitError ¶ added in v0.1.2
type ExitError struct{ Code int }
ExitError carries the child's exit code through Run's error return so callers can re-exit with the same code (after running their own cleanup).
type Options ¶
type Options struct {
Command []string // argv of the agent to run (required)
Upstream *url.URL // real provider base URL (required)
OriginsDir string // "" = memory-only originals
ListenAddr string // default "127.0.0.1:0" (ephemeral)
LogFile string // "" = no request log; else append JSONL per request
BaseURLEnvs []string // override the injected endpoint env names (harness presets)
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
OnExit func() // runs after the child exits, before Run returns
// Upstreams enables multi-provider mode: one local listener per entry
// (addr → real provider URL). Overrides Upstream; used by `sq <agent>`
// so every wired provider keeps its own port and original endpoint.
Upstreams map[string]string
}
Options configures one wrap session.