Documentation
¶
Overview ¶
Package devtools installs and resolves language servers and debug adapters managed by Wingman. Managed tools live directly below WINGMAN_HOME/tools; each tool has one active installation which is replaced on update.
Index ¶
- Variables
- func Disabled() bool
- func IsUnavailable(err error) bool
- func ToolLabel(id string) string
- func ToolLabels(ids []string) []string
- func UnavailableTools(err error) []string
- type Manager
- func (m *Manager) CanManage(command string) bool
- func (m *Manager) Resolve(command string) string
- func (m *Manager) Root() string
- func (m *Manager) Status(ctx context.Context, requirements []Requirement) ([]ToolStatus, error)
- func (m *Manager) ToolDir(id string) string
- func (m *Manager) Update(ctx context.Context, requirements []Requirement, progress ...func(Progress)) (bool, error)
- func (m *Manager) UpdateOnDemand(ctx context.Context, requirements []Requirement, install bool, ...) (bool, error)
- type Progress
- type ProgressPhase
- type Requirement
- type ToolStatus
- type UnavailableError
Constants ¶
This section is empty.
Variables ¶
var ErrInstallRequired = errors.New("managed tool installation requires confirmation")
ErrInstallRequired means an update-only request encountered a missing tool.
Functions ¶
func Disabled ¶
func Disabled() bool
Disabled reports whether automatic installation is turned off. Existing managed tools continue to resolve; only installations and updates stop.
func IsUnavailable ¶
func ToolLabel ¶
ToolLabel returns the user-facing name stored with a managed tool's recipe. Unknown IDs are returned unchanged so callers always have useful text.
func ToolLabels ¶
ToolLabels maps stable catalog IDs to their user-facing names.
func UnavailableTools ¶
UnavailableTools returns the stable tool IDs from a possibly joined update error. Callers can present a concise notice without exposing installer logs.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager owns the latest-only managed tool directory.
func (*Manager) Status ¶ added in v0.16.4
func (m *Manager) Status(ctx context.Context, requirements []Requirement) ([]ToolStatus, error)
Status uses the same managed-only resolution as discovery and launch.
func (*Manager) ToolDir ¶
ToolDir returns a complete managed installation for adapters that need bundled files in addition to an executable availability token.
func (*Manager) Update ¶
func (m *Manager) Update(ctx context.Context, requirements []Requirement, progress ...func(Progress)) (bool, error)
Update installs the latest release for every selected requirement. A fresh installation is checked at most once per day; failed checks are retried after a short backoff. Successful updates replace the prior directory and remove it rather than accumulating versions.
func (*Manager) UpdateOnDemand ¶ added in v0.16.4
func (m *Manager) UpdateOnDemand(ctx context.Context, requirements []Requirement, install bool, progress ...func(Progress)) (bool, error)
UpdateOnDemand checks for updates during an explicit user action. It keeps the daily refresh interval. Missing tools require install=true, which also allows immediate retries after a failed installation.
type Progress ¶
type Progress struct {
Tool string `json:"tool"`
Label string `json:"label"`
Phase ProgressPhase `json:"phase"`
Current int `json:"current"`
Total int `json:"total"`
}
Progress identifies the managed tool currently being checked, installed, or updated.
type ProgressPhase ¶ added in v0.15.1
type ProgressPhase string
ProgressPhase describes what the managed-tool updater is doing. Checking is intentionally distinct from installation so status surfaces do not imply that a fresh installation is being replaced on every startup.
const ( ProgressChecking ProgressPhase = "checking" ProgressInstalling ProgressPhase = "installing" ProgressUpdating ProgressPhase = "updating" )
type Requirement ¶
type Requirement struct {
Alternatives []string
Workspace string
Projects []string
MinimumMajorVersions map[string]int
}
Requirement lists equivalent commands in preference order. The first command with a managed recipe selects the package to install or update.
type ToolStatus ¶ added in v0.16.4
type ToolStatus struct {
Tool string `json:"tool"`
Label string `json:"label"`
Installed bool `json:"installed"`
Installable bool `json:"installable"`
}
ToolStatus describes an installation without downloading or changing tools.
type UnavailableError ¶
type UnavailableError struct {
}
UnavailableError means no usable copy of a required tool remains after an automatic installation failure. Refresh failures for an existing copy do not use this type.
func (*UnavailableError) Error ¶
func (e *UnavailableError) Error() string
func (*UnavailableError) Unwrap ¶
func (e *UnavailableError) Unwrap() error