dsh-connect-minimaxcode 0.5.6 → 0.5.7
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.en.md +8 -0
- package/README.md +17 -5
- package/lib/index.d.ts +29 -2
- package/lib/index.js +107 -10
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -308,6 +308,14 @@ The OAuth token is valid for about an hour and is refreshed automatically by the
|
|
|
308
308
|
|
|
309
309
|
## Changelog
|
|
310
310
|
|
|
311
|
+
### 0.5.7 (2026-11-10)
|
|
312
|
+
|
|
313
|
+
- **The quota readout now uses the open platform's documented endpoint**: the plugin read `/backend/account/token_plan/remains_percent`, and that path now answers every account with an empty `success` — it no longer even carries a `model_remains` field — so the readout showed nothing for anyone and said nothing about why. It now reads `GET /v1/token_plan/remains`, the endpoint the open platform's own M Plan documentation names. That endpoint asks for the **open platform's API key** rather than the OAuth bearer; the key comes from the `token_plan_credit` response and is remembered between reads.
|
|
314
|
+
- **"No subscription" is no longer reported as a failed read**: upstream answers an account without an M Plan subscription with `2062 no active token plan subscription` — credit packages carry no rolling windows of their own. The plugin now reports that as what it is. The balance, the check-in and the model calls are untouched by it.
|
|
315
|
+
- The older path is kept as a **fallback**: an account whose open platform hands out no key still gets whatever the old path can give.
|
|
316
|
+
- Fixed a misfire that came with it: the quota endpoint is asked with the open platform's plan key, so a 401 there means the *key* is wrong, not that the person's credential was revoked. It used to feed the "was this credential revoked" check, which could sign someone out over a bad key. That check now reads only the account-domain endpoints (membership and credit ledger).
|
|
317
|
+
- Added `tests/quota-endpoint.spec.ts` (13 cases) pinning: how the plan key is obtained, the documented endpoint being asked with the key rather than the OAuth bearer, `2062` counted as "no subscription" rather than an error, the fallback to the older path when there is no key, and the key being fetched once. All 209 cases pass.
|
|
318
|
+
|
|
311
319
|
### 0.5.6 (2026-11-09)
|
|
312
320
|
|
|
313
321
|
- **Fixed "every model request fails while credits and check-in still work"**: the two features read two different credential files. The model gateway only knew the plugin's own sign-in and the **legacy JWT** an older desktop app left behind (`local-runtime.auth.json`), while current installs store an OAuth grant instead (`auth/prod/<region>/mcode-public/auth.json`, an `mmoat_` token). Once the legacy JWT expired, the gateway answered every request with `401 auth failed` — and because credits read the OAuth file, the card showed a healthy balance beside a dead model. The gateway now tries, in order: the plugin's own sign-in → **the desktop app's OAuth grant** → the legacy JWT, taking the first that works.
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
把本机已登录的 **MiniMax Code 桌面 App(国内版)** 的模型接入 **DeepSeek Harness(DSH)**,装好即用,无需配置 API Key。
|
|
4
4
|
|
|
5
5
|

