@metaphi-ai/hum 0.1.51 → 0.1.53

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 +26 -5
  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.51" : "" } = {}) {
83548
+ function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.1.53" : "" } = {}) {
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.51" : "";
85526
+ var MINE = true ? "0.1.53" : "";
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` : "";
@@ -85690,6 +85690,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
85690
85690
  const append = (item) => setItems((prev) => [...prev, { id: nextId.current++, ...item }]);
85691
85691
  const steps = question ? question.questions && question.questions.length ? question.questions : [{ id: question.id, question: question.question, options: (question.options || []).map((o) => ({ label: o })), default: question.default }] : [];
85692
85692
  const step = steps.length ? steps[Math.min(qStep, steps.length - 1)] : null;
85693
+ const harnessQ = !!question && question.kind === "delivery" && qStep === 0;
85693
85694
  const stepOptions = step ? (step.options || []).map((o) => typeof o === "string" ? { label: o } : o) : [];
85694
85695
  const stepLabels = stepOptions.map((o) => o.label);
85695
85696
  const menu = value.trimStart().startsWith("/") && !value.includes(" ") ? COMMANDS.filter((c) => c.name.startsWith(value.trim())) : [];
@@ -86329,6 +86330,18 @@ function App2({ engine: engine2, task, resume, images = [] }) {
86329
86330
  answerStep("");
86330
86331
  return;
86331
86332
  }
86333
+ if (step.optional) {
86334
+ answerStep("");
86335
+ return;
86336
+ }
86337
+ if (harnessQ && key.escape) {
86338
+ setQuestion(null);
86339
+ setQStep(0);
86340
+ setQAnswers({});
86341
+ setQPicks([]);
86342
+ setQCursor(0);
86343
+ return;
86344
+ }
86332
86345
  return;
86333
86346
  }
86334
86347
  }
@@ -86435,7 +86448,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
86435
86448
  const answerStep = (text) => {
86436
86449
  if (!question || !step) return;
86437
86450
  setValue("");
86438
- append({ kind: "you", text: step.secret ? "(kept to yourself)" : text || `(the default: ${step.default})` });
86451
+ append({ kind: "you", text: step.secret ? "(kept to yourself)" : text || (step.default ? `(the default: ${step.default})` : "(nothing)") });
86439
86452
  const answers = { ...qAnswers, [step.id]: text };
86440
86453
  if (qStep + 1 < steps.length) {
86441
86454
  setQAnswers(answers);
@@ -86571,10 +86584,17 @@ function App2({ engine: engine2, task, resume, images = [] }) {
86571
86584
  decide("reject", text);
86572
86585
  return;
86573
86586
  }
86574
- if (question && step && !/^\/(quit|exit|stop)\b/.test(text)) {
86587
+ if (question && step && !harnessQ && !/^\/(quit|exit|stop)\b/.test(text)) {
86575
86588
  answerStep(text);
86576
86589
  return;
86577
86590
  }
86591
+ if (harnessQ) {
86592
+ setQuestion(null);
86593
+ setQStep(0);
86594
+ setQAnswers({});
86595
+ setQPicks([]);
86596
+ setQCursor(0);
86597
+ }
86578
86598
  if (reflection) closeReflection(reflection.id, "dismiss");
86579
86599
  if (text.startsWith("/")) {
86580
86600
  runCommand(text);
@@ -86797,6 +86817,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
86797
86817
  stepLabels.length ? step.multi ? "a number ticks \xB7 space ticks the one marked \xB7 " : step.graded ? "a number marks \xB7 words after it if you like \xB7 " : "a number picks \xB7 " : "",
86798
86818
  step.graded ? "" : "type an answer",
86799
86819
  step.default ? " \xB7 enter takes the default" : "",
86820
+ !step.default && step.optional ? " \xB7 enter says nothing" : "",
86800
86821
  step.multi && stepLabels.length ? " \xB7 enter takes what is ticked" : "",
86801
86822
  step.secret ? " \xB7 it is not shown and not recorded" : ""
86802
86823
  ] })
@@ -87102,7 +87123,7 @@ init_update();
87102
87123
  init_install();
87103
87124
  var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
87104
87125
  import { spawnSync as spawnSync5 } from "node:child_process";
87105
- var MINE2 = true ? "0.1.51" : "0.0.0";
87126
+ var MINE2 = true ? "0.1.53" : "0.0.0";
87106
87127
  var layout = installLayout();
87107
87128
  function completeInstall() {
87108
87129
  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.51",
3
+ "version": "0.1.53",
4
4
  "description": "Hum: a self-improving coding agent for your terminal.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",