@metaphi-ai/hum 0.1.13 → 0.1.15

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 +40 -20
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -83576,6 +83576,20 @@ var WORDMARK = [
83576
83576
  "\u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D"
83577
83577
  ];
83578
83578
  var TAGLINE = "\u0939\u092E \xB7 human and model, one harness";
83579
+ var MASCOT = [
83580
+ " \u2584\u2584 \u2584\u2588\u2598",
83581
+ "\u2584\u2584\u259F\u2599\u2588\u2588\u2588\u2599\u2596",
83582
+ " \u2580\u259C\u2588\u259B\u2599\u259A\u2596"
83583
+ ];
83584
+ var MASCOT_WIDTH = 10;
83585
+
83586
+ // src/banner.js
83587
+ function bannerLines(ev, homeRel2 = (p) => p) {
83588
+ const state = ev.state && ev.state !== "new" && ev.state !== "idle" ? ` \xB7 ${ev.state}` : "";
83589
+ const where = `${homeRel2(ev.cwd || "")}${ev.workspace ? ` \xB7 ${ev.workspace}` : ""}`;
83590
+ const agents = ev.agents_model ? ` \xB7 agents on ${ev.agents_model}` : "";
83591
+ return [`hum ${ev.version || ""}`.trim() + state, `${ev.model || ""}${agents}${ev.user ? ` \xB7 ${ev.user}` : ""}`, where];
83592
+ }
83579
83593
 
83580
83594
  // src/update.js
83581
83595
  import fs2 from "node:fs";
@@ -83828,6 +83842,7 @@ var input_default = MultilineInput;
83828
83842
  var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
83829
83843
  var fmtDur = (s) => s < 60 ? `${Math.max(1, Math.round(s))}s` : `${Math.floor(s / 60)}m ${Math.round(s % 60)}s`;
83830
83844
  var plural = (n, w) => `${n} ${w}${n === 1 ? "" : "s"}`;
83845
+ var firstResp = (e) => e.first_response_s ? ` \xB7 first response ${e.first_response_s.toFixed(1)}s` : "";
83831
83846
  var shortSession = (name) => (name || "").replace(/\.jsonl$/, "");
