dsh-any-deepseek 0.0.17 → 0.0.18

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/CONTRIBUTING.md CHANGED
@@ -29,7 +29,7 @@
29
29
 
30
30
  加完这一条,面板的规格下拉里就有它了 —— 不需要改别处。
31
31
 
32
- **两条硬规矩**(都是付过代价的):
32
+ **三条硬规矩**(都是付过代价的):
33
33
 
34
34
  1. **注释里不要写「我探过了」,除非真的探过。**
35
35
  这个仓里曾经有一条 `Probed live: the billing pair answers` 的注释,而那个路由**从没被调用过**,
@@ -39,6 +39,22 @@
39
39
  我们对外只暴露 `deepseek-v4.1-flash` 一个 id,各家的拼写由预设吸收。
40
40
  **这正是这个插件存在的理由** —— 所以别在预设里图省事写我们的 id。
41
41
 
42
+ 三种拼写的真实例子(都在仓内):
43
+
44
+ | 渠道 | 它要的写法 | 说明 |
45
+ |---|---|---|
46
+ | OpenCode Go / Ollama / Open Design | `deepseek-v4.1-flash` | 中转站的写法 |
47
+ | DeepSeek Official | `deepseek-flash` | 官方自己的短拼写 |
48
+ | **Tencent TokenHub** | **`deepseek-v4-flash-202605`** | **`-202605` 是 id 的一部分,不是日期** |
49
+
50
+ ⚠️ 最后那一行是最典型的坑:把后缀"规整"掉看起来像在清理,实际是让每条请求都被上游拒。
51
+
52
+ 3. **没有余额接口就写「没有」,别猜一个形状。**
53
+ 判法用状态码,不用猜:不带 key 时,**真路由回 401**(存在、需鉴权),**假路径回 404**。
54
+ 然后逐个探候选路径 —— 全 404 就是真的没有。此时**不声明 `balance`**,
55
+ 面板会自动退回「测通」模式(发一次最小真实请求,成功就显示「余额未尽」)。
56
+ 反面教材:仓里 open-design 那条曾声明过 `openai-billing` 并注释"已探过",实际每次 404。
57
+
42
58
  ### 2. 修一处文案
43
59
 
44
60
  面板上的每一句都应该是一个**能在页面上验证的事实**。读到含糊、过时、或替宿主猜原因的,直接改。
package/README.md CHANGED
@@ -56,7 +56,7 @@ dsh plugin --profile web add dsh-any-deepseek
56
56
  **渠道 id** 会自动填好(可以改,只是配置里的键名)。**显示名**留空的话用规格的默认名 ——
57
57
  同一家开两个号时,填上「主号」「备号」之类会好认。
58
58
 
59
- 内置规格:DeepSeek Official、OpenCode Go、Ollama Cloud、Open Design、CommandCode
59
+ 内置规格:DeepSeek Official、OpenCode Go、Ollama Cloud、Open Design、CommandCode、Tencent TokenHub
60
60
  (这些名字与下拉框里显示的完全一致)。
61
61
  要接别家,见 [接一个新渠道](#接一个新渠道)。
62
62
 
@@ -95,6 +95,9 @@ dsh plugin --profile web add dsh-any-deepseek
95
95
  > **「余额未尽」不等于「还剩多少」。** 一次成功的请求只证明三件事:地址通、key 对、账户没因为欠费被拒
96
96
  > (欠费的账户会回 402,不会回 200)。所以这里只写「未尽」,**不会编一个金额给你**。
97
97
 
98
+ **哪些内置规格没有余额接口?** 目前是 **Open Design** 和 **Tencent TokenHub** ——
99
+ 这两家只开推理面,所以它们永远显示「余额未尽」而不是金额。这是如实报告,不是缺陷。
100
+
98
101
  ### 看这个月花了多少
99
102
 
100
103
  切到 **用量** 分页。
package/lib/index.js CHANGED
@@ -306,6 +306,50 @@ const CHANNEL_PRESETS = {
306
306
  ...V41_FLASH_CAPS,
307
307
  compat: { ...DEEPSEEK_THINKING_COMPAT }
308
308
  },
309
+ /**
310
+ * Tencent Cloud's TokenHub — a first-party forwarding endpoint for DeepSeek.
311
+ *
312
+ * Owner request (2026-10-23): 「我本机dsh还配了tokenhub这个渠道,这个渠道是腾讯云的渠道,
313
+ * 它的模型名称是固定的0605后缀就是向官方的转发」.
314
+ *
315
+ * 🔴 **The model id is frozen at `deepseek-v4-flash-202605` — the `-202605` suffix is part of the
316
+ * id, not a date we append.** This is the sharpest illustration of why presets exist: the same
317
+ * model is `deepseek-v4.1-flash` on the relays, `deepseek-flash` on the official API, and
318
+ * `deepseek-v4-flash-202605` here. Getting it wrong does not fail locally — the upstream
319
+ * rejects it on the first request.
320
+ *
321
+ * Endpoint and model id verified against TWO independent records in this container (the
322
+ * 2026-10-15 model-aggregator survey and the 2026-10-19 research note), and against the live
323
+ * `/v1/models` route (401 = present, auth required).
324
+ */
325
+ "tencent-tokenhub": {
326
+ displayName: "Tencent TokenHub",
327
+ api: "openai-completions",
328
+ baseURL: "https://tokenhub.tencentmaas.com/v1/",
329
+ model: "deepseek-v4-flash-202605",
330
+ contextWindow: 1024e3,
331
+ maxTokens: 384e3,
332
+ input: ["text"],
333
+ reasoningEfforts: { ...V41_FLASH_CAPS.reasoningEfforts },
334
+ compat: { ...DEEPSEEK_THINKING_COMPAT },
335
+ /**
336
+ * 🔴 **No balance surface — measured by status-code discrimination, not assumed.**
337
+ *
338
+ * Without a key, the inference route answers **401** while a made-up path answers **404**,
339
+ * so 401 here means "route exists, auth required". Four balance candidates were then probed
340
+ * at the same prefix and ALL answered 404, i.e. they do not exist:
341
+ * /v1/dashboard/billing/subscription 404
342
+ * /v1/user/balance 404
343
+ * /v1/credits 404
344
+ *
345
+ * ⇒ No `balance` is declared. The panel therefore reports "no balance API" and falls back to
346
+ * ONE minimal live request (`http.ts` `balanceRow`), showing 「余额未尽」 with the serving
347
+ * model and round-trip time — exactly what the owner asked for (「余额查询是没有的做成测通
348
+ * 查询即可」). Declaring a speculative `openai-billing` shape would have produced a 404 on
349
+ * every check, which is the mistake this repo already made once and recorded.
350
+ */
351
+ note: "Tencent Cloud forwarding endpoint; model id is frozen with a -202605 suffix. Text-only, per the endpoint record. No balance API — the panel verifies liveness instead."
352
+ },
309
353
  ollama: {
310
354
  displayName: "Ollama Cloud",
311
355
  api: "openai-completions",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-any-deepseek",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "description": "One DeepSeek V4.1 Flash provider for DeepSeek Harness: paste a key per channel, switch channels manually, token usage booked per real upstream.",
5
5
  "license": "MIT",
6
6
  "repository": {