@metaphi-ai/hum 0.2.54 → 0.2.56
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 +29 -29
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -43266,7 +43266,7 @@ var require_utils = __commonJS({
|
|
|
43266
43266
|
}
|
|
43267
43267
|
return output;
|
|
43268
43268
|
}
|
|
43269
|
-
function
|
|
43269
|
+
function hyperlink2(url, text) {
|
|
43270
43270
|
const OSC3 = "\x1B]";
|
|
43271
43271
|
const BEL4 = "\x07";
|
|
43272
43272
|
const SEP2 = ";";
|
|
@@ -43280,7 +43280,7 @@ var require_utils = __commonJS({
|
|
|
43280
43280
|
mergeOptions,
|
|
43281
43281
|
wordWrap: multiLineWordWrap,
|
|
43282
43282
|
colorizeLines,
|
|
43283
|
-
hyperlink
|
|
43283
|
+
hyperlink: hyperlink2
|
|
43284
43284
|
};
|
|
43285
43285
|
}
|
|
43286
43286
|
});
|
|
@@ -89511,7 +89511,7 @@ var init_install = __esm({
|
|
|
89511
89511
|
"src/install.js"() {
|
|
89512
89512
|
init_define_HUM_CORE_SUBS();
|
|
89513
89513
|
win = process.platform === "win32";
|
|
89514
|
-
MINE = true ? "0.2.
|
|
89514
|
+
MINE = true ? "0.2.56" : "";
|
|
89515
89515
|
npmFix = (version = "") => `npm i -g @metaphi-ai/hum@${version || "latest"} --foreground-scripts`;
|
|
89516
89516
|
NPM_FIX = npmFix("latest");
|
|
89517
89517
|
humHome = (env3 = process.env) => env3.HUM_HOME || path.join(os3.homedir(), ".hum");
|
|
@@ -89866,10 +89866,10 @@ function clientEnv() {
|
|
|
89866
89866
|
platform: process.platform,
|
|
89867
89867
|
arch: process.arch,
|
|
89868
89868
|
terminal: process.env.TERM_PROGRAM || (process.env.WT_SESSION ? "Windows Terminal" : process.env.TERM || ""),
|
|
89869
|
-
tui: true ? "0.2.
|
|
89869
|
+
tui: true ? "0.2.56" : ""
|
|
89870
89870
|
};
|
|
89871
89871
|
}
|
|
89872
|
-
function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.2.
|
|
89872
|
+
function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.2.56" : "" } = {}) {
|
|
89873
89873
|
const refused = failures.find((f) => f.error && f.error.code !== "ENOENT");
|
|
89874
89874
|
const fix = npm ? npmFix(version) : updateCommand({ kind: "native" }, platform2);
|
|
89875
89875
|
if (!refused) {
|
|
@@ -91384,7 +91384,7 @@ var after = (ms, fn) => {
|
|
|
91384
91384
|
|
|
91385
91385
|
// src/app.jsx
|
|
91386
91386
|
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
91387
|
-
var MINE2 = true ? "0.2.
|
|
91387
|
+
var MINE2 = true ? "0.2.56" : "";
|
|
91388
91388
|
var fmtDur = (s) => s < 60 ? `${Math.max(1, Math.round(s))}s` : `${Math.floor(s / 60)}m ${Math.round(s % 60)}s`;
|
|
91389
91389
|
var plural = (n, w) => `${n} ${w}${n === 1 ? "" : "s"}`;
|
|
91390
91390
|
var shortSession = (name) => (name || "").replace(/\.jsonl$/, "");
|
|
@@ -91574,32 +91574,21 @@ function ToolList({ about, tools, indent = 4 }) {
|
|
|
91574
91574
|
] }) }, t.name);
|
|
91575
91575
|
}) });
|
|
91576
91576
|
}
|
|
91577
|
-
var INSTRUCTION_LINES = 8;
|
|
91578
91577
|
var serverAbout = (s) => {
|
|
91579
91578
|
const info = s.server || {};
|
|
91580
|
-
const lines = String(typeof s.instructions === "string" ? s.instructions : "").replace(/\r/g, "").split("\n").map((l) => l.trimEnd());
|
|
91581
|
-
while (lines.length && !lines[0].trim()) lines.shift();
|
|
91582
|
-
const subtitle = info.description || lines[0] || "";
|
|
91583
|
-
if (lines.length && lines[0].trim() === subtitle.trim()) lines.shift();
|
|
91584
|
-
while (lines.length && !lines[0].trim()) lines.shift();
|
|
91585
|
-
while (lines.length && !lines.at(-1).trim()) lines.pop();
|
|
91586
|
-
const body = lines.filter((l, i) => l.trim() || (lines[i - 1] || "").trim());
|
|
91587
91579
|
const version = info.version ? /^v\d/.test(info.version) ? info.version : `v${info.version}` : "";
|
|
91588
91580
|
return {
|
|
91589
91581
|
title: info.title || s.name,
|
|
91590
91582
|
name: info.title && info.title !== s.name ? s.name : "",
|
|
91591
91583
|
version,
|
|
91592
91584
|
website: info.website || "",
|
|
91593
|
-
subtitle
|
|
91594
|
-
body
|
|
91585
|
+
subtitle: info.description || ""
|
|
91595
91586
|
};
|
|
91596
91587
|
};
|
|
91597
|
-
function ServerDetail({ s
|
|
91588
|
+
function ServerDetail({ s }) {
|
|
91598
91589
|
const { stdout } = use_stdout_default();
|
|
91599
91590
|
const cols = Math.max(40, stdout && stdout.columns || 100);
|
|
91600
91591
|
const a = serverAbout(s);
|
|
91601
|
-
const shown = full ? a.body : a.body.slice(0, INSTRUCTION_LINES);
|
|
91602
|
-
const more = a.body.length - shown.length;
|
|
91603
91592
|
const meta = [a.name, a.version, a.website].filter(Boolean).join(" \xB7 ");
|
|
91604
91593
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box2, { flexDirection: "column", children: [
|
|
91605
91594
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box2, { flexDirection: "column", paddingLeft: 1, width: cols, children: [
|
|
@@ -91613,11 +91602,7 @@ function ServerDetail({ s, full = false }) {
|
|
|
91613
91602
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: `${serverLine(s)} \xB7 ${s.at}` })
|
|
91614
91603
|
] })
|
|
91615
91604
|
] }),
|
|
91616
|
-
|
|
91617
|
-
shown.map((l, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { wrap: "wrap", dimColor: !full, children: l || " " }, i)),
|
|
91618
|
-
more > 0 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: `\u2026 ${more} more line${more === 1 ? "" : "s"} \xB7 e shows all` }) : null
|
|
91619
|
-
] }) : null,
|
|
91620
|
-
!full && (s.about?.length || s.tools?.length) ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box2, { flexDirection: "column", marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ToolList, { about: s.about, tools: s.tools, indent: 3 }) }) : null
|
|
91605
|
+
s.about?.length || s.tools?.length ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box2, { flexDirection: "column", marginTop: 1, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ToolList, { about: s.about, tools: s.tools, indent: 3 }) }) : null
|
|
91621
91606
|
] });
|
|
91622
91607
|
}
|
|
91623
91608
|
var serverLine = (s) => s.state === "connected" ? `connected \xB7 ${s.tools.length} tool${s.tools.length === 1 ? "" : "s"}${s.signed_in ? " \xB7 signed in" : ""}` : s.state;
|
|
@@ -91689,7 +91674,13 @@ var ToolRow = ({ text, tail: tail2 }) => /* @__PURE__ */ (0, import_jsx_runtime3
|
|
|
91689
91674
|
tail2 ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: tail2 }) : null
|
|
91690
91675
|
] })
|
|
91691
91676
|
] });
|
|
91692
|
-
var CONTINUES = /* @__PURE__ */ new Set(["tool_result", "diff", "errtail", "spool", "agent_end", "thought"]);
|
|
91677
|
+
var CONTINUES = /* @__PURE__ */ new Set(["tool_result", "diff", "errtail", "spool", "link", "agent_end", "thought"]);
|
|
91678
|
+
var hyperlink = (url, text = url) => `\x1B]8;;${url}\x07${text}\x1B]8;;\x07`;
|
|
91679
|
+
var LINKS_SHOWN = 8;
|
|
91680
|
+
var linkRows = (links) => [
|
|
91681
|
+
...(links || []).slice(0, LINKS_SHOWN).map((l) => ({ kind: "link", title: l.title, url: l.url })),
|
|
91682
|
+
...(links || []).length > LINKS_SHOWN ? [{ kind: "link", more: links.length - LINKS_SHOWN }] : []
|
|
91683
|
+
];
|
|
91693
91684
|
var continuesBlock = (item) => !!item.agent || CONTINUES.has(item.kind);
|
|
91694
91685
|
var blockGap = (item) => continuesBlock(item) ? 0 : 1;
|
|
91695
91686
|
var rowStands = (call) => !!call && (call.lines != null || !!call.diff);
|
|
@@ -92221,6 +92212,7 @@ ${r.content}`).join("\n\n") };
|
|
|
92221
92212
|
const rowOf2 = (n) => ({ kind: "tool_result", text: `${it.summary || "(no output)"}${more(n)}`, isError: !it.ok, agent: it.agent });
|
|
92222
92213
|
if (it.agent) append(rowOf2(0));
|
|
92223
92214
|
else landResult(it, it.ok && rowStands(toolsRef.current[it.id]) ? null : rowOf2);
|
|
92215
|
+
if (!it.agent) linkRows(it.links).forEach(push);
|
|
92224
92216
|
break;
|
|
92225
92217
|
}
|
|
92226
92218
|
case "plan":
|
|
@@ -92356,6 +92348,7 @@ ${r.content}`).join("\n\n") };
|
|
|
92356
92348
|
if (t.length > 1) push({ kind: "errtail", lines: t });
|
|
92357
92349
|
}
|
|
92358
92350
|
if (ev.spool) push({ kind: "spool", text: `${ev.spool}/` });
|
|
92351
|
+
linkRows(ev.links).forEach(push);
|
|
92359
92352
|
break;
|
|
92360
92353
|
}
|
|
92361
92354
|
case "plan": {
|
|
@@ -92867,7 +92860,6 @@ ${r.content}`).join("\n\n") };
|
|
|
92867
92860
|
if (key.upArrow) move("action", acts.length, -1);
|
|
92868
92861
|
else if (key.downArrow || key.tab) move("action", acts.length, 1);
|
|
92869
92862
|
else if (key.escape) setPicker((p) => ({ ...p, step: "server" }));
|
|
92870
|
-
else if (input === "e" && serverAbout(s).body.length > INSTRUCTION_LINES) append({ kind: "server", server: s, full: true });
|
|
92871
92863
|
else if (key.return) {
|
|
92872
92864
|
setPicker(null);
|
|
92873
92865
|
const act = acts[picker.action];
|
|
@@ -93432,6 +93424,14 @@ ${r.content}`).join("\n\n") };
|
|
|
93432
93424
|
" \u21B3 ",
|
|
93433
93425
|
item.text
|
|
93434
93426
|
] }),
|
|
93427
|
+
item.kind === "link" && (item.more ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: ` \u2026 +${item.more} more links` }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text2, { children: [
|
|
93428
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text2, { dimColor: true, children: [
|
|
93429
|
+
" \u2197 ",
|
|
93430
|
+
item.title,
|
|
93431
|
+
" "
|
|
93432
|
+
] }),
|
|
93433
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { color: ACCENT, children: hyperlink(item.url) })
|
|
93434
|
+
] })),
|
|
93435
93435
|
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)) }),
|
|
93436
93436
|
item.kind === "output" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box2, { flexDirection: "column", paddingLeft: 4, children: [
|
|
93437
93437
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: `full output \xB7 ${item.name}` }),
|
|
@@ -93471,7 +93471,7 @@ ${r.content}`).join("\n\n") };
|
|
|
93471
93471
|
] }, src);
|
|
93472
93472
|
})
|
|
93473
93473
|
] }),
|
|
93474
|
-
item.kind === "server" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ServerDetail, { s: item.server
|
|
93474
|
+
item.kind === "server" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ServerDetail, { s: item.server }),
|
|
93475
93475
|
item.kind === "tools" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box2, { flexDirection: "column", children: [
|
|
93476
93476
|
item.own && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box2, { flexDirection: "column", children: [
|
|
93477
93477
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text2, { children: [
|
|
@@ -93650,7 +93650,7 @@ ${r.content}`).join("\n\n") };
|
|
|
93650
93650
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { bold: i === picker.action, dimColor: i !== picker.action, children: `${i + 1}. ${a.label}` })
|
|
93651
93651
|
] }, a.do)),
|
|
93652
93652
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { children: " " }),
|
|
93653
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children:
|
|
93653
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: "Enter to choose \xB7 Esc to go back" })
|
|
93654
93654
|
] });
|
|
93655
93655
|
}
|
|
93656
93656
|
const nameW = Math.max(...picker.servers.map((m) => m.name.length));
|
|
@@ -94050,7 +94050,7 @@ async function sendPending({
|
|
|
94050
94050
|
await init_theme();
|
|
94051
94051
|
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
|
|
94052
94052
|
import { spawnSync as spawnSync6 } from "node:child_process";
|
|
94053
|
-
var MINE3 = true ? "0.2.
|
|
94053
|
+
var MINE3 = true ? "0.2.56" : "0.0.0";
|
|
94054
94054
|
var layout = installLayout();
|
|
94055
94055
|
function completeInstall() {
|
|
94056
94056
|
if (layout.kind !== "npm" || !needsInstall(MINE3)) return;
|