Introduce the pm store: a unified, hash-verified package store that
replaces lazy_deps and the old installer's ad-hoc tool downloads.
Store tools are provisioned on PATH (ffmpeg, node/npm via pinned uv),
with a resumable 8-way downloader, verify() returning failure reasons,
and adopt() made EPERM-safe. chromium ships in the payload for every
target. The 3600-line install.sh is replaced by a staged bootstrapper
(heavy deps are pm's job after this); setup-hermes.sh, Dockerfile and
nix pin tables are rewired onto the store. Old install-script tests,
lazy_deps/managed_uv/build_info, and the ps1/bash installer test
batteries are removed with the machinery they tested.
Rebuilt from ethie/pm onto upstream/main (ac6c8028e0) after the
utf-8-sig sweep. 16 hot files (main also churned them) hand-merged:
platform adapters, main.py, electron/main.ts, tui_gateway/server.py,
cua_backend, installer-tests workflow, install.sh (full rewrite),
setup-hermes.sh, plugins doc.
61 lines
1.6 KiB
Python
61 lines
1.6 KiB
Python
"""pm: the hermes package system.
|
|
|
|
Everything hermes depends on — tool binaries, the python venv, node_modules
|
|
dirs, plugins — is a package in one dependency tree. Package definitions
|
|
(pm/packages.py) say what a package IS. The lockfile (pm/lock.json,
|
|
machine-written) says exactly which versions and hashes. The installed-state
|
|
file (facts.json, per install) says what is actually on this machine.
|
|
|
|
ensure(name) makes the installed state match the lockfile and returns a
|
|
Runner with the composed environment. env_for(*names) composes already-installed
|
|
packages' env without installing anything.
|
|
"""
|
|
|
|
from pm.ensure import (
|
|
activate,
|
|
adopt,
|
|
check,
|
|
enabled_extras,
|
|
ensure,
|
|
env_for,
|
|
is_installed,
|
|
lazy_installs_allowed,
|
|
sync_venv,
|
|
uv,
|
|
)
|
|
from pm.extras import available, ensure_import
|
|
from pm.lock import Facts, Lockfile
|
|
from pm.package import InstallError, Package, Runner, compose_env
|
|
from pm.registry import all_packages, get_package, register, walk
|
|
from pm.store import Store, current_target
|
|
|
|
__all__ = [
|
|
"ensure",
|
|
"env_for",
|
|
"is_installed",
|
|
"adopt",
|
|
"check",
|
|
"activate",
|
|
"sync_venv",
|
|
"available",
|
|
"ensure_import",
|
|
"enabled_extras",
|
|
"lazy_installs_allowed",
|
|
# NOTE: pm.uv is importable but deliberately not in __all__ — it is the
|
|
# marked transitional bridge for update/repair and must not spread.
|
|
"Facts",
|
|
"Lockfile",
|
|
"InstallError",
|
|
"Package",
|
|
"Runner",
|
|
"compose_env",
|
|
"all_packages",
|
|
"get_package",
|
|
"register",
|
|
"walk",
|
|
"Store",
|
|
"current_target",
|
|
]
|
|
|
|
import pm.packages # noqa: E402,F401 (registers the built-in definitions)
|