proxymanager

package
v1.7.20 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 29 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package proxymanager owns a standalone Codex provider runtime and reversible Codex configuration overlay. Its control API only listens on loopback.

Legacy Claude settings recovery for journals written before the proxy became Codex-only. Fresh proxy sessions never apply or inspect Claude settings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShowMenuError added in v1.7.17

func ShowMenuError(string)

Types

type Change

type Change struct {
	Env     bool            `json:"env,omitempty"`
	Key     string          `json:"key"`
	Before  json.RawMessage `json:"before,omitempty"`
	Applied json.RawMessage `json:"applied"`
}

Changes keep only fields owned by this proxy. Restore compares the current value with Applied so user edits made while the proxy runs are retained.

type Manager

type Manager struct {
	AdditionalProviders []string
	CatalogMode         codex.CatalogMode
	Refresh             bool
	Dir                 string
	// CodexListenAddress pins replacements, including a failed menu switch rollback.
	CodexListenAddress string
	// Empty inherits the running daemon's mode, or uses shared on first start.
	CodexMode string
}

func Default

func Default() (*Manager, error)

func (*Manager) Read

func (m *Manager) Read() (*State, error)

func (*Manager) RecoverStale

func (m *Manager) RecoverStale(ctx context.Context) (bool, error)

RecoverStale restores the settings overlay of a proxy that died without cleaning up (kill -9, power loss), including legacy Claude overlays. It never waits: a start or stop in progress owns the command lock and recovers on its own, and a held daemon lock means the proxy is alive. Reports whether it restored anything.

func (*Manager) Run

func (m *Manager) Run(ctx context.Context, p provider.Provider, id string) (runErr error)

Run owns the entire runtime lifetime. The caller cancels ctx for signals; the authenticated local stop endpoint uses the same cleanup path.

func (*Manager) RunMenuBar added in v1.7.17

func (m *Manager) RunMenuBar(context.Context, string) error

func (*Manager) Running

func (m *Manager) Running(ctx context.Context, s *State) bool

func (*Manager) Start

func (m *Manager) Start(ctx context.Context, executable string, p provider.Provider) (*State, error)

Start serializes starts and provider switches. The child is detached from the launching terminal and reports readiness only after the settings apply.

func (*Manager) Stop

func (m *Manager) Stop(ctx context.Context) error

type State

type State struct {
	AdditionalProviders []string          `json:"additional_providers,omitempty"`
	CatalogMode         codex.CatalogMode `json:"catalog_mode,omitempty"`
	ProxyVersion        int               `json:"proxy_version,omitempty"`
	ID                  string            `json:"id"`
	Provider            string            `json:"provider"`
	PID                 int               `json:"pid"`
	BaseURL             string            `json:"base_url"`
	ControlURL          string            `json:"control_url"`
	ControlToken        string            `json:"control_token"`
	// Legacy Claude overlay fields are read only to restore pre-Codex-only daemons.
	SettingsPath  string          `json:"settings_path,omitempty"`
	StartedAt     time.Time       `json:"started_at"`
	ConfigHash    string          `json:"config_hash"`
	MetadataStamp string          `json:"metadata_stamp,omitempty"`
	CodexMode     string          `json:"codex_mode,omitempty"`
	EnvBefore     json.RawMessage `json:"env_before,omitempty"`
	Changes       []Change        `json:"changes,omitempty"`
	CodexHome     string          `json:"codex_home,omitempty"`
	Codex         *codex.Overlay  `json:"codex,omitempty"`
}

func (*State) CatalogCapabilities added in v1.7.20

func (s *State) CatalogCapabilities() codex.CatalogCapabilities

CatalogCapabilities describes the client guarantees of the selected source. Shared mode remains local even when inspecting a malformed/stale journal.

func (*State) SupportsGatewayHotReload added in v1.7.20

func (s *State) SupportsGatewayHotReload() bool

Jump to

Keyboard shortcuts

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