@kenkaiiii/gg-core 5.96.2 → 5.97.1

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/dist/index.cjs CHANGED
@@ -1233,6 +1233,7 @@ var import_node_path4 = __toESM(require("path"), 1);
1233
1233
  var import_node_crypto3 = require("crypto");
1234
1234
  var import_gg_ai2 = require("@kenkaiiii/gg-ai");
1235
1235
  var MAX_BYTES = 10 * 1024 * 1024;
1236
+ var ROTATED_GENERATIONS = 3;
1236
1237
  var MIN_HEADROOM_BYTES = 64 * 1024;
1237
1238
  var fd = null;
1238
1239
  var logPath = null;
@@ -1249,6 +1250,17 @@ function rotateIfNeeded(filePath, force = false) {
1249
1250
  const st = import_node_fs3.default.statSync(filePath);
1250
1251
  if (!force && st.size <= MAX_BYTES - MIN_HEADROOM_BYTES) return;
1251
1252
  const rotated = `${filePath}.1`;
1253
+ for (let generation = ROTATED_GENERATIONS - 1; generation >= 1; generation--) {
1254
+ const older = `${filePath}.${generation + 1}`;
1255
+ try {
1256
+ import_node_fs3.default.unlinkSync(older);
1257
+ } catch {
1258
+ }
1259
+ try {
1260
+ import_node_fs3.default.renameSync(`${filePath}.${generation}`, older);
1261
+ } catch {
1262
+ }
1263
+ }
1252
1264
  try {
1253
1265
  import_node_fs3.default.unlinkSync(rotated);
1254
1266
  } catch {
@@ -2217,6 +2229,12 @@ var CLAUDE_FAST_BILLING = {
2217
2229
  paid: true,
2218
2230
  standardModel: "claude-opus-5-5"
2219
2231
  };
2232
+ var CLAUDE_FABLE_FAST_BILLING = {
2233
+ label: "bills usage credits",
2234
+ detail: "Fast mode bills your Claude usage credits ($16 in / $80 out per million tokens) from the first token, never your plan's included usage.",
2235
+ paid: true,
2236
+ standardModel: "claude-fable-5-2"
2237
+ };
2220
2238
  var XIAOMI_ULTRASPEED_BILLING = {
2221
2239
  label: "bills API Credits",
2222
2240
  detail: "UltraSpeed runs only on your Xiaomi API Credits, billed per token at a higher rate than MiMo-V2.6-Pro, never on the Token Plan.",
@@ -2232,18 +2250,18 @@ var GEMINI_AUTH_KEYS = [GEMINI_API_KEY];
2232
2250
  var KIMI_AUTH_KEYS = [KIMI_CODE_KEY, "moonshot"];
2233
2251
  var MODELS = [
2234
2252
  // ── Anthropic ──────────────────────────────────────────
2235
- // NOTE: Claude Mythos 5.1 (`claude-mythos-5-1`, 2026-09-01) is kept commented
2236
- // out — it's a Project Glasswing model, still "Active (invite only)" in
2237
- // Anthropic's docs and unavailable to most users. Re-enable once it's
2238
- // generally available.
2253
+ // NOTE: Claude Mythos 5.2 (`claude-mythos-5-2`, 2026-11-09) is kept commented
2254
+ // out — it's only for organizations verified through Anthropic's verification
2255
+ // programs and unavailable to most users. Re-enable once it's generally
2256
+ // available.
2239
2257
  {
2240
- // Released 2026-09-01 — replaces Fable 5 at the same $10/$50 MTok (cache
2241
- // reads drop to $0.25). Always-on adaptive thinking steered by effort;
2242
- // forced tool use is rejected with a 400, which gg-ai never sends on the
2243
- // Anthropic path. Fable 5 is retired here — a session that still has it
2244
- // saved falls back to the provider default on next start.
2245
- id: "claude-fable-5-1",
2246
- name: "Claude Fable 5.1",
2258
+ // Released 2026-11-09 — replaces Fable 5.1 at $8/$40 MTok (down from
2259
+ // $10/$50; cache reads $0.20). Same API surface as 5.1: always-on adaptive
2260
+ // thinking steered by effort, forced tool use rejected with a 400 (gg-ai
2261
+ // never sends it on the Anthropic path). Fable 5.1 is retired here — a
2262
+ // session that still has it saved falls back to the provider default.
2263
+ id: "claude-fable-5-2",
2264
+ name: "Claude Fable 5.2",
2247
2265
  provider: "anthropic",
2248
2266
  contextWindow: 1e6,
2249
2267
  maxOutputTokens: 128e3,
@@ -2253,12 +2271,28 @@ var MODELS = [
2253
2271
  costTier: "high",
2254
2272
  maxThinkingLevel: "max"
2255
2273
  },
2274
+ {
2275
+ // Fable 5.2 in fast mode: the same model at up to 2.5x output tokens/sec,
2276
+ // $16/$80 MTok. Sent as `claude-fable-5-2` + `speed: "fast"`; on a Claude
2277
+ // subscription it bills usage credits only, like Opus 5.5 Fast.
2278
+ id: "claude-fable-5-2-fast",
2279
+ name: "Claude Fable 5.2 Fast",
2280
+ provider: "anthropic",
2281
+ contextWindow: 1e6,
2282
+ maxOutputTokens: 128e3,
2283
+ supportsThinking: true,
2284
+ supportsImages: true,
2285
+ supportsVideo: false,
2286
+ costTier: "high",
2287
+ maxThinkingLevel: "max",
2288
+ billing: CLAUDE_FABLE_FAST_BILLING
2289
+ },
2256
2290
  // {
2257
2291
  // // Mythos-class model offered through Project Glasswing (limited
2258
- // // availability, invitation-only). Same underlying model as Fable 5.1 with
2259
- // // some safeguards lifted; kept here so approved accounts can select it.
2260
- // id: "claude-mythos-5-1",
2261
- // name: "Claude Mythos 5.1",
2292
+ // // availability, verified organizations only). Same specs and pricing as
2293
+ // // Fable 5.2; kept here so approved accounts can select it.
2294
+ // id: "claude-mythos-5-2",
2295
+ // name: "Claude Mythos 5.2",
2262
2296
  // provider: "anthropic",
2263
2297
  // contextWindow: 1_000_000,
2264
2298
  // maxOutputTokens: 128_000,
@@ -3252,7 +3286,7 @@ function isMiniMaxEffortModel(provider, model) {
3252
3286
  return provider === "minimax" && model.startsWith("MiniMax-M3.1");
3253
3287
  }
3254
3288
  function isAnthropicXhighModel(provider, model) {
3255
- return provider === "anthropic" && /opus-5|opus-4-8|opus-4-7|sonnet-5[-.]5|haiku-5[-.]5/.test(model);
3289
+ return provider === "anthropic" && /fable-5|mythos-5|opus-5|opus-4-8|opus-4-7|sonnet-5[-.]5|haiku-5[-.]5/.test(model);
3256
3290
  }
3257
3291
  function isAnthropicAdaptiveModel(provider, model) {
3258
3292
  return provider === "anthropic" && /opus-5|opus-4-8|opus-4-7|opus-4-6|sonnet-5|haiku-5|fable-5|mythos-5/.test(model);
@@ -3770,7 +3804,7 @@ var ALL_AUTH_PROVIDERS = [
3770
3804
  {
3771
3805
  value: "anthropic",
3772
3806
  label: "Anthropic",
3773
- description: "Claude Fable 5.1, Opus 5.5, Opus 5.5 Fast, Sonnet 5.5, Haiku 5.5",
3807
+ description: "Claude Fable 5.2, Fable 5.2 Fast, Opus 5.5, Opus 5.5 Fast, Sonnet 5.5, Haiku 5.5",
3774
3808
  methods: ["oauth", "apikey"],
3775
3809
  apiKeyLabel: "Anthropic",
3776
3810
  methodDetails: {