diff --git a/lib/nexus/engines.js b/lib/nexus/engines.js index 2494191..8bba9a4 100644 --- a/lib/nexus/engines.js +++ b/lib/nexus/engines.js @@ -8,7 +8,7 @@ const { codexMcpArgs } = require("./engine-mcp"); // per-run MCP `-c` overrides for codex (pure) const ENGINES = { __proto__: null, // null prototype: a typed name like "toString" is never an engine claude: { - label: "Claude Code", bin: "claude", install: "npm i -g @anthropic-ai/claude-code", kind: "stream", paid: true, ctx: 200000, model: "claude-opus-5-5", models: ["claude-opus-5-5", "claude-sonnet-5-5", "claude-haiku-5-5", "claude-fable-5-1"], + label: "Claude Code", bin: "claude", install: "npm i -g @anthropic-ai/claude-code", kind: "stream", paid: true, ctx: 200000, model: "claude-opus-5-5", models: ["claude-opus-5-5", "claude-sonnet-5-5", "claude-haiku-5-5", "claude-fable-5-2"], caps: { effort: true, appendSystemPrompt: true, fallbackModel: true, maxBudget: true, disallowedTools: true, cowork: true, model: true }, args: (p, o) => { const a = ["-p", p, "--output-format", "text"]; if (o.cont) a.push("--continue"); if (o.autonomous) a.push("--dangerously-skip-permissions"); if (o.model) a.push("--model", o.model); if (o.effort) a.push("--effort", o.effort === "ultracode" ? "max" : o.effort); if (o.maxTurns) a.push("--max-turns", String(o.maxTurns)); return a; }, tips: ["Claude can search the web, run bash, read/write files and spawn sub-agents to parallelize", "your real token usage and dollar cost update live in the status bar", "plan mode (shift+tab) has Claude outline the work before it touches any files", "Claude reads .nexus/NEXUS.md every session — keep project context there"], diff --git a/lib/nexus/pricing.js b/lib/nexus/pricing.js index 32efeeb..f0ac366 100644 --- a/lib/nexus/pricing.js +++ b/lib/nexus/pricing.js @@ -21,6 +21,8 @@ // 100,000 tokens (input incl. cache reads/writes). Bare aliases resolve to the // newest model of the family, as Claude Code does. const CLAUDE_PRICES = { + "fable 5.2": { in: 8, cw5: 10, cw1h: 16, cr: 0.2, out: 40 }, + "mythos 5.2": { in: 8, cw5: 10, cw1h: 16, cr: 0.2, out: 40 }, "fable 5.1": { in: 10, cw5: 12.5, cw1h: 20, cr: 0.25, out: 50 }, "mythos 5.1": { in: 10, cw5: 12.5, cw1h: 20, cr: 0.25, out: 50 }, "fable 5.0": { in: 10, cw5: 12.5, cw1h: 20, cr: 1, out: 50 }, @@ -42,9 +44,9 @@ const CLAUDE_PRICES = { "haiku 4.5": { in: 1, cw5: 1.25, cw1h: 2, cr: 0.1, out: 5 }, "haiku 3.5": { in: 0.8, cw5: 1, cw1h: 1.6, cr: 0.08, out: 4 }, }; -const CLAUDE_LATEST = { opus: "opus 5.5", sonnet: "sonnet 5.5", haiku: "haiku 5.5", fable: "fable 5.1", mythos: "mythos 5.1" }; +const CLAUDE_LATEST = { opus: "opus 5.5", sonnet: "sonnet 5.5", haiku: "haiku 5.5", fable: "fable 5.2", mythos: "mythos 5.2" }; const PRICING_SOURCE = "https://platform.claude.com/docs/en/about-claude/pricing"; -const PRICING_CHECKED = "2026-10-17"; +const PRICING_CHECKED = "2026-11-10"; // "claude-opus-5-5", "claude-opus-5-5[1m]", "Opus 5.5", "opus" -> "opus 5.5"; // "claude-opus-4-20250514" -> "opus 4.0"; "claude-3-5-haiku-..." -> "haiku 3.5". diff --git a/test/run.js b/test/run.js index 0a841a5..2d0e882 100644 --- a/test/run.js +++ b/test/run.js @@ -51,7 +51,7 @@ const eq = (name, a, b) => ok(name + " (" + JSON.stringify(a) + " === " + JSON. const group = (t) => console.log("\n\x1b[1m" + t + "\x1b[0m"); group("pricing"); -for (const [m, i, o] of [["opus", 4, 20], ["claude-opus-5-5", 4, 20], ["claude-opus-4-8", 5, 25], ["claude-opus-4-1-20250805", 15, 75], ["sonnet", 2, 10], ["claude-sonnet-4-6", 3, 15], ["haiku", 0.1, 0.5], ["claude-haiku-4-5-20251001", 1, 5], ["claude-3-5-haiku-20241022", 0.8, 4], ["fable", 10, 50], ["gemini-2.5-pro", 1.25, 10], ["gemini-2.5-flash", 0.3, 2.5], ["gpt-5-codex", 1.25, 10], ["o4-mini", 1.1, 4.4], ["gpt-4o", 2.5, 10], ["totally-unknown", 3, 15]]) +for (const [m, i, o] of [["opus", 4, 20], ["claude-opus-5-5", 4, 20], ["claude-opus-4-8", 5, 25], ["claude-opus-4-1-20250805", 15, 75], ["sonnet", 2, 10], ["claude-sonnet-4-6", 3, 15], ["haiku", 0.1, 0.5], ["claude-haiku-4-5-20251001", 1, 5], ["claude-3-5-haiku-20241022", 0.8, 4], ["fable", 8, 40], ["gemini-2.5-pro", 1.25, 10], ["gemini-2.5-flash", 0.3, 2.5], ["gpt-5-codex", 1.25, 10], ["o4-mini", 1.1, 4.4], ["gpt-4o", 2.5, 10], ["totally-unknown", 3, 15]]) ok("priceOf " + m, priceOf(m).in === i && priceOf(m).out === o); { const P = require("../lib/nexus/pricing"); @@ -59,6 +59,8 @@ for (const [m, i, o] of [["opus", 4, 20], ["claude-opus-5-5", 4, 20], ["claude-o ok("opus 5.5 exact cache rates (5m 5, 1h 8, read 0.20)", o55.cw5 === 5 && o55.cw1h === 8 && o55.cr === 0.2 && o55.label === "Claude Opus 5.5" && o55.known); ok("sonnet 5.5 cache read 0.10, sonnet 5 cache read 0.20", P.priceOf("claude-sonnet-5-5").cr === 0.1 && P.priceOf("claude-sonnet-5").cr === 0.2); ok("fable 5.1 cache read 0.25, opus 4 (dated id) = 15/75", P.priceOf("claude-fable-5-1").cr === 0.25 && P.priceOf("claude-opus-4-20250514").in === 15); + { const f = P.priceOf("claude-fable-5-2"); ok("fable 5.2 exact rates (8/40, 5m 10, 1h 16, read 0.20)", f.in === 8 && f.out === 40 && f.cw5 === 10 && f.cw1h === 16 && f.cr === 0.2 && f.known && f.label === "Claude Fable 5.2"); } + ok("fable 5.1 keeps its own price", P.priceOf("claude-fable-5-1").in === 10 && P.priceOf("claude-fable-5-1").out === 50); ok("unlisted claude version falls back to family latest, flagged", P.priceOf("claude-opus-9-9").in === 4 && P.priceOf("claude-opus-9-9").known === false); eq("costOf opus 5.5, 1M in every bucket", P.costOf("claude-opus-5-5", { input: 1e6, output: 1e6, cacheWrite5m: 1e6, cacheWrite1h: 1e6, cacheRead: 1e6 }), 37.2); eq("haiku 5.5 tier: 50k prompt", P.costOf("claude-haiku-5-5", { input: 50000 }), 0.005); @@ -3175,6 +3177,7 @@ ok("shouldCheck: first launch runs; throttled within 4h; runs after", shouldChec eq("claude-sonnet-5-5 -> Sonnet 5.5", modelLabel("claude-sonnet-5-5"), "Sonnet 5.5"); eq("claude-haiku-5-5 -> Haiku 5.5", modelLabel("claude-haiku-5-5"), "Haiku 5.5"); eq("fable-5-1 -> Fable 5.1", modelLabel("fable-5-1"), "Fable 5.1"); + eq("claude-fable-5-2 -> Fable 5.2", modelLabel("claude-fable-5-2"), "Fable 5.2"); eq("version-first id claude-3-5-sonnet-20241022 -> Sonnet 3.5", modelLabel("claude-3-5-sonnet-20241022"), "Sonnet 3.5"); eq("bare alias opus -> Opus (no invented version)", modelLabel("opus"), "Opus"); eq("engine name claude -> Claude", modelLabel("claude"), "Claude");