feat(pm): unified package manager — pm store foundation
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.
This commit is contained in:
@@ -201,39 +201,9 @@ def harden_import_path(src_root: str | None = None) -> None:
|
||||
sys.path.insert(0, root)
|
||||
|
||||
|
||||
def activate_durable_lazy_target() -> None:
|
||||
"""Put the durable lazy-install dir on ``sys.path`` if one is configured.
|
||||
|
||||
On immutable Docker images the agent venv is sealed and lazy installs
|
||||
are redirected to a writable dir on the data volume
|
||||
(``HERMES_LAZY_INSTALL_TARGET``, e.g. ``/opt/data/lazy-packages``).
|
||||
Packages installed there on a previous run must be importable on this
|
||||
run, so we activate the dir here — at the very first import, before any
|
||||
backend module imports its SDK.
|
||||
|
||||
The activation appends to the END of ``sys.path`` so the core venv
|
||||
always wins name collisions (see ``tools.lazy_deps`` for the full
|
||||
security rationale). Never raises; a missing/empty target is a no-op.
|
||||
"""
|
||||
if not os.environ.get("HERMES_LAZY_INSTALL_TARGET", "").strip():
|
||||
return
|
||||
try:
|
||||
from tools import lazy_deps
|
||||
lazy_deps.activate_durable_lazy_target()
|
||||
except Exception:
|
||||
# Bootstrap must never crash an entry point. If activation fails the
|
||||
# backend simply reports itself unavailable, exactly as before.
|
||||
pass
|
||||
|
||||
|
||||
# Apply on import — entry points just need ``import hermes_bootstrap``
|
||||
# (or ``from hermes_bootstrap import apply_windows_utf8_bootstrap``) at
|
||||
# the very top of their module, before importing anything else. The
|
||||
# import side effect does the right thing.
|
||||
apply_windows_utf8_bootstrap()
|
||||
suppress_platform_ver_console()
|
||||
|
||||
# Activate the durable lazy-install target (immutable Docker images) so
|
||||
# packages installed into the data volume on a previous run are importable
|
||||
# this run, before any backend module imports its SDK. No-op when unset.
|
||||
activate_durable_lazy_target()
|
||||
|
||||
Reference in New Issue
Block a user