dsh-commandcode-quota 0.2.1 → 0.2.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-commandcode-quota",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Command Code balance and quota panel for DeepSeek Harness: a status row under the composer showing balance and the 5-hour, weekly and monthly windows.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -51,7 +51,7 @@
51
51
  "access": "public"
52
52
  },
53
53
  "peerDependencies": {
54
- "@deepseek-ai/dsh-credentials": "*"
54
+ "@deepseek-ai/dsh-credentials": ">=0.1.0-0 <0.2.0-0 || >=0.2.0-0 <0.3.0-0 || >=0.3.0-0 <0.4.0-0"
55
55
  },
56
56
  "peerDependenciesMeta": {
57
57
  "@deepseek-ai/dsh-credentials": {
package/src/index.js CHANGED
@@ -72,7 +72,7 @@ async function ccFetch(baseURL, path, apiKey, timeoutMs) {
72
72
  headers: {
73
73
  authorization: `Bearer ${apiKey}`,
74
74
  accept: "application/json",
75
- "user-agent": "dsh-commandcode-quota/0.2.1"
75
+ "user-agent": "dsh-commandcode-quota/0.2.2"
76
76
  },
77
77
  signal: controller.signal
78
78
  });
@@ -252,6 +252,14 @@ async function main() {
252
252
  // 发版时最容易漏的一处:user-agent 里的版本号要与 package.json 同步。
253
253
  const uaVersion = source.match(/"user-agent":\s*"[^"]*\/([^"]+)"/)?.[1];
254
254
  assert.equal(uaVersion, manifest.version, "user-agent 版本必须与 package.json 的 version 一致");
255
+ // 官方包的 peer 范围必须带显式预发布分支。node-semver 只让「相同 major.minor.patch
256
+ // 元组、且自身带预发布标签」的比较符放行预发布版本,所以 '*' 和 '>=0.0.0-0' 都匹配
257
+ // 不到任何 0.x.0-rc.y —— 而那正是 harness 官方包的版本形态。
258
+ const peerRange = manifest.peerDependencies["@deepseek-ai/dsh-credentials"];
259
+ assert.ok(
260
+ typeof peerRange === "string" && /-0/.test(peerRange),
261
+ `官方包 peer 范围必须含显式预发布分支(当前: ${peerRange})`,
262
+ );
255
263
  console.log("通过:单账号响应、主/回退凭据、完整/快速查询、缓存、401、405、重试和超时。");
256
264
  console.log("通过:凭据端点只回条目名、翻译供应商名、保存后覆盖 patch 配置、非法名被拒、无 key 时依然可用。");
257
265
  console.log("通过:宿主端导出、路由、包名与 bundle 补丁层一致。");