runtime

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const BundleDirName = "runtimes"

BundleDirName is the subdirectory next to the fairpeer executable where bundled runtimes live (e.g. fairpeer.exe/runtimes/uv.exe).

View Source
const UVVersion = "0.5.11"

UVVersion is the pinned uv release version to download.

Variables

This section is empty.

Functions

func Install

func Install(ctx context.Context) error

Install downloads uv to the cache directory. Safe to call from a goroutine at startup. Idempotent: if the binary already exists in cache, returns nil.

func ResolveNode

func ResolveNode() (nodePath, npxPath string, ok bool)

ResolveNode finds Node.js and npx on PATH. Returns absolute paths. Node is NOT bundled (too large); the caller should prompt the user to install if not found.

func ResolvePython

func ResolvePython() (cmd string, prefixArgs []string, err error)

ResolvePython finds Python. Priority: uv (`uv run python`) → python3/python/py on PATH. When uv is used, returns ("uv", ["run", "python"]) so the caller can prepend the prefix args. When a direct Python is found, returns ("/usr/bin/python3", nil).

func ResolveUV

func ResolveUV() (string, bool)

ResolveUV finds uv on the system. Checks PATH first, then the exe-adjacent bundle directory. Returns the absolute path and true if found.

Types

type RuntimeEntry

type RuntimeEntry struct {
	Available bool   `json:"available"`
	Path      string `json:"path,omitempty"`
	Source    string `json:"source,omitempty"` // "path" | "bundle" | "uv" | ""
}

RuntimeEntry describes one runtime's availability.

type RuntimeStatus

type RuntimeStatus struct {
	UV     RuntimeEntry `json:"uv"`
	Python RuntimeEntry `json:"python"`
	Node   RuntimeEntry `json:"node"`
	NPX    RuntimeEntry `json:"npx"`
}

RuntimeStatus is a snapshot of all runtime environments, for the doctor command and the settings UI.

func DetectAll

func DetectAll() RuntimeStatus

DetectAll checks all runtimes and returns a status snapshot. Safe to call repeatedly (each sub-resolver caches its first result).

Jump to

Keyboard shortcuts

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