@tiens.nguyen/gu-cli 1.0.710 → 1.0.711
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 +14 -0
- package/package.json +1 -1
- package/terminal-layout.mjs +4 -2
package/gu-repl.mjs
CHANGED
|
@@ -2070,6 +2070,7 @@ const identityLineText = () =>
|
|
|
2070
2070
|
),
|
|
2071
2071
|
folder: folderLabel(),
|
|
2072
2072
|
keyUnchosen: keyChoicePending,
|
|
2073
|
+
apiKeyTail: sessionApiKeyTail,
|
|
2073
2074
|
},
|
|
2074
2075
|
{ orange, cyan: accent, dim, red },
|
|
2075
2076
|
);
|
|
@@ -5883,6 +5884,7 @@ async function addCodingProvider(roleName = "coding") {
|
|
|
5883
5884
|
sessionCodingLabel = model;
|
|
5884
5885
|
sessionCodingUrl = url;
|
|
5885
5886
|
sessionCodingKeyId = keyId;
|
|
5887
|
+
sessionApiKeyTail = secret.slice(-4); // store the tail for the bottom bar
|
|
5886
5888
|
keyChoicePending = false; // the provider's own key was just bound to this folder
|
|
5887
5889
|
await saveSessionCoding(cwd);
|
|
5888
5890
|
await saveSessionCodingKeyId(cwd);
|
|
@@ -7675,6 +7677,9 @@ async function manageCodingKeys(ks, keys) {
|
|
|
7675
7677
|
await saveSessionCodingKeyId(resolve(process.cwd()));
|
|
7676
7678
|
keyChoicePending = false; // chosen — the bar's mark comes off
|
|
7677
7679
|
codingKeyMissingKnown = false;
|
|
7680
|
+
// Fetch the key to get its tail for the bottom bar
|
|
7681
|
+
const keyData = await fetchCodingKey(keys[idx].backendId || "");
|
|
7682
|
+
sessionApiKeyTail = keyData.key ? keyData.key.slice(-4) : "";
|
|
7678
7683
|
console.log(
|
|
7679
7684
|
accent(` ✓ ${folderLabel()} → ${keys[idx].name}`) + dim(` ····${keys[idx].tail}\n`)
|
|
7680
7685
|
);
|
|
@@ -8306,6 +8311,8 @@ let sessionCodingModel = "";
|
|
|
8306
8311
|
* a folder keeps meaning until someone picks.
|
|
8307
8312
|
*/
|
|
8308
8313
|
let sessionCodingKeyId = "";
|
|
8314
|
+
// Last 4 characters of the current API key, for display in the bottom bar
|
|
8315
|
+
let sessionApiKeyTail = "";
|
|
8309
8316
|
// The friendly model name behind sessionCodingModel, for display only: the token footer
|
|
8310
8317
|
// must never show a raw "<kind>::<model>" wire id. Empty = running the account default.
|
|
8311
8318
|
let sessionCodingLabel = "";
|
|
@@ -9973,6 +9980,13 @@ async function main() {
|
|
|
9973
9980
|
}
|
|
9974
9981
|
}
|
|
9975
9982
|
sessionCodingKeyId = await loadSessionCodingKeyId(resolve(process.cwd())); // task #222
|
|
9983
|
+
// Fetch the API key tail after loading the session, if a key is configured
|
|
9984
|
+
if (sessionCodingKeyId) {
|
|
9985
|
+
try {
|
|
9986
|
+
const keyData = await fetchCodingKey("");
|
|
9987
|
+
sessionApiKeyTail = keyData.key ? keyData.key.slice(-4) : "";
|
|
9988
|
+
} catch { /* ignore — the bar works without the tail */ }
|
|
9989
|
+
}
|
|
9976
9990
|
sessionShowThought = await loadSessionShowThought(resolve(process.cwd())); // task #148
|
|
9977
9991
|
sessionUnfinishedTask = await loadSessionUnfinishedTask(resolve(process.cwd()));
|
|
9978
9992
|
// Task #104: seed the ↓ global OUTPUT-token total (user + coding-URL) from the API.
|
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.711",
|
|
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",
|
package/terminal-layout.mjs
CHANGED
|
@@ -2078,7 +2078,7 @@ export function activeCoderName({
|
|
|
2078
2078
|
const passthrough = (v) => v;
|
|
2079
2079
|
|
|
2080
2080
|
export function identityRow(
|
|
2081
|
-
{ coder = "", folder = "", keyUnchosen = false } = {},
|
|
2081
|
+
{ coder = "", folder = "", keyUnchosen = false, apiKeyTail = "" } = {},
|
|
2082
2082
|
{ orange = passthrough, cyan = passthrough, dim = passthrough, red = passthrough } = {},
|
|
2083
2083
|
) {
|
|
2084
2084
|
const name = String(coder ?? "").trim();
|
|
@@ -2086,7 +2086,9 @@ export function identityRow(
|
|
|
2086
2086
|
// The mark only means anything beside a named coder: with none shown there is nothing for it
|
|
2087
2087
|
// to be about, and it would read as a fault in the folder.
|
|
2088
2088
|
const mark = name && keyUnchosen ? red(" ⚠ key not chosen") : "";
|
|
2089
|
-
|
|
2089
|
+
// API key tail: show the last 4 characters of the API key when available (e.g., "| abcd")
|
|
2090
|
+
const keyIndicator = apiKeyTail ? dim(" | ") + dim(apiKeyTail) : "";
|
|
2091
|
+
return (name ? orange(name) + mark + keyIndicator + dim(" | ") : "") + cyan(where);
|
|
2090
2092
|
}
|
|
2091
2093
|
|
|
2092
2094
|
/**
|