/** * Thin adapter around pi's DefaultPackageManager. * Serializes operations (one at a time), forwards progress events, * and triggers session reload on success. * * Pi module resolution is delegated to the shared `ToolRegistry` * (`resolveModule("pi-coding-agent")`). All strategy chains, caching, * and diagnostic trails live there — see change: consolidate-tool-resolution. */ import * as os from "node:os"; import * as path from "node:path"; import * as crypto from "node:crypto"; import { computeIdentity, parseSourceKind } from "./package-source-helpers.js"; import { getDefaultRegistry, ModuleResolutionError, type ToolRegistry, type Resolution, } from "@blackbelt-technology/pi-dashboard-shared/tool-registry/index.js"; import { getDefaultSubprocessAdapter, type SubprocessAdapter, } from "@blackbelt-technology/pi-dashboard-shared/platform/subprocess-adapter.js"; /** * Resolve a command name through the tool registry's executor API. * If the name is registered (e.g. "npm", "openspec", "pi"), returns * the full executor argv — on Windows this is `[node.exe,