@tiens.nguyen/gu-cli 1.0.756 → 1.0.757
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/cli-token.mjs +8 -0
- package/gu-repl.mjs +8 -2
- package/package.json +1 -1
- package/terminal-layout.mjs +16 -0
package/cli-token.mjs
CHANGED
|
@@ -307,6 +307,14 @@ export function barNotice({ token, publicKeyB64, mode, now = new Date(), attempt
|
|
|
307
307
|
if (age <= STALE_AFTER_DAYS * 86_400_000) return null;
|
|
308
308
|
} else if (mode === "client" && !attempted) {
|
|
309
309
|
return null; // Client mode fetches one by itself; do not complain before it has tried.
|
|
310
|
+
} else if (mode === "expert") {
|
|
311
|
+
// NO TOKEN on a Client Expert machine (#292): not "old" — there is none — and not said twice.
|
|
312
|
+
// Startup already prints the linking steps, and the first turn asks for the token in place, so
|
|
313
|
+
// the bar repeating it was the same message in two places (reported with a screenshot).
|
|
314
|
+
return null;
|
|
315
|
+
} else {
|
|
316
|
+
// Hosted client, its automatic fetch has failed: the bar is the only place this is said.
|
|
317
|
+
return { kind: "missing", urgent: false, text: "gu isn't signed in · run gu login" };
|
|
310
318
|
}
|
|
311
319
|
|
|
312
320
|
// ROUTINE, so not an alarm (#292): a token getting old only means updates will stop one day.
|
package/gu-repl.mjs
CHANGED
|
@@ -9208,9 +9208,15 @@ async function localScaffoldState() {
|
|
|
9208
9208
|
/** Print the startup scaffold line — deferred while a turn owns the transcript. */
|
|
9209
9209
|
function announceScaffold() {
|
|
9210
9210
|
if (!scaffoldNotice || following) return;
|
|
9211
|
-
const { kind, text } = scaffoldNotice;
|
|
9211
|
+
const { kind, text, steps } = scaffoldNotice;
|
|
9212
9212
|
scaffoldNotice = null;
|
|
9213
|
-
|
|
9213
|
+
if (kind === "link") {
|
|
9214
|
+
// A setup step, said calmly (#292): the headline, then the steps on their own lines.
|
|
9215
|
+
console.log(GUTTER + yellow("! " + text));
|
|
9216
|
+
for (const s of steps ?? []) console.log(GUTTER + " " + dim(s));
|
|
9217
|
+
} else {
|
|
9218
|
+
console.log(GUTTER + (kind === "ok" ? accent("✓ " + text) : kind === "warn" ? yellow("⚠ " + text) : red("✗ " + text)));
|
|
9219
|
+
}
|
|
9214
9220
|
if (barPinned()) paintBar();
|
|
9215
9221
|
}
|
|
9216
9222
|
|
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.757",
|
|
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
|
@@ -1890,6 +1890,22 @@ export function scaffoldStartupNotice({ local = null, refresh = null, private: p
|
|
|
1890
1890
|
}
|
|
1891
1891
|
if (refresh.ok) return { kind: "ok", text: `scaffold fetched from the gu service (v${refresh.version})` };
|
|
1892
1892
|
const why = String(refresh.error ?? "unknown error").replace(/\.$/, "");
|
|
1893
|
+
// NOT LINKED YET (#292): the one "error" a new Client Expert machine always shows, and it is a
|
|
1894
|
+
// setup step, not a failure — gu asks for the token before the first turn anyway. It used to be
|
|
1895
|
+
// one red sentence ("× scaffold: … Please run `gu token` — copy … then: gu token …") wrapping
|
|
1896
|
+
// mid-word across three rows; now a calm headline and two numbered steps. The account address is
|
|
1897
|
+
// taken from the API's own text, so it follows the site the API was set up for.
|
|
1898
|
+
if (/isn't linked to your gu account/i.test(why)) {
|
|
1899
|
+
const url = (/(https?:\/\/[^\s)]+\/account)/.exec(why)?.[1] ?? "https://gu.getmarsic.cc/account").replace(/^https?:\/\//, "");
|
|
1900
|
+
return {
|
|
1901
|
+
kind: "link",
|
|
1902
|
+
text: "This computer isn't linked to your gu account yet.",
|
|
1903
|
+
steps: [
|
|
1904
|
+
`1. Copy your gu CLI token from ${url}`,
|
|
1905
|
+
"2. Run: gu token <your token> (or just ask something — gu will ask for it)",
|
|
1906
|
+
],
|
|
1907
|
+
};
|
|
1908
|
+
}
|
|
1893
1909
|
return refresh.kept !== undefined
|
|
1894
1910
|
? { kind: "warn", text: `scaffold: couldn't fetch — ${why}. Still using v${refresh.kept}.` }
|
|
1895
1911
|
: { kind: "err", text: `scaffold: ${why}.` };
|