@metaphi-ai/hum 0.2.47 → 0.2.49

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.
Files changed (2) hide show
  1. package/dist/cli.mjs +45 -8
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -89508,7 +89508,7 @@ var init_install = __esm({
89508
89508
  "src/install.js"() {
89509
89509
  init_define_HUM_CORE_SUBS();
89510
89510
  win = process.platform === "win32";
89511
- MINE = true ? "0.2.47" : "";
89511
+ MINE = true ? "0.2.49" : "";
89512
89512
  npmFix = (version = "") => `npm i -g @metaphi-ai/hum@${version || "latest"} --foreground-scripts`;
89513
89513
  NPM_FIX = npmFix("latest");
89514
89514
  humHome = (env3 = process.env) => env3.HUM_HOME || path.join(os3.homedir(), ".hum");
@@ -89863,10 +89863,10 @@ function clientEnv() {
89863
89863
  platform: process.platform,
89864
89864
  arch: process.arch,
89865
89865
  terminal: process.env.TERM_PROGRAM || (process.env.WT_SESSION ? "Windows Terminal" : process.env.TERM || ""),
89866
- tui: true ? "0.2.47" : ""
89866
+ tui: true ? "0.2.49" : ""
89867
89867
  };
89868
89868
  }
89869
- function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.2.47" : "" } = {}) {
89869
+ function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.2.49" : "" } = {}) {
89870
89870
  const refused = failures.find((f) => f.error && f.error.code !== "ENOENT");
89871
89871
  const fix = npm ? npmFix(version) : updateCommand({ kind: "native" }, platform2);
89872
89872
  if (!refused) {
@@ -91381,7 +91381,7 @@ var after = (ms, fn) => {
91381
91381
 
91382
91382
  // src/app.jsx
91383
91383
  var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
91384
- var MINE2 = true ? "0.2.47" : "";
91384
+ var MINE2 = true ? "0.2.49" : "";
91385
91385
  var fmtDur = (s) => s < 60 ? `${Math.max(1, Math.round(s))}s` : `${Math.floor(s / 60)}m ${Math.round(s % 60)}s`;
91386
91386
  var plural = (n, w) => `${n} ${w}${n === 1 ? "" : "s"}`;
91387
91387
  var shortSession = (name) => (name || "").replace(/\.jsonl$/, "");
@@ -91549,6 +91549,27 @@ var HELP_PAD = Math.max(...COMMANDS.map((c) => c.name.length));
91549
91549
  var DIFF_TAIL_LINES = 20;
91550
91550
  var PATCH_LINES = 200;
91551
91551
  var NEEDS_EVERY_MS = 1e4;
91552
+ function ToolList({ about, tools, indent = 4 }) {
91553
+ const { stdout } = use_stdout_default();
91554
+ const width = Math.max(40, stdout && stdout.columns || 100) - indent;
91555
+ if (!about || !about.length) {
91556
+ if (!tools || !tools.length) return null;
91557
+ const cell2 = Math.max(...tools.map((t) => t.length)) + 2;
91558
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box2, { flexDirection: "row", flexWrap: "wrap", paddingLeft: indent, width: width + indent, children: tools.map((t) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box2, { width: cell2, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { children: t }) }, t)) });
91559
+ }
91560
+ const gw = Math.max(0, ...about.map((t) => (t.group || "").length));
91561
+ const nw = Math.max(...about.map((t) => t.name.length));
91562
+ let last = null;
91563
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box2, { flexDirection: "column", paddingLeft: indent, children: about.map((t) => {
91564
+ const head = t.group && t.group !== last ? t.group : "";
91565
+ last = t.group || last;
91566
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box2, { width, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text2, { wrap: "truncate-end", children: [
91567
+ gw ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { color: ACCENT, children: `${head.padEnd(gw)} ` }) : null,
91568
+ `${t.name.padEnd(nw)} `,
91569
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: t.summary || "" })
91570
+ ] }) }, t.name);
91571
+ }) });
91572
+ }
91552
91573
  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;
