Documentation
¶
Overview ¶
Package proxymanager owns a standalone provider runtime and a reversible Claude Code settings overlay. Its control API only listens on loopback.
Index ¶
- type Change
- type Manager
- func (m *Manager) Read() (*State, error)
- func (m *Manager) RecoverStale(ctx context.Context) (bool, error)
- func (m *Manager) Run(ctx context.Context, p provider.Provider, settingsPath, id string) (runErr error)
- func (m *Manager) Running(ctx context.Context, s *State) bool
- func (m *Manager) Start(ctx context.Context, executable string, p provider.Provider, ...) (*State, error)
- func (m *Manager) Stop(ctx context.Context) error
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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{ Dir string }
func (*Manager) RecoverStale ¶
RecoverStale restores the settings overlay of a proxy that died without cleaning up (kill -9, power loss), so a plain claude stops pointing at a closed port. 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, settingsPath, 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.
type State ¶
type State struct {
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"`
SettingsPath string `json:"settings_path"`
StartedAt time.Time `json:"started_at"`
ConfigHash string `json:"config_hash"`
EnvBefore json.RawMessage `json:"env_before,omitempty"`
Changes []Change `json:"changes"`
}