@tiens.nguyen/gu-cli 1.0.938 → 1.0.940
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/README.md +17 -7
- package/agent-deps-preflight.mjs +1 -1
- package/autocompact.mjs +2 -2
- package/browser-bridge.mjs +2 -2
- package/browser-chrome.mjs +2 -2
- package/browser-command.mjs +4 -4
- package/browser-extension/README.md +6 -6
- package/clear-logs.mjs +3 -3
- package/clear-state.mjs +3 -3
- package/cli-token.mjs +8 -8
- package/client-expert-api.mjs +9 -9
- package/client-expert-run.mjs +7 -7
- package/client-expert-setup.mjs +4 -4
- package/command-allow.mjs +1 -1
- package/conversation-archive.mjs +2 -2
- package/credential-recovery.mjs +1 -1
- package/daemon-control.mjs +4 -4
- package/device-login.mjs +3 -3
- package/free-model.mjs +35 -3
- package/full-log-command.mjs +1 -1
- package/gonext_agent_chat.py +72 -72
- package/gu-cli.mjs +29 -28
- package/gu-home-move.mjs +193 -0
- package/gu-repl.mjs +72 -54
- package/gu_browser.py +3 -3
- package/gu_free_budget.py +11 -9
- package/gu_gif.py +1 -1
- package/gu_hooks.py +1 -1
- package/gu_mcp.py +22 -2
- package/gu_turn_notes.py +2 -2
- package/hooks-config.mjs +4 -4
- package/image-paste.mjs +8 -8
- package/install-path.mjs +1 -1
- package/log-level.mjs +1 -1
- package/log-policy.mjs +1 -1
- package/lsp-host.mjs +2 -2
- package/lsp-registry.mjs +9 -9
- package/mcp-command.mjs +1 -1
- package/mcp-config.mjs +5 -5
- package/model-doctor.mjs +10 -10
- package/mongo-mac.mjs +2 -2
- package/mongo-windows.mjs +3 -3
- package/package.json +2 -1
- package/platform-tools.mjs +3 -3
- package/poll-errors.mjs +2 -2
- package/prompt_scaffold_check.py +1 -1
- package/proxy-store.mjs +1 -1
- package/python-unix.mjs +6 -6
- package/python-windows.mjs +1 -1
- package/rag-selftest.mjs +2 -2
- package/resume-memory.mjs +1 -1
- package/scripts/image-paste-check.mjs +1 -1
- package/setup-fixes.mjs +4 -4
- package/shell-details.mjs +2 -2
- package/skill-install.mjs +9 -9
- package/skill-package.mjs +10 -10
- package/skill-source.mjs +4 -4
- package/skills-copy.mjs +15 -15
- package/skills.mjs +4 -4
- package/support-bundle.mjs +6 -6
- package/support-report.mjs +5 -5
- package/terminal-layout.mjs +1 -1
- package/turn-notes.mjs +2 -2
- package/version-check.mjs +1 -1
- package/workspace-revert.mjs +2 -2
package/free-model.mjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* the month's allowance is spent. The key is not in gu: the owner can replace it on the admin page,
|
|
8
8
|
* and gu picks the new one up the next time it fetches (each start, and after /voucher).
|
|
9
9
|
*
|
|
10
|
-
* ~/.
|
|
10
|
+
* ~/.gu/free-model.json (0600) — { url, model, keyId, price, period, allowanceMicro, spentMicro }
|
|
11
11
|
*
|
|
12
12
|
* Money is in MICRO-DOLLARS (1 USD = 1,000,000) so the sums are whole numbers, as on the server
|
|
13
13
|
* (api/src/billing/llmAllowance.ts — the same formula and the same levels).
|
|
@@ -234,6 +234,12 @@ export function stateFromPreset(preset, prev, now = new Date()) {
|
|
|
234
234
|
/**
|
|
235
235
|
* The line to show, or null. `over` is the refusal itself; warn/low are shown once per level.
|
|
236
236
|
*/
|
|
237
|
+
/** What to call a slot: an extra provider's label; the main slot is "Gemini" on Google's server (GH #580), else "free model". */
|
|
238
|
+
function slotName(slot, url) {
|
|
239
|
+
if (slot.extra) return slot.label;
|
|
240
|
+
return /generativelanguage\.googleapis\.com/.test(String(url)) ? "Gemini" : "free model";
|
|
241
|
+
}
|
|
242
|
+
|
|
237
243
|
export function notice(state, now = new Date(), url = "") {
|
|
238
244
|
const s = current(state, now);
|
|
239
245
|
if (!s) return null;
|
|
@@ -241,8 +247,8 @@ export function notice(state, now = new Date(), url = "") {
|
|
|
241
247
|
if (!slot.allowanceMicro) return null;
|
|
242
248
|
const level = levelFor(slot.spentMicro, slot.allowanceMicro);
|
|
243
249
|
const pct = Math.min(100, Math.floor((100 * slot.spentMicro) / slot.allowanceMicro));
|
|
244
|
-
const name = slot
|
|
245
|
-
const Name =
|
|
250
|
+
const name = slotName(slot, url);
|
|
251
|
+
const Name = name === "free model" ? "Free model" : name;
|
|
246
252
|
if (level === "over") {
|
|
247
253
|
const other = slot.extra ? " — or another free model with /model —" : "";
|
|
248
254
|
return { level, text: `Your ${name} allowance for this month is used up. Add your own model key with /model${other} — or a local one with Ollama — to keep going; it renews on the 1st.` };
|
|
@@ -252,6 +258,32 @@ export function notice(state, now = new Date(), url = "") {
|
|
|
252
258
|
return { level, text: null };
|
|
253
259
|
}
|
|
254
260
|
|
|
261
|
+
const MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
|
262
|
+
|
|
263
|
+
/** GH #580: the day a month's allowance comes back — the 1st of the month after `period` ("2026-12" → "1 Jan 2027"). */
|
|
264
|
+
export function renewsOn(period) {
|
|
265
|
+
const [y, m] = String(period ?? "").split("-").map(Number);
|
|
266
|
+
if (!y || !m) return "the 1st";
|
|
267
|
+
const d = new Date(Date.UTC(y, m, 1));
|
|
268
|
+
return `1 ${MONTHS[d.getUTCMonth()]} ${d.getUTCFullYear()}`;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* GH #580: said INSTEAD of "Ready — type your first question" when the model just set up has nothing left this
|
|
273
|
+
* month — e.g. a second Gemini code after the first month's allowance was spent: a code adds its month at the
|
|
274
|
+
* END, it does not refill this one (owner, 2026-12-04). → the sentence, or null when there is allowance left.
|
|
275
|
+
*/
|
|
276
|
+
export function spentAtSetup(state, url, now = new Date(), { redeemed = false } = {}) {
|
|
277
|
+
const s = current(state, now);
|
|
278
|
+
if (!s) return null;
|
|
279
|
+
const slot = slotFor(s, url);
|
|
280
|
+
if (!slot.allowanceMicro || slot.spentMicro < slot.allowanceMicro) return null;
|
|
281
|
+
const name = slotName(slot, url);
|
|
282
|
+
const Name = name === "free model" ? "The free model" : name;
|
|
283
|
+
return `This month's ${name} allowance is already used up${redeemed ? " — your code adds its month at the end, it does not refill this one" : ""}. ` +
|
|
284
|
+
`${Name} works again on ${renewsOn(s.period)}; until then, /model switches to your own key.`;
|
|
285
|
+
}
|
|
286
|
+
|
|
255
287
|
/**
|
|
256
288
|
* Is a NEW turn on this coder refused? Only at the START of a turn — never mid-turn — and only when
|
|
257
289
|
* the coder IS the free model (any provider; each has its own allowance). → the sentence, or null.
|
package/full-log-command.mjs
CHANGED
|
@@ -19,7 +19,7 @@ import { dirname, join } from "node:path";
|
|
|
19
19
|
|
|
20
20
|
export const USAGE = "gu full-log on|off|status [email or account id]";
|
|
21
21
|
/** The daemon's minute tick sees this and re-reads the policy at once (see gu-cli.mjs startLogPolicy). */
|
|
22
|
-
export const REFRESH_FLAG = join(homedir(), ".
|
|
22
|
+
export const REFRESH_FLAG = join(homedir(), ".gu", "log-policy.refresh");
|
|
23
23
|
export const TOKEN_PROMPT = "Admin token (Admin → Full Log → Create CLI token), hidden:";
|
|
24
24
|
|
|
25
25
|
/** → { action: "on"|"off"|"status", account? } | { error } */
|