@serviceme/devtools-shared 0.4.5 → 0.4.6

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.
Files changed (3) hide show
  1. package/dist/index.js +267 -26
  2. package/dist/index.mjs +267 -26
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -77,8 +77,19 @@ var PROVIDER_BASE_URL_PRESETS = {
77
77
  { label: "\u5168\u7403", baseUrl: "https://api.moonshot.ai/v1" }
78
78
  ],
79
79
  zhipu: [
80
- { label: "\u56FD\u5185", baseUrl: "https://open.bigmodel.cn/api/agent" },
81
- { label: "\u5168\u7403", baseUrl: "https://api.zhipuai.com/v1" }
80
+ // Zhipu's OpenAI-compatible Chat Completions endpoint is the
81
+ // `/api/paas/v4` path on `open.bigmodel.cn` (per
82
+ // https://docs.bigmodel.cn/cn/guide/develop/http/introduction —
83
+ // "请求端点(通用API)"). Earlier entries on this dropdown were
84
+ // wrong:
85
+ // - `/api/agent` is Zhipu's *Agent* (intelligent-agent) API
86
+ // surface, not chat completions — sending GLM model ids
87
+ // there returns 4xx.
88
+ // - `api.zhipuai.com/v1` was the v3-era host and has since
89
+ // been migrated to `bigmodel.cn`.
90
+ // Zhipu does not publish a separate regional endpoint, so only
91
+ // the official host is offered here (single-entry dropdown).
92
+ { label: "\u5B98\u65B9", baseUrl: "https://open.bigmodel.cn/api/paas/v4" }
82
93
  ],
83
94
  stepfun: [{ label: "\u5B98\u65B9", baseUrl: "https://api.stepfun.com/v1" }],
