@metaphi-ai/hum 0.2.23 → 0.2.24

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 +43 -7
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -88639,7 +88639,7 @@ var win, MINE, npmFix, NPM_FIX, humHome, versionsDir, versionDir, pkgDir, coreDi
88639
88639
  var init_install = __esm({
88640
88640
  "src/install.js"() {
88641
88641
  win = process.platform === "win32";
88642
- MINE = true ? "0.2.23" : "";
88642
+ MINE = true ? "0.2.24" : "";
88643
88643
  npmFix = (version = "") => `npm i -g @metaphi-ai/hum@${version || "latest"} --foreground-scripts`;
88644
88644
  NPM_FIX = npmFix("latest");
88645
88645
  humHome = (env3 = process.env) => env3.HUM_HOME || path.join(os3.homedir(), ".hum");
@@ -88975,10 +88975,10 @@ function clientEnv() {
88975
88975
  platform: process.platform,
88976
88976
  arch: process.arch,
88977
88977
  terminal: process.env.TERM_PROGRAM || (process.env.WT_SESSION ? "Windows Terminal" : process.env.TERM || ""),
88978
- tui: true ? "0.2.23" : ""
88978
+ tui: true ? "0.2.24" : ""
88979
88979
  };
88980
88980
  }
88981
- function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.2.23" : "" } = {}) {
88981
+ function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.2.24" : "" } = {}) {
88982
88982
  const refused = failures.find((f) => f.error && f.error.code !== "ENOENT");
88983
88983
  const fix = npm ? npmFix(version) : updateCommand({ kind: "native" }, platform2);
88984
88984
  if (!refused) {
@@ -90514,7 +90514,7 @@ var input_default = MultilineInput;
90514
90514
 
90515
90515
  // src/app.jsx
90516
90516
  var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
90517
- var MINE2 = true ? "0.2.23" : "";
90517
+ var MINE2 = true ? "0.2.24" : "";
90518
90518
  var fmtDur = (s) => s < 60 ? `${Math.max(1, Math.round(s))}s` : `${Math.floor(s / 60)}m ${Math.round(s % 60)}s`;
90519
90519
  var plural = (n, w) => `${n} ${w}${n === 1 ? "" : "s"}`;
90520
90520
  var firstResp = (e) => e.first_response_s ? ` \xB7 first response ${e.first_response_s.toFixed(1)}s` : "";
@@ -90696,6 +90696,7 @@ function App2({ core: core2, task, resume, images = [], peek = peekSession, upda
90696
90696
  const [sendingAsk, setSendingAsk] = (0, import_react36.useState)(null);
90697
90697
  const pendingAsk = (0, import_react36.useRef)(null);
90698
90698
  const [confirm, setConfirm] = (0, import_react36.useState)(null);
90699
+ const [trust, setTrust] = (0, import_react36.useState)(null);
90699
90700
  const [gate, setGate] = (0, import_react36.useState)("off");
90700
90701
  const [paused, setPaused] = (0, import_react36.useState)(false);
90701
90702
  const [reflections, setReflections] = (0, import_react36.useState)([]);
@@ -90812,6 +90813,7 @@ function App2({ core: core2, task, resume, images = [], peek = peekSession, upda
90812
90813
  setPaused(false);
90813
90814
  setPicker(null);
90814
90815
  setConfirm(null);
90816
+ setTrust(null);
90815
90817
  setSpend(0);
90816
90818
  setGoal(null);
90817
90819
  setSession(null);
@@ -91210,6 +91212,9 @@ function App2({ core: core2, task, resume, images = [], peek = peekSession, upda
91210
91212
  setPicker({ kind: "rewind", items: items2, index: want >= 0 ? want : items2.length - 1, top: 0, choice: null });
91211
91213
  break;
91212
91214
  }
91215
+ case "trust":
91216
+ setTrust({ path: ev.path || "", starts: ev.starts || [] });
91217
+ break;
91213
91218
  case "rewind_confirm":
91214
91219
  setPicker(null);
91215
91220
  setConfirm({ node: ev.node, said: ev.said || "", stat: ev.stat || "", why: ev.why || "" });
@@ -91372,7 +91377,7 @@ function App2({ core: core2, task, resume, images = [], peek = peekSession, upda
91372
91377
  }
91373
91378
  return;
91374
91379
  }
91375
- const panelOpen = agents.length > 0 && !value && !picker && !confirm && !proposal && !question && !reflection;
91380
+ const panelOpen = agents.length > 0 && !value && !picker && !confirm && !trust && !proposal && !question && !reflection;
91376
91381
  if (panelOpen && panelIndex < 0 && key.downArrow) {
91377
91382
  setPanelIndex(0);
91378
91383
  return;
@@ -91401,6 +91406,21 @@ function App2({ core: core2, task, resume, images = [], peek = peekSession, upda
91401
91406
  }
91402
91407
  if (input && !key.ctrl && !key.meta && input >= " ") setPanelIndex(-1);
91403
91408
  }
91409
+ if (trust && !picker) {
91410
+ if (input === "y" || key.return) {
91411
+ setTrust(null);
91412
+ core2.send({ cmd: "trust", ok: true });
91413
+ append({ kind: "info", text: `trusted \xB7 ${trust.path}` });
91414
+ return;
91415
+ }
91416
+ if (input === "n" || key.escape) {
91417
+ setTrust(null);
91418
+ core2.send({ cmd: "trust", ok: false });
91419
+ append({ kind: "info", text: "left off \xB7 hum trust allows them later" });
91420
+ return;
91421
+ }
91422
+ return;
91423
+ }
91404
91424
  if (confirm && !picker) {
91405
91425
  if (key.return) {
91406
91426
  setConfirm(null);
@@ -91856,7 +91876,7 @@ function App2({ core: core2, task, resume, images = [], peek = peekSession, upda
91856
91876
  const statusLine = phase === "connecting" ? "starting \u2026" : `${modelRef.current || ""} \xB7 ${fmtCost2(spend)}` + (ctxPct >= 10 ? ` \xB7 ctx ${ctxPct}%` : "") + (gate === "approve" ? " \xB7 approvals on" : "") + (hello && hello.mounting && hello.mounting.length ? ` \xB7 mounting ${hello.mounting.join(", ")}` : "") + (goal && goal.text ? ` \xB7 \u25CE goal ${goal.status || "active"}` : "") + (needYou ? ` \xB7 ${needYou} need you` : "") + (ready ? ` \xB7 restart for hum ${ready}` : "") + (offer ? " \xB7 /accept \xB7 /reject" : "") + (agents.length && panelIndex < 0 && !looking ? " \xB7 \u2193 agents" : "") + (ctrlc ? " \xB7 ctrl+c again to quit" : " \xB7 / for commands");
91857
91877
  const spinnerLabel = phase === "connecting" ? " starting \u2026" : ` ${status || "working"}${elapsed >= 2 ? ` \xB7 ${fmtDur(elapsed)}` : ""}` + (thinkChars.current > 4e3 ? ` \xB7 ${(thinkChars.current / 1e3).toFixed(0)}k thinking` : "");
91858
91878
  const rows = stdout?.rows || DEFAULT_ROWS;
91859
- const chrome = 1 + 2 + 4 + (value.split("\n").length - 1) + 1 + (menu.length ? menu.length : 0) + (!menu.length && agents.length ? agents.length + 1 : 0) + (looking ? 4 + (looking.question ? (looking.question.options || []).length + 2 : Math.min(PEEK_LINES, looking.lines.length) + 1) : 0) + (question && step ? 9 + Math.min(consultHeight, consultLines.length) : 0) + (proposal ? 4 + proposal.calls.length * (1 + Math.min(DIFF_TAIL_LINES, 8)) : 0) + (reflection ? 8 + reflection.details.split("\n").length : 0) + (confirm ? 4 + Math.min(8, String(confirm.stat || "").split("\n").length) : 0) + (picker ? 14 : 0);
91879
+ const chrome = 1 + 2 + 4 + (value.split("\n").length - 1) + 1 + (menu.length ? menu.length : 0) + (!menu.length && agents.length ? agents.length + 1 : 0) + (looking ? 4 + (looking.question ? (looking.question.options || []).length + 2 : Math.min(PEEK_LINES, looking.lines.length) + 1) : 0) + (question && step ? 9 + Math.min(consultHeight, consultLines.length) : 0) + (proposal ? 4 + proposal.calls.length * (1 + Math.min(DIFF_TAIL_LINES, 8)) : 0) + (reflection ? 8 + reflection.details.split("\n").length : 0) + (confirm ? 4 + Math.min(8, String(confirm.stat || "").split("\n").length) : 0) + (trust ? 4 + trust.starts.length : 0) + (picker ? 14 : 0);
91860
91880
  const liveBudget = Math.max(LIVE_MIN_ROWS, Math.min(DRAFT_TAIL_LINES, rows - 1 - chrome));
91861
91881
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", children: [
91862
91882
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Static, { items, children: (item) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", marginBottom: ["hum", "you", "banner", "turn"].includes(item.kind) ? 1 : 0, children: [
@@ -92220,6 +92240,21 @@ function App2({ core: core2, task, resume, images = [], peek = peekSession, upda
92220
92240
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: " " }),
92221
92241
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: "\u2190/\u2192 to adjust \xB7 Enter to confirm \xB7 s for this session only \xB7 Esc to cancel" })
92222
92242
  ] }),
92243
+ trust && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 1, marginTop: 1, children: [
92244
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { color: "yellow", bold: true, children: [
92245
+ "? ",
92246
+ "this repository's files would start, on your word ",
92247
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: "\xB7 y starts them \xB7 n leaves them off" })
92248
+ ] }),
92249
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { dimColor: true, children: [
92250
+ " ",
92251
+ trust.path
92252
+ ] }),
92253
+ trust.starts.map((l, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { children: [
92254
+ " \xB7 ",
92255
+ l
92256
+ ] }, i))
92257
+ ] }),
92223
92258
  confirm && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 1, marginTop: 1, children: [
92224
92259
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { color: "yellow", bold: true, children: [
92225
92260
  "\u23EE ",
@@ -92358,6 +92393,7 @@ function App2({ core: core2, task, resume, images = [], peek = peekSession, upda
92358
92393
  if (question && (key.pageUp || key.pageDown || sendingAsk)) return true;
92359
92394
  if (picker) return !chunk;
92360
92395
  if (confirm) return !!(key.return || key.escape);
92396
+ if (trust) return input === "y" || input === "n" || !!(key.return || key.escape);
92361
92397
  if (value.trim()) return false;
92362
92398
  if (reflection && why !== reflection.id && (input === "1" || input === "2")) return true;
92363
92399
  if (proposal && (input === "a" || input === "p") && (proposal.remember || []).length) return true;
@@ -92434,7 +92470,7 @@ init_update();
92434
92470
  init_install();
92435
92471
  var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
92436
92472
  import { spawnSync as spawnSync5 } from "node:child_process";
92437
- var MINE3 = true ? "0.2.23" : "0.0.0";
92473
+ var MINE3 = true ? "0.2.24" : "0.0.0";
92438
92474
  var layout = installLayout();
92439
92475
  function completeInstall() {
92440
92476
  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.23",
3
+ "version": "0.2.24",
4
4
  "description": "Hum: a self-improving coding agent for your terminal.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",