83832
83847
  var homeRel = (p) => {
83833
83848
  const h = os4.homedir();
@@ -83871,13 +83886,14 @@ var COMMANDS = [
83871
83886
  { name: "/approve", desc: "approvals on|off \u2014 whether every change and command waits for you first (leaving the sandbox always asks)" },
83872
83887
  { name: "/continue", desc: "after a pause: let the agent carry on" },
83873
83888
  { name: "/image", desc: "attach an image file to your next message (/image <path>); ctrl+v pastes a screenshot" },
83874
- { name: "/tools", desc: "what is mounted" },
83889
+ { name: "/mcp", desc: "the MCP servers in this session \u2014 what each mounted, and any that did not" },
83890
+ { name: "/tools", desc: "the tools the model has, and the sandbox they run in" },
83875
83891
  { name: "/hooks", desc: "the lifecycle hooks in scope (~/.hum/hooks.json, <repo>/.hum/hooks.json; Claude Code and Codex hook files too)" },
83876
83892
  { name: "/help", desc: "keys and commands" },
83877
83893
  { name: "/quit", desc: "leave; the session keeps running (hum brings you back)" },
83878
83894
  { name: "/stop", desc: "end this session's engine (the record is saved)" }
83879
83895
  ];
83880
- var HELP = "!cmd runs a command as you \xB7 esc interrupts the model (what it had is kept) \xB7 type while it works to steer \xB7 edit files in your editor any time (recorded as your turn) \xB7 ctrl+o shows the full output of the last tool result \xB7 ctrl+v pastes a screenshot from the clipboard \xB7 @path.png or /image <path> attaches an image file \xB7 commands run in a sandbox (writes in the working directory, no network); leaving it asks you first (enter approves, a typed reason rejects) \xB7 /approve makes every change and command wait for you \xB7 /resume picks a past session (a running one attaches) \xB7 /compact restarts the context from a summary \xB7 ctrl+c twice leaves and the session keeps running (`hum` brings you back) \xB7 /stop ends it";
83896
+ var HELP = "!cmd runs a command as you \xB7 esc interrupts the model (what it had is kept) \xB7 type while it works to steer \xB7 edit files in your editor any time (recorded as your turn) \xB7 ctrl+o shows the full output of the last tool result \xB7 ctrl+v pastes a screenshot from the clipboard \xB7 @path.png or /image <path> attaches an image file \xB7 commands run in a sandbox (writes in the working directory, no network); leaving it asks you first (enter approves, a typed reason rejects) \xB7 /approve makes every change and command wait for you \xB7 /mcp lists the tool servers \xB7 /resume picks a past session (a running one attaches) \xB7 /compact restarts the context from a summary \xB7 ctrl+c twice leaves and the session keeps running (`hum` brings you back) \xB7 /stop ends it";
83881
83897
  var DIFF_TAIL_LINES = 20;
83882
83898
  var OUTPUT_MAX_LINES = 200;
83883
83899
  var ERR_TAIL_LINES = 5;
@@ -83987,13 +84003,8 @@ function App2({ engine: engine2, task, resume, images = [] }) {
83987
84003
  setMeter((m) => ({ ...m, tokens: 0, cap: ev.compact_at || 0 }));
83988
84004
  setGate(ev.gate === "approve" ? "approve" : "off");
83989
84005
  if (ev.session) setSession(ev.session);
83990
- const state = ev.state && ev.state !== "new" && ev.state !== "idle" ? ` \xB7 ${ev.state}` : "";
83991
84006
  if (ev.fresh) append({ kind: "wordmark" });
83992
- append({
83993
- kind: "banner",
83994
- text: `${ev.model}${ev.user ? ` \xB7 ${ev.user}` : ""} \xB7 ${homeRel(ev.cwd)} \xB7 tools: ${ev.tools.join(", ")}${ev.sandbox ? ` \xB7 sandbox: ${ev.sandbox}` : ""}${ev.workspace ? ` \xB7 ${ev.workspace}` : ""}${state}`,
83995
- instruction: ev.session ? ev.instruction : null
83996
- });
84007
+ append({ kind: "banner", lines: bannerLines(ev, homeRel), instruction: ev.session ? ev.instruction : null });
83997
84008
  if (ev.note) append({ kind: "warn", text: ev.note });
83998
84009
  preHello.current.forEach((it) => append(it));
83999
84010
  preHello.current = [];
@@ -84051,7 +84062,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
84051
84062
  break;
84052
84063
  }
84053
84064
  case "turn_end":
84054
- append({ kind: "turn", text: `${fmtDur(it.elapsed_s || 0)} \xB7 ${plural(it.turns, "step")} \xB7 ${fmtCost(it.cost_usd)} session` });
84065
+ append({ kind: "turn", text: `${fmtDur(it.elapsed_s || 0)} \xB7 ${plural(it.turns, "step")} \xB7 ${fmtCost(it.cost_usd)} session${firstResp(it)}` });
84055
84066
  setSpend(it.cost_usd || 0);
84056
84067
  break;
84057
84068
  case "agent_start":
@@ -84206,7 +84217,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
84206
84217
  setSpend(ev.cost_usd);
84207
84218
  const dur = turnT0.current ? fmtDur((Date.now() - turnT0.current) / 1e3) : fmtDur(ev.elapsed_s);
84208
84219
  turnT0.current = null;
84209
- append({ kind: "turn", text: `${dur} \xB7 ${plural(ev.turns, "step")} \xB7 ${fmtCost(ev.cost_usd)} session` + (ev.stop_reason !== "done" && !String(ev.stop_reason).startsWith("paused") ? ` \xB7 stopped: ${ev.stop_reason}` : "") });
84220
+ append({ kind: "turn", text: `${dur} \xB7 ${plural(ev.turns, "step")} \xB7 ${fmtCost(ev.cost_usd)} session${firstResp(ev)}` + (ev.stop_reason !== "done" && !String(ev.stop_reason).startsWith("paused") ? ` \xB7 stopped: ${ev.stop_reason}` : "") });
84210
84221
  setPhaseBoth("idle");
84211
84222
  setStatus("");
84212
84223
  break;
@@ -84248,7 +84259,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
84248
84259
  (0, import_react24.useEffect)(() => {
84249
84260
  if (!hello) return void 0;
84250
84261
  let live = true;
84251
- updateNotice(true ? "0.1.13" : hello.version || "0.0.0").then((line) => {
84262
+ updateNotice(true ? "0.1.15" : hello.version || "0.0.0").then((line) => {
84252
84263
  if (live && line) append({ kind: "info", text: line });
84253
84264
  }).catch(() => {
84254
84265
  });
@@ -84396,7 +84407,11 @@ function App2({ engine: engine2, task, resume, images = [] }) {
84396
84407
  else engine2.send({ cmd: "attach", path: arg });
84397
84408
  break;
84398
84409
  case "/tools":
84399
- append({ kind: "info", text: (hello?.tools || []).join(", ") });
84410
+ append({ kind: "info", text: `${(hello?.tools || []).join(", ")} \xB7 sandbox: ${hello?.sandbox || "none"}` });
84411
+ break;
84412
+ case "/mcp":
84413
+ if (hello?.mcp === void 0) append({ kind: "warn", text: "this engine does not say what is mounted; update hum (/stop, then hum)" });
84414
+ else engine2.send({ cmd: "mcp" });
84400
84415
  break;
84401
84416
  case "/hooks":
84402
84417
  engine2.send({ cmd: "hooks" });
@@ -84462,13 +84477,18 @@ function App2({ engine: engine2, task, resume, images = [] }) {
84462
84477
  WORDMARK.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, bold: true, children: row }, i)),
84463
84478
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: TAGLINE })
84464
84479
  ] }),
