dsh-bottom-info-bar 1.27.1 → 1.27.3
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/README.md +2 -0
- package/README.zh-CN.md +2 -0
- package/lib/index.js +8 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -63,6 +63,8 @@ Plugin information is further grouped by billing mode — read only the block th
|
|
|
63
63
|
|
|
64
64
|
API keys go in DSH under **Settings → Models**; subscriptions (Codex, OpenCode, Xiaomi Token Plan, Command Code, MiniMax, Zhipu GLM, Kimi For Coding) read the local sign-in or the model key already configured in DSH (MiniMax's needs to be a Subscription Key). Unused plans never show up, and nothing needs to be typed on the plugin page. The one exception is Alibaba Token Plan (China and international sites): the inference plan key cannot read quota, so set an Alibaba Cloud AccessKey (`ALIBABA_CLOUD_ACCESS_KEY_ID` / `ALIBABA_CLOUD_ACCESS_KEY_SECRET`, a RAM user is enough) under **Quota credentials** in the plugin settings (collapsed by default), or in DSH's credentials / same-named environment variables. Anything off the list gets a not-supported hint instead of borrowed numbers.
|
|
65
65
|
|
|
66
|
+
One caveat for Codex: its numeric windows are read through an internal usage endpoint used by OpenAI's own Codex client. That endpoint is not publicly documented, and OpenAI may change or close it at any time. If you would rather not rely on it, do not sign in to Codex CLI (or delete `~/.codex/auth.json`) and Codex will show plan information only.
|
|
67
|
+
|
|
66
68
|
## Spend and updates
|
|
67
69
|
|
|
68
70
|
The ledger requires a DSH runtime with Node.js 22.13 or newer. It keeps records and historical session indexes in a local disk database, reads bounded batches, and streams exports. Existing ledger files are migrated once and retained for recovery; see [Ledger storage and recovery](docs/LEDGER.md).
|
package/README.zh-CN.md
CHANGED
|
@@ -63,6 +63,8 @@ https://github.com/songoao25/dsh-bottom-info-bar
|
|
|
63
63
|
|
|
64
64
|
API 密钥填在 DSH 的**设置 → 模型**;订阅类(Codex、OpenCode、小米 Token Plan、Command Code、MiniMax、智谱、Kimi For Coding)读本机登录或 DSH 里配的推理 Key 直接查额度(MiniMax 那把需是 Subscription Key),不在用的套餐不会出现在信息栏,也不用再在插件页填任何东西。只有阿里 Token Plan(中国站/国际站)例外:推理套餐 Key 读不到额度,要另配阿里云 AccessKey——`ALIBABA_CLOUD_ACCESS_KEY_ID` / `ALIBABA_CLOUD_ACCESS_KEY_SECRET`(RAM 用户即可),在**插件设置页的「额度凭据」**里填(默认折叠),也可以填在 DSH 凭据或同名环境变量里。列表里没有的服务商只会显示未适配提示,绝不借用别家的数据。
|
|
65
65
|
|
|
66
|
+
Codex 要多说一句:它的数字窗口是通过 Codex 官方客户端使用的内部用量接口读取的,该接口没有公开文档,OpenAI 未来可能调整或关闭。介意的用户可以不登录 Codex CLI(或删除 `~/.codex/auth.json`),届时 Codex 只显示套餐信息。
|
|
67
|
+
|
|
66
68
|
## 花费与更新
|
|
67
69
|
|
|
68
70
|
账本需要 DSH 内部运行环境为 Node.js 22.13 或更新版本。账目和历史会话保存在本机磁盘,按需分批读取,导出直接下载。升级会迁移旧账,但保留旧文件供恢复核对;详见 [账本存储与恢复](docs/LEDGER.md)。
|
package/lib/index.js
CHANGED
|
@@ -5496,6 +5496,11 @@ export default {
|
|
|
5496
5496
|
// Origin/Host headers and adds its private Host cookie. requestRejection() is the shared
|
|
5497
5497
|
// boundary for both Web and Desktop; reproducing the browser-header check here rejects
|
|
5498
5498
|
// legitimate desktop requests.
|
|
5499
|
+
// DSH 0.2.3 起 Connection 重构移除了 requestRejection:路由改由注册时的 auth 声明
|
|
5500
|
+
// 负责准入(默认 required,未认证请求在框架层被拦),插件这段手工检查在新宿主上
|
|
5501
|
+
// 已冗余。无守卫直调不存在的方法会抛 TypeError、被下方 catch 统一转成 500,
|
|
5502
|
+
// 全部 RPC(含设置页 getFieldConfig)随之失效(Issue #313)。因此:宿主仍提供
|
|
5503
|
+
// requestRejection 时照旧调用;不存在时跳过手工检查,准入交给框架默认策略。
|
|
5499
5504
|
ctx.inject(['connection', 'webServer'], function (webCtx) {
|
|
5500
5505
|
webCtx.effect(function () {
|
|
5501
5506
|
const dispose = webCtx.webServer.register({
|
|
@@ -5504,7 +5509,9 @@ export default {
|
|
|
5504
5509
|
handler: async function (req, res) {
|
|
5505
5510
|
let method = '';
|
|
5506
5511
|
try {
|
|
5507
|
-
const rejection = webCtx.connection.requestRejection
|
|
5512
|
+
const rejection = typeof webCtx.connection.requestRejection === 'function'
|
|
5513
|
+
? webCtx.connection.requestRejection(req)
|
|
5514
|
+
: undefined;
|
|
5508
5515
|
if (rejection !== undefined) {
|
|
5509
5516
|
respond(res, rejection, { error: rejection === 401 ? 'authentication required' : 'request rejected' });
|
|
5510
5517
|
return;
|