|
|
6
|
-
[](https://www.npmjs.com/package/dsh-connect-minimaxcode)
|
|
6
|
+
[](https://www.npmjs.com/package/dsh-connect-minimaxcode)
|
|
7
7
|
[](https://github.com/JeffTsuiCUG/dsh-connect-minimaxcode/actions/workflows/ci.yml)
|
|
8
8
|
|
|
9
9
|
[English](README.en.md) | 简体中文
|
|
@@ -291,13 +291,17 @@ GET https://agent.minimax.cn/minimax-cloud/api/v1/credit/details?page_number=1&p
|
|
|
291
291
|
|
|
292
292
|
### 限额窗口(套餐的两个滚动窗口)
|
|
293
293
|
|
|
294
|
-
套餐用量按两个滚动窗口计量(当前套餐为 5 小时与 7
|
|
294
|
+
套餐用量按两个滚动窗口计量(当前套餐为 5 小时与 7 天),插件会显示各窗口的已用百分比与重置倒计时。
|
|
295
|
+
|
|
296
|
+
读取走**开放平台官方文档给出的接口**(M Plan 用量说明页「如何查看 M Plan 用量 → 方式三:使用 API 接口查询」):
|
|
295
297
|
|
|
296
298
|
```
|
|
297
|
-
GET https://www.minimaxi.com/
|
|
298
|
-
Authorization: Bearer <
|
|
299
|
+
GET https://www.minimaxi.com/v1/token_plan/remains
|
|
300
|
+
Authorization: Bearer <API Key>
|
|
299
301
|
```
|
|
300
302
|
|
|
303
|
+
该接口要的是**开放平台的 API 密钥**,不是 OAuth 令牌。密钥由账户自己持有,取法与桌面 App 相同 —— 用 OAuth 令牌请求 `GET /backend/account/token_plan_credit?business=Agent&device_platform=desktop`,响应里的 `api_key` 就是它。
|
|
304
|
+
|
|
301
305
|
```json
|
|
302
306
|
"model_remains": [{
|
|
303
307
|
"model_name": "general",
|
|
@@ -312,7 +316,7 @@ Authorization: Bearer <OAuth 令牌>
|
|
|
312
316
|
|
|
313
317
|
- **窗口时长不写死**:从响应自身的起止字段推导(实测恰为 5 小时与 7 天),套餐条款变了显示会跟着变 —— 胶囊与详情行上的窗口名(`5h`、`7d`)也是这么来的,不是写死的字面量
|
|
314
318
|
- **无限量的窗口不报百分比**:上游用 `current_*_status` 标出没有额度的窗口(桌面 App 读作 `isUnlimited: 3 === status`),这类窗口不参与显示,避免出现「0%」这种没人能据此行动的读数
|
|
315
|
-
-
|
|
319
|
+
- **没有订阅就没有窗口,且这不算错误**:上游对未订阅 M Plan 的账户明确回 `2062 no active token plan subscription`,插件会如实标为「无订阅」而不是「读取失败」—— 积分包本身不带滚动窗口
|
|
316
320
|
- **接口异常时其余显示不受影响**:限额读不到,胶囊与卡片仍显示余额、签到与本机用量
|
|
317
321
|
- 上游还发 `current_*_count` 计数字段(无计数制时为 `-1`),插件只读百分比与起止时刻
|
|
318
322
|
### 关于续期
|
|
@@ -340,6 +344,14 @@ OAuth 令牌有效期约 1 小时,由客户端自动续期。插件**只在自
|
|
|
340
344
|
|
|
341
345
|
## 更新记录
|
|
342
346
|
|
|
347
|
+
### 0.5.7(2026-11-10)
|
|
348
|
+
|
|
349
|
+
- **限额窗口改走官方文档接口**:原先读的是 `/backend/account/token_plan/remains_percent`,这条路径现在对任何账户都只回一个空的 `success`(连 `model_remains` 字段都没有),于是限额一栏对所有人都显示不出来,却看不出原因。改用开放平台官方文档(M Plan 用量说明页)给出的 `GET /v1/token_plan/remains`。新接口要求**开放平台 API 密钥**而非 OAuth 令牌,密钥取自 `token_plan_credit` 的响应并缓存复用。
|
|
350
|
+
- **「没有订阅」不再被报成「读取失败」**:上游对未订阅 M Plan 的账户明确回 `2062 no active token plan subscription` —— 积分包本身不带 5 小时 / 周滚动窗口。插件现在把这种情况标为「无订阅」,余额、签到与模型调用不受任何影响。
|
|
351
|
+
- 旧路径保留为**兜底**:账户若拿不到开放平台密钥,仍走旧路径,不会因此彻底没有限额显示。
|
|
352
|
+
- 顺带修正一处误伤可能:限额接口是拿开放平台密钥问的,它回 401 说明的是密钥不对,**不是本人凭据被吊销**;此前它参与「凭据是否被吊销」的判断,可能把人误登出。现在该判断只看账户域接口(会员信息与积分流水)的 401。
|
|
353
|
+
- 新增 `tests/quota-endpoint.spec.ts`(13 个用例)钉住:计划密钥的取法、官方接口用密钥而非 OAuth 令牌请求、`2062` 归为「无订阅」而非错误、无密钥时回落旧路径、密钥只取一次。全量 209 个用例通过。
|
|
354
|
+
|
|
343
355
|
### 0.5.6(2026-11-09)
|
|
344
356
|
|
|
345
357
|
- **修复「模型请求全部失败,但积分/签到正常」**:这是两条凭证路径读的不是同一个文件。模型网关此前只认插件自登录与桌面 App 留下的**旧版 JWT**(`local-runtime.auth.json`),而新版 App 早已改用 OAuth 存储(`auth/prod/<region>/mcode-public/auth.json`,`mmoat_` 令牌)。旧 JWT 过期后网关一律回 `401 auth failed`,而积分走的是 OAuth 文件,于是出现「积分能看、模型不通」。现在网关依次尝试:插件自登录 → **桌面 App 的 OAuth 授权** → 旧版 JWT,三者取第一个可用的。
|
package/lib/index.d.ts
CHANGED
|
@@ -208,7 +208,12 @@ declare class MinimaxCatalog {
|
|
|
208
208
|
declare const MINIMAX_OAUTH_CLIENT_ID = "mcode-public";
|
|
209
209
|
/** Membership endpoint: carries the credit summary. */
|
|
210
210
|
declare const MEMBERSHIP_PATH = "/matrix/api/v1/commerce/get_membership_info";
|
|
211
|
-
/**
|
|
211
|
+
/**
|
|
212
|
+
* Rate-limit window endpoint the plugin used first.
|
|
213
|
+
*
|
|
214
|
+
* Kept as a fallback for an account whose open platform hands out no plan
|
|
215
|
+
* key, since the documented path needs one.
|
|
216
|
+
*/
|
|
212
217
|
declare const REMAINS_PERCENT_PATH = "/backend/account/token_plan/remains_percent";
|
|
213
218
|
/** The OAuth credential the account endpoints accept. */
|
|
214
219
|
interface OAuthCredential {
|
|
@@ -371,7 +376,7 @@ interface RateLimitWindows {
|
|
|
371
376
|
*/
|
|
372
377
|
declare function parseRateLimitWindows(document: unknown): RateLimitWindows | undefined;
|
|
373
378
|
/**
|
|
374
|
-
* Fetch the plan's two rate-limit windows.
|
|
379
|
+
* Fetch the plan's two rate-limit windows from the older open-platform path.
|
|
375
380
|
*
|
|
376
381
|
* The endpoint lives on the open-platform host, like the usage summary, and
|
|
377
382
|
* answers the same OAuth credential the membership endpoint takes. The JWT the
|
|
@@ -380,6 +385,15 @@ declare function parseRateLimitWindows(document: unknown): RateLimitWindows | un
|
|
|
380
385
|
* @returns The windows, or `undefined` when the response carries none.
|
|
381
386
|
*/
|
|
382
387
|
declare function fetchRateLimitWindows(credential: OAuthCredential, region: MinimaxRegion, fetchImpl?: typeof fetch): Promise<RateLimitWindows | undefined>;
|
|
388
|
+
/** What a quota read found. */
|
|
389
|
+
interface RateLimitRead {
|
|
390
|
+
/** The windows, when the plan meters any. */
|
|
391
|
+
windows?: RateLimitWindows;
|
|
392
|
+
/** Why there are none, when the upstream said so plainly. */
|
|
393
|
+
absence?: 'no-subscription';
|
|
394
|
+
/** Why the read failed, when it did. */
|
|
395
|
+
error?: string;
|
|
396
|
+
}
|
|
383
397
|
/** What the lots say about credits that are about to be lost. */
|
|
384
398
|
interface ExpirySummary {
|
|
385
399
|
/** Credits in lots that expire within {@link EXPIRING_WINDOW_DAYS} days. */
|
|
@@ -422,6 +436,8 @@ declare class MinimaxCredits {
|
|
|
422
436
|
get rateLimit(): RateLimitWindows | undefined;
|
|
423
437
|
/** Why the windows could not be read, when they could not. */
|
|
424
438
|
get rateLimitError(): string | undefined;
|
|
439
|
+
/** Why the plan has no windows, when the upstream said so plainly. */
|
|
440
|
+
get rateLimitAbsence(): 'no-subscription' | undefined;
|
|
425
441
|
/** When the windows were last read. */
|
|
426
442
|
get rateLimitAtMs(): number | undefined;
|
|
427
443
|
/**
|
|
@@ -451,6 +467,15 @@ declare class MinimaxCredits {
|
|
|
451
467
|
* window that cannot be read leaves the last one on display.
|
|
452
468
|
*/
|
|
453
469
|
refreshRateLimit(credential: OAuthCredential, region: MinimaxRegion, fetchImpl?: typeof fetch, now?: number): Promise<void>;
|
|
470
|
+
/**
|
|
471
|
+
* Read the windows from whichever endpoint can answer.
|
|
472
|
+
*
|
|
473
|
+
* The documented endpoint needs the open platform's plan key, which the
|
|
474
|
+
* same platform hands out; the key is remembered because it does not
|
|
475
|
+
* change from one read to the next. An account with no key at all still
|
|
476
|
+
* gets the older path's answer.
|
|
477
|
+
*/
|
|
478
|
+
readWindows(credential: OAuthCredential, region: MinimaxRegion, fetchImpl?: typeof fetch): Promise<RateLimitRead>;
|
|
454
479
|
}
|
|
455
480
|
//#endregion
|
|
456
481
|
//#region src/usage.d.ts
|
|
@@ -910,6 +935,8 @@ interface RateLimitStatus {
|
|
|
910
935
|
};
|
|
911
936
|
/** When the windows were read, in milliseconds since the epoch. */
|
|
912
937
|
updatedAtMs?: number;
|
|
938
|
+
/** Why the plan has no windows, when the upstream said so plainly. */
|
|
939
|
+
reason?: 'no-subscription';
|
|
913
940
|
/** Why the windows could not be read. */
|
|
914
941
|
error?: string;
|
|
915
942
|
}
|
package/lib/index.js
CHANGED
|
@@ -793,7 +793,24 @@ const MINIMAX_OPEN_HOSTS = {
|
|
|
793
793
|
const MEMBERSHIP_PATH = "/matrix/api/v1/commerce/get_membership_info";
|
|
794
794
|
/** Credit ledger endpoint: per-grant amounts and expiry. */
|
|
795
795
|
const CREDIT_DETAILS_PATH = "/minimax-cloud/api/v1/credit/details";
|
|
796
|
-
/**
|
|
796
|
+
/** Open-platform credit endpoint that carries the account's plan key. */
|
|
797
|
+
const TOKEN_PLAN_CREDIT_PATH = "/backend/account/token_plan_credit";
|
|
798
|
+
/**
|
|
799
|
+
* Rate-limit window endpoint, as the open platform documents it.
|
|
800
|
+
*
|
|
801
|
+
* The M Plan FAQ names `GET /v1/token_plan/remains` as the way to read the
|
|
802
|
+
* quota over HTTP. It asks for an API secret key rather than the desktop
|
|
803
|
+
* app's OAuth bearer, and it is the path the upstream still maintains: the
|
|
804
|
+
* older path this plugin started with now answers 200 with an empty body
|
|
805
|
+
* even for accounts that do have windows.
|
|
806
|
+
*/
|
|
807
|
+
const TOKEN_PLAN_REMAINS_PATH = "/v1/token_plan/remains";
|
|
808
|
+
/**
|
|
809
|
+
* Rate-limit window endpoint the plugin used first.
|
|
810
|
+
*
|
|
811
|
+
* Kept as a fallback for an account whose open platform hands out no plan
|
|
812
|
+
* key, since the documented path needs one.
|
|
813
|
+
*/
|
|
797
814
|
const REMAINS_PERCENT_PATH = "/backend/account/token_plan/remains_percent";
|
|
798
815
|
/** OAuth token endpoint. */
|
|
799
816
|
const TOKEN_PATH$1 = "/oauth2/token";
|
|
@@ -1160,7 +1177,7 @@ function parsePercent(value) {
|
|
|
1160
1177
|
return Number.isFinite(parsed) ? parsed : void 0;
|
|
1161
1178
|
}
|
|
1162
1179
|
/**
|
|
1163
|
-
* Fetch the plan's two rate-limit windows.
|
|
1180
|
+
* Fetch the plan's two rate-limit windows from the older open-platform path.
|
|
1164
1181
|
*
|
|
1165
1182
|
* The endpoint lives on the open-platform host, like the usage summary, and
|
|
1166
1183
|
* answers the same OAuth credential the membership endpoint takes. The JWT the
|
|
@@ -1177,6 +1194,61 @@ async function fetchRateLimitWindows(credential, region, fetchImpl = fetch) {
|
|
|
1177
1194
|
return parseRateLimitWindows(await response.json());
|
|
1178
1195
|
}
|
|
1179
1196
|
/**
|
|
1197
|
+
* Read the open platform's plan key.
|
|
1198
|
+
*
|
|
1199
|
+
* The documented quota endpoint wants an API secret key, and the open
|
|
1200
|
+
* platform is where the account's key comes from: the desktop app asks the
|
|
1201
|
+
* same endpoint with its OAuth bearer and gets the key back in the answer,
|
|
1202
|
+
* so the key is a property of the account rather than something the person
|
|
1203
|
+
* has to configure.
|
|
1204
|
+
*
|
|
1205
|
+
* @returns The key, or `undefined` when the account has none.
|
|
1206
|
+
*/
|
|
1207
|
+
async function fetchTokenPlanApiKey(credential, region, fetchImpl = fetch) {
|
|
1208
|
+
const response = await fetchImpl(`${MINIMAX_OPEN_HOSTS[region]}${TOKEN_PLAN_CREDIT_PATH}?business=Agent&device_platform=desktop`, { headers: {
|
|
1209
|
+
accept: "application/json",
|
|
1210
|
+
authorization: `Bearer ${credential.token}`
|
|
1211
|
+
} });
|
|
1212
|
+
if (!response.ok) throw new Error(`token plan credit request failed: HTTP ${response.status}`);
|
|
1213
|
+
const key = (await response.json()).api_key;
|
|
1214
|
+
return typeof key === "string" && key.length > 0 ? key : void 0;
|
|
1215
|
+
}
|
|
1216
|
+
/** The upstream's own code for "this account has no plan subscription". */
|
|
1217
|
+
const NO_SUBSCRIPTION_CODE = 2062;
|
|
1218
|
+
/** The upstream's own code for "the request carried no usable API key". */
|
|
1219
|
+
const MISSING_API_KEY_CODE = 1004;
|
|
1220
|
+
/** The upstream's status code inside a response body, when it carries one. */
|
|
1221
|
+
function readBaseRespCode(document) {
|
|
1222
|
+
const base = document.base_resp;
|
|
1223
|
+
if (typeof base !== "object" || base === null) return void 0;
|
|
1224
|
+
const code = base.status_code;
|
|
1225
|
+
return typeof code === "number" ? code : void 0;
|
|
1226
|
+
}
|
|
1227
|
+
/**
|
|
1228
|
+
* Read the windows from the documented quota endpoint.
|
|
1229
|
+
*
|
|
1230
|
+
* The upstream says plainly when there is nothing to report: `2062` means
|
|
1231
|
+
* the account has no plan subscription, and the quota does not exist for it
|
|
1232
|
+
* at all. That is a fact about the plan rather than a failure to read, so
|
|
1233
|
+
* it is reported as such and not as an error — the windows of a plan the
|
|
1234
|
+
* account does not hold are not missing data.
|
|
1235
|
+
*/
|
|
1236
|
+
async function fetchTokenPlanWindows(apiKey, region, fetchImpl = fetch) {
|
|
1237
|
+
const response = await fetchImpl(`${MINIMAX_OPEN_HOSTS[region]}${TOKEN_PLAN_REMAINS_PATH}`, { headers: {
|
|
1238
|
+
accept: "application/json",
|
|
1239
|
+
authorization: `Bearer ${apiKey}`,
|
|
1240
|
+
"content-type": "application/json"
|
|
1241
|
+
} });
|
|
1242
|
+
if (!response.ok) throw new Error(`rate-limit window request failed: HTTP ${response.status}`);
|
|
1243
|
+
const document = await response.json();
|
|
1244
|
+
const code = readBaseRespCode(document);
|
|
1245
|
+
if (code === NO_SUBSCRIPTION_CODE) return { absence: "no-subscription" };
|
|
1246
|
+
if (code === MISSING_API_KEY_CODE) return { error: "the open platform did not accept the plan key" };
|
|
1247
|
+
const windows = parseRateLimitWindows(document);
|
|
1248
|
+
if (windows === void 0) return { error: "response carried no rate-limit windows" };
|
|
1249
|
+
return { windows };
|
|
1250
|
+
}
|
|
1251
|
+
/**
|
|
1180
1252
|
* Summarize what is about to expire.
|
|
1181
1253
|
*
|
|
1182
1254
|
* Only lots that still hold credits count: a lot that was granted and used up
|
|
@@ -1215,7 +1287,9 @@ var MinimaxCredits = class {
|
|
|
1215
1287
|
#ledgerError;
|
|
1216
1288
|
#rateLimit;
|
|
1217
1289
|
#rateLimitError;
|
|
1290
|
+
#rateLimitAbsence;
|
|
1218
1291
|
#rateLimitAtMs;
|
|
1292
|
+
#apiKey;
|
|
1219
1293
|
/** The balance as last read. */
|
|
1220
1294
|
get snapshot() {
|
|
1221
1295
|
return this.#snapshot;
|
|
@@ -1248,6 +1322,10 @@ var MinimaxCredits = class {
|
|
|
1248
1322
|
get rateLimitError() {
|
|
1249
1323
|
return this.#rateLimitError;
|
|
1250
1324
|
}
|
|
1325
|
+
/** Why the plan has no windows, when the upstream said so plainly. */
|
|
1326
|
+
get rateLimitAbsence() {
|
|
1327
|
+
return this.#rateLimitAbsence;
|
|
1328
|
+
}
|
|
1251
1329
|
/** When the windows were last read. */
|
|
1252
1330
|
get rateLimitAtMs() {
|
|
1253
1331
|
return this.#rateLimitAtMs;
|
|
@@ -1311,14 +1389,36 @@ var MinimaxCredits = class {
|
|
|
1311
1389
|
*/
|
|
1312
1390
|
async refreshRateLimit(credential, region, fetchImpl = fetch, now = Date.now()) {
|
|
1313
1391
|
try {
|
|
1314
|
-
const
|
|
1315
|
-
this.#rateLimit = windows;
|
|
1316
|
-
this.#
|
|
1392
|
+
const read = await this.readWindows(credential, region, fetchImpl);
|
|
1393
|
+
if (read.error === void 0) this.#rateLimit = read.windows;
|
|
1394
|
+
this.#rateLimitAbsence = read.absence;
|
|
1395
|
+
this.#rateLimitError = read.error;
|
|
1317
1396
|
this.#rateLimitAtMs = now;
|
|
1318
1397
|
} catch (error) {
|
|
1319
1398
|
this.#rateLimitError = error instanceof Error ? error.message : String(error);
|
|
1320
1399
|
}
|
|
1321
1400
|
}
|
|
1401
|
+
/**
|
|
1402
|
+
* Read the windows from whichever endpoint can answer.
|
|
1403
|
+
*
|
|
1404
|
+
* The documented endpoint needs the open platform's plan key, which the
|
|
1405
|
+
* same platform hands out; the key is remembered because it does not
|
|
1406
|
+
* change from one read to the next. An account with no key at all still
|
|
1407
|
+
* gets the older path's answer.
|
|
1408
|
+
*/
|
|
1409
|
+
async readWindows(credential, region, fetchImpl = fetch) {
|
|
1410
|
+
const apiKey = this.#apiKey ?? await fetchTokenPlanApiKey(credential, region, fetchImpl);
|
|
1411
|
+
this.#apiKey = apiKey;
|
|
1412
|
+
if (apiKey !== void 0) try {
|
|
1413
|
+
return await fetchTokenPlanWindows(apiKey, region, fetchImpl);
|
|
1414
|
+
} catch (error) {
|
|
1415
|
+
const legacy = await fetchRateLimitWindows(credential, region, fetchImpl);
|
|
1416
|
+
if (legacy !== void 0) return { windows: legacy };
|
|
1417
|
+
throw error;
|
|
1418
|
+
}
|
|
1419
|
+
const legacy = await fetchRateLimitWindows(credential, region, fetchImpl);
|
|
1420
|
+
return legacy === void 0 ? { error: "response carried no rate-limit windows" } : { windows: legacy };
|
|
1421
|
+
}
|
|
1322
1422
|
};
|
|
1323
1423
|
//#endregion
|
|
1324
1424
|
//#region src/credentials.ts
|
|
@@ -2271,11 +2371,7 @@ function apply(ctx) {
|
|
|
2271
2371
|
}
|
|
2272
2372
|
await credits.refresh(state.credential, region, fetch, now);
|
|
2273
2373
|
creditState = credits.snapshot === void 0 ? "unavailable" : "ok";
|
|
2274
|
-
if ([
|
|
2275
|
-
credits.error,
|
|
2276
|
-
credits.ledgerError,
|
|
2277
|
-
credits.rateLimitError
|
|
2278
|
-
].find((message) => isUnauthorized(message)) !== void 0) {
|
|
2374
|
+
if ([credits.error, credits.ledgerError].find((message) => isUnauthorized(message)) !== void 0) {
|
|
2279
2375
|
await revokePluginCredential();
|
|
2280
2376
|
return;
|
|
2281
2377
|
}
|
|
@@ -2382,6 +2478,7 @@ function apply(ctx) {
|
|
|
2382
2478
|
const windows = credits.rateLimit;
|
|
2383
2479
|
if (windows === void 0) return {
|
|
2384
2480
|
state: "unavailable",
|
|
2481
|
+
...credits.rateLimitAbsence === void 0 ? {} : { reason: credits.rateLimitAbsence },
|
|
2385
2482
|
...credits.rateLimitError === void 0 ? {} : { error: credits.rateLimitError }
|
|
2386
2483
|
};
|
|
2387
2484
|
return {
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "dsh-connect-minimaxcode",
|
|
3
3
|
"displayName": "DSH Connect MiniMax Code",
|
|
4
4
|
"description": "把本机已登录的 MiniMax Code 桌面 App 模型接入 DeepSeek Harness:零配置、Anthropic Messages 兼容、动态模型目录,并显示积分余额与到期 — bring MiniMax Code desktop app models into DSH with a dynamic model catalog and a credit balance with expiry details.",
|
|
5
|
-
"version": "0.5.
|
|
5
|
+
"version": "0.5.7",
|
|
6
6
|
"author": "JeffTsuiCUG",
|
|
7
7
|
"contributors": [
|
|
8
8
|
{
|