91553
91574
  var serverActions = (s) => [
91554
91575
  { do: "tools", label: "show tools" },
@@ -92796,7 +92817,7 @@ ${r.content}`).join("\n\n") };
92796
92817
  else if (key.return) {
92797
92818
  setPicker(null);
92798
92819
  const act = acts[picker.action];
92799
- if (act.do === "tools") append({ kind: "info", text: s.tools.length ? `${s.name}: ${s.tools.join(", ")}` : `${s.name}: no tools` });
92820
+ if (act.do === "tools") append({ kind: "tools", servers: [s] });
92800
92821
  else {
92801
92822
  wantServer.current = false;
92802
92823
  core2.send({ cmd: "mcp", name: s.name, do: act.do });
@@ -93046,7 +93067,7 @@ ${r.content}`).join("\n\n") };
93046
93067
  else core2.send({ cmd: "attach", path: arg });
93047
93068
  break;
93048
93069
  case "/tools":
93049
- append({ kind: "info", text: `${(hello?.tools || []).join(", ")} \xB7 sandbox: ${hello?.sandbox || "none"}` });
93070
+ append({ kind: "tools", own: (hello?.tools || []).filter((t) => !t.includes("__")).sort(), sandbox: hello?.sandbox || "none", servers: hello?.mcp || [] });
93050
93071
  break;
93051
93072
  case "/mcp":
93052
93073
  if (hello?.mcp === void 0) append({ kind: "warn", text: "this version of hum does not say what is mounted; update hum (/stop, then hum)" });
@@ -93391,11 +93412,27 @@ ${r.content}`).join("\n\n") };
93391
93412
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { bold: true, children: s.name }),
93392
93413
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: ` \xB7 ${serverLine(s)}${s.state === "connected" && s.instructions ? " \xB7 with instructions" : ""} \xB7 ${s.at}` })
93393
93414
  ] }),
93394
- s.tools.length ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: ` ${s.tools.join(" \xB7 ")}` }) : null
93415
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ToolList, { about: s.about, tools: s.tools })
93395
93416
  ] }, s.name))
93396
93417
  ] }, src);
93397
93418
  })
93398
93419
  ] }),
93420
+ item.kind === "tools" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box2, { flexDirection: "column", children: [
93421
+ item.own && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box2, { flexDirection: "column", children: [
93422
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text2, { children: [
93423
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { bold: true, color: ACCENT, children: "hum" }),
93424
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: ` \xB7 ${item.own.length} tools \xB7 sandbox: ${item.sandbox}` })
93425
+ ] }),
93426
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ToolList, { tools: item.own, indent: 2 })
93427
+ ] }),
93428
+ (item.servers || []).map((s) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box2, { flexDirection: "column", marginTop: item.own ? 1 : 0, children: [
93429
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text2, { children: [
93430
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { bold: true, color: ACCENT, children: s.name }),
93431
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: ` \xB7 ${(s.tools || []).length} tool${(s.tools || []).length === 1 ? "" : "s"}` })
93432
+ ] }),
93433
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ToolList, { about: s.about, tools: s.tools, indent: 2 })
93434
+ ] }, s.name))
93435
+ ] }),
93399
93436
  item.kind === "info" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: item.text }),
93400
93437
  item.kind === "help" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box2, { flexDirection: "column", paddingLeft: 1, children: [
93401
93438
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { bold: true, children: "commands" }),
@@ -93958,7 +93995,7 @@ async function sendPending({
93958
93995
  await init_theme();
93959
93996
  var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
93960
93997
  import { spawnSync as spawnSync6 } from "node:child_process";
93961
- var MINE3 = true ? "0.2.47" : "0.0.0";
93998
+ var MINE3 = true ? "0.2.49" : "0.0.0";
93962
93999
  var layout = installLayout();
93963
94000
  function completeInstall() {
93964
94001
  if (layout.kind !== "npm" || !needsInstall(MINE3)) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metaphi-ai/hum",
3
- "version": "0.2.47",
3
+ "version": "0.2.49",
4
4
  "description": "Hum: a self-improving coding agent for your terminal.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",