@prestyj/core 5.27.0 → 5.28.0

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.
@@ -123,6 +123,7 @@ var import_promises2 = __toESM(require("fs/promises"), 1);
123
123
  var import_promises3 = require("timers/promises");
124
124
 
125
125
  // src/auth-storage.ts
126
+ var MOONSHOT_OAUTH_KEY = "moonshot-oauth";
126
127
  var XIAOMI_CREDITS_KEY = "xiaomi-credits";
127
128
  var LOCAL_CREDENTIAL_LIFETIME_MS = 100 * 365 * 24 * 60 * 60 * 1e3;
128
129
  var USAGE_EXHAUSTED_DEFAULT_MS = 15 * 60 * 1e3;
@@ -208,8 +209,10 @@ var MODELS = [
208
209
  maxThinkingLevel: "max"
209
210
  },
210
211
  {
211
- id: "claude-sonnet-5",
212
- name: "Claude Sonnet 5",
212
+ // Released 2026-09-28 — replaces Sonnet 5 at $2/$10 MTok, with the same
213
+ // 1M context / 128K output and adaptive thinking, now including xhigh.
214
+ id: "claude-sonnet-5-5",
215
+ name: "Claude Sonnet 5.5",
213
216
  provider: "anthropic",
214
217
  contextWindow: 1e6,
215
218
  maxOutputTokens: 128e3,
@@ -299,10 +302,12 @@ var MODELS = [
299
302
  },
300
303
  // ── Sakana (Fugu) ──────────────────────────────────────
301
304
  // Sakana Fugu is a multi-agent system surfaced as a standard LLM via the
302
- // OpenAI-compatible Sakana API (https://api.sakana.ai/v1). Both models take
303
- // text + image input. Plain Fugu stops at xhigh; Ultra v1.1 also supports max.
304
- // `fugu` routes across all providers; `fugu-ultra` is
305
- // the heavier tier (may need larger client timeouts on complex tasks).
305
+ // OpenAI-compatible Sakana API (https://api.sakana.ai/v1). All three take
306
+ // text + image input (verified against the live /models list, 2026-09-28).
307
+ // `fugu` balances latency and quality; `fugu-max` (v1.0, 2026-09-11) is the
308
+ // cost tier over the largest open-weight pool ($2/$6 per 1M); `fugu-ultra`
309
+ // is the heavier quality tier (may need larger client timeouts). Plain Fugu
310
+ // and Fugu Max stop at xhigh — Sakana documents max as the same effort there.
306
311
  {
307
312
  id: "fugu",
308
313
  name: "Fugu",
@@ -315,6 +320,18 @@ var MODELS = [
315
320
  costTier: "medium",
316
321
  maxThinkingLevel: "xhigh"
317
322
  },
323
+ {
324
+ id: "fugu-max",
325
+ name: "Fugu Max",
326
+ provider: "sakana",
327
+ contextWindow: 1e6,
328
+ maxOutputTokens: 128e3,
329
+ supportsThinking: true,
330
+ supportsImages: true,
331
+ supportsVideo: false,
332
+ costTier: "medium",
333
+ maxThinkingLevel: "xhigh"
334
+ },
318
335
  {
319
336
  id: "fugu-ultra",
320
337
  name: "Fugu Ultra",
@@ -325,7 +342,7 @@ var MODELS = [
325
342
  supportsImages: true,
326
343
  supportsVideo: false,
327
344
  costTier: "high",
328
- // The rolling alias now serves v1.1, which adds a distinct max effort.
345
+ // The rolling alias now serves v2.0 (2026-09-11), which keeps max effort.
329
346
  maxThinkingLevel: "max"
330
347
  },
331
348
  // ── xAI (Grok) ─────────────────────────────────────────
@@ -469,7 +486,27 @@ var MODELS = [
469
486
  costTier: "high",
470
487
  maxThinkingLevel: "max"
471
488
  },
472
- // Retain the cheaper dedicated coding model as an explicit alternative.
489
+ // K2.8 Preview (2026-09-11) is served only on the Kimi For Coding OAuth
490
+ // endpoint, under its rolling `kimi-for-coding` id (live /models, 2026-09-28:
491
+ // display_name "K2.8 Preview", 1M context, image + video input, efforts
492
+ // low/high/max default max). The public API-key endpoint does not serve it,
493
+ // so it resolves from the Kimi sign-in credential only.
494
+ {
495
+ id: "kimi-for-coding",
496
+ name: "Kimi K2.8 Preview",
497
+ provider: "moonshot",
498
+ contextWindow: 1048576,
499
+ maxOutputTokens: 131072,
500
+ supportsThinking: true,
501
+ supportsImages: true,
502
+ supportsVideo: true,
503
+ maxVideoBytes: 100 * 1024 * 1024,
504
+ costTier: "medium",
505
+ maxThinkingLevel: "max",
506
+ authStorageKeys: [MOONSHOT_OAUTH_KEY]
507
+ },
508
+ // K2.7 Code is requested by its pinned id (not the `kimi-for-coding` alias
509
+ // that moved to K2.8), so it stays the real K2.7 on both endpoints.
473
510
  {
474
511
  id: "kimi-k2.7-code",
475
512
  name: "Kimi K2.7 Code",
@@ -616,10 +653,14 @@ var MODELS = [
616
653
  authStorageKeys: [XIAOMI_CREDITS_KEY]
617
654
  },
618
655
  // ── DeepSeek ───────────────────────────────────────────
656
+ // The live /models list (2026-09-28) serves exactly `deepseek-flash` and
657
+ // `deepseek-v4-pro`. V4 Flash and V4 Flash Vision Exp are retired; their old
658
+ // ids only temporarily route to V4.1 Flash, so they are retired here too.
619
659
  {
620
660
  // `deepseek-v4-pro` now serves DeepSeek-V4-Pro-0813 (released 2026-08-13,
621
661
  // first STABLE V4 Pro — supersedes the April preview; calling name
622
662
  // unchanged, same 1.6T/49B MoE). 1M context, text-only, low/high/max effort.
663
+ // DeepSeek reversed its planned 2026-09-14 retirement, so it stays served.
623
664
  // Docs abbreviate output as 384K; use the same conservative 384,000-token
624
665
  // application cap across V4 models rather than mixing decimal/binary units.
625
666
  id: "deepseek-v4-pro",
@@ -634,21 +675,10 @@ var MODELS = [
634
675
  maxThinkingLevel: "max"
635
676
  },
636
677
  {
637
- id: "deepseek-v4-flash",
638
- name: "DeepSeek V4 Flash",
639
- provider: "deepseek",
640
- contextWindow: 1048576,
641
- maxOutputTokens: 384e3,
642
- supportsThinking: true,
643
- supportsImages: false,
644
- supportsVideo: false,
645
- costTier: "low",
646
- maxThinkingLevel: "max"
647
- },
648
- // Opt-in experimental vision sibling; never replaces the stable summary model.
649
- {
650
- id: "deepseek-v4-flash-vision-exp",
651
- name: "DeepSeek V4 Flash Vision (Experimental)",
678
+ // `deepseek-flash` is the rolling alias for the latest Flash — currently
679
+ // V4.1 Flash (2026-09-10): native image input, 1M context, 384K output.
680
+ id: "deepseek-flash",
681
+ name: "DeepSeek V4.1 Flash",
652
682
  provider: "deepseek",
653
683
  contextWindow: 1048576,
654
684
  maxOutputTokens: 384e3,
@@ -660,11 +690,13 @@ var MODELS = [
660
690
  },
661
691
  // ── OpenRouter ─────────────────────────────────────────
662
692
  {
663
- id: "qwen/qwen3.6-plus",
664
- name: "Qwen3.6-Plus",
693
+ // Qwen3.8 Max — Alibaba's flagship (live /endpoints, 2026-09-28): 1M
694
+ // context, 131,072 output, text + image + video input, reasoning on.
695
+ id: "qwen/qwen3.8-max",
696
+ name: "Qwen3.8 Max",
665
697
  provider: "openrouter",
666
698
  contextWindow: 1e6,
667
- maxOutputTokens: 65536,
699
+ maxOutputTokens: 131072,
668
700
  supportsThinking: true,
669
701
  supportsImages: true,
670
702
  supportsVideo: true,
@@ -758,13 +790,13 @@ function getDefaultModel(provider) {
758
790
  if (provider === "deepseek") return MODELS.find((m) => m.id === "deepseek-v4-pro");
759
791
  if (provider === "huggingface")
760
792
  return MODELS.find((m) => m.id === "Qwen/Qwen3-Coder-480B-A35B-Instruct");
761
- if (provider === "openrouter") return MODELS.find((m) => m.id === "qwen/qwen3.6-plus");
793
+ if (provider === "openrouter") return MODELS.find((m) => m.id === "qwen/qwen3.8-max");
762
794
  if (provider === "sakana") return MODELS.find((m) => m.id === "fugu");
763
795
  if (provider === "xai") return MODELS.find((m) => m.id === "grok-4.7");
764
796
  if (provider === "local") {
765
797
  return getModelsForProvider("local")[0] ?? PLACEHOLDER_LOCAL_MODEL;
766
798
  }
767
- return MODELS.find((m) => m.id === "claude-sonnet-5");
799
+ return MODELS.find((m) => m.id === "claude-sonnet-5-5");
768
800
  }
769
801
  var PLACEHOLDER_LOCAL_MODEL = {
770
802
  id: "local/none/none",
@@ -802,7 +834,7 @@ function getDefaultThinkingLevel(modelId, options) {
802
834
  }
803
835
  function getSummaryModel(provider, currentModelId) {
804
836
  if (provider === "anthropic") {
805
- return MODELS.find((m) => m.id === "claude-sonnet-5");
837
+ return MODELS.find((m) => m.id === "claude-sonnet-5-5");
806
838
  }
807
839
  if (provider === "openai" || provider === "glm" || provider === "deepseek" || provider === "huggingface") {
808
840
  const low = getModelsForProvider(provider).find((m) => m.costTier === "low");