@tiens.nguyen/gu-cli 1.0.728 → 1.0.729
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 +16 -0
- package/package.json +1 -1
package/gu-repl.mjs
CHANGED
|
@@ -6333,6 +6333,14 @@ function listJsonFiles(dir) {
|
|
|
6333
6333
|
}
|
|
6334
6334
|
}
|
|
6335
6335
|
|
|
6336
|
+
/** The email of the account this worker key belongs to, or "" (older API, none on record, offline). */
|
|
6337
|
+
let accountEmailPromise = null;
|
|
6338
|
+
async function fetchAccountEmail() {
|
|
6339
|
+
const s = await fetchWorkerSettings();
|
|
6340
|
+
const e = typeof s?.userEmail === "string" ? s.userEmail.trim() : "";
|
|
6341
|
+
return /^[^\s@]+@[^\s@]+$/.test(e) ? e : "";
|
|
6342
|
+
}
|
|
6343
|
+
|
|
6336
6344
|
async function fetchWorkerSettings() {
|
|
6337
6345
|
try {
|
|
6338
6346
|
const r = await fetch(`${apiBase}/api/worker/settings`, {
|
|
@@ -10349,6 +10357,9 @@ async function main() {
|
|
|
10349
10357
|
// Show which models will answer, straight from user settings (also validates auth).
|
|
10350
10358
|
try {
|
|
10351
10359
|
const probe = await probeWithRecovery();
|
|
10360
|
+
// WHICH ACCOUNT, shown under the key in the banner (client mode). Asked for now and read when
|
|
10361
|
+
// the banner is drawn, so startup never waits on it; private mode has no web account to name.
|
|
10362
|
+
accountEmailPromise = isClientExpert() ? Promise.resolve("") : fetchAccountEmail();
|
|
10352
10363
|
// A NEW gu SESSION: where does its scaffold come from? (task #246) Your file ("loaded") or the
|
|
10353
10364
|
// gu service ("fetched" — the refresh the session then reuses). Background: never delays startup.
|
|
10354
10365
|
void checkPromptScaffoldAtStart();
|
|
@@ -10478,6 +10489,11 @@ async function main() {
|
|
|
10478
10489
|
// shown when it is actually routing, and never the credentials — host and user only.
|
|
10479
10490
|
if (bannerProxy) statusRows.push(lbl("proxy") + bannerProxy);
|
|
10480
10491
|
statusRows.push(dim(`key ${workerKey.slice(0, 8)}…`));
|
|
10492
|
+
// Under the key, in client mode: the account this machine signs in as — so a machine paired
|
|
10493
|
+
// to the wrong account is obvious at a glance. Nothing when the API does not say (older API,
|
|
10494
|
+
// or no email on record): an absent line is better than a guessed one.
|
|
10495
|
+
const accountEmail = await (accountEmailPromise ?? Promise.resolve(""));
|
|
10496
|
+
if (accountEmail) statusRows.push(dim(`account ${accountEmail}`));
|
|
10481
10497
|
console.log(renderBanner(statusRows));
|
|
10482
10498
|
}
|
|
10483
10499
|
// Task #127, Phase 3: if the base chat model server isn't answering, offer to set it up
|
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.729",
|
|
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",
|