Expand description
pkg — the zpm plugin package manager (global store).
zshrs plugin package manager (znative) — a GLOBAL-only package manager for
zsh script plugins AND native (Rust cdylib) plugins.
Ported from strykelang’s package manager (strykelang/pkg/), retargeted
from .stk modules to zshrs plugins and simplified to the global-store
model (no per-project manifest/lockfile — the global install index at
$ZSHRS_HOME/pkg/installed.toml is the single source of truth).
World’s first: a compiled Unix shell whose package manager installs and loads BOTH interpreted (zsh) and compiled (Rust cdylib) plugins from one content-addressed global store, with SHA-256 integrity pinning.
Surface:
- [
manifest] — a plugin’s optionalznative.toml([plugin]/[native]/[script]); auto-detected when absent. - [
store] —$ZSHRS_HOME/pkg/{store,cache,git,bin}/layout + theinstalled.tomlglobal index. - [
resolver] — turn a source spec (owner/repo,git+URL,path:DIR) into a staged directory ready to install. - [
commands] —znative {add,remove,list,info,load,update}implementations. builtin— theznativebuiltin dispatcher (wired fromfusevm_bridge).
Modules§
- builtin
- The
znativebuiltin — argv dispatcher oversuper::commands. Wired fromfusevm_bridgealongside the other zshrs-originalz*builtins. Errors print asznative: <reason>on stderr (terse zsh style) and return 1. - commands
znativesubcommand implementations (global model). Ported in spirit from strykelang’spkg/commands.rs, reduced to the global store: install a plugin, record it ininstalled.toml, and load it — natives via thezmodload -Rplugin host, scripts viasource+$fpath.- manifest
- A plugin’s optional
znative.toml, declaring how the plugin is loaded. - resolver
- Resolve a user-supplied source spec into a staged plugin directory.
Adapted from strykelang’s
pkg/resolver.rs, trimmed to the three source forms zshrs plugins ship as (no semver/registry graph — global model). - store
- Global store + installed index. Ported from strykelang’s
pkg/store.rs, retargeted to$ZSHRS_HOME/pkg/and reduced to the global-only model.
Enums§
- PkgError
- Errors emitted by the package manager.
Displayproduces the one-line reason (noznative:prefix — the builtin adds it).
Functions§
- store_
integrity - Deterministic SHA-256 of a directory tree,
sha256-<hex>. Ported from strykelangpkg/lockfile.rs::integrity_for_directory. Files are walked in sorted order so the hash is stable regardless of filesystem iteration; each file contributes<relpath>\0F\0<len>\n<bytes>\n, symlinks their target. Recorded in the install index for change detection / audit.
Type Aliases§
- PkgResult
- Result alias used throughout the package manager. Errors are stringly-typed
(one user-facing diagnostic per failure path), emitted to stderr as
znative: <reason>with exit code 1 — matching the shell’s terse error style.