@tiens.nguyen/gu-cli 1.0.878 → 1.0.880
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/gu-repl.mjs +11 -3
- package/package.json +1 -1
package/gu-repl.mjs
CHANGED
|
@@ -550,6 +550,7 @@ const orange = (s) => color256(208, s); // peak-token label (task #84)
|
|
|
550
550
|
// A menu's ACTION rows (pick another model…, API keys…, add a provider…) in orange, apart from the
|
|
551
551
|
// models above them (#248). \x1b[22m first: an unselected picker row is wrapped in dim, which would
|
|
552
552
|
// turn the orange grey. Plain text when colour is off (NO_COLOR, TERM=dumb).
|
|
553
|
+
const ACTION_ROW_START = "\x1b[22m\x1b[38;5;208m";
|
|
553
554
|
const actionRow = (s) => (dim("x") === "x" ? s : `\x1b[22m${orange(s)}`);
|
|
554
555
|
// Compact token count: 950 → "950", 12300 → "12.3k", 1500000 → "1.5M" (task #83).
|
|
555
556
|
const fmtTokens = (n) => {
|
|
@@ -8982,7 +8983,9 @@ async function askKeyName(prompt = " key name: ") {
|
|
|
8982
8983
|
*/
|
|
8983
8984
|
async function askServerKey({ host = "", nameHint = '"work", "personal"', optional = false } = {}) {
|
|
8984
8985
|
const ps = await import("./coding-provider-setup.mjs");
|
|
8985
|
-
|
|
8986
|
+
// Esc is said here (#249): the prompt that follows is bare text, with nothing on it saying a
|
|
8987
|
+
// way out exists — Esc cancels the whole add, nothing saved.
|
|
8988
|
+
console.log("\n" + GUTTER + dim(`A name just tells keys apart — ${nameHint}. Esc to cancel.`));
|
|
8986
8989
|
const name = (await askKeyName()).trim();
|
|
8987
8990
|
console.log(GUTTER + dim(SECRET_KEY_HINT));
|
|
8988
8991
|
const secret = (await askSecret(` API key${host ? ` for ${host}` : ""}${name ? ` (${name})` : ""}: `)).trim();
|
|
@@ -11290,7 +11293,11 @@ function drawList(redraw) {
|
|
|
11290
11293
|
const box = listMulti ? (listChecked.has(i) ? "[x] " : "[ ] ") : "";
|
|
11291
11294
|
const left = listDeadline && i === listTimeoutIndex ? " (auto in " + countdownLabel(listDeadline - Date.now()) + ")" : "";
|
|
11292
11295
|
const body = box + listItems[i] + left;
|
|
11293
|
-
|
|
11296
|
+
// An orange action row (#249) gets an orange ▸ too — the cursor in the row's own colour.
|
|
11297
|
+
const cursor = i === listSel
|
|
11298
|
+
? (String(listItems[i]).startsWith(ACTION_ROW_START) ? orange("▸ ") + body : accent("▸ " + body))
|
|
11299
|
+
: dim(" " + body);
|
|
11300
|
+
return clipVisible(GUTTER + cursor, width - 1);
|
|
11294
11301
|
};
|
|
11295
11302
|
const marker = (text) => clipVisible(GUTTER + dim(text), width - 1);
|
|
11296
11303
|
const rows = [];
|
|
@@ -11308,7 +11315,8 @@ function drawList(redraw) {
|
|
|
11308
11315
|
// The cap's message rides UNDER the list, in the same block, so it is erased and redrawn with
|
|
11309
11316
|
// it — a note printed into the scrolling output would stay on screen after the list is gone.
|
|
11310
11317
|
if (listNote) rows.push(clipVisible(GUTTER + yellow(listNote), width - 1));
|
|
11311
|
-
|
|
11318
|
+
// Indented like the rows' text (past the "▸ " column), not like the ▸ itself.
|
|
11319
|
+
if (listFooter) rows.push(clipVisible(GUTTER + dim(" " + listFooter), width - 1));
|
|
11312
11320
|
// On a redraw the caret sits one row BELOW the block (each draw ends with "\n").
|
|
11313
11321
|
const up = redraw ? physicalRows(listRowsDrawn, width) : 0;
|
|
11314
11322
|
// #321: what the screen held under the picker when it opened, and how far it reaches — so the
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiens.nguyen/gu-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.880",
|
|
4
4
|
"description": "Gu CLI — the gu terminal plus the local worker that runs agent / OCR / PDF / embedding jobs on your Mac (Ollama / MLX / OpenAI-compatible).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|