Documentation
¶
Overview ¶
Package toolchain manages optional analyzers owned by a Kivgraph installation. Managed tools live in Kivgraph state, never in a repository.
Index ¶
- Constants
- func FindNPM() (string, error)
- func IsManagedPyrightCommand(command, stateDirectory string) bool
- func Names() []string
- func PyrightAnalyzerCommand(executable string) string
- func PyrightRoot(stateDirectory string) string
- func Remove(stateDirectory, name string) error
- func SplitCommandLine(command string) ([]string, error)
- func StateRoot(stateDirectory string) string
- func ValidateName(name string) error
- func ValidateVersion(version string) error
- type Manifest
- type ToolStatus
Constants ¶
const ( // Pyright is the first managed analyzer. The command family is intentionally // generic so future analyzers can use the same state and activation model. Pyright = "pyright" // DefaultPyrightVersion is pinned so an install does not silently change // the semantic provider used by a later graph generation. DefaultPyrightVersion = "1.1.413" )
Variables ¶
This section is empty.
Functions ¶
func IsManagedPyrightCommand ¶
IsManagedPyrightCommand reports whether command points into this installation's managed Pyright directory.
func PyrightAnalyzerCommand ¶
PyrightAnalyzerCommand returns the bundled adapter command configured to launch one managed Pyright language server.
func PyrightRoot ¶
PyrightRoot returns the version-independent Pyright directory.
func SplitCommandLine ¶
SplitCommandLine parses the small shell-like command vocabulary accepted by analyzer configuration. It removes quoting used for paths with spaces while preserving ordinary command arguments and platform path separators.
func StateRoot ¶
StateRoot returns the directory where managed tools belong for one installation or profile universe.
func ValidateName ¶
ValidateName checks the generic command's tool argument.
func ValidateVersion ¶
ValidateVersion accepts one exact stable semantic version, without a leading v. Keeping the path and package selector in this form avoids a floating npm range and makes the install reproducible at the command level.
Types ¶
type Manifest ¶
type Manifest struct {
Schema int `json:"schema"`
Name string `json:"name"`
Version string `json:"version"`
Package string `json:"package"`
Executable string `json:"executable"`
SHA256 string `json:"sha256"`
}
Manifest is the durable description of an installed managed tool.
type ToolStatus ¶
type ToolStatus struct {
Name string `json:"name"`
State string `json:"state"`
Version string `json:"version,omitempty"`
Root string `json:"root,omitempty"`
Executable string `json:"executable,omitempty"`
SHA256 string `json:"sha256,omitempty"`
Detail string `json:"detail,omitempty"`
}
ToolStatus describes one managed tool without claiming that an absent tool is an error. A broken installation is named separately from a missing one.
func Install ¶
func Install(ctx context.Context, stateDirectory, name, version, npmPath string) (ToolStatus, error)
Install installs one supported analyzer into stateDirectory. npmPath is injectable for tests; an empty value discovers npm on PATH.
func Status ¶
func Status(stateDirectory string) ([]ToolStatus, error)
Status returns the status of every managed analyzer in this build.