@metaphi-ai/hum 0.1.33 → 0.1.34
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 +43 -4
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -75838,7 +75838,7 @@ function runningVersion(candidates = engineCandidates(), opts = {}) {
|
|
|
75838
75838
|
}
|
|
75839
75839
|
return null;
|
|
75840
75840
|
}
|
|
75841
|
-
function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.1.
|
|
75841
|
+
function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.1.34" : "" } = {}) {
|
|
75842
75842
|
const refused = failures.find((f) => f.error && f.error.code !== "ENOENT");
|
|
75843
75843
|
const fix = npm ? npmFix(version) : updateCommand({ kind: "native" }, platform2);
|
|
75844
75844
|
if (!refused) {
|
|
@@ -84541,7 +84541,7 @@ var input_default = MultilineInput;
|
|
|
84541
84541
|
|
|
84542
84542
|
// src/app.jsx
|
|
84543
84543
|
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
|
84544
|
-
var MINE = true ? "0.1.
|
|
84544
|
+
var MINE = true ? "0.1.34" : "";
|
|
84545
84545
|
var fmtDur = (s) => s < 60 ? `${Math.max(1, Math.round(s))}s` : `${Math.floor(s / 60)}m ${Math.round(s % 60)}s`;
|
|
84546
84546
|
var plural = (n, w) => `${n} ${w}${n === 1 ? "" : "s"}`;
|
|
84547
84547
|
var firstResp = (e) => e.first_response_s ? ` \xB7 first response ${e.first_response_s.toFixed(1)}s` : "";
|
|
@@ -84635,6 +84635,7 @@ var REWIND_CHOICES = [
|
|
|
84635
84635
|
];
|
|
84636
84636
|
var OUTPUT_MAX_LINES = 200;
|
|
84637
84637
|
var ERR_TAIL_LINES = 5;
|
|
84638
|
+
var THOUGHT_TAIL_LINES = 3;
|
|
84638
84639
|
var diagLine = (d) => `${d.file ? `${d.file}${d.line != null ? `:${d.line}` : ""}: ` : ""}${d.severity || "error"}: ${d.message || ""}`;
|
|
84639
84640
|
var tallyLine = (tally) => Object.entries(tally).map(([name, t]) => {
|
|
84640
84641
|
const short = name.includes("__") ? name.split("__")[1] : name;
|
|
@@ -84668,6 +84669,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84668
84669
|
const [confirm, setConfirm] = (0, import_react24.useState)(null);
|
|
84669
84670
|
const [gate, setGate] = (0, import_react24.useState)("off");
|
|
84670
84671
|
const [paused, setPaused] = (0, import_react24.useState)(false);
|
|
84672
|
+
const [reflection, setReflection] = (0, import_react24.useState)(null);
|
|
84671
84673
|
const attachRef = (0, import_react24.useRef)([]);
|
|
84672
84674
|
const inputRef = (0, import_react24.useRef)(null);
|
|
84673
84675
|
const nextId = (0, import_react24.useRef)(0);
|
|
@@ -85013,6 +85015,13 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
85013
85015
|
setQCursor(0);
|
|
85014
85016
|
append({ kind: "info", text: `answered: ${ev.answer}` });
|
|
85015
85017
|
break;
|
|
85018
|
+
case "reflection":
|
|
85019
|
+
setReflection({ id: ev.id, well: ev.well || [], missed: ev.missed || [] });
|
|
85020
|
+
break;
|
|
85021
|
+
case "reflection_closed":
|
|
85022
|
+
setReflection((r) => r && r.id === ev.id ? null : r);
|
|
85023
|
+
if (ev.vote !== "dismiss") append({ kind: "info", text: ev.vote === "up" ? "upvoted" : "downvoted" });
|
|
85024
|
+
break;
|
|
85016
85025
|
case "paused":
|
|
85017
85026
|
foldThinking();
|
|
85018
85027
|
flushDraft();
|
|
@@ -85227,6 +85236,14 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
85227
85236
|
else if (/^[1-3]$/.test(input)) pick(REWIND_CHOICES[Number(input) - 1].key);
|
|
85228
85237
|
return;
|
|
85229
85238
|
}
|
|
85239
|
+
if (reflection && !proposal && !question && !picker && !value.trim()) {
|
|
85240
|
+
const vote = input === "1" ? "up" : input === "2" ? "down" : key.return || key.escape ? "dismiss" : null;
|
|
85241
|
+
if (vote) {
|
|
85242
|
+
engine2.send({ cmd: "reflect_vote", id: reflection.id, vote });
|
|
85243
|
+
setReflection(null);
|
|
85244
|
+
return;
|
|
85245
|
+
}
|
|
85246
|
+
}
|
|
85230
85247
|
if (proposal && !picker) {
|
|
85231
85248
|
if (key.return && !value.trim()) {
|
|
85232
85249
|
decide("accept");
|
|
@@ -85479,6 +85496,10 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
85479
85496
|
answerStep(text);
|
|
85480
85497
|
return;
|
|
85481
85498
|
}
|
|
85499
|
+
if (reflection) {
|
|
85500
|
+
engine2.send({ cmd: "reflect_vote", id: reflection.id, vote: "dismiss" });
|
|
85501
|
+
setReflection(null);
|
|
85502
|
+
}
|
|
85482
85503
|
if (text.startsWith("/")) {
|
|
85483
85504
|
runCommand(text);
|
|
85484
85505
|
return;
|
|
@@ -85647,6 +85668,9 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
85647
85668
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { width: 2, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, dimColor: true, children: "\u25CF" }) }),
|
|
85648
85669
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: tail(renderMarkdown(draft, width - 2), DRAFT_TAIL_LINES) })
|
|
85649
85670
|
] }),
|
|
85671
|
+
phase === "busy" && thinking && // the thought as it streams: its newest lines, dim, so a long think is never a blank screen.
|
|
85672
|
+
// It folds into one line under the reply the moment the reply starts
|
|
85673
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { flexDirection: "column", marginTop: 1, paddingLeft: 2, width, children: thinking.slice(-600).split("\n").filter((l) => l.trim()).slice(-THOUGHT_TAIL_LINES).map((l, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, wrap: "truncate-start", children: l }, i)) }),
|
|
85650
85674
|
(phase === "busy" || phase === "connecting") && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { marginTop: 1, children: [
|
|
85651
85675
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(build_default, { type: "dots" }) }),
|
|
85652
85676
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: spinnerLabel })
|
|
@@ -85682,6 +85706,21 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
85682
85706
|
step.secret ? " \xB7 it is not shown and not recorded" : ""
|
|
85683
85707
|
] })
|
|
85684
85708
|
] }),
|
|
85709
|
+
reflection && !proposal && !question && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { borderStyle: "round", borderColor: ACCENT, paddingX: 1, marginTop: 1, children: [
|
|
85710
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { flexDirection: "column", width: MASCOT_WIDTH + 1, flexShrink: 0, marginRight: 1, children: MASCOT.map((row, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, bold: true, children: row }, i)) }),
|
|
85711
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", flexGrow: 1, children: [
|
|
85712
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { bold: true, children: "looking back" }),
|
|
85713
|
+
reflection.well.map((l, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { children: [
|
|
85714
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: "green", children: " \u2713 " }),
|
|
85715
|
+
l
|
|
85716
|
+
] }, `w${i}`)),
|
|
85717
|
+
reflection.missed.map((l, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { children: [
|
|
85718
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: "yellow", children: " \u2717 " }),
|
|
85719
|
+
l
|
|
85720
|
+
] }, `m${i}`)),
|
|
85721
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: " 1 upvote \xB7 2 downvote \xB7 enter dismiss" })
|
|
85722
|
+
] })
|
|
85723
|
+
] }),
|
|
85685
85724
|
proposal && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: ACCENT, paddingX: 1, marginTop: 1, children: [
|
|
85686
85725
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { children: [
|
|
85687
85726
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, bold: true, children: "? " }),
|
|
@@ -85917,7 +85956,7 @@ init_update();
|
|
|
85917
85956
|
init_install();
|
|
85918
85957
|
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
85919
85958
|
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
85920
|
-
var MINE2 = true ? "0.1.
|
|
85959
|
+
var MINE2 = true ? "0.1.34" : "0.0.0";
|
|
85921
85960
|
var layout = installLayout();
|
|
85922
85961
|
function completeInstall() {
|
|
85923
85962
|
if (layout.kind !== "npm" || !needsInstall(MINE2)) return;
|
|
@@ -85927,7 +85966,7 @@ function completeInstall() {
|
|
|
85927
85966
|
const r = installEngine(MINE2, { say });
|
|
85928
85967
|
if (!r.ok) say(`the update did not finish: ${r.error} \xB7 ${npmFix(MINE2)}`);
|
|
85929
85968
|
}
|
|
85930
|
-
var ENGINE_COMMANDS = /* @__PURE__ */ new Set(["run", "login", "logout", "whoami", "model", "key", "sessions", "show", "sync", "skill", "ps", "stop", "hooks", "engine"]);
|
|
85969
|
+
var ENGINE_COMMANDS = /* @__PURE__ */ new Set(["run", "login", "logout", "whoami", "model", "key", "sessions", "show", "sync", "skill", "persona", "ps", "stop", "hooks", "engine"]);
|
|
85931
85970
|
var argv0 = process.argv.slice(2);
|
|
85932
85971
|
if (argv0[0] === "--version" || argv0[0] === "-V") {
|
|
85933
85972
|
process.stdout.write(`hum ${MINE2}
|