@metaphi-ai/hum 0.1.15 → 0.1.18

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 +55 -3
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -83885,6 +83885,7 @@ var COMMANDS = [
83885
83885
  { name: "/cost", desc: "tokens and cost so far" },
83886
83886
  { name: "/approve", desc: "approvals on|off \u2014 whether every change and command waits for you first (leaving the sandbox always asks)" },
83887
83887
  { name: "/continue", desc: "after a pause: let the agent carry on" },
83888
+ { name: "/goal", desc: "what must hold before the work is done (/goal <condition>; /goal clear) \u2014 it outlives compaction and resume, and is checked against the workspace before every stop" },
83888
83889
  { name: "/image", desc: "attach an image file to your next message (/image <path>); ctrl+v pastes a screenshot" },
83889
83890
  { name: "/mcp", desc: "the MCP servers in this session \u2014 what each mounted, and any that did not" },
83890
83891
  { name: "/tools", desc: "the tools the model has, and the sandbox they run in" },
@@ -83905,6 +83906,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
83905
83906
  const [phase, setPhase] = (0, import_react24.useState)("connecting");
83906
83907
  const [status, setStatus] = (0, import_react24.useState)("");
83907
83908
  const [hello, setHello] = (0, import_react24.useState)(null);
83909
+ const [goal, setGoal] = (0, import_react24.useState)(null);
83908
83910
  const [session, setSession] = (0, import_react24.useState)(null);
83909
83911
  const [spend, setSpend] = (0, import_react24.useState)(0);
83910
83912
  const [draft, setDraft] = (0, import_react24.useState)("");
@@ -83915,6 +83917,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
83915
83917
  const [ctrlc, setCtrlc] = (0, import_react24.useState)(0);
83916
83918
  const [picker, setPicker] = (0, import_react24.useState)(null);
83917
83919
  const [proposal, setProposal] = (0, import_react24.useState)(null);
83920
+ const [question, setQuestion] = (0, import_react24.useState)(null);
83918
83921
  const [gate, setGate] = (0, import_react24.useState)("off");
83919
83922
  const [paused, setPaused] = (0, import_react24.useState)(false);
83920
83923
  const attachRef = (0, import_react24.useRef)([]);
@@ -84006,6 +84009,8 @@ function App2({ engine: engine2, task, resume, images = [] }) {
84006
84009
  if (ev.fresh) append({ kind: "wordmark" });
84007
84010
  append({ kind: "banner", lines: bannerLines(ev, homeRel), instruction: ev.session ? ev.instruction : null });
84008
84011
  if (ev.note) append({ kind: "warn", text: ev.note });
84012
+ setGoal(ev.goal || null);
84013
+ if (ev.goal) append({ kind: "info", text: `goal: ${ev.goal}` });
84009
84014
  preHello.current.forEach((it) => append(it));
84010
84015
  preHello.current = [];
84011
84016
  if (ev.session) {
@@ -84172,6 +84177,15 @@ function App2({ engine: engine2, task, resume, images = [] }) {
84172
84177
  setProposal({ content: ev.content || "", calls: ev.calls || [] });
84173
84178
  setStatus("waiting for your decision");
84174
84179
  break;
84180
+ case "question":
84181
+ foldThinking();
84182
+ flushDraft();
84183
+ setQuestion({ id: ev.id, question: ev.question || "", options: ev.options || [], default: ev.default || null });
84184
+ break;
84185
+ case "question_closed":
84186
+ setQuestion(null);
84187
+ append({ kind: "info", text: `answered: ${ev.answer}` });
84188
+ break;
84175
84189
  case "paused":
84176
84190
  foldThinking();
84177
84191
  flushDraft();
@@ -84187,6 +84201,10 @@ function App2({ engine: engine2, task, resume, images = [] }) {
84187
84201
  setProposal(null);
84188
84202
  append({ kind: "info", text: "approvals off: the waiting proposal ran" });
84189
84203
  break;
84204
+ case "goal":
84205
+ setGoal(ev.text || null);
84206
+ append({ kind: "info", text: ev.text ? `goal: ${ev.text}` : "goal cleared" });
84207
+ break;
84190
84208
  case "gate":
84191
84209
  setGate(ev.mode);
84192
84210
  append({ kind: "info", text: ev.mode === "approve" ? "approvals on: changes and commands wait for you first" : "approvals off: the agent acts, you steer" });
@@ -84259,7 +84277,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
84259
84277
  (0, import_react24.useEffect)(() => {
84260
84278
  if (!hello) return void 0;
84261
84279
  let live = true;
84262
- updateNotice(true ? "0.1.15" : hello.version || "0.0.0").then((line) => {
84280
+ updateNotice(true ? "0.1.18" : hello.version || "0.0.0").then((line) => {
84263
84281
  if (live && line) append({ kind: "info", text: line });
84264
84282
  }).catch(() => {
84265
84283
  });
@@ -84320,6 +84338,12 @@ function App2({ engine: engine2, task, resume, images = [] }) {
84320
84338
  return;
84321
84339
  }
84322
84340
  }
84341
+ if (question && !picker) {
84342
+ if (key.return && !value.trim() || key.escape) {
84343
+ if (question.default) engine2.send({ cmd: "answer", id: question.id, text: "" });
84344
+ return;
84345
+ }
84346
+ }
84323
84347
  if (picker) {
84324
84348
  if (key.upArrow) setPicker((p) => ({ ...p, index: (p.index + p.items.length - 1) % p.items.length }));
84325
84349
  else if (key.downArrow || key.tab) setPicker((p) => ({ ...p, index: (p.index + 1) % p.items.length }));
@@ -84419,6 +84443,10 @@ function App2({ engine: engine2, task, resume, images = [] }) {
84419
84443
  case "/continue":
84420
84444
  engine2.send({ cmd: "continue" });
84421
84445
  break;
84446
+ case "/goal":
84447
+ if (!arg) append({ kind: "info", text: goal ? `goal: ${goal}` : "no goal set \u2014 /goal <what must hold before the work is done>; /goal clear removes it" });
84448
+ else engine2.send({ cmd: "goal", text: arg });
84449
+ break;
84422
84450
  case "/approve": {
84423
84451
  const mode = arg === "on" ? "approve" : arg === "off" ? "off" : gate === "approve" ? "off" : "approve";
84424
84452
  engine2.send({ cmd: "gate", mode });
@@ -84445,6 +84473,11 @@ function App2({ engine: engine2, task, resume, images = [] }) {
84445
84473
  decide("reject", text);
84446
84474
  return;
84447
84475
  }
84476
+ if (question && !/^\/(quit|exit|stop)\b/.test(text)) {
84477
+ append({ kind: "you", text });
84478
+ engine2.send({ cmd: "answer", id: question.id, text });
84479
+ return;
84480
+ }
84448
84481
  if (text.startsWith("/")) {
84449
84482
  runCommand(text);
84450
84483
  return;
@@ -84596,6 +84629,25 @@ function App2({ engine: engine2, task, resume, images = [] }) {
84596
84629
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(build_default, { type: "dots" }) }),
84597
84630
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: spinnerLabel })
84598
84631
  ] }),
84632
+ question && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: ACCENT, paddingX: 1, marginTop: 1, children: [
84633
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { children: [
84634
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, bold: true, children: "? " }),
84635
+ question.question
84636
+ ] }),
84637
+ question.options.map((o, i) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { children: [
84638
+ " ",
84639
+ i + 1,
84640
+ ". ",
84641
+ o,
84642
+ question.default === o ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: " (default)" }) : null
84643
+ ] }, i)),
84644
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { dimColor: true, children: [
84645
+ " ",
84646
+ question.options.length ? "a number picks \xB7 " : "",
84647
+ "type an answer",
84648
+ question.default ? " \xB7 enter takes the default" : ""
84649
+ ] })
84650
+ ] }),
84599
84651
  proposal && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", borderStyle: "round", borderColor: ACCENT, paddingX: 1, marginTop: 1, children: [
