@prestyj/core 5.39.2 → 5.40.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.
package/dist/index.cjs CHANGED
@@ -2219,6 +2219,13 @@ function providerStorageKeys(provider) {
2219
2219
  return dual ? [dual.oauthKey, dual.provider] : [provider];
2220
2220
  }
2221
2221
  var XIAOMI_CREDITS_KEY = "xiaomi-credits";
2222
+ var XIAOMI_CREDITS_BASE_URL = "https://api.xiaomimimo.com/v1";
2223
+ function withXiaomiHost(key, creds) {
2224
+ if (creds.baseUrl) return creds;
2225
+ if (key === "xiaomi") return { ...creds, baseUrl: XIAOMI_TOKEN_PLAN_BASE_URLS[0] };
2226
+ if (key === XIAOMI_CREDITS_KEY) return { ...creds, baseUrl: XIAOMI_CREDITS_BASE_URL };
2227
+ return creds;
2228
+ }
2222
2229
  var GEMINI_API_KEY = "gemini-api";
2223
2230
  var GEMINI_API_KEY_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
2224
2231
  var LOCAL_AUTH_KEY_PREFIX = "local:";
@@ -2641,7 +2648,7 @@ var AuthStorage = class {
2641
2648
  ...opts.rejectedToken !== void 0 ? { rejectedToken: opts.rejectedToken } : {}
2642
2649
  });
2643
2650
  }
2644
- return creds2;
2651
+ return withXiaomiHost(key, creds2);
2645
2652
  }
2646
2653
  throw new NotLoggedInError(provider);
2647
2654
  }
@@ -2683,7 +2690,7 @@ var AuthStorage = class {
2683
2690
  }
2684
2691
  if (STATIC_API_KEY_PROVIDERS.has(provider)) {
2685
2692
  if (provider === "minimax" && !creds.baseUrl) return await this.withMiniMaxRegion(creds);
2686
- return creds;
2693
+ return withXiaomiHost(provider, creds);
2687
2694
  }
2688
2695
  if (!opts?.forceRefresh && Date.now() < creds.expiresAt - refreshThresholdMs(creds)) {
2689
2696
  return creds;
@@ -2810,8 +2817,8 @@ var CLAUDE_FABLE_FAST_BILLING = {
2810
2817
  standardModel: "claude-fable-5-2"
2811
2818
  };
2812
2819
  var XIAOMI_ULTRASPEED_BILLING = {
2813
- label: "bills API Credits",
2814
- 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.",
2820
+ label: "may bill API Credits",
2821
+ detail: "UltraSpeed is included in Token Plan Pro and Max for a limited time; otherwise it bills your Xiaomi API Credits per token at a higher rate than MiMo-V2.6-Pro.",
2815
2822
  paid: true,
2816
2823
  standardModel: "mimo-v2.6-pro"
2817
2824
  };
@@ -3532,14 +3539,12 @@ var MODELS = [
3532
3539
  authStorageKeys: ["xiaomi", XIAOMI_CREDITS_KEY]
3533
3540
  },
3534
3541
  // UltraSpeed: Pro-grade quality at much lower latency, premium-priced for
3535
- // the throughput gain. API-only — not served over the Token Plan endpoint,
3536
- // so credentials resolve from the distinct API Credits key only (see the
3537
- // authStorageKeys doc). The Token Plan host rejects it with "Not supported
3538
- // model" — the known-model/wrong-host reply — where an invented id gets
3539
- // "Unsupported model", which is how this id was confirmed without a
3540
- // Credits key. Attachments can't be probed directly for the same reason, so
3541
- // this entry tracks the rest of the V2.6 series ("full modality across the
3542
- // series") and mirrors Pro's verified image+video surface.
3542
+ // the throughput gain. Xiaomi's platform changelog V2.2.3 (2026-11-19) adds it
3543
+ // to Token Plan Pro and Max for a limited time, so it prefers the Token Plan
3544
+ // like Pro and falls back to API Credits (Lite plans still need Credits).
3545
+ // Billing stays `paid` because the Credits path, and the plan once the
3546
+ // promotion ends, spend real money. Attachments mirror Pro's verified
3547
+ // image+video surface ("full modality across the series").
3543
3548
  {
3544
3549
  id: "mimo-v2.6-pro-ultraspeed",
3545
3550
  name: "MiMo-V2.6-Pro-UltraSpeed",
@@ -3552,7 +3557,7 @@ var MODELS = [
3552
3557
  maxVideoBytes: 36 * 1024 * 1024,
3553
3558
  costTier: "high",
3554
3559
  maxThinkingLevel: "high",
3555
- authStorageKeys: [XIAOMI_CREDITS_KEY],
3560
+ authStorageKeys: ["xiaomi", XIAOMI_CREDITS_KEY],
3556
3561
  billing: XIAOMI_ULTRASPEED_BILLING
3557
3562
  },
3558
3563
  // ── DeepSeek ───────────────────────────────────────────
@@ -4729,7 +4734,7 @@ var ALL_AUTH_PROVIDERS = [
4729
4734
  },
4730
4735
  {
4731
4736
  key: XIAOMI_CREDITS_KEY,
4732
- label: "API Credits (required for UltraSpeed)",
4737
+ label: "API Credits",
4733
4738
  baseUrl: "https://api.xiaomimimo.com/v1"
4734
4739
  }
4735
4740
  ]