84465
- item.kind === "banner" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { borderStyle: "round", borderColor: ACCENT, paddingX: 2, flexDirection: "column", alignSelf: "flex-start", children: [
84466
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { children: [
84467
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, bold: true, children: "\u2733 hum " }),
84468
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: "\u0939\u092E" })
84469
- ] }),
84470
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: item.text }),
84471
- item.instruction ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: item.instruction.split("\n")[0].slice(0, width - 8) }) : null
84480
+ item.kind === "banner" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 1, children: [
84481
+ MASCOT.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { children: [
84482
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { width: MASCOT_WIDTH + 2, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, bold: true, children: row }) }),
84483
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { bold: i === 0, dimColor: i !== 0, children: item.lines[i] || "" })
84484
+ ] }, i)),
84485
+ item.instruction ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { children: [
84486
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { width: MASCOT_WIDTH + 2, flexShrink: 0 }),
84487
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { dimColor: true, children: [
84488
+ "\u276F ",
84489
+ item.instruction.split("\n")[0].slice(0, width - MASCOT_WIDTH - 6)
84490
+ ] })
84491
+ ] }) : null
84472
84492
  ] }),
84473
84493
  item.kind === "hum" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { children: [
84474
84494
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { width: 2, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, children: "\u25CF" }) }),
@@ -84945,7 +84965,7 @@ import { spawnSync as spawnSync3 } from "node:child_process";
84945
84965
  var ENGINE_COMMANDS = /* @__PURE__ */ new Set(["run", "login", "logout", "whoami", "model", "key", "sessions", "show", "sync", "skill", "ps", "stop", "hooks", "engine"]);
84946
84966
  var argv0 = process.argv.slice(2);
84947
84967
  if (argv0[0] === "--version" || argv0[0] === "-V") {
84948
- process.stdout.write(`hum ${true ? "0.1.13" : "0.0.0"}
84968
+ process.stdout.write(`hum ${true ? "0.1.15" : "0.0.0"}
84949
84969
  `);
84950
84970
  process.exit(0);
84951
84971
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metaphi-ai/hum",
3
- "version": "0.1.13",
3
+ "version": "0.1.15",
4
4
  "description": "Hum (हम): a self-improving coding agent for your terminal.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",