84600
84652
  /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { children: [
84601
84653
  /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, bold: true, children: "? " }),
@@ -84670,7 +84722,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
84670
84722
  focus: phase !== "dead" && !picker,
84671
84723
  navActive: menu.length === 0,
84672
84724
  history: historyRef.current,
84673
- placeholder: proposal ? "enter to approve \xB7 or type why not" : paused ? "paused \xB7 say what to do, or /continue" : phase === "busy" ? "type to steer \xB7 esc to stop \xB7 !cmd runs a command" : session ? "what next?" : "what are we doing?"
84725
+ placeholder: question ? question.options.length ? "a number, or your answer" : "your answer" : proposal ? "enter to approve \xB7 or type why not" : paused ? "paused \xB7 say what to do, or /continue" : phase === "busy" ? "type to steer \xB7 esc to stop \xB7 !cmd runs a command" : session ? "what next?" : "what are we doing?"
84674
84726
  }
84675
84727
  )
84676
84728
  ] }),
@@ -84965,7 +85017,7 @@ import { spawnSync as spawnSync3 } from "node:child_process";
84965
85017
  var ENGINE_COMMANDS = /* @__PURE__ */ new Set(["run", "login", "logout", "whoami", "model", "key", "sessions", "show", "sync", "skill", "ps", "stop", "hooks", "engine"]);
84966
85018
  var argv0 = process.argv.slice(2);
84967
85019
  if (argv0[0] === "--version" || argv0[0] === "-V") {
84968
- process.stdout.write(`hum ${true ? "0.1.15" : "0.0.0"}
85020
+ process.stdout.write(`hum ${true ? "0.1.18" : "0.0.0"}
84969
85021
  `);
84970
85022
  process.exit(0);
84971
85023
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metaphi-ai/hum",
3
- "version": "0.1.15",
3
+ "version": "0.1.18",
4
4
  "description": "Hum (हम): a self-improving coding agent for your terminal.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",