@agentlayer.tech/wallet 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -307,12 +307,21 @@ def _ensure_node_runtime(npm_bin: str, project_root: Path) -> dict[str, object]:
|
|
|
307
307
|
raise SystemExit(f"Missing package.json for Node runtime at '{project_root}'.")
|
|
308
308
|
package_lock = project_root / "package-lock.json"
|
|
309
309
|
command = [npm_bin, "ci"] if package_lock.exists() else [npm_bin, "install"]
|
|
310
|
-
|
|
310
|
+
env = dict(os.environ)
|
|
311
|
+
cache_dir = (
|
|
312
|
+
env.get("OPENCLAW_AGENT_WALLET_NPM_CACHE")
|
|
313
|
+
or str(_resolve_openclaw_home() / "npm-cache")
|
|
314
|
+
)
|
|
315
|
+
env["NPM_CONFIG_CACHE"] = cache_dir
|
|
316
|
+
env["npm_config_cache"] = cache_dir
|
|
317
|
+
Path(cache_dir).expanduser().mkdir(parents=True, exist_ok=True)
|
|
318
|
+
subprocess.run(command, cwd=project_root, check=True, env=env)
|
|
311
319
|
return {
|
|
312
320
|
"project_root": str(project_root),
|
|
313
321
|
"package_json": str(package_json),
|
|
314
322
|
"package_lock": str(package_lock) if package_lock.exists() else None,
|
|
315
323
|
"command": command,
|
|
324
|
+
"cache_dir": cache_dir,
|
|
316
325
|
}
|
|
317
326
|
|
|
318
327
|
|