@metaphi-ai/hum 0.2.27 → 0.2.29
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 +19 -23
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -89037,7 +89037,7 @@ var win, MINE, npmFix, NPM_FIX, humHome, versionsDir, versionDir, pkgDir, coreDi
|
|
|
89037
89037
|
var init_install = __esm({
|
|
89038
89038
|
"src/install.js"() {
|
|
89039
89039
|
win = process.platform === "win32";
|
|
89040
|
-
MINE = true ? "0.2.
|
|
89040
|
+
MINE = true ? "0.2.29" : "";
|
|
89041
89041
|
npmFix = (version = "") => `npm i -g @metaphi-ai/hum@${version || "latest"} --foreground-scripts`;
|
|
89042
89042
|
NPM_FIX = npmFix("latest");
|
|
89043
89043
|
humHome = (env3 = process.env) => env3.HUM_HOME || path.join(os3.homedir(), ".hum");
|
|
@@ -89382,10 +89382,10 @@ function clientEnv() {
|
|
|
89382
89382
|
platform: process.platform,
|
|
89383
89383
|
arch: process.arch,
|
|
89384
89384
|
terminal: process.env.TERM_PROGRAM || (process.env.WT_SESSION ? "Windows Terminal" : process.env.TERM || ""),
|
|
89385
|
-
tui: true ? "0.2.
|
|
89385
|
+
tui: true ? "0.2.29" : ""
|
|
89386
89386
|
};
|
|
89387
89387
|
}
|
|
89388
|
-
function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.2.
|
|
89388
|
+
function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.2.29" : "" } = {}) {
|
|
89389
89389
|
const refused = failures.find((f) => f.error && f.error.code !== "ENOENT");
|
|
89390
89390
|
const fix = npm ? npmFix(version) : updateCommand({ kind: "native" }, platform2);
|
|
89391
89391
|
if (!refused) {
|
|
@@ -90887,7 +90887,7 @@ var after = (ms, fn) => {
|
|
|
90887
90887
|
|
|
90888
90888
|
// src/app.jsx
|
|
90889
90889
|
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
90890
|
-
var MINE2 = true ? "0.2.
|
|
90890
|
+
var MINE2 = true ? "0.2.29" : "";
|
|
90891
90891
|
var fmtDur = (s) => s < 60 ? `${Math.max(1, Math.round(s))}s` : `${Math.floor(s / 60)}m ${Math.round(s % 60)}s`;
|
|
90892
90892
|
var plural = (n, w) => `${n} ${w}${n === 1 ? "" : "s"}`;
|
|
90893
90893
|
var shortSession = (name) => (name || "").replace(/\.jsonl$/, "");
|
|
@@ -91215,6 +91215,7 @@ function App2({ core: core2, task, resume, images = [], peek = peekSession, upda
|
|
|
91215
91215
|
const thoughtRef = (0, import_react38.useRef)(null);
|
|
91216
91216
|
const ledRef = (0, import_react38.useRef)(null);
|
|
91217
91217
|
const toolsRef = (0, import_react38.useRef)({});
|
|
91218
|
+
const proposedRef = (0, import_react38.useRef)(/* @__PURE__ */ new Set());
|
|
91218
91219
|
const historyRef = (0, import_react38.useRef)(loadHistory());
|
|
91219
91220
|
const modelRef = (0, import_react38.useRef)("");
|
|
91220
91221
|
const heldRef = (0, import_react38.useRef)({ reads: [], calls: [] });
|
|
@@ -91756,6 +91757,7 @@ ${r.content}`).join("\n\n") };
|
|
|
91756
91757
|
foldThinking();
|
|
91757
91758
|
flushDraft();
|
|
91758
91759
|
toolsRef.current[ev.id] = ev;
|
|
91760
|
+
if (proposedRef.current.delete(ev.id)) break;
|
|
91759
91761
|
const row = { kind: "tool", text: callLabel(ev), name: ev.name, args: ev.args };
|
|
91760
91762
|
if (ev.diff) append(row);
|
|
91761
91763
|
else holdCall(ev, row);
|
|
@@ -91796,7 +91798,10 @@ ${r.content}`).join("\n\n") };
|
|
|
91796
91798
|
foldThinking();
|
|
91797
91799
|
flushDraft();
|
|
91798
91800
|
(ev.calls || []).forEach((c) => {
|
|
91799
|
-
if (c.diff
|
|
91801
|
+
if (!c.diff || proposedRef.current.has(c.id)) return;
|
|
91802
|
+
proposedRef.current.add(c.id);
|
|
91803
|
+
append({ kind: "tool", text: callLabel(c), name: c.name, args: c.args });
|
|
91804
|
+
append({ kind: "diff", lines: c.diff.split("\n"), more: 0 });
|
|
91800
91805
|
});
|
|
91801
91806
|
setProposal({ content: ev.content || "", calls: ev.calls || [], remember: ev.remember || [], remember_text: ev.remember_text || "", agent: ev.agent || null });
|
|
91802
91807
|
setStatus("waiting for your decision");
|
|
@@ -92671,7 +92676,7 @@ ${r.content}`).join("\n\n") };
|
|
|
92671
92676
|
const spinnerRows = wrapAnsi2(spinnerLabel, Math.max(1, width - 1), { hard: true, trim: false }).split("\n").length;
|
|
92672
92677
|
const rows = stdout?.rows || DEFAULT_ROWS;
|
|
92673
92678
|
const heldRows = [...foldRows(held.reads), ...held.calls.map((c) => c.item)];
|
|
92674
|
-
const chrome = 1 + 1 + spinnerRows + heldRows.reduce((n, r) => n + 1 + blockGap(r), 0) + 4 + (value.split("\n").length - 1) + 1 + (menu.length ? menu.length : 0) + files.length + (!menu.length && !files.length && agents.length ? agents.length + 1 : 0) + (looking ? 4 + (looking.question ? (looking.question.options || []).length + 2 : Math.min(PEEK_LINES, looking.lines.length) + 1) : 0) + (question && step ? 9 + Math.min(consultHeight, consult.text.length + consult.rows.length) + (consult.rows.length ? 1 : 0) : 0) + (proposal ? 4 + proposal.calls.length
|
|
92679
|
+
const chrome = 1 + 1 + spinnerRows + heldRows.reduce((n, r) => n + 1 + blockGap(r), 0) + 4 + (value.split("\n").length - 1) + 1 + (menu.length ? menu.length : 0) + files.length + (!menu.length && !files.length && agents.length ? agents.length + 1 : 0) + (looking ? 4 + (looking.question ? (looking.question.options || []).length + 2 : Math.min(PEEK_LINES, looking.lines.length) + 1) : 0) + (question && step ? 9 + Math.min(consultHeight, consult.text.length + consult.rows.length) + (consult.rows.length ? 1 : 0) : 0) + (proposal ? 4 + proposal.calls.length : 0) + (reflection ? 8 + reflection.details.split("\n").length : 0) + (confirm ? 4 + Math.min(8, String(confirm.stat || "").split("\n").length) : 0) + (trust ? 4 + trust.starts.length : 0) + (picker ? 14 : 0);
|
|
92675
92680
|
const liveBudget = Math.max(LIVE_MIN_ROWS, Math.min(DRAFT_TAIL_LINES, rows - 1 - chrome));
|
|
92676
92681
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box2, { flexDirection: "column", children: [
|
|
92677
92682
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Static, { items, children: (item) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box2, { flexDirection: "column", marginTop: blockGap(item), children: [
|
|
@@ -92802,7 +92807,7 @@ ${r.content}`).join("\n\n") };
|
|
|
92802
92807
|
item.kind === "errtail" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box2, { flexDirection: "column", paddingLeft: 6, children: item.lines.map((l, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { color: "red", dimColor: true, children: l }, i)) }),
|
|
92803
92808
|
item.kind === "output" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box2, { flexDirection: "column", paddingLeft: 4, children: [
|
|
92804
92809
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: `full output \xB7 ${item.name}` }),
|
|
92805
|
-
item.lines.map((l, i) =>
|
|
92810
|
+
item.lines.map((l, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: l || " " }, i))
|
|
92806
92811
|
] }),
|
|
92807
92812
|
item.kind === "turn" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text2, { children: [
|
|
92808
92813
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { color: ACCENT, children: "\u273B " }),
|
|
@@ -92937,7 +92942,11 @@ ${r.content}`).join("\n\n") };
|
|
|
92937
92942
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text2, { children: [
|
|
92938
92943
|
" \xB7 ",
|
|
92939
92944
|
c.desc,
|
|
92940
|
-
c.lines != null ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: ` (${c.lines} lines)` }) : null
|
|
92945
|
+
c.lines != null ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: ` (${c.lines} lines)` }) : null,
|
|
92946
|
+
c.diff ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text2, { children: [
|
|
92947
|
+
" ",
|
|
92948
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(DiffStat, { lines: c.diff.split("\n") })
|
|
92949
|
+
] }) : null
|
|
92941
92950
|
] }),
|
|
92942
92951
|
(c.name === "bash" || c.name === "powershell") && c.desc !== `$ ${String(c.args?.command || "")}` ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text2, { color: "cyan", children: [
|
|
92943
92952
|
" $ ",
|
|
@@ -92946,20 +92955,7 @@ ${r.content}`).join("\n\n") };
|
|
|
92946
92955
|
c.escape ? /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text2, { color: "yellow", children: [
|
|
92947
92956
|
" outside the sandbox \u2014 ",
|
|
92948
92957
|
String(c.reason || "").slice(0, Math.max(20, width - 32))
|
|
92949
|
-
] }) : null
|
|
92950
|
-
c.diff ? c.diff.split("\n").slice(0, DIFF_TAIL_LINES).map((l, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
92951
|
-
Text2,
|
|
92952
|
-
{
|
|
92953
|
-
color: l.startsWith("+") ? "green" : l.startsWith("-") ? "red" : void 0,
|
|
92954
|
-
dimColor: !l.startsWith("+") && !l.startsWith("-"),
|
|
92955
|
-
children: [
|
|
92956
|
-
" ",
|
|
92957
|
-
l || " "
|
|
92958
|
-
]
|
|
92959
|
-
},
|
|
92960
|
-
i
|
|
92961
|
-
)) : null,
|
|
92962
|
-
c.diff && c.diff.split("\n").length > DIFF_TAIL_LINES ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: ` the whole change (${c.diff.split("\n").length} lines) is above` }) : null
|
|
92958
|
+
] }) : null
|
|
92963
92959
|
] }, c.id))
|
|
92964
92960
|
] }),
|
|
92965
92961
|
looking && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box2, { flexDirection: "column", borderStyle: "round", borderColor: "magenta", paddingX: 1, marginTop: 1, children: [
|
|
@@ -93273,7 +93269,7 @@ init_install();
|
|
|
93273
93269
|
await init_theme();
|
|
93274
93270
|
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
|
|
93275
93271
|
import { spawnSync as spawnSync6 } from "node:child_process";
|
|
93276
|
-
var MINE3 = true ? "0.2.
|
|
93272
|
+
var MINE3 = true ? "0.2.29" : "0.0.0";
|
|
93277
93273
|
var layout = installLayout();
|
|
93278
93274
|
function completeInstall() {
|
|
93279
93275
|
if (layout.kind !== "npm" || !needsInstall(MINE3)) return;
|