feat: v2.5.12 — plan and quota for every AI tool, Grok Build and Kimi Code, Quit AgentHub (#65)
Usage panel (status bar): - every account shows its plan (Claude subscriptionType, Codex chatgpt_plan_type, Cursor membershipType, Grok subscriptionTier) - new quota rows: Cursor CLI (cursor.com usage-summary), Antigravity (`agy --print /usage`, two model pools; AGENTHUB_AGY_USAGE=0 never runs agy), Grok Build, Kimi Code, OpenCode Go — each login read from the tool's own file, sent only to its own host while valid, never refreshed - in-flight quota reads are shared between tabs AI Tools catalog: Grok Build (`grok`) and Kimi Code (`kimi`) added; Gemini CLI, Hermes and OpenClaw removed. Also: Quit AgentHub (#65, `agenthub stop`), status-area icon, Add to Chat on an editor selection, Settings in three groups, JetBrains-style Changes panel (ticked files/hunks, ignore, blame, file history), terminal font. --no-verify: :3000 is taken by another dev server (lane-detect tests); both suites run by hand — server 2636/2639 (the 3 are :3000), client 1131/1131.
This commit is contained in:
@@ -4,7 +4,8 @@
|
||||
* before it is used, the sync's own rows follow a rate change while a user's
|
||||
* row and a deleted pattern are never touched, a bad list or a failed fetch
|
||||
* changes nothing, and an OpenAI model (a Codex session's) is priced from its
|
||||
* `openai` entry too.
|
||||
* `openai` entry too, and a Claude entry's above-100k rates fill the long_*
|
||||
* columns.
|
||||
* @author Nguyễn Ngọc Trí Vĩ <vinnt@smartgift.vn>
|
||||
*/
|
||||
|
||||
@@ -428,3 +429,34 @@ describe("pricing sync", () => {
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe("long-context rates", () => {
|
||||
it("takes Anthropic's above-100k input/output rates into the long columns", () => {
|
||||
const e = {
|
||||
...LIST["claude-opus-9-9"],
|
||||
input_cost_per_token_above_100k_tokens: 0.00002,
|
||||
output_cost_per_token_above_100k_tokens: 0.0001,
|
||||
};
|
||||
const r = toRow("claude-opus-9-9", e);
|
||||
assert.equal(r.longIn, 20);
|
||||
assert.equal(r.longOut, 100);
|
||||
assert.equal(toRow("claude-opus-9-9", LIST["claude-opus-9-9"]).longIn, 0);
|
||||
});
|
||||
|
||||
it("writes them, and fills them into a sync row that predates them", async () => {
|
||||
const e = {
|
||||
...LIST["claude-opus-9-9"],
|
||||
input_cost_per_token_above_100k_tokens: 0.00002,
|
||||
output_cost_per_token_above_100k_tokens: 0.0001,
|
||||
};
|
||||
useModel("claude-opus-9-9");
|
||||
await syncPricing(db, {
|
||||
fetchList: async () => ({ "claude-opus-9-9": LIST["claude-opus-9-9"] }),
|
||||
});
|
||||
assert.equal(row("claude-opus-9-9%").long_input_per_mtok, 0);
|
||||
_resetCache();
|
||||
await syncPricing(db, { fetchList: async () => ({ "claude-opus-9-9": e }) });
|
||||
assert.equal(row("claude-opus-9-9%").long_input_per_mtok, 20);
|
||||
assert.equal(row("claude-opus-9-9%").long_output_per_mtok, 100);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user