Skip to main content

Crate rootle_manager

Crate rootle_manager 

Source
Expand description

Provider manager (plans/0010): install, list, update, upgrade, pin, remove, use — for stdio provider binaries distributed as GitHub release tarballs for Linux x86_64 and aarch64.

Layout (XDG tiers, one purpose each — see the plan’s survey):

~/.local/share/rootle/providers/<name>/<version>/rootle-<name>  binary
~/.local/share/rootle/providers/<name>/current -> <version>/    pointer
~/.local/state/rootle/providers/<name>.toml                    receipt

Atomicity (krew model): download to temp staging → verify sha256 (mandatory) → extract into the versioned dir → write the receipt LAST → atomically re-point current. A failed step leaves the previous version intact. The running TUI is never affected — provider children die with the app, the next spawn picks up the new current.

Config declares, the store installs (mise pattern): use writes the existing [provider] block; the runtime build() is untouched and hand-edited configs keep working.

Submodules by concern: refs (the install-reference grammar), release (GitHub API, tarball, checksum), install (the install/update/upgrade flows), store (local state on disk), bookkeeping (pin/remove/use/list).

Modules§

progress
CLI output aesthetics for the provider manager (plans/0010): the uv/mise grammar — bold-cyan in-progress verbs that flip to bold-green on completion, a braille spinner during downloads, dim step summaries with bold counts and timings. Std only: raw ANSI, IsTerminal gating, NO_COLOR respected.

Structs§

Installed
An installed provider, as list reports.
Manager
ProviderReference
A resolved install reference (the grammar from the plan): gitlab | owner/repo | https://github.com/owner/repo, each optionally @tag-pinned — or a plain-HTTP URL naming the platform tarball directly (plans/0014 #1a: arbitrary artifact hosts).
Receipt
The receipt: provenance recorded beside the binary so list/upgrade read local state, never the network (gh manifest.yml pattern).

Enums§

ManagerError
SweepOutcome
One provider’s result in rootle update’s sweep (0019 M1) — rendered by the caller, never printed here.

Functions§

checksum_sidecar
The .sha256 sidecar for asset — no sidecar, no install.
download_bytes
extract_binary
Extract the binary from the tarball: find the single executable file, return its bytes (our tarballs contain <dir>/<binary>).
latest_release
latest_release_at
The verified-download machinery, shared with rootle update (0017 M2) — same integrity model as provider installs. Tests point this at a loopback host.
pick_asset
Pick the asset for this platform: <anything>-<target>.tar.gz, suffix-matched (gh extension’s model — tolerate version prefixes and name variants).
platform_target
The native Linux release target; GNU hosts use the static musl artifact.
verify_checksum
Verify against the .sha256 sidecar asset — mandatory (krew rule: a missing checksum is a failed install, not a warning).

Type Aliases§

Result