@kenkaiiii/gg-core 5.90.0 → 5.91.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.
@@ -44,12 +44,14 @@ __export(model_registry_exports, {
44
44
  getMaxThinkingLevel: () => getMaxThinkingLevel,
45
45
  getModel: () => getModel,
46
46
  getModelsForProvider: () => getModelsForProvider,
47
+ getProviderCatalog: () => getProviderCatalog,
47
48
  getSummaryModel: () => getSummaryModel,
48
49
  getToolResultCharLimit: () => getToolResultCharLimit,
49
50
  getVideoByteLimit: () => getVideoByteLimit,
50
51
  isHiddenProvider: () => isHiddenProvider,
51
52
  isPaidModel: () => isPaidModel,
52
53
  registerRuntimeModels: () => registerRuntimeModels,
54
+ setProviderCatalog: () => setProviderCatalog,
53
55
  usesOpenAICodexTransport: () => usesOpenAICodexTransport,
54
56
  withoutPaidTier: () => withoutPaidTier
55
57
  });
@@ -132,6 +134,7 @@ var MOONSHOT_OAUTH_KEY = "moonshot-oauth";
132
134
  var XIAOMI_CREDITS_KEY = "xiaomi-credits";
133
135
  var GEMINI_API_KEY = "gemini-api";
134
136
  var LOCAL_CREDENTIAL_LIFETIME_MS = 100 * 365 * 24 * 60 * 60 * 1e3;
137
+ var MINIMAX_REGION_RETRY_MS = 5 * 60 * 1e3;
135
138
  var USAGE_EXHAUSTED_DEFAULT_MS = 15 * 60 * 1e3;
136
139
 
137
140
  // src/model-registry.ts
@@ -671,6 +674,23 @@ var MODELS = [
671
674
  maxThinkingLevel: "max"
672
675
  },
673
676
  // ── MiniMax ────────────────────────────────────────────
677
+ {
678
+ // The only text model M Plan / Token Plan keys cover; MiniMax-M3 on those
679
+ // keys fails with "insufficient balance (1008)". Pay-as-you-go serves both.
680
+ // Always thinks (`thinking: disabled` 400s; omitted = on) with a real
681
+ // low→max effort ladder on output_config.effort, API default max.
682
+ id: "MiniMax-M3.1-Flash",
683
+ name: "MiniMax M3.1 Flash",
684
+ provider: "minimax",
685
+ contextWindow: 1e6,
686
+ maxOutputTokens: 131072,
687
+ supportsThinking: true,
688
+ supportsImages: true,
689
+ supportsVideo: true,
690
+ maxVideoBytes: 50 * 1024 * 1024,
691
+ costTier: "low",
692
+ maxThinkingLevel: "max"
693
+ },
674
694
  {
675
695
  id: "MiniMax-M3",
676
696
  name: "MiniMax M3",
@@ -877,11 +897,44 @@ function clearRuntimeModels(predicate) {
877
897
  if (predicate(model)) runtimeModels.delete(id);
878
898
  }
879
899
  }
900
+ var providerCatalogs = /* @__PURE__ */ new Map();
901
+ function setProviderCatalog(provider, models) {
902
+ if (!models) {
903
+ providerCatalogs.delete(provider);
904
+ return [];
905
+ }
906
+ const installed = /* @__PURE__ */ new Map();
907
+ for (const model of models) {
908
+ if (model.provider !== provider) continue;
909
+ if (MODELS.some((m) => m.id === model.id && m.provider !== provider)) continue;
910
+ installed.set(model.id, model);
911
+ }
912
+ providerCatalogs.set(provider, installed);
913
+ return [...installed.values()];
914
+ }
915
+ function getProviderCatalog(provider) {
916
+ const catalog = providerCatalogs.get(provider);
917
+ return catalog ? [...catalog.values()] : void 0;
918
+ }
880
919
  function getAllModels() {
881
- return [...MODELS, ...runtimeModels.values()];
920
+ const synced = [...providerCatalogs.values()].flatMap((c) => [...c.values()]);
921
+ return [
922
+ ...MODELS.filter((m) => !providerCatalogs.has(m.provider)),
923
+ ...synced,
924
+ ...runtimeModels.values()
925
+ ];
882
926
  }
883
927
  function getModel(id) {
884
- return MODELS.find((m) => m.id === id) ?? runtimeModels.get(id);
928
+ const fixed = MODELS.find((m) => m.id === id);
929
+ if (fixed && !providerCatalogs.has(fixed.provider)) return fixed;
930
+ return findSynced(id) ?? fixed ?? runtimeModels.get(id);
931
+ }
932
+ function findSynced(id) {
933
+ for (const catalog of providerCatalogs.values()) {
934
+ const hit = catalog.get(id);
935
+ if (hit) return hit;
936
+ }
937
+ return void 0;
885
938
  }
886
939
  function getModelsForProvider(provider) {
887
940
  return getAllModels().filter((m) => m.provider === provider);
@@ -921,7 +974,7 @@ var DEFAULT_MODEL_IDS = {
921
974
  gemini: "gemini-3.1-flash-lite",
922
975
  glm: "glm-5.3",
923
976
  moonshot: "kimi-k3",
924
- minimax: "MiniMax-M3",
977
+ minimax: "MiniMax-M3.1-Flash",
925
978
  deepseek: "deepseek-v4-pro",
926
979
  huggingface: "moonshotai/Kimi-K2.7-Code",
927
980
  openrouter: "qwen/qwen3.8-max",
@@ -1002,12 +1055,14 @@ function getSummaryModel(provider, currentModelId) {
1002
1055
  getMaxThinkingLevel,
1003
1056
  getModel,
1004
1057
  getModelsForProvider,
1058
+ getProviderCatalog,
1005
1059
  getSummaryModel,
1006
1060
  getToolResultCharLimit,
1007
1061
  getVideoByteLimit,
1008
1062
  isHiddenProvider,
1009
1063
  isPaidModel,
1010
1064
  registerRuntimeModels,
1065
+ setProviderCatalog,
1011
1066
  usesOpenAICodexTransport,
1012
1067
  withoutPaidTier
1013
1068
  });