@metaphi-ai/hum 0.2.46 → 0.2.48

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 +48 -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.46" : "";
89511
+ MINE = true ? "0.2.48" : "";
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.46" : ""
89866
+ tui: true ? "0.2.48" : ""
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.46" : "" } = {}) {
89869
+ function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.2.48" : "" } = {}) {
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.46" : "";
91384
+ var MINE2 = true ? "0.2.48" : "";
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,30 @@ 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 pad2 = " ".repeat(indent);
91554
+ if (!about || !about.length) {
91555
+ if (!tools || !tools.length) return null;
91556
+ const cell2 = Math.max(...tools.map((t) => t.length)) + 2;
91557
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box2, { flexDirection: "row", flexWrap: "wrap", paddingLeft: 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)) });
91558
+ }
91559
+ const width = Math.max(...about.map((t) => t.name.length));
91560
+ const rows = [];
91561
+ let group = null;
91562
+ for (const t of about) {
91563
+ if (t.group && t.group !== group) {
91564
+ group = t.group;
91565
+ rows.push(/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { color: ACCENT, children: `${pad2}${group}` }, `g:${group}`));
91566
+ }
91567
+ rows.push(
91568
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text2, { children: [
91569
+ `${pad2}${group ? " " : ""}${t.name.padEnd(width)} `,
91570
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: t.summary || "" })
91571
+ ] }, t.name)
91572
+ );
91573
+ }
91574
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Box2, { flexDirection: "column", children: rows });
91575
+ }
91552
91576
  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
91577
  var serverActions = (s) => [
91554
91578
  { do: "tools", label: "show tools" },
@@ -92796,7 +92820,7 @@ ${r.content}`).join("\n\n") };
92796
92820
  else if (key.return) {
92797
92821
  setPicker(null);
92798
92822
  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` });
92823
+ if (act.do === "tools") append({ kind: "tools", servers: [s] });
92800
92824
  else {
92801
92825
  wantServer.current = false;
92802
92826
  core2.send({ cmd: "mcp", name: s.name, do: act.do });
@@ -93046,7 +93070,7 @@ ${r.content}`).join("\n\n") };
93046
93070
  else core2.send({ cmd: "attach", path: arg });
93047
93071
  break;
93048
93072
  case "/tools":
93049
- append({ kind: "info", text: `${(hello?.tools || []).join(", ")} \xB7 sandbox: ${hello?.sandbox || "none"}` });
93073
+ append({ kind: "tools", own: (hello?.tools || []).filter((t) => !t.includes("__")).sort(), sandbox: hello?.sandbox || "none", servers: hello?.mcp || [] });
93050
93074
  break;
93051
93075
  case "/mcp":
93052
93076
  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 +93415,27 @@ ${r.content}`).join("\n\n") };
93391
93415
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { bold: true, children: s.name }),
93392
93416
  /* @__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
93417
  ] }),
93394
- s.tools.length ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: ` ${s.tools.join(" \xB7 ")}` }) : null
93418
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ToolList, { about: s.about, tools: s.tools })
93395
93419
  ] }, s.name))
93396
93420
  ] }, src);
93397
93421
  })
93398
93422
  ] }),
93423
+ item.kind === "tools" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box2, { flexDirection: "column", children: [
93424
+ item.own && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box2, { flexDirection: "column", children: [
93425
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text2, { children: [
93426
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { bold: true, color: ACCENT, children: "hum" }),
93427
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: ` \xB7 ${item.own.length} tools \xB7 sandbox: ${item.sandbox}` })
93428
+ ] }),
93429
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ToolList, { tools: item.own, indent: 2 })
93430
+ ] }),
93431
+ (item.servers || []).map((s) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box2, { flexDirection: "column", marginTop: item.own ? 1 : 0, children: [
93432
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Text2, { children: [
93433
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { bold: true, color: ACCENT, children: s.name }),
93434
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: ` \xB7 ${(s.tools || []).length} tool${(s.tools || []).length === 1 ? "" : "s"}` })
93435
+ ] }),
93436
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ToolList, { about: s.about, tools: s.tools, indent: 2 })
93437
+ ] }, s.name))
93438
+ ] }),
93399
93439
  item.kind === "info" && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { dimColor: true, children: item.text }),
93400
93440
  item.kind === "help" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Box2, { flexDirection: "column", paddingLeft: 1, children: [
93401
93441
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Text2, { bold: true, children: "commands" }),
@@ -93958,7 +93998,7 @@ async function sendPending({
93958
93998
  await init_theme();
93959
93999
  var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
93960
94000
  import { spawnSync as spawnSync6 } from "node:child_process";
93961
- var MINE3 = true ? "0.2.46" : "0.0.0";
94001
+ var MINE3 = true ? "0.2.48" : "0.0.0";
93962
94002
  var layout = installLayout();
93963
94003
  function completeInstall() {
93964
94004
  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.46",
3
+ "version": "0.2.48",
4
4
  "description": "Hum: a self-improving coding agent for your terminal.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",