mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-06 13:26:40 +00:00
pnpm 12.15.0 (native executable) installs every JS workspace from one pnpm-lock.yaml, imported from package-lock.json with the same resolved versions. website/, the WhatsApp bridge and the photon sidecar stay separate npm projects. Configuration moves from .npmrc and the root manifest into pnpm-workspace.yaml: the 14-day minimumReleaseAge and its excludes, overrides, allowBuilds (the old allowScripts set, with strictDepBuilds failing any unlisted build script), engineStrict, sideEffectsCache: false (in-place rebuilds must not write into the store) and verifyDepsBeforeRun: false (a `pnpm run` never installs). The pnpm version is pinned in pm/lock.json and in root devEngines. pmOnFail: ignore keeps that pin out of pnpm-lock.yaml: a leading pin document makes osv-scanner read zero packages. scripts/build/node-deps.mjs enforces the exact version instead, and every lock reader refuses a multi-document lock. A root preinstall refuses `npm install`; devEngines onFail is warn so npx (MCP servers, the tsc linter) keeps working inside the checkout. User-machine installs run --frozen-lockfile --trust-lockfile (release age is checked when locking, in CI, not per user). node-deps removes npm-era node_modules trees before the first pnpm install. Nix builds the store with fetchPnpmDeps and a hash file that CI checks.
32 lines
1.5 KiB
Python
32 lines
1.5 KiB
Python
"""Log setup-pm's restore results and write policy without traversing cache trees."""
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import os
|
|
|
|
|
|
def log_caches(inputs: dict, steps: dict, scope: str) -> None:
|
|
node = inputs["node-package-manager"]
|
|
for family, name, producer, output in [
|
|
("tools", "tools", "prepare", "store"),
|
|
("uv", "python", "install", "uv-cache-path"),
|
|
(node, "node", "install", {"npm": "npm-cache-path", "pnpm": "pnpm-store-path"}[node]),
|
|
]:
|
|
candidates = [steps.get(f"{name}-cache", {}), steps.get(f"{name}-cache-restore", {})]
|
|
selected = next((step for step in candidates if step.get("outcome") not in (None, "skipped")), {})
|
|
outcome = selected.get("outcome", "skipped")
|
|
hit = selected.get("outputs", {}).get("cache-hit", "")
|
|
policy = "disabled" if inputs.get(f"save-{name}-cache") == "false" else "on-success"
|
|
if not selected:
|
|
policy = "not-registered"
|
|
path = steps.get(producer, {}).get("outputs", {}).get(output, "")
|
|
# This is policy, not a save receipt: the native post action reports
|
|
# exact-hit skips, successful archive sizes and upload failures later.
|
|
print(f"[setup-pm cache] {family}: restore={outcome}, cache-hit={hit!r}, "
|
|
f"save={policy}, path={path!r}, scope={scope}", flush=True)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
log_caches(json.loads(os.environ["_PM_CACHE_INPUTS"]), json.loads(os.environ["_PM_CACHE_STEPS"]),
|
|
os.environ.get("GITHUB_REF", "unknown"))
|