84
95
  siliconflow: [
@@ -125,7 +136,7 @@ function isProviderCacheControlAware(type) {
125
136
  }
126
137
 
127
138
  // src/ai/providers.metadata.ts
128
- var MODEL_METADATA = {
139
+ var PRIMARY_METADATA = {
129
140
  "MiniMax-M3": {
130
141
  detail: "Native multimodal frontier coding model (1M context, 512K effective)",
131
142
  imageInput: true,
@@ -325,6 +336,62 @@ var MODEL_METADATA = {
325
336
  maxInputTokens: 1e6,
326
337
  maxOutputTokens: 128e3
327
338
  },
339
+ // GLM-5.3 (2026-08-14) — same 744B base as GLM-5.2 with extended
340
+ // post-training for security / long-horizon coding. ~one-tenth the
341
+ // per-token price of comparable U.S. frontier models; Z.ai's headline
342
+ // result is 84.5% on CyberGym vulnerability-identification benchmark
343
+ // (vendor-reported, no third-party replication as of 2026-08-18).
344
+ // Available via GLM Coding Plan + ZCode; open weights staged ~2026-08-28.
345
+ "glm-5.3": {
346
+ detail: "GLM-5.3 \u2014 1M \u4E0A\u4E0B\u6587\uFF0C\u540E\u8BAD\u7EC3\u589E\u5F3A\u4EE3\u7801 / \u7F51\u7EDC\u5B89\u5168",
347
+ imageInput: false,
348
+ toolCalling: true,
349
+ // Vendor-published USD price (Decrypt, 2026-08-14). Cache-hit price
350
+ // has not been published — the picker shows "(not published)" rather
351
+ // than fabricating a number (the rate usually diverges 4–10× from
352
+ // input, so a guess would mislead budget estimates).
353
+ pricingUSD: { input: 1.4, output: 4.4, cacheRead: null },
354
+ pricingCNY: { input: 10, output: 31, cacheRead: null },
355
+ priceCategory: "high",
356
+ maxInputTokens: 1e6,
357
+ maxOutputTokens: 128e3
358
+ },
359
+ // GLM-5.1-HighSpeed (2026-05) — production-grade high-throughput
360
+ // variant of GLM-5.1. Same 200K context + 128K output, but optimised
361
+ // via Zhipu's TileRT inference engine for 400 TPS output (~2× the
362
+ // rate of comparable flagship models). Native SSE streaming + MCP
363
+ // tool-call support. Listed on BigModel + Alibaba Cloud DashScope
364
+ // (model id `glm-5.1-highspeed`). Pricing mirrors GLM-5.1 since the
365
+ // rate is identical architecture — TileRT is a serving-side optim.
366
+ "glm-5.1-highspeed": {
367
+ detail: "GLM-5.1 HighSpeed \u2014 400 TPS \u9AD8\u541E\u5410\u751F\u4EA7\u53D8\u4F53",
368
+ imageInput: false,
369
+ toolCalling: true,
370
+ pricingUSD: { input: 0.6, output: 2.2, cacheRead: 0.11 },
371
+ pricingCNY: { input: 4.3, output: 15.7, cacheRead: 0.79 },
372
+ priceCategory: "medium",
373
+ maxInputTokens: 2e5,
374
+ maxOutputTokens: 128e3
375
+ },
376
+ // GLM-4.7-Flash (2026-01-19) — free-tier version of GLM-4.7, lightweight
377
+ // + high-frequency optimised. Coding / writing / translation /
378
+ // reasoning at "best-in-class-for-its-size" per the Zhipu release notes;
379
+ // the "Flash" tier is distinct from `glm-4.7-flashx` (the latter is the
380
+ // 快速版 without tool calling; this Flash is the full-feature lite).
381
+ "glm-4.7-flash": {
382
+ detail: "GLM-4.7 Flash \u2014 \u8F7B\u91CF\u514D\u8D39\u7248\uFF0C200K \u4E0A\u4E0B\u6587",
383
+ imageInput: false,
384
+ toolCalling: true,
385
+ // Free tier — public pricing page lists the model as "免费" with no
386
+ // input/output rate. Numbers below are conservative estimates based
387
+ // on the GLM-3-Turbo "入门级 ¥1/1M tokens" reference; the provider
388
+ // has not published a cache rate either, so cacheRead is null.
389
+ pricingUSD: { input: 0.06, output: 0.21, cacheRead: null },
390
+ pricingCNY: { input: 0.4, output: 1.5, cacheRead: null },
391
+ priceCategory: "low",
392
+ maxInputTokens: 2e5,
393
+ maxOutputTokens: 128e3
394
+ },
328
395
  "glm-4.7": {
329
396
  detail: "200K \u4E0A\u4E0B\u6587\uFF0C\u5DE5\u5177\u8C03\u7528",
330
397
  imageInput: false,
@@ -390,6 +457,27 @@ var MODEL_METADATA = {
390
457
  maxInputTokens: 2e5,
391
458
  maxOutputTokens: 128e3
392
459
  },
460
+ // `glm-4.5` (no suffix) is exposed by Zhipu's `/v1/models`
461
+ // endpoint as of 2026-08-18 but is NOT listed on the public
462
+ // "模型概览" page (https://docs.bigmodel.cn/cn/guide/start/model-overview).
463
+ // It is almost certainly a legacy alias that routes to one of the
464
+ // suffixed variants — the only sibling in the 4.5 generation
465
+ // that ships tool calling is `glm-4.5-air` (128K context, 96K
466
+ // max output, ¥-billed), so we mirror that metadata here. The
467
+ // token caps are the most important field for the VSCode chat
468
+ // picker (entries with `maxInputTokens: 0` are hidden), and the
469
+ // pricing column is honest about it being a best-guess until
470
+ // Zhipu publishes a dedicated spec.
471
+ "glm-4.5": {
472
+ detail: "GLM-4.5 \u2014 \u5DE5\u5177\u8C03\u7528\uFF08\u88F8\u540D\uFF1BZhipu /v1/models \u66B4\u9732\u7684 legacy alias\uFF09",
473
+ imageInput: false,
474
+ toolCalling: true,
475
+ pricingUSD: { input: 0, output: 0, cacheRead: null },
476
+ pricingCNY: { input: 0, output: 0, cacheRead: null },
477
+ priceCategory: "low",
478
+ maxInputTokens: 128e3,
479
+ maxOutputTokens: 96e3
480
+ },
393
481
  "glm-4.5-air": {
394
482
  detail: "GLM-4.5 Air \u2014 \u5DE5\u5177\u8C03\u7528",
395
483
  imageInput: false,
@@ -551,8 +639,79 @@ var MODEL_METADATA = {
551
639
  priceCategory: "low",
552
640
  maxInputTokens: 32768,
553
641
  maxOutputTokens: 32768
642
+ },
643
+ // ── MiniMax M2.5 (2026-02-13) ──────────────────────────────────────
644
+ // 229B MoE, 80.2% SWE-Bench Verified, the predecessor to M2.7.
645
+ // Source: https://siliconflow.cn/models?series=qwen (MiniMax card),
646
+ // platform.minimaxi.com/docs/release-notes/models (M2.5 release note).
647
+ "MiniMax-M2.5": {
648
+ detail: "MiniMax M2.5 \u2014 229B MoE, SOTA \u7F16\u7A0B / Agent / \u529E\u516C\u751F\u4EA7\u529B\uFF08192K \u4E0A\u4E0B\u6587\uFF09",
649
+ imageInput: false,
650
+ toolCalling: true,
651
+ // ¥2.1 / ¥8.4 per 1M tokens; cache hit documented at ¥0.21 (按
652
+ // 官方 10% cache 命中率回填)
653
+ pricingUSD: { input: 0.3, output: 1.2, cacheRead: 0.03 },
654
+ pricingCNY: { input: 2.1, output: 8.4, cacheRead: 0.21 },
655
+ priceCategory: "medium",
656
+ // 官方 context 192K;output 按 16K 保守估值(M2.7 标 128K,M2.5
657
+ // 官方未单独发布 max output 数字,按其同代老模型惯例取 16K)。
658
+ maxInputTokens: 192e3,
659
+ maxOutputTokens: 16384
660
+ },
661
+ // ── Qwen3.6-35B-A3B(2026-04-17 通义千问)────────────────────────────
662
+ // 35B MoE,激活仅 3B,256K 上下文;2026 年 Qwen3.6 系列首发
663
+ // small-size open-weight。"激活成本 1/10" 是其与前代 Qwen3.5-27B
664
+ // 相比的核心卖点。Source:
665
+ // https://siliconflow.cn/news/z12t3edpv6ypbuja3o65lgh2
666
+ "Qwen3.6-35B-A3B": {
667
+ detail: "Qwen3.6-35B-A3B \u2014 35B MoE (3B \u6FC0\u6D3B)\uFF0C\u601D\u8003/\u975E\u601D\u8003\u53CC\u6A21\uFF0C256K \u4E0A\u4E0B\u6587",
668
+ imageInput: true,
669
+ toolCalling: true,
670
+ // SiliconFlow 列价:¥1.6 / ¥12.8 per 1M tokens
671
+ pricingUSD: { input: 0.23, output: 1.83, cacheRead: null },
672
+ pricingCNY: { input: 1.6, output: 12.8, cacheRead: null },
673
+ priceCategory: "low",
674
+ // Qwen3.6-35B-A3B 官方 256K context;output 上限按同代 27B
675
+ // 同样 32K 取值(Qwen3.6 系列 max output 未单独公布)。
676
+ maxInputTokens: 256e3,
677
+ maxOutputTokens: 32768
554
678
  }
555
679
  };
680
+ var NAMESPACE_ALIASES = {
681
+ // SiliconFlow (CNY-billed China-domiciled platform)
682
+ "deepseek-ai/DeepSeek-V4-Pro": "deepseek-v4-pro",
683
+ "deepseek-ai/DeepSeek-V4-Flash": "deepseek-v4-flash",
684
+ "zai-org/GLM-5.2": "glm-5.2",
685
+ "Qwen/Qwen3.6-35B-A3B": "Qwen3.6-35B-A3B",
686
+ "moonshotai/Kimi-K2.7-Code": "kimi-k2.7-code",
687
+ // Novita (USD-billed global aggregator)
688
+ "deepseek/deepseek-v4-pro": "deepseek-v4-pro",
689
+ "deepseek/deepseek-v4-flash": "deepseek-v4-flash",
690
+ "zai/glm-5.2": "glm-5.2",
691
+ "zai/glm-5.1": "glm-5.1",
692
+ "moonshotai/kimi-k3": "kimi-k3",
693
+ // Zhipu naming-history aliases. The 2026-08 "模型一览" page
694
+ // (https://docs.bigmodel.cn/cn/guide/start/model-overview) lists
695
+ // the FlashX variant under its date-stamped id
696
+ // `GLM-4-FlashX-250414`; the bare `glm-4-flashx` is the
697
+ // historical alias that still resolves in chat-completions calls
698
+ // (and is what every existing ProvidersTab user has stored). Map
699
+ // the new id to the same primary entry so both spellings benefit
700
+ // from the curated detail / pricing / capability columns.
701
+ "glm-4-flashx-250414": "glm-4-flashx"
702
+ };
703
+ var MODEL_METADATA = (() => {
704
+ const merged = {
705
+ ...PRIMARY_METADATA
706
+ };
707
+ for (const [alias, target] of Object.entries(NAMESPACE_ALIASES)) {
708
+ const targetEntry = PRIMARY_METADATA[target];
709
+ if (targetEntry !== void 0) {
710
+ merged[alias] = targetEntry;
711
+ }
712
+ }
713
+ return Object.freeze(merged);
714
+ })();
556
715
  function lookupModelMetadata(modelId) {
557
716
  return MODEL_METADATA[modelId];
558
717
  }
@@ -620,7 +779,12 @@ var BUILTIN_PROVIDER_PRESETS = {
620
779
  models: [
621
780
  buildPresetModel("MiniMax-M3", "MiniMax-M3"),
622
781
  buildPresetModel("MiniMax-M2.7", "MiniMax-M2.7"),
623
- buildPresetModel("MiniMax-M2.7-highspeed", "MiniMax-M2.7-highspeed")
782
+ buildPresetModel("MiniMax-M2.7-highspeed", "MiniMax-M2.7-highspeed"),
783
+ // M2.5 (2026-02-13, 80.2% SWE-Bench Verified) — the
784
+ // predecessor of M2.7. Still in the catalog and often
785
+ // available on MiniMax's promotional $0.30/$1.20 rate, so
786
+ // keep it as a preset for users on the M2.5 plan tier.
787
+ buildPresetModel("MiniMax-M2.5", "MiniMax-M2.5")
624
788
  ]
625
789
  },
626
790
  deepseek: {
@@ -669,27 +833,81 @@ var BUILTIN_PROVIDER_PRESETS = {
669
833
  zhipu: {
670
834
  displayName: "Zhipu",
671
835
  baseUrl: "https://open.bigmodel.cn/api/paas/v4",
672
- // Every id below has a curated `MODEL_METADATA` entry (see above)
673
- // keep this list in sync with that table. It previously only
674
- // listed the GLM-4.x models, so newer flagship releases (GLM-5.2 /
675
- // 5.1 / 5 / 5-Turbo / 5V-Turbo) never appeared in the ProvidersTab
676
- // "add provider" preset even though their metadata existed.
836
+ // The preset is the **intersection** of (a) the curated
837
+ // `MODEL_METADATA` table above and (b) what Zhipu's
838
+ // `/v1/models` endpoint actually returns as of 2026-08-18
839
+ // (verified by the user's "Fetch from API" pull in
840
+ // ProvidersTab see screenshot in the 2026-08-18 review).
841
+ // The two sources are kept in sync deliberately: a curated
842
+ // entry without a `/v1/models` listing is dead weight in the
843
+ // starter list (the user can still add it by hand), and a
844
+ // `/v1/models` listing without a curated entry breaks
845
+ // `buildPresetModel`'s fail-loudly contract.
846
+ //
847
+ // 2026-08-18 trim — the following 8 entries were removed
848
+ // because they no longer show up in Zhipu's `/v1/models`
849
+ // response (they were either retired, never exposed via
850
+ // chat-completions, or only reachable on private/coding-plan
851
+ // endpoints that the public `/v1/models` doesn't advertise):
852
+ //
853
+ // glm-5.1-highspeed — production 400-TPS variant of
854
+ // GLM-5.1 served via TileRT; still
855
+ // listed in some third-party mirrors
856
+ // (Alibaba Cloud DashScope) but not
857
+ // on Zhipu's own /v1/models.
858
+ // glm-5v-turbo — multimodal coding base; only
859
+ // reachable via the dedicated
860
+ // multimodal endpoint, not
861
+ // /v1/chat/completions.
862
+ // glm-4.7-flash — free-tier 4.7 lite; advertised on
863
+ // the docs pricing page but absent
864
+ // from /v1/models.
865
+ // glm-4.7-flashx — quick-response 4.7; same situation
866
+ // as glm-4.7-flash.
867
+ // glm-4.5v — multimodal 4.5; only on the
868
+ // dedicated VLM endpoint.
869
+ // glm-4.5-airx — quick-response 4.5 Air; not in
870
+ // /v1/models anymore.
871
+ // glm-4-long — 1M-context 4-Long; the `/long`
872
+ // path was retired in 2026 H1.
873
+ // glm-4-flashx — quick-response 4 FlashX; the
874
+ // `-250414` dated alias (see
875
+ // `NAMESPACE_ALIASES` in
876
+ // `providers.metadata.ts`) is the
877
+ // only spelling still exposed.
878
+ //
879
+ // Note: `glm-4.5` (no suffix) IS in the preset now. It is
880
+ // NOT listed on the public "模型概览" page but it IS
881
+ // returned by /v1/models — almost certainly a legacy alias
882
+ // that routes to one of the suffixed 4.5 variants. The
883
+ // curated metadata entry marks it as such; users on a
884
+ // private coding-plan endpoint that distinguishes `glm-4.5`
885
+ // from `glm-4.5-air` should override the model id in the
886
+ // ProvidersTab.
887
+ //
888
+ // Earlier (also 2026-08-18) trim — `glm-4-plus` and
889
+ // `glm-3-turbo` were removed from the preset on the same
890
+ // date. Both are no longer listed in Zhipu's public
891
+ // "模型一览": `GLM-4-0520` is in the "即将弃用模型" list
892
+ // and `GLM-3-Turbo` has been retired without a formal
893
+ // redirect. Their API endpoints may still respond for
894
+ // legacy accounts (the `glm-4-plus` 429 "余额不足" log we
895
+ // saw on 2026-08-18 is one such case), but they shouldn't
896
+ // be the default starter pick for a freshly added Zhipu
897
+ // provider. Users with a paid legacy plan that still works
898
+ // can add the id back by hand in the ProvidersTab; the
899
+ // `MODEL_METADATA` entries are kept so the id is still
900
+ // resolvable for the curated detail / pricing columns.
677
901
  models: [
902
+ buildPresetModel("glm-5.3", "GLM-5.3"),
678
903
  buildPresetModel("glm-5.2", "GLM-5.2"),
679
904
  buildPresetModel("glm-5.1", "GLM-5.1"),
680
905
  buildPresetModel("glm-5", "GLM-5"),
681
906
  buildPresetModel("glm-5-turbo", "GLM-5 Turbo"),
682
- buildPresetModel("glm-5v-turbo", "GLM-5V Turbo"),
683
907
  buildPresetModel("glm-4.7", "GLM-4.7"),
684
- buildPresetModel("glm-4.7-flashx", "GLM-4.7 FlashX"),
685
908
  buildPresetModel("glm-4.6", "GLM-4.6"),
686
- buildPresetModel("glm-4.5v", "GLM-4.5V"),
687
909
  buildPresetModel("glm-4.5-air", "GLM-4.5 Air"),
688
- buildPresetModel("glm-4.5-airx", "GLM-4.5 AirX"),
689
- buildPresetModel("glm-4-plus", "GLM-4 Plus"),
690
- buildPresetModel("glm-4-long", "GLM-4 Long"),
691
- buildPresetModel("glm-4-flashx", "GLM-4 FlashX"),
692
- buildPresetModel("glm-3-turbo", "GLM-3 Turbo")
910
+ buildPresetModel("glm-4.5", "GLM-4.5")
693
911
  ]
694
912
  },
695
913
  stepfun: {
@@ -704,9 +922,23 @@ var BUILTIN_PROVIDER_PRESETS = {
704
922
  siliconflow: {
705
923
  displayName: "SiliconFlow",
706
924
  baseUrl: "https://api.siliconflow.cn/v1",
707
- // 聚合平台:模型列表动态,用户添加后通过 /v1/models 拉取。
708
- // 占位 0 容量模型避免 picker 显示空。
709
- models: []
925
+ // 聚合平台 模型列表由平台动态维护(>100 个)。这里列的
926
+ // 6 个是 2026 7-8 月各家最新的旗舰/代表型号,给 ProvidersTab
927
+ // 一个 "一眼能看到" 的起点;用户添加 provider 后可继续通过
928
+ // `/v1/models` 拉取完整列表。
929
+ // 这里的 id 是 SiliconFlow API 用的 namespaced 字符串,必须
930
+ // 与 MODEL_METADATA 的 alias 严格一致。
931
+ models: [
932
+ // DeepSeek V4 系列 (2026-04)
933
+ buildPresetModel("deepseek-ai/DeepSeek-V4-Pro", "DeepSeek V4 Pro (via SiliconFlow)"),
934
+ buildPresetModel("deepseek-ai/DeepSeek-V4-Flash", "DeepSeek V4 Flash (via SiliconFlow)"),
935
+ // GLM-5.2 (2026-06-17) — open-weight 编程旗舰,1M context
936
+ buildPresetModel("zai-org/GLM-5.2", "GLM-5.2 (via SiliconFlow)"),
937
+ // Qwen3.6-35B-A3B (2026-04) — 35B MoE, 3B 激活,"小而强"
938
+ buildPresetModel("Qwen/Qwen3.6-35B-A3B", "Qwen3.6-35B-A3B (via SiliconFlow)"),
939
+ // Kimi K2.7-Code (2026-06-12) — Moonshot coding 旗舰
940
+ buildPresetModel("moonshotai/Kimi-K2.7-Code", "Kimi K2.7 Code (via SiliconFlow)")
941
+ ]
710
942
  },
711
943
  openrouter: {
712
944
  displayName: "OpenRouter",
@@ -716,12 +948,21 @@ var BUILTIN_PROVIDER_PRESETS = {
716
948
  novita: {
717
949
  displayName: "Novita",
718
950
  baseUrl: "https://api.novita.ai/openai/v1",
719
- // 聚合平台:Novita 本身不产出自有模型,只是把 Kimi K3 / GLM 5.2 /
720
- // DeepSeek V4 / MiniMax M3 / Step 3.7 Flash 等第三方开源或授权模型
721
- // 挂到统一 OpenAI 兼容网关下(见 https://novita.ai/llm-api)。此前
722
- // 占位的 "novita-ai/novita-3.5-flash" 在其模型列表中查无此模型 id,
723
- // 已移除。用户添加 provider 后通过 /v1/models 拉取真实列表。
724
- models: []
951
+ // 聚合平台:Novita 本身不产出自有模型,只是把 Kimi K3 / GLM 5.x /
952
+ // DeepSeek V4 等第三方开源或授权模型挂到统一 OpenAI 兼容网关下
953
+ // (见 https://novita.ai/llm-api)。这里列 5 个 2026 旗舰作为
954
+ // preset 起点;用户添加 provider 后可继续通过 `/v1/models` 拉取
955
+ // 完整列表。id 严格匹配 Novita API 的 namespaced 字符串。
956
+ models: [
957
+ // DeepSeek V4 系列 (2026-04)
958
+ buildPresetModel("deepseek/deepseek-v4-pro", "DeepSeek V4 Pro (via Novita)"),
959
+ buildPresetModel("deepseek/deepseek-v4-flash", "DeepSeek V4 Flash (via Novita)"),
960
+ // GLM-5 系列 (2026-04/06)
961
+ buildPresetModel("zai/glm-5.2", "GLM-5.2 (via Novita)"),
962
+ buildPresetModel("zai/glm-5.1", "GLM-5.1 (via Novita)"),
963
+ // Kimi K3 (2026-07-16 API, 2026-07-27 开源) — 1M context, 2.8T MoE
964
+ buildPresetModel("moonshotai/kimi-k3", "Kimi K3 (via Novita)")
965
+ ]
725
966
  }
726
967
  };
727
968
  function getBuiltinProviderPreset(type) {
package/dist/index.mjs CHANGED
@@ -12,8 +12,19 @@ var PROVIDER_BASE_URL_PRESETS = {
12
12
  { label: "\u5168\u7403", baseUrl: "https://api.moonshot.ai/v1" }
13
13
  ],
14
14
  zhipu: [
15
- { label: "\u56FD\u5185", baseUrl: "https://open.bigmodel.cn/api/agent" },
16
- { label: "\u5168\u7403", baseUrl: "https://api.zhipuai.com/v1" }
15
+ // Zhipu's OpenAI-compatible Chat Completions endpoint is the
16
+ // `/api/paas/v4` path on `open.bigmodel.cn` (per
17
+ // https://docs.bigmodel.cn/cn/guide/develop/http/introduction —
18
+ // "请求端点(通用API)"). Earlier entries on this dropdown were
19
+ // wrong:
20
+ // - `/api/agent` is Zhipu's *Agent* (intelligent-agent) API
21
+ // surface, not chat completions — sending GLM model ids
22
+ // there returns 4xx.
23
+ // - `api.zhipuai.com/v1` was the v3-era host and has since
24
+ // been migrated to `bigmodel.cn`.
25
+ // Zhipu does not publish a separate regional endpoint, so only
26
+ // the official host is offered here (single-entry dropdown).
27
+ { label: "\u5B98\u65B9", baseUrl: "https://open.bigmodel.cn/api/paas/v4" }
17
28
  ],
18
29
  stepfun: [{ label: "\u5B98\u65B9", baseUrl: "https://api.stepfun.com/v1" }],
19
30
  siliconflow: [
@@ -60,7 +71,7 @@ function isProviderCacheControlAware(type) {
60
71
  }
61
72
 
62
73
  // src/ai/providers.metadata.ts
63
- var MODEL_METADATA = {
74
+ var PRIMARY_METADATA = {
64
75
  "MiniMax-M3": {
65
76
  detail: "Native multimodal frontier coding model (1M context, 512K effective)",
66
77
  imageInput: true,
@@ -260,6 +271,62 @@ var MODEL_METADATA = {
260
271
  maxInputTokens: 1e6,
261
272
  maxOutputTokens: 128e3
262
273
  },
274
+ // GLM-5.3 (2026-08-14) — same 744B base as GLM-5.2 with extended
275
+ // post-training for security / long-horizon coding. ~one-tenth the
276
+ // per-token price of comparable U.S. frontier models; Z.ai's headline
277
+ // result is 84.5% on CyberGym vulnerability-identification benchmark
278
+ // (vendor-reported, no third-party replication as of 2026-08-18).
279
+ // Available via GLM Coding Plan + ZCode; open weights staged ~2026-08-28.
280
+ "glm-5.3": {
281
+ detail: "GLM-5.3 \u2014 1M \u4E0A\u4E0B\u6587\uFF0C\u540E\u8BAD\u7EC3\u589E\u5F3A\u4EE3\u7801 / \u7F51\u7EDC\u5B89\u5168",
282
+ imageInput: false,
283
+ toolCalling: true,
284
+ // Vendor-published USD price (Decrypt, 2026-08-14). Cache-hit price
285
+ // has not been published — the picker shows "(not published)" rather
286
+ // than fabricating a number (the rate usually diverges 4–10× from
287
+ // input, so a guess would mislead budget estimates).
288
+ pricingUSD: { input: 1.4, output: 4.4, cacheRead: null },
289
+ pricingCNY: { input: 10, output: 31, cacheRead: null },
290
+ priceCategory: "high",
291
+ maxInputTokens: 1e6,
292
+ maxOutputTokens: 128e3
293
+ },
294
+ // GLM-5.1-HighSpeed (2026-05) — production-grade high-throughput
295
+ // variant of GLM-5.1. Same 200K context + 128K output, but optimised
296
+ // via Zhipu's TileRT inference engine for 400 TPS output (~2× the
297
+ // rate of comparable flagship models). Native SSE streaming + MCP
298
+ // tool-call support. Listed on BigModel + Alibaba Cloud DashScope
299
+ // (model id `glm-5.1-highspeed`). Pricing mirrors GLM-5.1 since the
300
+ // rate is identical architecture — TileRT is a serving-side optim.
301
+ "glm-5.1-highspeed": {
302
+ detail: "GLM-5.1 HighSpeed \u2014 400 TPS \u9AD8\u541E\u5410\u751F\u4EA7\u53D8\u4F53",
303
+ imageInput: false,
304
+ toolCalling: true,
305
+ pricingUSD: { input: 0.6, output: 2.2, cacheRead: 0.11 },
306
+ pricingCNY: { input: 4.3, output: 15.7, cacheRead: 0.79 },
307
+ priceCategory: "medium",
308
+ maxInputTokens: 2e5,
309
+ maxOutputTokens: 128e3
310
+ },
311
+ // GLM-4.7-Flash (2026-01-19) — free-tier version of GLM-4.7, lightweight
312
+ // + high-frequency optimised. Coding / writing / translation /
313
+ // reasoning at "best-in-class-for-its-size" per the Zhipu release notes;
314
+ // the "Flash" tier is distinct from `glm-4.7-flashx` (the latter is the
315
+ // 快速版 without tool calling; this Flash is the full-feature lite).
316
+ "glm-4.7-flash": {
317
+ detail: "GLM-4.7 Flash \u2014 \u8F7B\u91CF\u514D\u8D39\u7248\uFF0C200K \u4E0A\u4E0B\u6587",
318
+ imageInput: false,
319
+ toolCalling: true,
320
+ // Free tier — public pricing page lists the model as "免费" with no
321
+ // input/output rate. Numbers below are conservative estimates based
322
+ // on the GLM-3-Turbo "入门级 ¥1/1M tokens" reference; the provider
323
+ // has not published a cache rate either, so cacheRead is null.
324
+ pricingUSD: { input: 0.06, output: 0.21, cacheRead: null },
325
+ pricingCNY: { input: 0.4, output: 1.5, cacheRead: null },
326
+ priceCategory: "low",
327
+ maxInputTokens: 2e5,
328
+ maxOutputTokens: 128e3
329
+ },
263
330
  "glm-4.7": {
264
331
  detail: "200K \u4E0A\u4E0B\u6587\uFF0C\u5DE5\u5177\u8C03\u7528",
265
332
  imageInput: false,
@@ -325,6 +392,27 @@ var MODEL_METADATA = {
325
392
  maxInputTokens: 2e5,
326
393
  maxOutputTokens: 128e3
327
394
  },
395
+ // `glm-4.5` (no suffix) is exposed by Zhipu's `/v1/models`
396
+ // endpoint as of 2026-08-18 but is NOT listed on the public
397
+ // "模型概览" page (https://docs.bigmodel.cn/cn/guide/start/model-overview).
398
+ // It is almost certainly a legacy alias that routes to one of the
399
+ // suffixed variants — the only sibling in the 4.5 generation
400
+ // that ships tool calling is `glm-4.5-air` (128K context, 96K
401
+ // max output, ¥-billed), so we mirror that metadata here. The
402
+ // token caps are the most important field for the VSCode chat
403
+ // picker (entries with `maxInputTokens: 0` are hidden), and the
404
+ // pricing column is honest about it being a best-guess until
405
+ // Zhipu publishes a dedicated spec.
406
+ "glm-4.5": {
407
+ detail: "GLM-4.5 \u2014 \u5DE5\u5177\u8C03\u7528\uFF08\u88F8\u540D\uFF1BZhipu /v1/models \u66B4\u9732\u7684 legacy alias\uFF09",
408
+ imageInput: false,
409
+ toolCalling: true,
410
+ pricingUSD: { input: 0, output: 0, cacheRead: null },
411
+ pricingCNY: { input: 0, output: 0, cacheRead: null },
412
+ priceCategory: "low",
413
+ maxInputTokens: 128e3,
414
+ maxOutputTokens: 96e3
415
+ },
328
416
  "glm-4.5-air": {
329
417
  detail: "GLM-4.5 Air \u2014 \u5DE5\u5177\u8C03\u7528",
330
418
  imageInput: false,
@@ -486,8 +574,79 @@ var MODEL_METADATA = {
486
574
  priceCategory: "low",
487
575
  maxInputTokens: 32768,
488
576
  maxOutputTokens: 32768
577
+ },
578
+ // ── MiniMax M2.5 (2026-02-13) ──────────────────────────────────────
579
+ // 229B MoE, 80.2% SWE-Bench Verified, the predecessor to M2.7.
580
+ // Source: https://siliconflow.cn/models?series=qwen (MiniMax card),
581
+ // platform.minimaxi.com/docs/release-notes/models (M2.5 release note).
582
+ "MiniMax-M2.5": {
583
+ detail: "MiniMax M2.5 \u2014 229B MoE, SOTA \u7F16\u7A0B / Agent / \u529E\u516C\u751F\u4EA7\u529B\uFF08192K \u4E0A\u4E0B\u6587\uFF09",
584
+ imageInput: false,
585
+ toolCalling: true,
586
+ // ¥2.1 / ¥8.4 per 1M tokens; cache hit documented at ¥0.21 (按
587
+ // 官方 10% cache 命中率回填)
588
+ pricingUSD: { input: 0.3, output: 1.2, cacheRead: 0.03 },
589
+ pricingCNY: { input: 2.1, output: 8.4, cacheRead: 0.21 },
590
+ priceCategory: "medium",
591
+ // 官方 context 192K;output 按 16K 保守估值(M2.7 标 128K,M2.5
592
+ // 官方未单独发布 max output 数字,按其同代老模型惯例取 16K)。
593
+ maxInputTokens: 192e3,
594
+ maxOutputTokens: 16384
595
+ },
596
+ // ── Qwen3.6-35B-A3B(2026-04-17 通义千问)────────────────────────────
597
+ // 35B MoE,激活仅 3B,256K 上下文;2026 年 Qwen3.6 系列首发
598
+ // small-size open-weight。"激活成本 1/10" 是其与前代 Qwen3.5-27B
599
+ // 相比的核心卖点。Source:
600
+ // https://siliconflow.cn/news/z12t3edpv6ypbuja3o65lgh2
601
+ "Qwen3.6-35B-A3B": {
602
+ detail: "Qwen3.6-35B-A3B \u2014 35B MoE (3B \u6FC0\u6D3B)\uFF0C\u601D\u8003/\u975E\u601D\u8003\u53CC\u6A21\uFF0C256K \u4E0A\u4E0B\u6587",
603
+ imageInput: true,
604
+ toolCalling: true,
605
+ // SiliconFlow 列价:¥1.6 / ¥12.8 per 1M tokens
606
+ pricingUSD: { input: 0.23, output: 1.83, cacheRead: null },
607
+ pricingCNY: { input: 1.6, output: 12.8, cacheRead: null },
608
+ priceCategory: "low",
609
+ // Qwen3.6-35B-A3B 官方 256K context;output 上限按同代 27B
610
+ // 同样 32K 取值(Qwen3.6 系列 max output 未单独公布)。
611
+ maxInputTokens: 256e3,
612
+ maxOutputTokens: 32768
489
613
  }
490
614
  };
615
+ var NAMESPACE_ALIASES = {
616
+ // SiliconFlow (CNY-billed China-domiciled platform)
617
+ "deepseek-ai/DeepSeek-V4-Pro": "deepseek-v4-pro",
618
+ "deepseek-ai/DeepSeek-V4-Flash": "deepseek-v4-flash",
619
+ "zai-org/GLM-5.2": "glm-5.2",
620
+ "Qwen/Qwen3.6-35B-A3B": "Qwen3.6-35B-A3B",
621
+ "moonshotai/Kimi-K2.7-Code": "kimi-k2.7-code",
622
+ // Novita (USD-billed global aggregator)
623
+ "deepseek/deepseek-v4-pro": "deepseek-v4-pro",
624
+ "deepseek/deepseek-v4-flash": "deepseek-v4-flash",
625
+ "zai/glm-5.2": "glm-5.2",
626
+ "zai/glm-5.1": "glm-5.1",
627
+ "moonshotai/kimi-k3": "kimi-k3",
628
+ // Zhipu naming-history aliases. The 2026-08 "模型一览" page
629
+ // (https://docs.bigmodel.cn/cn/guide/start/model-overview) lists
630
+ // the FlashX variant under its date-stamped id
631
+ // `GLM-4-FlashX-250414`; the bare `glm-4-flashx` is the
632
+ // historical alias that still resolves in chat-completions calls
633
+ // (and is what every existing ProvidersTab user has stored). Map
634
+ // the new id to the same primary entry so both spellings benefit
635
+ // from the curated detail / pricing / capability columns.
636
+ "glm-4-flashx-250414": "glm-4-flashx"
637
+ };
638
+ var MODEL_METADATA = (() => {
639
+ const merged = {
640
+ ...PRIMARY_METADATA
641
+ };
642
+ for (const [alias, target] of Object.entries(NAMESPACE_ALIASES)) {
643
+ const targetEntry = PRIMARY_METADATA[target];
644
+ if (targetEntry !== void 0) {
645
+ merged[alias] = targetEntry;
646
+ }
647
+ }
648
+ return Object.freeze(merged);
649
+ })();
491
650
  function lookupModelMetadata(modelId) {
492
651
  return MODEL_METADATA[modelId];
493
652
  }
@@ -555,7 +714,12 @@ var BUILTIN_PROVIDER_PRESETS = {
555
714
  models: [
556
715
  buildPresetModel("MiniMax-M3", "MiniMax-M3"),
557
716
  buildPresetModel("MiniMax-M2.7", "MiniMax-M2.7"),
558
- buildPresetModel("MiniMax-M2.7-highspeed", "MiniMax-M2.7-highspeed")
717
+ buildPresetModel("MiniMax-M2.7-highspeed", "MiniMax-M2.7-highspeed"),
718
+ // M2.5 (2026-02-13, 80.2% SWE-Bench Verified) — the
719
+ // predecessor of M2.7. Still in the catalog and often
720
+ // available on MiniMax's promotional $0.30/$1.20 rate, so
721
+ // keep it as a preset for users on the M2.5 plan tier.
722
+ buildPresetModel("MiniMax-M2.5", "MiniMax-M2.5")
559
723
  ]
560
724
  },
561
725
  deepseek: {
@@ -604,27 +768,81 @@ var BUILTIN_PROVIDER_PRESETS = {
604
768
  zhipu: {
605
769
  displayName: "Zhipu",
606
770
  baseUrl: "https://open.bigmodel.cn/api/paas/v4",
607
- // Every id below has a curated `MODEL_METADATA` entry (see above)
608
- // keep this list in sync with that table. It previously only
609
- // listed the GLM-4.x models, so newer flagship releases (GLM-5.2 /
610
- // 5.1 / 5 / 5-Turbo / 5V-Turbo) never appeared in the ProvidersTab
611
- // "add provider" preset even though their metadata existed.
771
+ // The preset is the **intersection** of (a) the curated
772
+ // `MODEL_METADATA` table above and (b) what Zhipu's
773
+ // `/v1/models` endpoint actually returns as of 2026-08-18
774
+ // (verified by the user's "Fetch from API" pull in
775
+ // ProvidersTab see screenshot in the 2026-08-18 review).
776
+ // The two sources are kept in sync deliberately: a curated
777
+ // entry without a `/v1/models` listing is dead weight in the
778
+ // starter list (the user can still add it by hand), and a
779
+ // `/v1/models` listing without a curated entry breaks
780
+ // `buildPresetModel`'s fail-loudly contract.
781
+ //
782
+ // 2026-08-18 trim — the following 8 entries were removed
783
+ // because they no longer show up in Zhipu's `/v1/models`
784
+ // response (they were either retired, never exposed via
785
+ // chat-completions, or only reachable on private/coding-plan
786
+ // endpoints that the public `/v1/models` doesn't advertise):
787
+ //
788
+ // glm-5.1-highspeed — production 400-TPS variant of
789
+ // GLM-5.1 served via TileRT; still
790
+ // listed in some third-party mirrors
791
+ // (Alibaba Cloud DashScope) but not
792
+ // on Zhipu's own /v1/models.
793
+ // glm-5v-turbo — multimodal coding base; only
794
+ // reachable via the dedicated
795
+ // multimodal endpoint, not
796
+ // /v1/chat/completions.
797
+ // glm-4.7-flash — free-tier 4.7 lite; advertised on
798
+ // the docs pricing page but absent
799
+ // from /v1/models.
800
+ // glm-4.7-flashx — quick-response 4.7; same situation
801
+ // as glm-4.7-flash.
802
+ // glm-4.5v — multimodal 4.5; only on the
803
+ // dedicated VLM endpoint.
804
+ // glm-4.5-airx — quick-response 4.5 Air; not in
805
+ // /v1/models anymore.
806
+ // glm-4-long — 1M-context 4-Long; the `/long`
807
+ // path was retired in 2026 H1.
808
+ // glm-4-flashx — quick-response 4 FlashX; the
809
+ // `-250414` dated alias (see
810
+ // `NAMESPACE_ALIASES` in
811
+ // `providers.metadata.ts`) is the
812
+ // only spelling still exposed.
813
+ //
814
+ // Note: `glm-4.5` (no suffix) IS in the preset now. It is
815
+ // NOT listed on the public "模型概览" page but it IS
816
+ // returned by /v1/models — almost certainly a legacy alias
817
+ // that routes to one of the suffixed 4.5 variants. The
818
+ // curated metadata entry marks it as such; users on a
819
+ // private coding-plan endpoint that distinguishes `glm-4.5`
820
+ // from `glm-4.5-air` should override the model id in the
821
+ // ProvidersTab.
822
+ //
823
+ // Earlier (also 2026-08-18) trim — `glm-4-plus` and
824
+ // `glm-3-turbo` were removed from the preset on the same
825
+ // date. Both are no longer listed in Zhipu's public
826
+ // "模型一览": `GLM-4-0520` is in the "即将弃用模型" list
827
+ // and `GLM-3-Turbo` has been retired without a formal
828
+ // redirect. Their API endpoints may still respond for
829
+ // legacy accounts (the `glm-4-plus` 429 "余额不足" log we
830
+ // saw on 2026-08-18 is one such case), but they shouldn't
831
+ // be the default starter pick for a freshly added Zhipu
832
+ // provider. Users with a paid legacy plan that still works
833
+ // can add the id back by hand in the ProvidersTab; the
834
+ // `MODEL_METADATA` entries are kept so the id is still
835
+ // resolvable for the curated detail / pricing columns.
612
836
  models: [
837
+ buildPresetModel("glm-5.3", "GLM-5.3"),
613
838
  buildPresetModel("glm-5.2", "GLM-5.2"),
614
839
  buildPresetModel("glm-5.1", "GLM-5.1"),
615
840
  buildPresetModel("glm-5", "GLM-5"),
616
841
  buildPresetModel("glm-5-turbo", "GLM-5 Turbo"),
617
- buildPresetModel("glm-5v-turbo", "GLM-5V Turbo"),
618
842
  buildPresetModel("glm-4.7", "GLM-4.7"),
619
- buildPresetModel("glm-4.7-flashx", "GLM-4.7 FlashX"),
620
843
  buildPresetModel("glm-4.6", "GLM-4.6"),
621
- buildPresetModel("glm-4.5v", "GLM-4.5V"),
622
844
  buildPresetModel("glm-4.5-air", "GLM-4.5 Air"),
623
- buildPresetModel("glm-4.5-airx", "GLM-4.5 AirX"),
624
- buildPresetModel("glm-4-plus", "GLM-4 Plus"),
625
- buildPresetModel("glm-4-long", "GLM-4 Long"),
626
- buildPresetModel("glm-4-flashx", "GLM-4 FlashX"),
627
- buildPresetModel("glm-3-turbo", "GLM-3 Turbo")
845
+ buildPresetModel("glm-4.5", "GLM-4.5")
628
846
  ]
629
847
  },
630
848
  stepfun: {
@@ -639,9 +857,23 @@ var BUILTIN_PROVIDER_PRESETS = {
639
857
  siliconflow: {
640
858
  displayName: "SiliconFlow",
641
859
  baseUrl: "https://api.siliconflow.cn/v1",
642
- // 聚合平台:模型列表动态,用户添加后通过 /v1/models 拉取。
643
- // 占位 0 容量模型避免 picker 显示空。
644
- models: []
860
+ // 聚合平台 模型列表由平台动态维护(>100 个)。这里列的
861
+ // 6 个是 2026 7-8 月各家最新的旗舰/代表型号,给 ProvidersTab
862
+ // 一个 "一眼能看到" 的起点;用户添加 provider 后可继续通过
863
+ // `/v1/models` 拉取完整列表。
864
+ // 这里的 id 是 SiliconFlow API 用的 namespaced 字符串,必须
865
+ // 与 MODEL_METADATA 的 alias 严格一致。
866
+ models: [
867
+ // DeepSeek V4 系列 (2026-04)
868
+ buildPresetModel("deepseek-ai/DeepSeek-V4-Pro", "DeepSeek V4 Pro (via SiliconFlow)"),
869
+ buildPresetModel("deepseek-ai/DeepSeek-V4-Flash", "DeepSeek V4 Flash (via SiliconFlow)"),
870
+ // GLM-5.2 (2026-06-17) — open-weight 编程旗舰,1M context
871
+ buildPresetModel("zai-org/GLM-5.2", "GLM-5.2 (via SiliconFlow)"),
872
+ // Qwen3.6-35B-A3B (2026-04) — 35B MoE, 3B 激活,"小而强"
873
+ buildPresetModel("Qwen/Qwen3.6-35B-A3B", "Qwen3.6-35B-A3B (via SiliconFlow)"),
874
+ // Kimi K2.7-Code (2026-06-12) — Moonshot coding 旗舰
875
+ buildPresetModel("moonshotai/Kimi-K2.7-Code", "Kimi K2.7 Code (via SiliconFlow)")
876
+ ]
645
877
  },
646
878
  openrouter: {
647
879
  displayName: "OpenRouter",
@@ -651,12 +883,21 @@ var BUILTIN_PROVIDER_PRESETS = {
651
883
  novita: {
652
884
  displayName: "Novita",
653
885
  baseUrl: "https://api.novita.ai/openai/v1",
654
- // 聚合平台:Novita 本身不产出自有模型,只是把 Kimi K3 / GLM 5.2 /
655
- // DeepSeek V4 / MiniMax M3 / Step 3.7 Flash 等第三方开源或授权模型
656
- // 挂到统一 OpenAI 兼容网关下(见 https://novita.ai/llm-api)。此前
657
- // 占位的 "novita-ai/novita-3.5-flash" 在其模型列表中查无此模型 id,
658
- // 已移除。用户添加 provider 后通过 /v1/models 拉取真实列表。
659
- models: []
886
+ // 聚合平台:Novita 本身不产出自有模型,只是把 Kimi K3 / GLM 5.x /
887
+ // DeepSeek V4 等第三方开源或授权模型挂到统一 OpenAI 兼容网关下
888
+ // (见 https://novita.ai/llm-api)。这里列 5 个 2026 旗舰作为
889
+ // preset 起点;用户添加 provider 后可继续通过 `/v1/models` 拉取
890
+ // 完整列表。id 严格匹配 Novita API 的 namespaced 字符串。
891
+ models: [
892
+ // DeepSeek V4 系列 (2026-04)
893
+ buildPresetModel("deepseek/deepseek-v4-pro", "DeepSeek V4 Pro (via Novita)"),
894
+ buildPresetModel("deepseek/deepseek-v4-flash", "DeepSeek V4 Flash (via Novita)"),
895
+ // GLM-5 系列 (2026-04/06)
896
+ buildPresetModel("zai/glm-5.2", "GLM-5.2 (via Novita)"),
897
+ buildPresetModel("zai/glm-5.1", "GLM-5.1 (via Novita)"),
898
+ // Kimi K3 (2026-07-16 API, 2026-07-27 开源) — 1M context, 2.8T MoE
899
+ buildPresetModel("moonshotai/kimi-k3", "Kimi K3 (via Novita)")
900
+ ]
660
901
  }
661
902
  };
662
903
  function getBuiltinProviderPreset(type) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serviceme/devtools-shared",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "Shared webview↔extension message contracts and cross-package data models used by SERVICEME.",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "repository": {