@kenkaiiii/gg-core 5.108.0 → 5.109.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
@@ -46,6 +46,8 @@ __export(index_exports, {
46
46
  FALLBACK_CONTEXT_WINDOW: () => FALLBACK_CONTEXT_WINDOW,
47
47
  GEMINI_API_KEY: () => GEMINI_API_KEY,
48
48
  GEMINI_API_KEY_BASE_URL: () => GEMINI_API_KEY_BASE_URL,
49
+ GLM_CODING_PLAN_BASE_URL: () => GLM_CODING_PLAN_BASE_URL,
50
+ GLM_CODING_PLAN_KEY: () => GLM_CODING_PLAN_KEY,
49
51
  HIDDEN_PROVIDERS: () => HIDDEN_PROVIDERS,
50
52
  KIMI_CODE_DEFAULT_BASE_URL: () => KIMI_CODE_DEFAULT_BASE_URL,
51
53
  KIMI_CODE_KEY: () => KIMI_CODE_KEY,
@@ -1636,6 +1638,8 @@ async function detectXiaomiTokenPlanBaseUrl(apiKey, options = {}) {
1636
1638
  // src/auth-storage.ts
1637
1639
  var OPENAI_CHATGPT_KEY = "openai-chatgpt";
1638
1640
  var KIMI_CODE_KEY = "kimi-code";
1641
+ var GLM_CODING_PLAN_KEY = "glm-coding";
1642
+ var GLM_CODING_PLAN_BASE_URL = "https://api.z.ai/api/coding/paas/v4";
1639
1643
  var RETIRED_SIGN_INS = [
1640
1644
  {
1641
1645
  provider: "anthropic",
@@ -1687,12 +1691,14 @@ function usableEntry(data, storageKey) {
1687
1691
  function storageKeyProvider(storageKey) {
1688
1692
  if (storageKey === OPENAI_CHATGPT_KEY) return "openai";
1689
1693
  if (storageKey === KIMI_CODE_KEY) return "moonshot";
1694
+ if (storageKey === GLM_CODING_PLAN_KEY) return "glm";
1690
1695
  if (storageKey === XIAOMI_CREDITS_KEY) return "xiaomi";
1691
1696
  if (storageKey === GEMINI_API_KEY) return "gemini";
1692
1697
  return storageKey;
1693
1698
  }
1694
1699
  function apiKeyStorageKeys(provider) {
1695
1700
  if (provider === "moonshot") return [KIMI_CODE_KEY, "moonshot"];
1701
+ if (provider === "glm") return [GLM_CODING_PLAN_KEY, "glm"];
1696
1702
  if (provider === "xiaomi") return ["xiaomi", XIAOMI_CREDITS_KEY];
1697
1703
  if (provider === "gemini") return [GEMINI_API_KEY];
1698
1704
  return [provider];
@@ -2387,6 +2393,7 @@ var CODEX_FAST_BILLING = {
2387
2393
  };
2388
2394
  var GEMINI_AUTH_KEYS = [GEMINI_API_KEY];
2389
2395
  var KIMI_AUTH_KEYS = [KIMI_CODE_KEY, "moonshot"];
2396
+ var GLM_AUTH_KEYS = [GLM_CODING_PLAN_KEY, "glm"];
2390
2397
  var MODELS = [
2391
2398
  // ── Anthropic ──────────────────────────────────────────
2392
2399
  // NOTE: Claude Mythos 5.2 (`claude-mythos-5-2`, 2026-11-09) is kept commented
@@ -2972,12 +2979,29 @@ var MODELS = [
2972
2979
  authStorageKeys: KIMI_AUTH_KEYS
2973
2980
  },
2974
2981
  // ── Z.AI (GLM) ─────────────────────────────────────────
2975
- // Two GLM entries, both live on the coding endpoint (verified against its
2982
+ // All GLM entries are live on the coding endpoint (verified against its
2976
2983
  // /models list). The pre-5.3 ids stay retired: they routed to strictly worse
2977
2984
  // coding for the same plan quota, and the endpoint already answers `glm-5.2`
2978
2985
  // requests as glm-5.3.
2979
2986
  // `max` is both the ceiling and Z.AI's own default — the rungs below it live
2980
2987
  // in thinking-level.ts.
2988
+ // GLM-5.4 (released 2026-11) runs on a Coding Plan key only: the standard
2989
+ // endpoint answers "You do not have permission to access glm-5.4". Images
2990
+ // are native (verified: base64 PNG read back exactly), so its attachments go
2991
+ // inline rather than through the zai_vision MCP that 5.3 still needs.
2992
+ {
2993
+ id: "glm-5.4",
2994
+ name: "GLM-5.4",
2995
+ provider: "glm",
2996
+ contextWindow: 1e6,
2997
+ maxOutputTokens: 131072,
2998
+ supportsThinking: true,
2999
+ supportsImages: true,
3000
+ supportsVideo: false,
3001
+ costTier: "medium",
3002
+ maxThinkingLevel: "max",
3003
+ authStorageKeys: [GLM_CODING_PLAN_KEY]
3004
+ },
2981
3005
  {
2982
3006
  id: "glm-5.3",
2983
3007
  name: "GLM-5.3",
@@ -2988,7 +3012,13 @@ var MODELS = [
2988
3012
  supportsImages: false,
2989
3013
  supportsVideo: false,
2990
3014
  costTier: "medium",
2991
- maxThinkingLevel: "max"
3015
+ maxThinkingLevel: "max",
3016
+ // The Coding Plan endpoint stopped serving 5.3 when 5.4 landed ("Invalid
3017
+ // API parameter" on a bare request, 2026-11-23); the standard endpoint still does.
3018
+ authStorageKeys: ["glm"],
3019
+ // Same day, 5.3's ladder shrank: medium/xhigh and thinking-off now 400 with
3020
+ // "always engages in thinking … please use low, high, or max".
3021
+ thinkingLevels: ["low", "high", "max"]
2992
3022
  },
2993
3023
  // GLM-5.3-Flash (released 2026-08-26): 320B-A18B natively multimodal sibling
2994
3024
  // at ~1/20th of 5.3's API price with 3× the coding-plan quota, so it is the
@@ -3012,7 +3042,8 @@ var MODELS = [
3012
3042
  supportsImages: true,
3013
3043
  supportsVideo: false,
3014
3044
  costTier: "low",
3015
- maxThinkingLevel: "max"
3045
+ maxThinkingLevel: "max",
3046
+ authStorageKeys: GLM_AUTH_KEYS
3016
3047
  },
3017
3048
  // ── MiniMax ────────────────────────────────────────────
3018
3049
  {
@@ -3399,7 +3430,7 @@ var DEFAULT_MODEL_IDS = {
3399
3430
  xiaomi: "mimo-v2.6-pro",
3400
3431
  openai: "gpt-6.2-sol",
3401
3432
  gemini: "gemini-3.1-flash-lite",
3402
- glm: "glm-5.3",
3433
+ glm: "glm-5.4",
3403
3434
  moonshot: "kimi-k3",
3404
3435
  minimax: "MiniMax-M3.1-Flash",
3405
3436
  deepseek: "deepseek-v4-pro",
@@ -4272,13 +4303,27 @@ var ALL_AUTH_PROVIDERS = [
4272
4303
  {
4273
4304
  value: "glm",
4274
4305
  label: "Z.AI (GLM)",
4275
- description: "GLM-5.3, GLM-5.3-Flash",
4306
+ description: "GLM-5.4 (Coding Plan), GLM-5.3 (API key), GLM-5.3-Flash",
4276
4307
  methods: ["apikey"],
4277
4308
  apiKeyLabel: "Z.AI",
4309
+ apiKeyVariants: [
4310
+ {
4311
+ key: GLM_CODING_PLAN_KEY,
4312
+ label: "GLM Coding Plan",
4313
+ kind: "plan",
4314
+ billing: "Uses your GLM Coding Plan.",
4315
+ baseUrl: GLM_CODING_PLAN_BASE_URL
4316
+ },
4317
+ {
4318
+ key: "glm",
4319
+ label: "Z.AI API",
4320
+ kind: "payg",
4321
+ billing: "Pay-per-token from your Z.AI account balance."
4322
+ }
4323
+ ],
4278
4324
  methodDetails: apiKeyDetails(
4279
4325
  "Z.AI API key",
4280
- "Pay-per-token from your Z.AI account balance.",
4281
- "GLM Coding Plan quota can't be used here: Z.AI limits the plan to the tools it lists."
4326
+ "A GLM Coding Plan key uses your plan; a Z.AI API key is pay-per-token."
4282
4327
  )
4283
4328
  },
4284
4329
  {
@@ -5082,6 +5127,8 @@ function createAutoUpdater(config) {
5082
5127
  FALLBACK_CONTEXT_WINDOW,
5083
5128
  GEMINI_API_KEY,
5084
5129
  GEMINI_API_KEY_BASE_URL,
5130
+ GLM_CODING_PLAN_BASE_URL,
5131
+ GLM_CODING_PLAN_KEY,
5085
5132
  HIDDEN_PROVIDERS,
5086
5133
  KIMI_CODE_DEFAULT_BASE_URL,
5087
5134
  KIMI_CODE_KEY,