@metaphi-ai/hum 0.1.13 → 0.1.14
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 +51 -20
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -83576,6 +83576,32 @@ 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
|
+
}
|
|
83593
|
+
function mcpLines(ev) {
|
|
83594
|
+
const servers = ev && ev.mcp || [];
|
|
83595
|
+
if (servers.length === 0) {
|
|
83596
|
+
return ["no MCP servers in this session \u2014 add one to ~/.hum/config.toml ([[mcp]] with a name and a url or a command); the ones your deployment provides arrive when you sign in"];
|
|
83597
|
+
}
|
|
83598
|
+
return servers.map((s) => {
|
|
83599
|
+
const at = s.url || s.command || "";
|
|
83600
|
+
if (s.error) return `${s.name} \xB7 ${at} \xB7 not mounted \u2014 ${s.error}`;
|
|
83601
|
+
const n = (s.tools || []).length;
|
|
83602
|
+
return `${s.name} \xB7 ${at} \xB7 ${n} tool${n === 1 ? "" : "s"}${n ? `: ${s.tools.join(", ")}` : ""}`;
|
|
83603
|
+
});
|
|
83604
|
+
}
|
|
83579
83605
|
|
|
83580
83606
|
// src/update.js
|
|
83581
83607
|
import fs2 from "node:fs";
|
|
@@ -83828,6 +83854,7 @@ var input_default = MultilineInput;
|
|
|
83828
83854
|
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
|
83829
83855
|
var fmtDur = (s) => s < 60 ? `${Math.max(1, Math.round(s))}s` : `${Math.floor(s / 60)}m ${Math.round(s % 60)}s`;
|
|
83830
83856
|
var plural = (n, w) => `${n} ${w}${n === 1 ? "" : "s"}`;
|
|
83857
|
+
var firstResp = (e) => e.first_response_s ? ` \xB7 first response ${e.first_response_s.toFixed(1)}s` : "";
|
|
83831
83858
|
var shortSession = (name) => (name || "").replace(/\.jsonl$/, "");
|
|
83832
83859
|
var homeRel = (p) => {
|
|
83833
83860
|
const h = os4.homedir();
|
|
@@ -83871,13 +83898,14 @@ var COMMANDS = [
|
|
|
83871
83898
|
{ name: "/approve", desc: "approvals on|off \u2014 whether every change and command waits for you first (leaving the sandbox always asks)" },
|
|
83872
83899
|
{ name: "/continue", desc: "after a pause: let the agent carry on" },
|
|
83873
83900
|
{ name: "/image", desc: "attach an image file to your next message (/image <path>); ctrl+v pastes a screenshot" },
|
|
83874
|
-
{ name: "/
|
|
83901
|
+
{ name: "/mcp", desc: "the MCP servers in this session \u2014 what each mounted, and any that did not" },
|
|
83902
|
+
{ name: "/tools", desc: "the tools the model has, and the sandbox they run in" },
|
|
83875
83903
|
{ name: "/hooks", desc: "the lifecycle hooks in scope (~/.hum/hooks.json, <repo>/.hum/hooks.json; Claude Code and Codex hook files too)" },
|
|
83876
83904
|
{ name: "/help", desc: "keys and commands" },
|
|
83877
83905
|
{ name: "/quit", desc: "leave; the session keeps running (hum brings you back)" },
|
|
83878
83906
|
{ name: "/stop", desc: "end this session's engine (the record is saved)" }
|
|
83879
83907
|
];
|
|
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";
|
|
83908
|
+
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
83909
|
var DIFF_TAIL_LINES = 20;
|
|
83882
83910
|
var OUTPUT_MAX_LINES = 200;
|
|
83883
83911
|
var ERR_TAIL_LINES = 5;
|
|
@@ -83987,13 +84015,8 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
83987
84015
|
setMeter((m) => ({ ...m, tokens: 0, cap: ev.compact_at || 0 }));
|
|
83988
84016
|
setGate(ev.gate === "approve" ? "approve" : "off");
|
|
83989
84017
|
if (ev.session) setSession(ev.session);
|
|
83990
|
-
const state = ev.state && ev.state !== "new" && ev.state !== "idle" ? ` \xB7 ${ev.state}` : "";
|
|
83991
84018
|
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
|
-
});
|
|
84019
|
+
append({ kind: "banner", lines: bannerLines(ev, homeRel), instruction: ev.session ? ev.instruction : null });
|
|
83997
84020
|
if (ev.note) append({ kind: "warn", text: ev.note });
|
|
83998
84021
|
preHello.current.forEach((it) => append(it));
|
|
83999
84022
|
preHello.current = [];
|
|
@@ -84051,7 +84074,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84051
84074
|
break;
|
|
84052
84075
|
}
|
|
84053
84076
|
case "turn_end":
|
|
84054
|
-
append({ kind: "turn", text: `${fmtDur(it.elapsed_s || 0)} \xB7 ${plural(it.turns, "step")} \xB7 ${fmtCost(it.cost_usd)} session` });
|
|
84077
|
+
append({ kind: "turn", text: `${fmtDur(it.elapsed_s || 0)} \xB7 ${plural(it.turns, "step")} \xB7 ${fmtCost(it.cost_usd)} session${firstResp(it)}` });
|
|
84055
84078
|
setSpend(it.cost_usd || 0);
|
|
84056
84079
|
break;
|
|
84057
84080
|
case "agent_start":
|
|
@@ -84206,7 +84229,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84206
84229
|
setSpend(ev.cost_usd);
|
|
84207
84230
|
const dur = turnT0.current ? fmtDur((Date.now() - turnT0.current) / 1e3) : fmtDur(ev.elapsed_s);
|
|
84208
84231
|
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}` : "") });
|
|
84232
|
+
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
84233
|
setPhaseBoth("idle");
|
|
84211
84234
|
setStatus("");
|
|
84212
84235
|
break;
|
|
@@ -84248,7 +84271,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84248
84271
|
(0, import_react24.useEffect)(() => {
|
|
84249
84272
|
if (!hello) return void 0;
|
|
84250
84273
|
let live = true;
|
|
84251
|
-
updateNotice(true ? "0.1.
|
|
84274
|
+
updateNotice(true ? "0.1.14" : hello.version || "0.0.0").then((line) => {
|
|
84252
84275
|
if (live && line) append({ kind: "info", text: line });
|
|
84253
84276
|
}).catch(() => {
|
|
84254
84277
|
});
|
|
@@ -84396,7 +84419,10 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84396
84419
|
else engine2.send({ cmd: "attach", path: arg });
|
|
84397
84420
|
break;
|
|
84398
84421
|
case "/tools":
|
|
84399
|
-
append({ kind: "info", text: (hello?.tools || []).join(", ") });
|
|
84422
|
+
append({ kind: "info", text: `${(hello?.tools || []).join(", ")} \xB7 sandbox: ${hello?.sandbox || "none"}` });
|
|
84423
|
+
break;
|
|
84424
|
+
case "/mcp":
|
|
84425
|
+
mcpLines(hello).forEach((t) => append({ kind: "info", text: t }));
|
|
84400
84426
|
break;
|
|
84401
84427
|
case "/hooks":
|
|
84402
84428
|
engine2.send({ cmd: "hooks" });
|
|
@@ -84462,13 +84488,18 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84462
84488
|
WORDMARK.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, bold: true, children: row }, i)),
|
|
84463
84489
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: TAGLINE })
|
|
84464
84490
|
] }),
|
|
84465
|
-
item.kind === "banner" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, {
|
|
84466
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
84467
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, bold: true, children:
|
|
84468
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor:
|
|
84469
|
-
] }),
|
|
84470
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.
|
|
84471
|
-
|
|
84491
|
+
item.kind === "banner" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 1, children: [
|
|
84492
|
+
MASCOT.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { children: [
|
|
84493
|
+
/* @__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 }) }),
|
|
84494
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { bold: i === 0, dimColor: i !== 0, children: item.lines[i] || "" })
|
|
84495
|
+
] }, i)),
|
|
84496
|
+
item.instruction ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { children: [
|
|
84497
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { width: MASCOT_WIDTH + 2, flexShrink: 0 }),
|
|
84498
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { dimColor: true, children: [
|
|
84499
|
+
"\u276F ",
|
|
84500
|
+
item.instruction.split("\n")[0].slice(0, width - MASCOT_WIDTH - 6)
|
|
84501
|
+
] })
|
|
84502
|
+
] }) : null
|
|
84472
84503
|
] }),
|
|
84473
84504
|
item.kind === "hum" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { children: [
|
|
84474
84505
|
/* @__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 +84976,7 @@ import { spawnSync as spawnSync3 } from "node:child_process";
|
|
|
84945
84976
|
var ENGINE_COMMANDS = /* @__PURE__ */ new Set(["run", "login", "logout", "whoami", "model", "key", "sessions", "show", "sync", "skill", "ps", "stop", "hooks", "engine"]);
|
|
84946
84977
|
var argv0 = process.argv.slice(2);
|
|
84947
84978
|
if (argv0[0] === "--version" || argv0[0] === "-V") {
|
|
84948
|
-
process.stdout.write(`hum ${true ? "0.1.
|
|
84979
|
+
process.stdout.write(`hum ${true ? "0.1.14" : "0.0.0"}
|
|
84949
84980
|
`);
|
|
84950
84981
|
process.exit(0);
|
|
84951
84982
|
}
|