@mutmutco/hub 4.3.64 → 4.3.66

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.
Files changed (2) hide show
  1. package/dist/index.cjs +43 -5
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -34,6 +34,7 @@ __export(index_exports, {
34
34
  heldOutput: () => heldOutput,
35
35
  hermesArm: () => hermesArm,
36
36
  hermesHome: () => hermesHome,
37
+ hermesHomes: () => hermesHomes,
37
38
  hermesHostCommand: () => hermesHostCommand,
38
39
  hermesHostEvidence: () => hermesHostEvidence,
39
40
  hermesHostPresent: () => hermesHostPresent,
@@ -1784,9 +1785,48 @@ function enableHermesPlugin(env, runner) {
1784
1785
  const reason = message2(result.stderr?.trim() || result.stdout?.trim() || `exit ${result.status ?? "unknown"}`);
1785
1786
  return { ok: false, detail: `\`${command} plugins enable mmi\` failed: ${reason}` };
1786
1787
  }
1788
+ function hermesHomes(env = process.env) {
1789
+ const root = hermesHome(env);
1790
+ const homes = [root];
1791
+ try {
1792
+ for (const entry of (0, import_node_fs13.readdirSync)((0, import_node_path10.join)(root, "profiles"), { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
1793
+ if (entry.isDirectory() && !entry.name.startsWith(".")) homes.push((0, import_node_path10.join)(root, "profiles", entry.name));
1794
+ }
1795
+ } catch {
1796
+ }
1797
+ return homes;
1798
+ }
1799
+ var VERDICT_RANK = { fail: 3, defer: 2, ok: 1, skip: 0 };
1787
1800
  function hermesArm(options) {
1788
1801
  const env = options.env ?? process.env;
1789
- const home = hermesHome(env);
1802
+ if (!hermesHostPresent(env, options.hostCommandRunner)) {
1803
+ return {
1804
+ surface: "hermes",
1805
+ from: null,
1806
+ to: options.target,
1807
+ verdict: "skip",
1808
+ detail: `host absent (${hermesHostCommand(env)} CLI not on PATH) \u2014 skipped without writes`
1809
+ };
1810
+ }
1811
+ const homes = hermesHomes(env);
1812
+ const results = homes.map((home, index) => ({
1813
+ home,
1814
+ result: armHermesHome(home, { ...env, HERMES_HOME: home }, options, index === 0)
1815
+ }));
1816
+ const primary = results[0].result;
1817
+ if (results.length === 1) return primary;
1818
+ const worst = results.reduce((a, b) => VERDICT_RANK[b.result.verdict] > VERDICT_RANK[a.result.verdict] ? b : a);
1819
+ const detail = results.map(({ home, result }, index) => `${index === 0 ? "home" : `profile ${(0, import_node_path10.basename)(home)}`}: ${result.detail}`).join(" | ");
1820
+ return {
1821
+ surface: "hermes",
1822
+ from: primary.from,
1823
+ to: primary.to,
1824
+ verdict: worst.result.verdict,
1825
+ detail: `${homes.length} Hermes homes \u2014 ${detail}`,
1826
+ launchStaged: results.some(({ result }) => result.launchStaged) || void 0
1827
+ };
1828
+ }
1829
+ function armHermesHome(home, env, options, primary) {
1790
1830
  const parent = (0, import_node_path10.join)(home, "plugins");
1791
1831
  const live = (0, import_node_path10.join)(parent, "mmi");
1792
1832
  const installed = yamlVersion(live);
@@ -1798,14 +1838,11 @@ function hermesArm(options) {
1798
1838
  detail,
1799
1839
  launchStaged: launchStaged || void 0
1800
1840
  });
1801
- if (!hermesHostPresent(env, options.hostCommandRunner)) {
1802
- return result(null, options.target, "skip", `host absent (${hermesHostCommand(env)} CLI not on PATH) \u2014 skipped without writes`);
1803
- }
1804
1841
  if ((0, import_node_fs13.existsSync)(live) && !mmiOwned2(live)) {
1805
1842
  return result(installed, options.target, "defer", `${live} carries no ${PACKAGE2} package identity \u2014 refusing to displace an unmanaged Hermes mmi plugin`);
1806
1843
  }
1807
1844
  if (installed && compareSemver(installed, options.target) > 0) return result(installed, installed, "skip", `installed ${installed} is above candidate ${options.target} (monotonic)`);
1808
- const highWater = journalHighWater(options.paths.journalPath, "hermes");
1845
+ const highWater = primary ? journalHighWater(options.paths.journalPath, "hermes") : null;
1809
1846
  if (highWater && compareSemver(highWater, options.target) > 0) return result(installed, highWater, "skip", `journal high-water ${highWater} is above candidate ${options.target} (monotonic)`);
1810
1847
  const hostRunner = options.hostCommandRunner ?? runHostCommand;
1811
1848
  if (installed === options.target && treeHealthy2(live)) {
@@ -3291,6 +3328,7 @@ if (typeof require !== "undefined" && require.main === module) {
3291
3328
  heldOutput,
3292
3329
  hermesArm,
3293
3330
  hermesHome,
3331
+ hermesHomes,
3294
3332
  hermesHostCommand,
3295
3333
  hermesHostEvidence,
3296
3334
  hermesHostPresent,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutmutco/hub",
3
- "version": "4.3.64",
3
+ "version": "4.3.66",
4
4
  "description": "Install and maintain the MMI CLI and every present host surface from one release-gated Hub command.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",