devtools

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2026 License: MIT Imports: 28 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

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 IsUnavailable(err error) bool

func ToolLabel

func ToolLabel(id string) string

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

func ToolLabels(ids []string) []string

ToolLabels maps stable catalog IDs to their user-facing names.

func UnavailableTools

func UnavailableTools(err error) []string

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 New

func New() (*Manager, error)

New creates a manager rooted at WINGMAN_HOME/tools.

func (*Manager) CanManage

func (m *Manager) CanManage(command string) bool

CanManage reports whether command has a curated latest-version recipe.

func (*Manager) Resolve

func (m *Manager) Resolve(command string) string

Resolve returns the absolute path of a managed command, if installed.

func (*Manager) Root

func (m *Manager) Root() string

Root returns the directory containing managed tools.

func (*Manager) ToolDir

func (m *Manager) ToolDir(id string) string

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.

type Progress

type Progress struct {
	Tool    string
	Label   string
	Phase   ProgressPhase
	Current int
	Total   int
}

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. Project and virtual-environment commands satisfy the requirement before a managed package is selected. System commands remain runtime fallbacks, but do not suppress installation of Wingman's package-managed copy.

type UnavailableError

type UnavailableError struct {
	Tool string
	Err  error
}

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

Jump to

Keyboard shortcuts

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