update

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package update tells a user that a newer Jade release exists without getting in their way.

The rules that keep it quiet: nothing is fetched on the request path — a notice is read from a cache, and the cache is refreshed at most once a day in the background with a short timeout; a failed or offline check also waits a day; and the notice appears only where someone asked what they are running, `jade-mcp --version` and the capabilities report, never in the server instructions an agent reads every session. JADE_UPDATE_CHECK=0, a CI environment or a development build turn it off.

The check is one unauthenticated GET of the latest release tag from GitHub. It sends nothing about the workspace or its use; telemetry stays local.

Index

Constants

View Source
const (
	// DisableEnv set to 0 turns the check off.
	DisableEnv = "JADE_UPDATE_CHECK"
	// InstallCommand installs or updates Jade in place.
	InstallCommand = "curl -fsSL https://raw.githubusercontent.com/julianbei/jade/main/install.sh | sh"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker struct {
	Current   string
	CachePath string
	URL       string
	Now       func() time.Time
	Client    *http.Client
	Getenv    func(string) string
}

Checker compares the running version with the latest release.

func New

func New(current string) *Checker

New builds a Checker for the running version, caching in the user's cache directory.

func (*Checker) Enabled

func (c *Checker) Enabled() bool

Enabled reports whether this binary checks at all.

func (*Checker) Notice

func (c *Checker) Notice() string

Notice is a one-line notice when the cached latest release is newer than the running version, and empty otherwise. It never touches the network.

func (*Checker) Refresh

func (c *Checker) Refresh()

Refresh fetches the latest release tag when the cache is a day old or missing. It is bounded by its client's timeout; call it in the background.

Jump to

Keyboard shortcuts

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