@mutmutco/hub 4.3.62 → 4.3.64
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.
- package/dist/index.cjs +22 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1772,6 +1772,18 @@ function materializeHermesSkills(home) {
|
|
|
1772
1772
|
return { ok: false, detail: message2(error) };
|
|
1773
1773
|
}
|
|
1774
1774
|
}
|
|
1775
|
+
function enableHermesPlugin(env, runner) {
|
|
1776
|
+
const command = hermesHostCommand(env);
|
|
1777
|
+
let result;
|
|
1778
|
+
try {
|
|
1779
|
+
result = runner(command, ["plugins", "enable", "mmi", "--no-allow-tool-override"], env);
|
|
1780
|
+
} catch (error) {
|
|
1781
|
+
return { ok: false, detail: `\`${command} plugins enable mmi\` could not run: ${message2(error)}` };
|
|
1782
|
+
}
|
|
1783
|
+
if (result.status === 0) return { ok: true, detail: "enabled in plugins.enabled" };
|
|
1784
|
+
const reason = message2(result.stderr?.trim() || result.stdout?.trim() || `exit ${result.status ?? "unknown"}`);
|
|
1785
|
+
return { ok: false, detail: `\`${command} plugins enable mmi\` failed: ${reason}` };
|
|
1786
|
+
}
|
|
1775
1787
|
function hermesArm(options) {
|
|
1776
1788
|
const env = options.env ?? process.env;
|
|
1777
1789
|
const home = hermesHome(env);
|
|
@@ -1795,12 +1807,15 @@ function hermesArm(options) {
|
|
|
1795
1807
|
if (installed && compareSemver(installed, options.target) > 0) return result(installed, installed, "skip", `installed ${installed} is above candidate ${options.target} (monotonic)`);
|
|
1796
1808
|
const highWater = journalHighWater(options.paths.journalPath, "hermes");
|
|
1797
1809
|
if (highWater && compareSemver(highWater, options.target) > 0) return result(installed, highWater, "skip", `journal high-water ${highWater} is above candidate ${options.target} (monotonic)`);
|
|
1810
|
+
const hostRunner = options.hostCommandRunner ?? runHostCommand;
|
|
1798
1811
|
if (installed === options.target && treeHealthy2(live)) {
|
|
1799
1812
|
const skills2 = materializeHermesSkills(home);
|
|
1800
1813
|
if (!skills2.ok) return result(installed, options.target, "fail", `plugin at target ${options.target}, but skills provisioning failed: ${skills2.detail}`);
|
|
1801
|
-
|
|
1814
|
+
const enabled2 = enableHermesPlugin(env, hostRunner);
|
|
1815
|
+
if (!enabled2.ok) return result(installed, options.target, "fail", `plugin at target ${options.target}, but ${enabled2.detail}`);
|
|
1816
|
+
return result(installed, options.target, "ok", `already at target ${options.target}; ${skills2.detail}; ${enabled2.detail}`);
|
|
1802
1817
|
}
|
|
1803
|
-
if (options.dryRun) return result(installed, options.target, "ok", `dry-run: would stage ${PACKAGE2}@${options.target}, atomically switch ${installed ?? "absent"} -> ${options.target},
|
|
1818
|
+
if (options.dryRun) return result(installed, options.target, "ok", `dry-run: would stage ${PACKAGE2}@${options.target}, atomically switch ${installed ?? "absent"} -> ${options.target}, provision skills into ${(0, import_node_path10.join)(home, "skills", "mmi")}, then enable mmi in plugins.enabled`);
|
|
1804
1819
|
const staged = stagePackage({ surface: "hermes", packageName: PACKAGE2, target: options.target, witness: MANIFEST2, paths: options.paths, env });
|
|
1805
1820
|
if ("defer" in staged) return result(installed, options.target, "defer", staged.defer);
|
|
1806
1821
|
const stagedVersion = yamlVersion(staged.packageRoot);
|
|
@@ -1836,7 +1851,8 @@ function hermesArm(options) {
|
|
|
1836
1851
|
return result(installed, options.target, "defer", incomingTree);
|
|
1837
1852
|
}
|
|
1838
1853
|
}
|
|
1839
|
-
const
|
|
1854
|
+
const displaced = (0, import_node_fs13.existsSync)(live);
|
|
1855
|
+
const busy = displaced ? hermesHostEvidence(env, home, options.processListProvider) : null;
|
|
1840
1856
|
if (busy) {
|
|
1841
1857
|
const pending = noteLaunchStaged(options.paths, env, {
|
|
1842
1858
|
surface: "hermes",
|
|
@@ -1849,7 +1865,6 @@ function hermesArm(options) {
|
|
|
1849
1865
|
});
|
|
1850
1866
|
return result(installed, options.target, "ok", `staged ${options.target} for next launch while Hermes is running (${busy}) \u2014 ${pending}`, true);
|
|
1851
1867
|
}
|
|
1852
|
-
const displaced = (0, import_node_fs13.existsSync)(live);
|
|
1853
1868
|
try {
|
|
1854
1869
|
if (displaced) (0, import_node_fs13.renameSync)(live, quarantine);
|
|
1855
1870
|
(0, import_node_fs13.renameSync)(incoming, live);
|
|
@@ -1881,7 +1896,9 @@ function hermesArm(options) {
|
|
|
1881
1896
|
clearLaunchTarget(launchTargetPath);
|
|
1882
1897
|
const skills = materializeHermesSkills(home);
|
|
1883
1898
|
if (!skills.ok) return result(installed, options.target, "fail", `plugin converged to ${options.target}, but skills provisioning failed: ${skills.detail}`);
|
|
1884
|
-
|
|
1899
|
+
const enabled = enableHermesPlugin(env, hostRunner);
|
|
1900
|
+
if (!enabled.ok) return result(installed, options.target, "fail", `plugin converged to ${options.target}, but ${enabled.detail}`);
|
|
1901
|
+
return result(installed, options.target, "ok", `converged ${installed ?? "absent"} -> ${options.target} (staged, verified, atomically switched${displaced ? `; previous generation quarantined at ${quarantine}` : ""}); ${skills.detail}; ${enabled.detail}`);
|
|
1885
1902
|
}
|
|
1886
1903
|
function probeHermesLaunchStaging(env = process.env) {
|
|
1887
1904
|
return probeLaunchTargetVersion((0, import_node_path10.join)(hermesHome(env), ".mmi-updater", "launch-target.json"), yamlVersion);
|
package/package.json
CHANGED