lang

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package lang declares the OS-level developer toolchain that `multiversa stack` installs. These are distinct from the curated agentic engines in internal/stack (Engram, Graphify, …): tools here are foundational languages and runtimes (Go, Rust, Python, Node, pnpm).

Every Tool installs into the user's home directory by default so a portable USB lab can carry its own toolchain without sudo.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedOS = errors.New("not supported on this OS — use the bash fallback or platform-native installer")

ErrUnsupportedOS is returned by a Tool when the current host has no install path defined (e.g. asking for pyenv on Windows).

Functions

This section is empty.

Types

type Docker

type Docker struct{}

Docker is system-level on Linux (apt/dnf/pacman repo) and a desktop app on macOS/Windows. We don't auto-launch the GUI installer; we surface the right command and let the user click through. This keeps the consultive contract honest: the wizard never silently swallows a GUI prompt.

func (Docker) Description

func (Docker) Description() string

func (Docker) DisplayName

func (Docker) DisplayName() string

func (Docker) ID

func (Docker) ID() string

func (Docker) Installed

func (d Docker) Installed() bool

func (Docker) PlanFor

func (Docker) PlanFor(osKind, pkgMgr string) (Plan, error)

func (Docker) Probe

func (Docker) Probe() string

type Go

type Go struct{}

Go (the language) uses the package manager when available. We don't install from the official tarball by default because that requires writing to /usr/local without sudo, which breaks the no-sudo portability promise.

func (Go) Description

func (Go) Description() string

func (Go) DisplayName

func (Go) DisplayName() string

func (Go) ID

func (Go) ID() string

func (Go) Installed

func (g Go) Installed() bool

func (Go) PlanFor

func (Go) PlanFor(osKind, pkgMgr string) (Plan, error)

func (Go) Probe

func (Go) Probe() string

type Node

type Node struct{}

Node uses nvm on Unix and the official MSI on Windows. We prefer nvm because it lets Moshe pin per-project Node versions without root. The install drops nvm into ~/.nvm; activating it requires sourcing nvm.sh, which the post-install message reminds the user to do.

func (Node) Description

func (Node) Description() string

func (Node) DisplayName

func (Node) DisplayName() string

func (Node) ID

func (Node) ID() string

func (Node) Installed

func (n Node) Installed() bool

func (Node) PlanFor

func (Node) PlanFor(osKind, _ string) (Plan, error)

func (Node) Probe

func (Node) Probe() string

type Plan

type Plan struct {
	Program string   // executable to run ("sh", "brew", "apt", …)
	Args    []string // arguments
	Shell   string   // optional: full shell pipeline (e.g. "curl … | sh")
	Notes   string   // human-readable note about what happens
}

Plan describes how a Tool will be installed on the current host. The shell field, when non-empty, is a single command piped into sh (used by rustup, pnpm install, pyenv, nvm). When empty, Args is run directly via internal/exec.

type Pnpm

type Pnpm struct{}

Pnpm installs pnpm via the official standalone script. This is the only Node package manager Multiversa supports — `npm` is banned by policy (see CONSTITUTION.md). The standalone installer does not require Node to be present yet; it brings its own bundled runtime.

func (Pnpm) Description

func (Pnpm) Description() string

func (Pnpm) DisplayName

func (Pnpm) DisplayName() string

func (Pnpm) ID

func (Pnpm) ID() string

func (Pnpm) Installed

func (p Pnpm) Installed() bool

func (Pnpm) PlanFor

func (Pnpm) PlanFor(osKind, _ string) (Plan, error)

func (Pnpm) Probe

func (Pnpm) Probe() string

type Python

type Python struct{}

Python uses pyenv on Unix for per-project version management. On Windows we install the latest official Python via winget — pyenv-win exists but adds an extra dependency we don't currently audit.

func (Python) Description

func (Python) Description() string

func (Python) DisplayName

func (Python) DisplayName() string

func (Python) ID

func (Python) ID() string

func (Python) Installed

func (p Python) Installed() bool

func (Python) PlanFor

func (Python) PlanFor(osKind, _ string) (Plan, error)

func (Python) Probe

func (Python) Probe() string

type Rust

type Rust struct{}

Rust installs the official rustup toolchain. rustup is the canonical way to manage Rust across every OS, including Windows (with the rustup-init.exe shim). User-mode install into ~/.cargo and ~/.rustup keeps it portable and avoids sudo.

func (Rust) Description

func (Rust) Description() string

func (Rust) DisplayName

func (Rust) DisplayName() string

func (Rust) ID

func (Rust) ID() string

func (Rust) Installed

func (r Rust) Installed() bool

func (Rust) PlanFor

func (Rust) PlanFor(osKind, _ string) (Plan, error)

func (Rust) Probe

func (Rust) Probe() string

type Tool

type Tool interface {
	ID() string          // stable kebab-case identifier
	DisplayName() string // human label
	Description() string // one-line purpose
	Probe() string       // binary name to check on PATH (matches detect)

	// PlanFor returns the install Plan for the given OS kind ("darwin",
	// "linux", "windows") and pkgMgr ("brew", "apt", "dnf", …). It returns
	// (Plan{}, ErrUnsupportedOS) when no path is defined.
	PlanFor(osKind, pkgMgr string) (Plan, error)

	// Installed reports whether the tool is already on PATH.
	Installed() bool
}

Tool is one OS-level developer dependency.

func Registry

func Registry() []Tool

Registry returns the curated list in canonical install order. Order matters: Rust before pnpm before Node before … nothing depends on this strictly today, but a stable order makes runs reproducible.

Jump to

Keyboard shortcuts

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