@metaphi-ai/hum 0.1.56 → 0.1.57

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 +33 -10
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -83389,17 +83389,19 @@ function mismatchLine(mine, running, { env: env3 = process.env, layout: layout2
83389
83389
  if (state && !state.ok && state.wanted === mine && state.error) return `${head}: the update did not finish (${state.error}) \xB7 ${fix}`;
83390
83390
  return `${head} \xB7 ${fix}`;
83391
83391
  }
83392
- async function updateNotice(mine, { running = "", env: env3 = process.env, fetchImpl = globalThis.fetch, layout: layout2 = installLayout(process.execPath, env3), spawnImpl = spawn } = {}) {
83392
+ function updateBox(mine, latest, notes = "", { env: env3 = process.env, layout: layout2 = installLayout(process.execPath, env3) } = {}) {
83393
+ if (env3.HUM_NO_UPDATE_CHECK || !mine || !latest || !newer(latest, mine)) return null;
83394
+ return { head: `Update available! ${mine} -> ${latest}`, command: updateCommand(layout2), notes: notes || "" };
83395
+ }
83396
+ async function updateNotice(mine, { running = "", latest = "", env: env3 = process.env, layout: layout2 = installLayout(process.execPath, env3), spawnImpl = spawn } = {}) {
83393
83397
  const drift = mismatchLine(mine, running, { env: env3, layout: layout2 });
83394
83398
  if (drift) return drift;
83395
- const latest = await latestVersion(fetchImpl, env3);
83396
- if (!latest || !newer(latest, mine)) return "";
83397
- if (layout2.kind !== "native") return `hum ${latest} is out (this is ${mine}) \xB7 ${updateCommand(layout2)}`;
83399
+ if (env3.HUM_NO_UPDATE_CHECK || !latest || !newer(latest, mine) || layout2.kind !== "native") return "";
83398
83400
  if (readyVersion(layout2, latest)) return `hum ${latest} is ready \xB7 restart hum to use it`;
83399
83401
  if (startBackgroundUpdate(latest, { env: env3, spawnImpl })) return `hum ${latest} is downloading in the background \xB7 it takes effect the next time you start hum`;
83400
83402
  const s = readState(env3);
83401
83403
  if (s.version === latest && !env3.HUM_NO_AUTO_UPDATE) return `hum ${latest} is still installing in the background (${path2.join(humHome2(env3), "update.log")} has the details)`;
83402
- return `hum ${latest} is out (this is ${mine}) \xB7 ${updateCommand(layout2)}`;
83404
+ return "";
83403
83405
  }
83404
83406
  function updateNow(layout2 = installLayout()) {
83405
83407
  if (layout2.kind === "native") {
@@ -83545,7 +83547,7 @@ function runningVersion(candidates = engineCandidates(), opts = {}) {
83545
83547
  }
83546
83548
  return null;
83547
83549
  }
83548
- function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.1.56" : "" } = {}) {
83550
+ function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.1.57" : "" } = {}) {
83549
83551
  const refused = failures.find((f) => f.error && f.error.code !== "ENOENT");
83550
83552
  const fix = npm ? npmFix(version) : updateCommand({ kind: "native" }, platform2);
83551
83553
  if (!refused) {
@@ -85524,7 +85526,7 @@ var input_default = MultilineInput;
85524
85526
 
85525
85527
  // src/app.jsx
85526
85528
  var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
85527
- var MINE = true ? "0.1.56" : "";
85529
+ var MINE = true ? "0.1.57" : "";
85528
85530
  var fmtDur = (s) => s < 60 ? `${Math.max(1, Math.round(s))}s` : `${Math.floor(s / 60)}m ${Math.round(s % 60)}s`;
85529
85531
  var plural = (n, w) => `${n} ${w}${n === 1 ? "" : "s"}`;
85530
85532
  var firstResp = (e) => e.first_response_s ? ` \xB7 first response ${e.first_response_s.toFixed(1)}s` : "";
@@ -85801,7 +85803,11 @@ function App2({ engine: engine2, task, resume, images = [] }) {
85801
85803
  setMeter((m) => ({ ...m, tokens: 0, cap: ev.compact_at || 0 }));
85802
85804
  setGate(ev.gate === "approve" ? "approve" : "off");
85803
85805
  if (ev.session) setSession(ev.session);
85804
- if (ev.fresh) append({ kind: "wordmark" });
85806
+ if (ev.fresh) {
85807
+ const box = updateBox(MINE || ev.version || "", ev.latest_version || "", ev.release_notes_url || "");
85808
+ if (box) append({ kind: "update", ...box });
85809
+ append({ kind: "wordmark" });
85810
+ }
85805
85811
  append({ kind: "banner", lines: bannerLines(ev, homeRel, MINE), instruction: ev.session ? ev.instruction : null });
85806
85812
  if (ev.note) append({ kind: "warn", text: ev.note });
85807
85813
  setGoal(ev.goal || null);
@@ -86180,7 +86186,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
86180
86186
  (0, import_react24.useEffect)(() => {
86181
86187
  if (!hello) return void 0;
86182
86188
  let live = true;
86183
- updateNotice(MINE || hello.version || "0.0.0", { running: hello.version || "" }).then((line) => {
86189
+ updateNotice(MINE || hello.version || "0.0.0", { running: hello.version || "", latest: hello.latest_version || "" }).then((line) => {
86184
86190
  if (live && line) append({ kind: "info", text: line });
86185
86191
  }).catch(() => {
86186
86192
  });
@@ -86626,6 +86632,23 @@ function App2({ engine: engine2, task, resume, images = [] }) {
86626
86632
  const liveBudget = Math.max(LIVE_MIN_ROWS, Math.min(DRAFT_TAIL_LINES, rows - 1 - chrome));
86627
86633
  return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", children: [
86628
86634
  /* @__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: [
86635
+ item.kind === "update" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: "gray", paddingX: 1, marginLeft: 1, alignSelf: "flex-start", children: [
86636
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { children: [
86637
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: "yellow", children: "\u2728 " }),
86638
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { bold: true, children: item.head })
86639
+ ] }),
86640
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { children: [
86641
+ "Run ",
86642
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, children: item.command }),
86643
+ " to update."
86644
+ ] }),
86645
+ item.notes ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { children: [
86646
+ "\n",
86647
+ "See full release notes:",
86648
+ "\n",
86649
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, underline: true, children: item.notes })
86650
+ ] }) : null
86651
+ ] }),
86629
86652
  item.kind === "wordmark" && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { flexDirection: "column", paddingLeft: 1, children: WORDMARK.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, bold: true, children: row }, i)) }),
86630
86653
  item.kind === "banner" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 1, children: [
86631
86654
  MASCOT.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { children: [
@@ -87125,7 +87148,7 @@ init_update();
87125
87148
  init_install();
87126
87149
  var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
87127
87150
  import { spawnSync as spawnSync5 } from "node:child_process";
87128
- var MINE2 = true ? "0.1.56" : "0.0.0";
87151
+ var MINE2 = true ? "0.1.57" : "0.0.0";
87129
87152
  var layout = installLayout();
87130
87153
  function completeInstall() {
87131
87154
  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.56",
3
+ "version": "0.1.57",
4
4
  "description": "Hum: a self-improving coding agent for your terminal.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",