@metaphi-ai/hum 0.1.42 → 0.1.44
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 +31 -3
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -75861,7 +75861,7 @@ function runningVersion(candidates = engineCandidates(), opts = {}) {
|
|
|
75861
75861
|
}
|
|
75862
75862
|
return null;
|
|
75863
75863
|
}
|
|
75864
|
-
function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.1.
|
|
75864
|
+
function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.1.44" : "" } = {}) {
|
|
75865
75865
|
const refused = failures.find((f) => f.error && f.error.code !== "ENOENT");
|
|
75866
75866
|
const fix = npm ? npmFix(version) : updateCommand({ kind: "native" }, platform2);
|
|
75867
75867
|
if (!refused) {
|
|
@@ -84575,7 +84575,7 @@ var input_default = MultilineInput;
|
|
|
84575
84575
|
|
|
84576
84576
|
// src/app.jsx
|
|
84577
84577
|
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
|
84578
|
-
var MINE = true ? "0.1.
|
|
84578
|
+
var MINE = true ? "0.1.44" : "";
|
|
84579
84579
|
var fmtDur = (s) => s < 60 ? `${Math.max(1, Math.round(s))}s` : `${Math.floor(s / 60)}m ${Math.round(s % 60)}s`;
|
|
84580
84580
|
var plural = (n, w) => `${n} ${w}${n === 1 ? "" : "s"}`;
|
|
84581
84581
|
var firstResp = (e) => e.first_response_s ? ` \xB7 first response ${e.first_response_s.toFixed(1)}s` : "";
|
|
@@ -84616,6 +84616,7 @@ var handEdit = (stat) => {
|
|
|
84616
84616
|
${lines.join("\n ")}`;
|
|
84617
84617
|
};
|
|
84618
84618
|
var fmtCost = (c) => c >= 0.01 ? `$${c.toFixed(2)}` : c > 0 ? `$${c.toFixed(4)}` : "$0";
|
|
84619
|
+
var fmtTokens = (t) => t >= 1e3 ? `${(t / 1e3).toFixed(1)}k tokens` : `${t || 0} tokens`;
|
|
84619
84620
|
var HISTORY_PATH = path3.join(os5.homedir(), ".hum", "history.json");
|
|
84620
84621
|
var HISTORY_MAX = 300;
|
|
84621
84622
|
var loadHistory = () => {
|
|
@@ -84687,6 +84688,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84687
84688
|
const [goal, setGoal] = (0, import_react24.useState)(null);
|
|
84688
84689
|
const [session, setSession] = (0, import_react24.useState)(null);
|
|
84689
84690
|
const [spend, setSpend] = (0, import_react24.useState)(0);
|
|
84691
|
+
const [agents, setAgents] = (0, import_react24.useState)([]);
|
|
84690
84692
|
const [draft, setDraft] = (0, import_react24.useState)("");
|
|
84691
84693
|
const [thinking, setThinking] = (0, import_react24.useState)("");
|
|
84692
84694
|
const [value, setValue] = (0, import_react24.useState)("");
|
|
@@ -84754,6 +84756,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84754
84756
|
thinkT0.current = null;
|
|
84755
84757
|
};
|
|
84756
84758
|
const resetForSession = () => {
|
|
84759
|
+
setAgents([]);
|
|
84757
84760
|
setItems([]);
|
|
84758
84761
|
setDraft("");
|
|
84759
84762
|
draftRef.current = "";
|
|
@@ -84817,6 +84820,9 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84817
84820
|
}
|
|
84818
84821
|
}
|
|
84819
84822
|
switch (ev.type) {
|
|
84823
|
+
case "agents":
|
|
84824
|
+
setAgents(ev.items || []);
|
|
84825
|
+
break;
|
|
84820
84826
|
case "agent_start":
|
|
84821
84827
|
foldThinking();
|
|
84822
84828
|
flushDraft();
|
|
@@ -84824,6 +84830,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84824
84830
|
break;
|
|
84825
84831
|
case "agent_end":
|
|
84826
84832
|
append({ kind: "agent_end", text: `agent ${ev.n} done \xB7 ${plural(ev.steps, "step")} \xB7 ${fmtCost(ev.cost_usd)}${ev.reason !== "done" ? ` \xB7 ${ev.reason}` : ""}` });
|
|
84833
|
+
setAgents((a) => a.filter((x) => x.n !== ev.n));
|
|
84827
84834
|
break;
|
|
84828
84835
|
case "hello": {
|
|
84829
84836
|
if (helloRef.current) resetForSession();
|
|
@@ -86043,6 +86050,27 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
86043
86050
|
] }, c.name)),
|
|
86044
86051
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: "tab to complete \xB7 enter to run" })
|
|
86045
86052
|
] }),
|
|
86053
|
+
!menu.length && agents.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", paddingX: 1, children: [
|
|
86054
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { children: [
|
|
86055
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: "magenta", children: "\u25CF" }),
|
|
86056
|
+
" main"
|
|
86057
|
+
] }),
|
|
86058
|
+
agents.map((a) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { children: [
|
|
86059
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: "magenta", children: "\u25CB " }),
|
|
86060
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: String(a.kind).padEnd(10) }),
|
|
86061
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: a.desc }),
|
|
86062
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { dimColor: true, children: [
|
|
86063
|
+
" ",
|
|
86064
|
+
fmtDur(a.elapsed_s || 0),
|
|
86065
|
+
" \xB7 ",
|
|
86066
|
+
plural(a.steps || 0, "step"),
|
|
86067
|
+
" \xB7 ",
|
|
86068
|
+
fmtTokens(a.tokens),
|
|
86069
|
+
" \xB7 ",
|
|
86070
|
+
fmtCost(a.cost_usd || 0)
|
|
86071
|
+
] })
|
|
86072
|
+
] }, a.n))
|
|
86073
|
+
] }),
|
|
86046
86074
|
!menu.length && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { paddingX: 1, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: statusLine }) })
|
|
86047
86075
|
] });
|
|
86048
86076
|
}
|
|
@@ -86053,7 +86081,7 @@ init_update();
|
|
|
86053
86081
|
init_install();
|
|
86054
86082
|
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
86055
86083
|
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
86056
|
-
var MINE2 = true ? "0.1.
|
|
86084
|
+
var MINE2 = true ? "0.1.44" : "0.0.0";
|
|
86057
86085
|
var layout = installLayout();
|
|
86058
86086
|
function completeInstall() {
|
|
86059
86087
|
if (layout.kind !== "npm" || !needsInstall(MINE2)) return;
|