Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultClient *http.Client
DefaultClient is the HTTP client used for npm registry requests. Override in tests with an httptest server client.
Functions ¶
func FetchLatest ¶
FetchLatest queries the npm registry and returns the latest published version. This is a synchronous call with timeout, intended for diagnostic commands (doctor).
func IsCIEnv ¶ added in v1.0.25
func IsCIEnv() bool
IsCIEnv returns true when any of the standard CI environment variables is set. Exported for internal/skillscheck so its skip rules track the same CI-suppression behavior as the update notifier.
func IsNewer ¶
IsNewer returns true if version a should be considered an update over b.
When both parse as semver, standard comparison applies. When b cannot be parsed (e.g. bare commit hash "9b933f1"), any valid a is considered newer — an unparseable local version is assumed outdated. When a cannot be parsed, returns false (can't confirm it's newer).
func IsRelease ¶ added in v1.0.25
IsRelease reports whether version looks like a clean published release (semver "1.0.0", or npm prerelease "1.0.0-beta.1") and not a git-describe dev build like "1.0.0-12-g9b933f1-dirty". Exported so internal/skillscheck can apply the same release-only gating without duplicating the regex.
func ParseVersion ¶
ParseVersion parses "X.Y.Z" (with optional "v" prefix and pre-release suffix) into [major, minor, patch]. Returns nil on invalid input.
func RefreshCache ¶
func RefreshCache(currentVersion string)
RefreshCache fetches the latest version from npm and updates the local cache. No-op if the cache is still fresh (< 24h). Safe to call from a goroutine.
func SetPending ¶
func SetPending(info *UpdateInfo)
SetPending stores the update info for consumption by output decorators.
Types ¶
type UpdateInfo ¶
UpdateInfo holds version update information.
func CheckCached ¶
func CheckCached(currentVersion string) *UpdateInfo
CheckCached checks the local cache only (no network). Always fast.
func (*UpdateInfo) Message ¶
func (u *UpdateInfo) Message() string
Message returns a concise update notification including the canonical fix command. Aligned with skillscheck.StaleNotice.Message style so AI agents can parse a unified "run: lark-cli update" hint across both notice types.