@mars-sea/dsh-commandcode-provider 0.16.3 → 0.16.4

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/CHANGELOG.md CHANGED
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.16.4] - 2026-11-02
8
+
9
+ ### Added
10
+
11
+ - **新增免费模型 Ling 3.1 Flash 1019(`inclusionai/ling-3.1-flash-1019:free`,服务端目录先行)。** `?view=client` 的 `catalogVersion` 由 `7f405e24…` 变为 `f3a51355…`,默认目录 94 → 95、client 视图 106 → 107,唯一新增行是 Ling 3.1 Flash 1019:1,000,000 上下文、262,144 输出上限、纯文本输入、推理档位 `low`/`medium`/`high`、Go 档、ZDR 覆盖、`/chat/completions` 端点;100% 免费促销自 `2026-10-29T16:00Z` 起至 `2026-11-03T16:00Z`(北京时间 11-04 00:00 到期),每账号每天 100 次请求。官方 models、pricing 与 go/goat/pro/max 计划页均已上架;`1.88.2` 产物注册表尚未收录该行(审计报 `absent from CLI registry`,与 `gpt-6.1-terra` 的目录先行形态一致)。快照 +1:`KNOWN_PLANS` 94 → 95、`KNOWN_EFFORTS` 67 → 68、`KNOWN_DEALS` 4 → 5(带 `expiresAt`,到期后 FREE 徽标自动消失,不跟随下架);`KNOWN_IMAGE_MODELS`(73)、`KNOWN_THINKING_MODELS`(16)、`KNOWN_NON_ZDR_MODELS`(18)、订阅表(9)、峰值定价(5)、内置价格行(94)与输出上限表(79)均不变——免费行照旧不进价格表,`MODEL_OUTPUT_TOKEN_LIMITS` 也不含 Ling 行(走 chat/completions)。`COMMAND_CODE_CLI_VERSION` 保持 `1.88.2`。**验证**:`typecheck` 退出码 0,`npm test` 1156/1156(扩展既有快照断言,未新增用例),`build` 两段 `Build complete`;本轮仅公开 GET 采集(14 个源全部 HTTP 200),未做真实账号登录、付费生成与服务端协议验证。
12
+
13
+ ### Fixed
14
+
15
+ - **账户余额为 0 时提示指向错误方向(2026-10-31 实测)。** 上游对 `POST /provider/v1/chat/completions` 返回 `400`,正文为 `You have insufficient credits to make this request…`、结构化代码只有 `BAD_REQUEST`;插件已能据此把账号轮换掉,但单账号场景没有可换对象,最终只显示通用文案「服务端拒绝了本次请求,请检查模型、套餐和请求设置」——按这三条查一条也查不到点上。现在该形状在通用分支之前被识别,提示为「账户额度不足,无法完成本次请求——请充值额度,或切换到其他账号」。判定复用账号轮换的同一组 pattern(新增 `isInsufficientCreditsText()` 与 `INSUFFICIENT_CREDITS`/`PREMIUM_CREDITS_EXHAUSTED` 代码集),两处不会漂移;失败码仍取 `httpErrorCode(status)`,重试预算与轮换行为不变。**验证**:`typecheck` 退出码 0,`npm test` 1156/1156(新增 3 条:实测正文、仅结构化代码、普通 400 不被吞)。
16
+
7
17
  ## [0.16.3] - 2026-10-31
8
18
 
9
19
  ### Changed
