agy-cli 0.1.65: usage windows name the model ids they cover (#1180)

A usage window from `agy usage` now carries the model ids it covers, taken
from the catalog `agy models` listed: each display name in the group's
"Models within this group:" line (or the group's own name) maps to the
family id and every effort variant the catalog serves. With no catalog yet,
or a name the catalog doesn't have, a window has no ids. The windows stay
aside, so routing is unchanged; agy-cli 0.1.65.

Run at 8acf7ffb5 on macOS (mote), CI-style with a temp HOME:
bun test packages/agy-cli, 35 pass, 0 fail; bun scripts/check.mjs agy-cli
passes. Not tried: a real agy account (the local one answers 403).

Co-authored-by: Ruining Yang <ArmedHelicopter@users.noreply.github.com>
This commit is contained in:
Ruining Yang
2026-11-15 20:31:27 +08:00
committed by GitHub
co-authored by Ruining Yang
parent 6b5c19d50e
commit f4c2f2fb2b
6 changed files with 202 additions and 2 deletions
+7
View File
@@ -8,6 +8,7 @@ import os from "node:os"
import path from "node:path"
import { fileURLToPath } from "node:url"
import { createUsageReader } from "./usage.mjs"
import { storeCatalogRows } from "./model-ids.mjs"
import { backgroundBlocked, cannotSignIn, forgetStoredSignIn, storedEmail, storedSignInNow } from "./signin.mjs"
import { sanitizePatternFields } from "./re2-pattern.mjs"
import { startLogin } from "./login.mjs"
@@ -620,6 +621,8 @@ function buildModelCatalog(list) {
}
function fallbackModelCatalog(agyPath = null) {
// The usage reader names ids on its windows from the catalog being served.
storeCatalogRows(FALLBACK_MODELS)
return { agyPath, list: FALLBACK_MODELS, catalog: null, offeredKey: null, isFallback: true, fetchedAt: 0, lastAttemptAt: null }
}
@@ -692,6 +695,8 @@ function startingModelCatalog(agyPath) {
acpOfferedModels = new Map(saved.offered.map(({ id, name }) => [id, name]))
acpOfferedKey = [...acpOfferedModels.keys()].sort().join("\n")
}
// The usage reader names ids on its windows from the catalog being served.
storeCatalogRows(saved.list)
return { agyPath, list: saved.list, catalog: null, offeredKey: null, isFallback: false, fetchedAt: 0, lastAttemptAt: null }
}
@@ -707,6 +712,8 @@ function useAgyPath(agyPath) {
function storeListedCatalog(agyPath, list, lastAttemptAt) {
saveCatalog(agyPath, { list })
// The usage reader names ids on its windows from the catalog being served.
storeCatalogRows(list)
cachedModelCatalog = {
agyPath,
list,