hum-cli 0.2.71__py3-none-any.whl → 0.2.72__py3-none-any.whl
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.
- hum/__init__.py +1 -1
- hum/runtime/loop.py +6 -2
- hum/runtime/workspace.py +12 -2
- hum/tui/cli.mjs +34 -10
- {hum_cli-0.2.71.dist-info → hum_cli-0.2.72.dist-info}/METADATA +1 -1
- {hum_cli-0.2.71.dist-info → hum_cli-0.2.72.dist-info}/RECORD +9 -9
- {hum_cli-0.2.71.dist-info → hum_cli-0.2.72.dist-info}/WHEEL +0 -0
- {hum_cli-0.2.71.dist-info → hum_cli-0.2.72.dist-info}/entry_points.txt +0 -0
- {hum_cli-0.2.71.dist-info → hum_cli-0.2.72.dist-info}/licenses/LICENSE +0 -0
hum/__init__.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""Hum — an agent harness built as an RL environment that humans can drive."""
|
|
2
|
-
__version__ = "0.2.
|
|
2
|
+
__version__ = "0.2.72"
|
hum/runtime/loop.py
CHANGED
|
@@ -32,6 +32,10 @@ from .skills import SKILLS_FRAME, carried, in_effect, keeps_whole
|
|
|
32
32
|
from .tools import RUN_AS, WROTE, ToolRegistry, tool_output_dir
|
|
33
33
|
from .workspace import Workspace, describe_change, fingerprint
|
|
34
34
|
|
|
35
|
+
# what the model reads when files moved between turns and no tool of this session moved them: the person, their
|
|
36
|
+
# editor or another agent did, and the loop cannot tell which, so it never says whose hand it was
|
|
37
|
+
OUTSIDE = "files changed outside this session (by the person, an editor or another program)"
|
|
38
|
+
|
|
35
39
|
|
|
36
40
|
class Trip(BaseModel):
|
|
37
41
|
"""A pause an older session's record left open (the circuit breaker that wrote it is gone)."""
|
|
@@ -703,7 +707,7 @@ class Runner:
|
|
|
703
707
|
stat = await self.workspace.stat(before, after, paths=paths) if before else ""
|
|
704
708
|
shown = (patch if len(patch) <= EDIT_IN_CONTEXT_BYTES else patch[:EDIT_IN_CONTEXT_BYTES]
|
|
705
709
|
+ "\n[… rest of the patch omitted here; read the files for detail]")
|
|
706
|
-
content = "[
|
|
710
|
+
content = f"[{OUTSIDE}]\n" + stat + ("\n\n" + shown if shown else "")
|
|
707
711
|
extra: dict[str, Any] = {"event": "human_edit", "tree_before": before, "tree": after, "diff": patch,
|
|
708
712
|
"stat": stat}
|
|
709
713
|
if paths is not None:
|
|
@@ -732,7 +736,7 @@ class Runner:
|
|
|
732
736
|
return None
|
|
733
737
|
self._fp = fp
|
|
734
738
|
desc = await describe_change(self.executor)
|
|
735
|
-
return f"[
|
|
739
|
+
return f"[{OUTSIDE}]\n{desc}".strip(), {"event": "human_edit"}
|
|
736
740
|
|
|
737
741
|
def _record_edit(self, branch: str, parent: str | None, edit: tuple[str, dict[str, Any]], why: str) -> Node:
|
|
738
742
|
content, extra = edit
|
hum/runtime/workspace.py
CHANGED
|
@@ -335,9 +335,11 @@ class Workspace:
|
|
|
335
335
|
return out
|
|
336
336
|
|
|
337
337
|
async def stat(self, a: str, b: str, paths: list[str] | None = None) -> str:
|
|
338
|
+
"""One line per file that moved, ``path (+added −removed)``, as Claude Code and Codex name an edit; a binary
|
|
339
|
+
file says so. Not git's --stat bar, which is drawn to a width and says nothing a count does not."""
|
|
338
340
|
ex = f"{self._only(paths)} {self._not_credentials()}".strip()
|
|
339
|
-
r = await self.ex.exec(self._git(f"diff-tree --
|
|
340
|
-
return "\n".join(r.stdout.strip().splitlines()[:80])
|
|
341
|
+
r = await self.ex.exec(self._git(f"diff-tree -r --numstat -M --no-color {a} {b} -- {ex}"), timeout_sec=300)
|
|
342
|
+
return "\n".join(_numstat_line(ln) for ln in r.stdout.strip().splitlines()[:80] if ln.strip())
|
|
341
343
|
|
|
342
344
|
async def changed_paths(self, a: str, b: str) -> list[str]:
|
|
343
345
|
"""Every path that differs between two trees. No rename detection: a rename is a path
|
|
@@ -518,3 +520,11 @@ async def describe_change(ex: Executor) -> str:
|
|
|
518
520
|
r = await ex.exec("git status --porcelain=v1 && git diff --stat", timeout_sec=30)
|
|
519
521
|
lines = (r.stdout or "").strip().splitlines()
|
|
520
522
|
return "\n".join(lines[:60])
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
def _numstat_line(line: str) -> str:
|
|
526
|
+
"""``12\t3\tpath`` → ``path (+12 −3)``; ``-\t-\tpath`` (binary) → ``path (binary)``."""
|
|
527
|
+
added, removed, path = (line.split("\t", 2) + ["", ""])[:3]
|
|
528
|
+
if added == "-" and removed == "-":
|
|
529
|
+
return f"{path} (binary)"
|
|
530
|
+
return f"{path} (+{added} −{removed})"
|
hum/tui/cli.mjs
CHANGED
|
@@ -90407,7 +90407,7 @@ var init_install = __esm({
|
|
|
90407
90407
|
"src/install.js"() {
|
|
90408
90408
|
init_define_HUM_CORE_SUBS();
|
|
90409
90409
|
win = process.platform === "win32";
|
|
90410
|
-
MINE = true ? "0.2.
|
|
90410
|
+
MINE = true ? "0.2.72" : "";
|
|
90411
90411
|
npmFix = (version = "") => `npm i -g @metaphi-ai/hum@${version || "latest"} --foreground-scripts`;
|
|
90412
90412
|
NPM_FIX = npmFix("latest");
|
|
90413
90413
|
humHome = (env3 = process.env) => env3.HUM_HOME || path.join(os3.homedir(), ".hum");
|
|
@@ -90762,10 +90762,10 @@ function clientEnv() {
|
|
|
90762
90762
|
platform: process.platform,
|
|
90763
90763
|
arch: process.arch,
|
|
90764
90764
|
terminal: process.env.TERM_PROGRAM || (process.env.WT_SESSION ? "Windows Terminal" : process.env.TERM || ""),
|
|
90765
|
-
tui: true ? "0.2.
|
|
90765
|
+
tui: true ? "0.2.72" : ""
|
|
90766
90766
|
};
|
|
90767
90767
|
}
|
|
90768
|
-
function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.2.
|
|
90768
|
+
function startFailure(failures, { npm = /^(node|bun)(\.exe)?$/i.test(String(process.execPath).split(/[\\/]/).pop()), platform: platform2 = process.platform, version = true ? "0.2.72" : "" } = {}) {
|
|
90769
90769
|
const refused = failures.find((f) => f.error && f.error.code !== "ENOENT");
|
|
90770
90770
|
const fix = npm ? npmFix(version) : updateCommand({ kind: "native" }, platform2);
|
|
90771
90771
|
if (!refused) {
|
|
@@ -92281,7 +92281,7 @@ var after = (ms, fn) => {
|
|
|
92281
92281
|
|
|
92282
92282
|
// src/app.jsx
|
|
92283
92283
|
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
92284
|
-
var MINE2 = true ? "0.2.
|
|
92284
|
+
var MINE2 = true ? "0.2.72" : "";
|
|
92285
92285
|
var fmtDur = (s) => s < 60 ? `${Math.max(1, Math.round(s))}s` : `${Math.floor(s / 60)}m ${Math.round(s % 60)}s`;
|
|
92286
92286
|
var plural = (n, w) => `${n} ${w}${n === 1 ? "" : "s"}`;
|
|
92287
92287
|
var shortSession = (name) => (name || "").replace(/\.jsonl$/, "");
|
|
@@ -92316,10 +92316,9 @@ var homeRel = (p) => {
|
|
|
92316
92316
|
return p && h && p.startsWith(h) ? "~" + p.slice(h.length) : p;
|
|
92317
92317
|
};
|
|
92318
92318
|
var handEdit = (stat) => {
|
|
92319
|
-
const
|
|
92320
|
-
if (!
|
|
92321
|
-
|
|
92322
|
-
return lines.length === 1 ? `you edited ${s}` : `you edited files:
|
|
92319
|
+
const lines = String(stat || "").trim().split("\n").filter(Boolean);
|
|
92320
|
+
if (!lines.length) return "files changed outside this session";
|
|
92321
|
+
return lines.length === 1 ? `${lines[0]} changed outside this session` : `${lines.length} files changed outside this session:
|
|
92323
92322
|
${lines.join("\n ")}`;
|
|
92324
92323
|
};
|
|
92325
92324
|
var fmtCost2 = (c) => c >= 0.01 ? `$${c.toFixed(2)}` : c > 0 ? `$${c.toFixed(4)}` : "$0";
|
|
@@ -92392,6 +92391,7 @@ var DRAFT_TAIL_LINES = 14;
|
|
|
92392
92391
|
var LIVE_MIN_ROWS = 3;
|
|
92393
92392
|
var DEFAULT_ROWS = 24;
|
|
92394
92393
|
var ELAPSED_TICK_MS = 1e3;
|
|
92394
|
+
var REFLOW_MS = 75;
|
|
92395
92395
|
var liveTail = (text, width, rows) => {
|
|
92396
92396
|
const l = wrapAnsi2(text, Math.max(20, width), { hard: true, trim: false }).split("\n");
|
|
92397
92397
|
return l.length <= rows ? l.join("\n") : "\u2026\n" + l.slice(-(rows - 1)).join("\n");
|
|
@@ -92671,6 +92671,25 @@ function App2({ core: core2, task, resume, images = [], peek = peekSession, upda
|
|
|
92671
92671
|
const width = (stdout?.columns || 80) - 2;
|
|
92672
92672
|
const [items, setItems] = (0, import_react38.useState)([]);
|
|
92673
92673
|
const [transcriptEpoch, setTranscriptEpoch] = (0, import_react38.useState)(0);
|
|
92674
|
+
(0, import_react38.useEffect)(() => {
|
|
92675
|
+
if (!stdout || typeof stdout.on !== "function") return void 0;
|
|
92676
|
+
let was = stdout.columns;
|
|
92677
|
+
let timer = null;
|
|
92678
|
+
const onResize = () => {
|
|
92679
|
+
clearTimeout(timer);
|
|
92680
|
+
timer = setTimeout(() => {
|
|
92681
|
+
if (stdout.columns === was) return;
|
|
92682
|
+
was = stdout.columns;
|
|
92683
|
+
stdout.write("\x1B[2J\x1B[3J\x1B[H");
|
|
92684
|
+
setTranscriptEpoch((n) => n + 1);
|
|
92685
|
+
}, REFLOW_MS);
|
|
92686
|
+
};
|
|
92687
|
+
stdout.on("resize", onResize);
|
|
92688
|
+
return () => {
|
|
92689
|
+
stdout.off("resize", onResize);
|
|
92690
|
+
clearTimeout(timer);
|
|
92691
|
+
};
|
|
92692
|
+
}, [stdout]);
|
|
92674
92693
|
const [phase, setPhase] = (0, import_react38.useState)("connecting");
|
|
92675
92694
|
const [status, setStatus] = (0, import_react38.useState)("");
|
|
92676
92695
|
const [retrying, setRetrying] = (0, import_react38.useState)(null);
|
|
@@ -92723,6 +92742,7 @@ function App2({ core: core2, task, resume, images = [], peek = peekSession, upda
|
|
|
92723
92742
|
const nextId = (0, import_react38.useRef)(0);
|
|
92724
92743
|
const phaseRef = (0, import_react38.useRef)("connecting");
|
|
92725
92744
|
const turnT0 = (0, import_react38.useRef)(null);
|
|
92745
|
+
const gotChars = (0, import_react38.useRef)(0);
|
|
92726
92746
|
const thinkT0 = (0, import_react38.useRef)(null);
|
|
92727
92747
|
const thinkChars = (0, import_react38.useRef)(0);
|
|
92728
92748
|
const thinkText = (0, import_react38.useRef)("");
|
|
@@ -93268,6 +93288,7 @@ ${r.content}`).join("\n\n") };
|
|
|
93268
93288
|
if (!thinkT0.current) thinkT0.current = Date.now();
|
|
93269
93289
|
thinkChars.current += ev.text.length;
|
|
93270
93290
|
thinkText.current += ev.text;
|
|
93291
|
+
gotChars.current += ev.text.length;
|
|
93271
93292
|
break;
|
|
93272
93293
|
case "text_delta":
|
|
93273
93294
|
if (thinkChars.current > 0) {
|
|
@@ -93275,6 +93296,7 @@ ${r.content}`).join("\n\n") };
|
|
|
93275
93296
|
ledRef.current = thoughtRef.current;
|
|
93276
93297
|
}
|
|
93277
93298
|
draftRef.current += ev.text;
|
|
93299
|
+
gotChars.current += ev.text.length;
|
|
93278
93300
|
setDraft((d) => d + ev.text);
|
|
93279
93301
|
break;
|
|
93280
93302
|
case "tool_pending":
|
|
@@ -93502,6 +93524,7 @@ ${r.content}`).join("\n\n") };
|
|
|
93502
93524
|
lastEnd.current = ev;
|
|
93503
93525
|
const dur = turnT0.current ? fmtDur((Date.now() - turnT0.current) / 1e3) : fmtDur(ev.elapsed_s);
|
|
93504
93526
|
turnT0.current = null;
|
|
93527
|
+
gotChars.current = 0;
|
|
93505
93528
|
append({ kind: "turn", text: `${dur} \xB7 ${plural(ev.turns, "step")} \xB7 ${fmtCost2(ev.cost_usd)} session` + (ev.stop_reason !== "done" && !String(ev.stop_reason).startsWith("paused") ? ` \xB7 stopped: ${ev.stop_reason}` : "") });
|
|
93506
93529
|
if (wroteRef.current) setOffer(true);
|
|
93507
93530
|
wroteRef.current = false;
|
|
@@ -94288,7 +94311,8 @@ ${r.content}`).join("\n\n") };
|
|
|
94288
94311
|
const retryLeft = retrying ? Math.max(0, Math.ceil((retrying.until - Date.now()) / 1e3)) : 0;
|
|
94289
94312
|
const phaseWord = retrying ? `model ${retrying.kind}: ${retryLeft ? `retry ${retrying.attempt} in ${retryLeft} s` : `retry ${retrying.attempt} sent`}` : statusOf === "tool" ? "" : status;
|
|
94290
94313
|
const doing = [stepAt >= 0 ? `${stepAt + 1}/${planSteps.length} \xB7 ${planSteps[stepAt].step}` : "", phaseWord].filter(Boolean).join(" \xB7 ") || "working";
|
|
94291
|
-
const
|
|
94314
|
+
const got = gotChars.current >= 4 ? `\u2193 ${fmtTokens(Math.round(gotChars.current / 4))}` : "";
|
|
94315
|
+
const beside = [elapsed >= 1 ? fmtDur(elapsed) : "", got, escOwned ? "" : "esc to interrupt"].filter(Boolean).join(" \xB7 ");
|
|
94292
94316
|
const spinnerLabel = phase === "connecting" ? " starting \u2026" : ` ${doing}${beside ? ` (${beside})` : ""}`;
|
|
94293
94317
|
const spinnerRows = wrapAnsi2(spinnerLabel, Math.max(1, width - 1), { hard: true, trim: false }).split("\n").length;
|
|
94294
94318
|
const rows = stdout?.rows || DEFAULT_ROWS;
|
|
@@ -95065,7 +95089,7 @@ async function sendPending({
|
|
|
95065
95089
|
await init_theme();
|
|
95066
95090
|
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
|
|
95067
95091
|
import { spawnSync as spawnSync6 } from "node:child_process";
|
|
95068
|
-
var MINE3 = true ? "0.2.
|
|
95092
|
+
var MINE3 = true ? "0.2.72" : "0.0.0";
|
|
95069
95093
|
var layout = installLayout();
|
|
95070
95094
|
function completeInstall() {
|
|
95071
95095
|
if (layout.kind !== "npm" || !needsInstall(MINE3)) return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
hum/__init__.py,sha256=
|
|
1
|
+
hum/__init__.py,sha256=u1v7DNbsvjMjgUe0Oq67DVqZRfTvWIUmQn3R1Y-sPYo,104
|
|
2
2
|
hum/auth.py,sha256=JWaNIaEdQM6Px9RJ0MImb_dgcW1wbXPkra-mNKYOtQ8,21171
|
|
3
3
|
hum/catalog.py,sha256=6INNvyhwu69UZV80Ri9pGRc6H2eRzSsqkW08vSfMhAU,5290
|
|
4
4
|
hum/cli.py,sha256=G9m88KBd8Pa95mXEXJgX9PdDn4DJcw09sOb2PurI4vk,81508
|
|
@@ -51,7 +51,7 @@ hum/runtime/hooks.py,sha256=J75DSe5RVT_NDpBY0FRq6gstSDkklrCwmtC9BxRnKMQ,15967
|
|
|
51
51
|
hum/runtime/images.py,sha256=4rZ7Sqiw-X0I2mayLA1xkNd8ZwREPf8Iq02kJJyFZX4,11594
|
|
52
52
|
hum/runtime/lead.py,sha256=Q34siKxfH-EpwqIEB5iMXJNGbVFTbGV1rUVMS8dEyDQ,31037
|
|
53
53
|
hum/runtime/llm.py,sha256=phc4fLlPOxIOdBOJG2S-9MEHaWtG82bO8A20-ivwp3Y,47446
|
|
54
|
-
hum/runtime/loop.py,sha256=
|
|
54
|
+
hum/runtime/loop.py,sha256=1FekU9THC7BfHjvWc2e08b4YLTwUWe-U1lvnZUkCpys,102217
|
|
55
55
|
hum/runtime/lsp.py,sha256=1-JhG_KvbfNq_FLnVmVy2NrvK7d3D-2cO8ayWkR9ybc,30319
|
|
56
56
|
hum/runtime/memory.py,sha256=Z2u9boBWxjaQOOOwY50wfWoGFPPFnKcvfaqOv-O4vWU,14429
|
|
57
57
|
hum/runtime/models.py,sha256=2bTvzgR9yXZmk8aT84TLDYMKTJr8iO4ui8RoWKw5ddU,9395
|
|
@@ -86,7 +86,7 @@ hum/runtime/trajectory.py,sha256=VB9dgsFzmZf7MSoweB-uhGsQzN7SAr6DIpQXgZ3vDyU,742
|
|
|
86
86
|
hum/runtime/trust.py,sha256=wpMKzY2KM3rxDcI9oN8ic7eSa3RW_E9_brK-aw5QNkU,8664
|
|
87
87
|
hum/runtime/uploads.py,sha256=Paqm5buViEk9Hc_zgxMOPRhKESpk2TA1EXd-4aEDIss,4482
|
|
88
88
|
hum/runtime/web.py,sha256=-UfO7hIrumv2qyXr6cpQzns3RT7oj4Dg_rTHK0zNIno,11736
|
|
89
|
-
hum/runtime/workspace.py,sha256=
|
|
89
|
+
hum/runtime/workspace.py,sha256=IQvH9UjUehW629ezlQmLukIrW-0HHyuRs1Efyh-5Ty4,28755
|
|
90
90
|
hum/runtime/worktrees.py,sha256=nl0_Othc7yR0ffn7g8mUKcfJrbWpJIiOixRfmHwq3ro,14296
|
|
91
91
|
hum/sdk/__init__.py,sha256=fHZIn7L4dsCvQoQFj7ESiu-2jc1pKLOo0nwIhjU1veM,2550
|
|
92
92
|
hum/sdk/agent.py,sha256=56fYzjLwjmaMwLoTk2mXb3E_Jo-HVJuSEXudzg3N30s,5077
|
|
@@ -118,10 +118,10 @@ hum/skills/artifact-design/references/reports.md,sha256=5MSv7JGYJHobHXfgAclt_xsf
|
|
|
118
118
|
hum/skills/consult-human/SKILL.md,sha256=5rMKwC5C9L4nn-ifTjQGXl9hsYbeqOCHNl0IEog_T-E,6867
|
|
119
119
|
hum/skills/consult-human/references/examples.md,sha256=hAdTOiJHlv27dTraEyPz0BILqx_8gZj0FPO43b2OMvw,3490
|
|
120
120
|
hum/skills/consult-human/references/hypotheses.md,sha256=a3Hj3_zdxZZS7-bpxXGu2AEgaOV5Q31iVc2VHJ2yjxQ,3263
|
|
121
|
-
hum/tui/cli.mjs,sha256=
|
|
121
|
+
hum/tui/cli.mjs,sha256=u8S3B5ST3qUBmVfnT-fA9zJNuvbus9jl_t5IwX_0dw8,4258810
|
|
122
122
|
humboldt/__init__.py,sha256=EcK3Ou8qg9DLaYCtm5t2EcU-C8xZxP8yxfGBiQkuW-M,236
|
|
123
|
-
hum_cli-0.2.
|
|
124
|
-
hum_cli-0.2.
|
|
125
|
-
hum_cli-0.2.
|
|
126
|
-
hum_cli-0.2.
|
|
127
|
-
hum_cli-0.2.
|
|
123
|
+
hum_cli-0.2.72.dist-info/METADATA,sha256=J-lr7-3YTIjidwkquiFh_ZIwIlQ-mE_PhSt7q5oM8og,1684
|
|
124
|
+
hum_cli-0.2.72.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
125
|
+
hum_cli-0.2.72.dist-info/entry_points.txt,sha256=L-JBWR79zdIsMdTN5K_PSI4HeJ4kwmo1Bm5oc3lVi5A,104
|
|
126
|
+
hum_cli-0.2.72.dist-info/licenses/LICENSE,sha256=-_Jjy2-XAujWZirw6S-ORP1kLKeVuuG8piFwhYLtt8E,742
|
|
127
|
+
hum_cli-0.2.72.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|