package/lib/client.js CHANGED
@@ -3896,7 +3896,7 @@ window.__ModuleLoader__.load({
3896
3896
  }
3897
3897
  //#endregion
3898
3898
  //#region package.json
3899
- var version = "0.16.3";
3899
+ var version = "0.16.4";
3900
3900
  var repository = {
3901
3901
  "type": "git",
3902
3902
  "url": "git+https://github.com/Mars-Sea/dsh-commandcode-provider.git"
package/lib/index.js CHANGED
@@ -521,6 +521,11 @@ const KNOWN_EFFORTS = {
521
521
  "medium",
522
522
  "high"
523
523
  ],
524
+ "inclusionai/ling-3.1-flash-1019:free": [
525
+ "low",
526
+ "medium",
527
+ "high"
528
+ ],
524
529
  "mistral/mistral-large-4": [
525
530
  "low",
526
531
  "medium",
@@ -1003,6 +1008,7 @@ const KNOWN_PLANS = {
1003
1008
  "gpt-6-luna": "go",
1004
1009
  "meituan/LongCat-2.0": "go",
1005
1010
  "inclusionai/ling-3.1-flash": "go",
1011
+ "inclusionai/ling-3.1-flash-1019:free": "go",
1006
1012
  "meta/muse-spark-1.2-contributor": "go",
1007
1013
  "meta/muse-spark-1.3-contributor": "go",
1008
1014
  "meta/muse-spark-open": "go",
@@ -1207,6 +1213,11 @@ function modelVisibleForAnyAccount(modelId, accounts) {
1207
1213
  }
1208
1214
  const KNOWN_DEALS = {
1209
1215
  "MiniMaxAI/MiniMax-M3": { label: "50% off" },
1216
+ "inclusionai/ling-3.1-flash-1019:free": {
1217
+ label: "FREE",
1218
+ free: true,
1219
+ expiresAt: "2026-11-03T16:00:00Z"
1220
+ },
1210
1221
  "poolside/laguna-s-2.1-free": {
1211
1222
  label: "FREE",
1212
1223
  free: true
@@ -4832,6 +4843,8 @@ function generateHttpError(status, errText, retryAfterMs, parsed = parseProvider
4832
4843
  if (status === 422 && isZdrNoProviders(providerCode, providerDetail, errText)) return bilingual("PROVIDER_HTTP_ERROR", `Command Code API error 422 (${detail}): zero data retention is enforced but no ZDR-capable upstream is available for this model — turn the ZDR setting off (or use another model)`, "Command Code API 返回 422:已开启零数据保留(ZDR),但该模型当前没有可用的 ZDR 上游——请关闭 ZDR 开关,或改用其他模型", { status: 422 });
4833
4844
  if (status === 401) return bilingual("INVALID_CREDENTIAL", `Command Code API error 401 (${detail}): the API key is missing or invalid — check the key stored for COMMANDCODE_API_KEY (Models page) or the auth file`, "Command Code API 返回 401:API 密钥缺失或无效——请在设置页检查 COMMANDCODE_API_KEY 存储的密钥,或检查 auth 文件", { status: 401 });
4834
4845
  if (status === 413) return bilingual("PROVIDER_HTTP_ERROR", "Command Code API error 413: the request body exceeds the provider's size limit (the cap is undocumented, measured at about 50 MB) — the session history is too large to send, usually because of accumulated image attachments. Start a new session, or drop the image-heavy part of this one, and retry", "Command Code API 返回 413:请求体超过服务端的体积上限(官方未公开,实测约 50 MB)——会话历史过大,通常是历史图片累积所致。请新建会话,或移除本会话中图片较多的部分后重试", { status: 413 });
4846
+ const creditsCode = providerCode?.toUpperCase();
4847
+ if (creditsCode !== void 0 && INSUFFICIENT_CREDITS_CODES.has(creditsCode) || isInsufficientCreditsText(overflowDetail) || isInsufficientCreditsText(errText)) return bilingual(httpErrorCode(status), `Command Code API error ${status}: this account has insufficient credits for the request — top up credits or switch to another account`, `Command Code API 返回 ${status}:账户额度不足,无法完成本次请求——请充值额度,或切换到其他账号`, { status });
4835
4848
  const safeIdentifier = (value) => value !== void 0 && /^[A-Za-z0-9_.:-]{1,80}$/.test(value) ? value : void 0;
4836
4849
  const diagnosticCode = safeIdentifier(parsed.code) ?? /^\s*(MODEL_NOT_IN_PLAN|INSUFFICIENT_CREDITS|USAGE_EXCEEDED|PREMIUM_CREDITS_EXHAUSTED)\b/i.exec(parsed.message ?? "")?.[1];
4837
4850
  const diagnosticType = safeIdentifier(parsed.type);
@@ -4924,6 +4937,30 @@ const ACCOUNT_UNAVAILABLE_CODES = /* @__PURE__ */ new Set([
4924
4937
  "PREMIUM_CREDITS_EXHAUSTED",
4925
4938
  "MODEL_NOT_IN_PLAN"
4926
4939
  ]);
4940
+ /**
4941
+ * 余额用尽的两种结构化代码(`USAGE_EXCEEDED`/`MODEL_NOT_IN_PLAN` 不属于这一类:
4942
+ * 前者是窗口额度,后者是套餐不含该模型,用户可行动的方向不同)。
4943
+ */
4944
+ const INSUFFICIENT_CREDITS_CODES = /* @__PURE__ */ new Set(["INSUFFICIENT_CREDITS", "PREMIUM_CREDITS_EXHAUSTED"]);
4945
+ /**
4946
+ * 正文里「额度用尽」的特征。
4947
+ *
4948
+ * 账号轮换判定与用户可见文案共用这一份 pattern:两处各写一份必然漂移,出现
4949
+ * 「轮换认得出、文案认不出」的错位——2026-10-31 的实测就是这样,账号池已经按
4950
+ * 这个原因换号,而单账号场景下用户看到的仍是通用 400 提示。
4951
+ *
4952
+ * 下划线与空格是同一个词:JSON 正文常写 `insufficient_credits`,CLI 自己的
4953
+ * marker 列表写 `insufficient credits`,先归一分隔符再匹配。
4954
+ */
4955
+ function isInsufficientCreditsText(text) {
4956
+ const lower = text.toLowerCase().replaceAll("_", " ");
4957
+ return lower.includes("insufficient credits") || lower.includes("premium credits exhausted") || /insufficient (credit|balance)/.test(lower) || /out of credit/.test(lower);
4958
+ }
4959
+ /** 正文里「模型不在本账号套餐内」的特征,与上者同一归一规则。 */
4960
+ function isModelOutsidePlanText(text) {
4961
+ const lower = text.toLowerCase().replaceAll("_", " ");
4962
+ return lower.includes("model not in plan") || /not (available|included)[^.]{0,40}plan/.test(lower) || lower.includes("upgrade your plan");
4963
+ }
4927
4964
  function classifyAccountRejection(status, errText, parsed = parseProviderError(errText)) {
4928
4965
  const code = (parsed.code ?? parsed.type)?.toUpperCase();
4929
4966
  if (status === 429 || code === "RATE_LIMITED") {
@@ -4937,8 +4974,7 @@ function classifyAccountRejection(status, errText, parsed = parseProviderError(e
4937
4974
  if (status === 401) return { reason: "invalid-credential" };
4938
4975
  if (code !== void 0 && ACCOUNT_UNAVAILABLE_CODES.has(code)) return { reason: "unavailable" };
4939
4976
  if (status < 400 || status >= 500) return void 0;
4940
- const lower = errText.toLowerCase().replaceAll("_", " ");
4941
- if (lower.includes("insufficient credits") || lower.includes("premium credits exhausted") || lower.includes("model not in plan") || /insufficient (credit|balance)/.test(lower) || /out of credit/.test(lower) || /not (available|included)[^.]{0,40}plan/.test(lower) || lower.includes("upgrade your plan")) return { reason: "unavailable" };
4977
+ if (isInsufficientCreditsText(errText) || isModelOutsidePlanText(errText)) return { reason: "unavailable" };
4942
4978
  }
4943
4979
  /**
4944
4980
  * The usage-window evidence carried by a rejected request, mirroring the CLI's
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mars-sea/dsh-commandcode-provider",
3
- "version": "0.16.3",
3
+ "version": "0.16.4",
4
4
  "description": "Unofficial DeepSeek Harness LLM provider plugin for Command Code, ported from pi-commandcode-provider (MIT). Registers the 'commandcode' provider route with a Models-page card and live model catalog.",
5
5
  "icon": "./icon.svg",
6
6
  "type": "module",