@metaphi-ai/hum 0.1.48 → 0.1.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 +43 -3
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -83545,7 +83545,7 @@ function runningVersion(candidates = engineCandidates(), opts = {}) {
83545
83545
  }
83546
83546
  return null;
83547
83547
  }
83548
- function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.1.48" : "" } = {}) {
83548
+ function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.1.49" : "" } = {}) {
83549
83549
  const refused = failures.find((f) => f.error && f.error.code !== "ENOENT");
83550
83550
  const fix = npm ? npmFix(version) : updateCommand({ kind: "native" }, platform2);
83551
83551
  if (!refused) {
@@ -85523,7 +85523,7 @@ var input_default = MultilineInput;
85523
85523
 
85524
85524
  // src/app.jsx
85525
85525
  var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
85526
- var MINE = true ? "0.1.48" : "";
85526
+ var MINE = true ? "0.1.49" : "";
85527
85527
  var fmtDur = (s) => s < 60 ? `${Math.max(1, Math.round(s))}s` : `${Math.floor(s / 60)}m ${Math.round(s % 60)}s`;
85528
85528
  var plural = (n, w) => `${n} ${w}${n === 1 ? "" : "s"}`;
85529
85529
  var firstResp = (e) => e.first_response_s ? ` \xB7 first response ${e.first_response_s.toFixed(1)}s` : "";
@@ -85591,6 +85591,7 @@ var COMMANDS = [
85591
85591
  { name: "/resume", desc: "pick a past session to continue (this machine or any other)" },
85592
85592
  { name: "/compact", desc: "summarise and restart the context now (/compact <what the note should attend to>)" },
85593
85593
  { name: "/model", desc: "switch between the models you can use; /model <name> switches straight away" },
85594
+ { name: "/effort", desc: "how hard the model thinks, whatever the model: low, medium or high; /effort <level> sets it straight away" },
85594
85595
  { name: "/diff", desc: "what has changed since this session began (/diff last: the last exchange; /diff <path>: one file)" },
85595
85596
  { name: "/rewind", desc: "go back to something you said: the files, the conversation, or both (esc esc opens it too)" },
85596
85597
  { name: "/cost", desc: "tokens and cost so far" },
@@ -85915,6 +85916,12 @@ function App2({ engine: engine2, task, resume, images = [] }) {
85915
85916
  setPicker({ kind: "model", items: ev.items, index: cur, via: ev.via, byo: ev.byo || [] });
85916
85917
  break;
85917
85918
  }
85919
+ case "efforts": {
85920
+ if (!ev.items || ev.items.length === 0) break;
85921
+ const cur = Math.max(0, ev.items.findIndex((e) => e.current));
85922
+ setPicker({ kind: "effort", items: ev.items, index: cur });
85923
+ break;
85924
+ }
85918
85925
  case "session":
85919
85926
  setSession(ev.name);
85920
85927
  setSpend(0);
@@ -86312,6 +86319,20 @@ function App2({ engine: engine2, task, resume, images = [] }) {
86312
86319
  return;
86313
86320
  }
86314
86321
  }
86322
+ if (picker && picker.kind === "effort") {
86323
+ const it = picker.items[picker.index];
86324
+ const pick = (keep) => {
86325
+ setPicker(null);
86326
+ if (it.current && !(keep && !it.default)) return;
86327
+ engine2.send(keep ? { cmd: "effort", level: it.level, default: true } : { cmd: "effort", level: it.level });
86328
+ };
86329
+ if (key.leftArrow || key.upArrow) setPicker((p) => ({ ...p, index: (p.index + p.items.length - 1) % p.items.length }));
86330
+ else if (key.rightArrow || key.downArrow || key.tab) setPicker((p) => ({ ...p, index: (p.index + 1) % p.items.length }));
86331
+ else if (key.escape) setPicker(null);
86332
+ else if (key.return) pick(true);
86333
+ else if (input === "s" && !value.trim()) pick(false);
86334
+ return;
86335
+ }
86315
86336
  if (picker && picker.kind === "model") {
86316
86337
  const it = picker.items[picker.index];
86317
86338
  const pick = () => {
@@ -86447,6 +86468,10 @@ function App2({ engine: engine2, task, resume, images = [] }) {
86447
86468
  engine2.send({ cmd: "model", name: arg });
86448
86469
  } else engine2.send({ cmd: "model" });
86449
86470
  break;
86471
+ case "/effort":
86472
+ if (arg) engine2.send({ cmd: "effort", level: arg });
86473
+ else engine2.send({ cmd: "effort" });
86474
+ break;
86450
86475
  case "/diff":
86451
86476
  engine2.send({ cmd: "diff", scope: arg });
86452
86477
  break;
@@ -86854,6 +86879,21 @@ function App2({ engine: engine2, task, resume, images = [] }) {
86854
86879
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: " " }),
86855
86880
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: "Enter to switch \xB7 Esc to cancel" })
86856
86881
  ] }),
86882
+ picker && picker.kind === "effort" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", paddingX: 1, marginTop: 1, children: [
86883
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, bold: true, children: "Effort" }),
86884
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: " " }),
86885
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { children: [
86886
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: " Faster" }),
86887
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: " ".repeat(Math.max(1, picker.items.length * 10 - 14)) }),
86888
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: "Smarter" })
86889
+ ] }),
86890
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { children: [
86891
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: " " }),
86892
+ picker.items.map((e, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: i === picker.index ? ACCENT : void 0, bold: i === picker.index, dimColor: i !== picker.index, children: `${i === picker.index ? "\u25B2 " : " "}${e.level}${e.current ? " \u2713" : ""}`.padEnd(10) }, e.level))
86893
+ ] }),
86894
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: " " }),
86895
+ /* @__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" })
86896
+ ] }),
86857
86897
  confirm && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "yellow", paddingX: 1, marginTop: 1, children: [
86858
86898
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { color: "yellow", bold: true, children: [
86859
86899
  "\u23EE ",
@@ -87039,7 +87079,7 @@ init_update();
87039
87079
  init_install();
87040
87080
  var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
87041
87081
  import { spawnSync as spawnSync5 } from "node:child_process";
87042
- var MINE2 = true ? "0.1.48" : "0.0.0";
87082
+ var MINE2 = true ? "0.1.49" : "0.0.0";
87043
87083
  var layout = installLayout();
87044
87084
  function completeInstall() {
87045
87085
  if (layout.kind !== "npm" || !needsInstall(MINE2)) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metaphi-ai/hum",
3
- "version": "0.1.48",
3
+ "version": "0.1.49",
4
4
  "description": "Hum: a self-improving coding agent for your terminal.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",