@modelstatus/cli 0.1.50 → 0.1.52
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/package.json +1 -1
- package/src/tui/app.js +26 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modelstatus/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.52",
|
|
4
4
|
"description": "Track which AI models you use, where, and never get surprised by a retirement. Free offline model-health for any repo (mm status), browser sign-in for cloud inventory + alerts.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"llm",
|
package/src/tui/app.js
CHANGED
|
@@ -40,34 +40,39 @@ const GATE_KEYS = [{ k: "1-8", label: "switch" }, { k: "7", label: "sign in" }];
|
|
|
40
40
|
// toast, status, keybar, bottomRule) — the body fills whatever rows remain.
|
|
41
41
|
const CHROME_ROWS = 10;
|
|
42
42
|
|
|
43
|
+
// Rows to reserve below the frame (termRows = rows - reserve). POSITIVE shrinks
|
|
44
|
+
// the frame, NEGATIVE grows it past the reported height.
|
|
45
|
+
// - 1 everywhere: a full-height ink frame write+newlines its bottom line and
|
|
46
|
+
// scrolls the buffer up 1/render; the 1-row reserve keeps the last line blank.
|
|
47
|
+
// - -7 in Warp: empirically (the user dialing it live in their Warp), the frame
|
|
48
|
+
// must be GROWN ~7 rows past stdout.rows or the top clips — Warp's block model
|
|
49
|
+
// reports/handles the alt-screen height such that a flush-height frame rides too
|
|
50
|
+
// high. So in Warp we render TALLER, which pushes the window down into view.
|
|
51
|
+
// Gated on Warp (a negative reserve elsewhere would over-grow + clip the top of
|
|
52
|
+
// a normal full-screen terminal).
|
|
53
|
+
const WARP_RESERVE = -7;
|
|
54
|
+
|
|
55
|
+
/** True when running under Warp (TERM_PROGRAM=WarpTerminal, or any WARP_* env, or
|
|
56
|
+
* TERM_PROGRAM merely containing "warp" — broad so detection doesn't silently
|
|
57
|
+
* miss a build/config that doesn't set the canonical value). */
|
|
58
|
+
function isWarp(env) {
|
|
59
|
+
if (String(env.TERM_PROGRAM || "").toLowerCase().includes("warp")) return true;
|
|
60
|
+
for (const k in env) if (k.startsWith("WARP_")) return true;
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
|
|
43
64
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* the bottom line, which scrolls the buffer up by 1 each render; reserving the
|
|
48
|
-
* last row keeps it blank so nothing ever scrolls.
|
|
49
|
-
* - 6 rows in Warp: Warp keeps ~5 rows of block chrome (sticky command header +
|
|
50
|
-
* pinned input) drawn OVER the alternate screen and over-reports stdout.rows by
|
|
51
|
-
* that much, so the TOP clips unless we also subtract them (1 guard + 5 chrome;
|
|
52
|
-
* measured against the user's Warp build — see Warp issues #6428/#2373, the
|
|
53
|
-
* chrome area can't be reclaimed via alt_screen_padding). Gated on TERM_PROGRAM
|
|
54
|
-
* so non-Warp terminals keep the plain 1-row reserve (an extra reserve elsewhere
|
|
55
|
-
* would leave a blank band).
|
|
56
|
-
*
|
|
57
|
-
* MM_TUI_RESERVE_ROWS (integer ≥ 0) overrides the whole reserve so a user on a
|
|
58
|
-
* different Warp version / input position / timing-line setting can self-tune
|
|
59
|
-
* (e.g. =5 or =7) without waiting for a release; 0 opts out entirely.
|
|
65
|
+
* MM_TUI_RESERVE_ROWS (any integer, may be negative) overrides the reserve so a
|
|
66
|
+
* user on a different terminal/version can self-tune in either direction without
|
|
67
|
+
* a release; blank/non-integer falls back to the gated default.
|
|
60
68
|
*/
|
|
61
69
|
export function rowsReserve(env = process.env) {
|
|
62
|
-
// Only a non-blank, integer-valued string overrides (so `MM_TUI_RESERVE_ROWS=`
|
|
63
|
-
// or stray whitespace falls back to the default rather than being read as 0 —
|
|
64
|
-
// `Number("")` is 0). `=0` is honored as an explicit opt-out.
|
|
65
70
|
const raw = env.MM_TUI_RESERVE_ROWS;
|
|
66
71
|
if (typeof raw === "string" && raw.trim() !== "") {
|
|
67
72
|
const n = Number(raw);
|
|
68
|
-
if (Number.isInteger(n)
|
|
73
|
+
if (Number.isInteger(n)) return n;
|
|
69
74
|
}
|
|
70
|
-
return env
|
|
75
|
+
return isWarp(env) ? WARP_RESERVE : 1;
|
|
71
76
|
}
|
|
72
77
|
|
|
73
78
|
/** Frame height for a terminal of `rows` rows: reserve rows, then clamp to a
|