@metaphi-ai/hum 0.1.10 → 0.1.11
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/cli.mjs +22 -3
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -84668,11 +84668,15 @@ function attempt({ bin, args: args2 }, cwd2, { task, images, resume }) {
|
|
|
84668
84668
|
settle(() => resolve(rec));
|
|
84669
84669
|
return;
|
|
84670
84670
|
}
|
|
84671
|
+
if (rec && rec.error) {
|
|
84672
|
+
settle(() => reject({ failed: rec.error }));
|
|
84673
|
+
return;
|
|
84674
|
+
}
|
|
84671
84675
|
if (died && !rec) {
|
|
84672
84676
|
settle(() => reject({ died: logPath }));
|
|
84673
84677
|
return;
|
|
84674
84678
|
}
|
|
84675
|
-
if (Date.now() - t0 >
|
|
84679
|
+
if (Date.now() - t0 > 9e4) {
|
|
84676
84680
|
settle(() => reject({ timeout: true }));
|
|
84677
84681
|
return;
|
|
84678
84682
|
}
|
|
@@ -84681,6 +84685,20 @@ function attempt({ bin, args: args2 }, cwd2, { task, images, resume }) {
|
|
|
84681
84685
|
poll();
|
|
84682
84686
|
});
|
|
84683
84687
|
}
|
|
84688
|
+
function failureMessage(error) {
|
|
84689
|
+
return error.message + (error.hint ? `
|
|
84690
|
+
${error.hint}` : "");
|
|
84691
|
+
}
|
|
84692
|
+
function diedMessage(logPath, text = null) {
|
|
84693
|
+
let tail2 = "";
|
|
84694
|
+
try {
|
|
84695
|
+
tail2 = (text ?? fs3.readFileSync(logPath, "utf8")).trim().split("\n").slice(-3).join("\n").trim();
|
|
84696
|
+
} catch {
|
|
84697
|
+
}
|
|
84698
|
+
return `the engine did not start${tail2 ? `:
|
|
84699
|
+
${tail2}` : ""}
|
|
84700
|
+
(its log: ${logPath})`;
|
|
84701
|
+
}
|
|
84684
84702
|
async function spawnEngine(cwd2, { task = null, images = [], resume = null, candidates = engineCandidates() } = {}) {
|
|
84685
84703
|
const failures = [];
|
|
84686
84704
|
for (const cand of candidates) {
|
|
@@ -84692,7 +84710,8 @@ async function spawnEngine(cwd2, { task = null, images = [], resume = null, cand
|
|
|
84692
84710
|
failures.push({ ...cand, error: f.spawn });
|
|
84693
84711
|
continue;
|
|
84694
84712
|
}
|
|
84695
|
-
if (f && f.
|
|
84713
|
+
if (f && f.failed) throw new EngineError(failureMessage(f.failed));
|
|
84714
|
+
if (f && f.died) throw new EngineError(diedMessage(f.died));
|
|
84696
84715
|
if (f && f.timeout) throw new EngineError("the engine did not start in time");
|
|
84697
84716
|
throw f;
|
|
84698
84717
|
}
|
|
@@ -84776,7 +84795,7 @@ import { spawnSync as spawnSync2 } from "node:child_process";
|
|
|
84776
84795
|
var ENGINE_COMMANDS = /* @__PURE__ */ new Set(["run", "login", "logout", "whoami", "model", "key", "sessions", "show", "sync", "skill", "ps", "stop", "hooks", "engine"]);
|
|
84777
84796
|
var argv0 = process.argv.slice(2);
|
|
84778
84797
|
if (argv0[0] === "--version" || argv0[0] === "-V") {
|
|
84779
|
-
process.stdout.write(`hum ${true ? "0.1.
|
|
84798
|
+
process.stdout.write(`hum ${true ? "0.1.11" : "0.0.0"}
|
|
84780
84799
|
`);
|
|
84781
84800
|
process.exit(0);
|
|
84782
84801
|
}
|