dsh-connect-minimaxcode 0.4.0 → 0.4.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/README.md +16 -6
- package/lib/index.d.ts +3 -2
- package/lib/index.js +9 -4
- package/package.json +6 -3
package/README.md
CHANGED
|
@@ -186,14 +186,14 @@ Content-Type: application/json
|
|
|
186
186
|
|
|
187
187
|
### 积分会过期吗?会
|
|
188
188
|
|
|
189
|
-
|
|
189
|
+
积分不是一池子,而是**按笔发放的批次**,每批有自己的到期日。客户端每天发一批,每批在**发放日 + 30 个自然日**到期(按账户所在时区,当日 00:00 失效),于是形成一条逐日错开的 30 天阶梯:
|
|
190
190
|
|
|
191
191
|
```
|
|
192
|
-
GET https://agent.minimax.cn/minimax-cloud/api/v1/credit/details?
|
|
193
|
-
→ details[] { granted_amount, remaining_amount, consumed_amount, granted_at_ms, expire_at_ms }
|
|
192
|
+
GET https://agent.minimax.cn/minimax-cloud/api/v1/credit/details?page_number=1&page_size=100
|
|
193
|
+
→ details[] { granted_amount, remaining_amount, consumed_amount, granted_at_ms, expire_at_ms, credit_type }
|
|
194
194
|
```
|
|
195
195
|
|
|
196
|
-
实测本机 23 笔:09-20 发的在 10-
|
|
196
|
+
实测本机 23 笔:09-20 发的在 10-20 到期、09-21 发的在 10-21 到期……另有一笔 08-25 发的在 2027-08-25 到期(一年期批次,`credit_type` 1=购买 / 2=签到)。**到期日一律读 `expire_at_ms`**,不写死天数——至少存在 30 天与 365 天两种制式。
|
|
197
197
|
|
|
198
198
|
插件据此在**插件页面**(设置 → 插件 → DSH Connect MiniMax Code)与输入框下方的胶囊里给出:
|
|
199
199
|
|
|
@@ -202,9 +202,11 @@ GET https://agent.minimax.cn/minimax-cloud/api/v1/credit/details?page=1&page_siz
|
|
|
202
202
|
- 接下来几笔**到期批次**的清单(日期 + 金额)
|
|
203
203
|
- 余额条与本机消耗(token 数、等效金额)
|
|
204
204
|
|
|
205
|
-
只统计**仍有余额**的批次:已发放但用光的批次到期时并没有东西可损失,把它算进去会让每个账号都看起来"快过期了"
|
|
205
|
+
只统计**仍有余额**的批次:已发放但用光的批次到期时并没有东西可损失,把它算进去会让每个账号都看起来"快过期了"。积分的消耗近似先进先出,所以**"7 天内到期"的金额常常是 0**(快到期的那些基本都已被用完),因此界面同时给出**最早到期时间**,那才是真正有意义的信号。
|
|
206
206
|
|
|
207
|
-
>
|
|
207
|
+
> 过期不会把批次里的 `remaining_amount` 清零(实测会留下 -0.31 这样的负值残留),而是把过期批次**排除在余额之外**;所以总额以余额接口为准。
|
|
208
|
+
>
|
|
209
|
+
> 台账的 `remaining_amount` 合计与余额接口的 `total_remaining_amount` 在**静止期逐位相等**;两次采样之间看到的差异,是账户在这段时间里被真实消耗掉的量。
|
|
208
210
|
|
|
209
211
|
### 消耗怎么算
|
|
210
212
|
|
|
@@ -265,6 +267,14 @@ OAuth 令牌有效期约 1 小时,由客户端自动续期。插件**只在自
|
|
|
265
267
|
|
|
266
268
|
历史版本见 [GitHub Releases](https://github.com/JeffTsuiCUG/dsh-connect-minimaxcode/releases) 与 [npm 版本列表](https://www.npmjs.com/package/dsh-connect-minimaxcode?activeTab=versions)。
|
|
267
269
|
|
|
270
|
+
## 市场收录与展示
|
|
271
|
+
|
|
272
|
+
插件已包含可安装的 `dsh.bundle` manifest,并发布到 npm。社区插件市场(`dshmarket`)的目录由 [Awesome DSH Plugin](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin) 注册表生成,本插件的收录条目已提交为 PR [#8110](https://github.com/awesome-dsh-plugin/awesome-dsh-plugin/pull/8110),仓库内保留了一份草稿与操作说明:[`awesome-dsh-plugin-submission/`](awesome-dsh-plugin-submission/)。
|
|
273
|
+
|
|
274
|
+
市场截图按当前约定由**插件自己仓库根目录的** `screenshots.json` 声明(注册表 `data/screenshots.json` 是旧约定下的回退,不再新增键)。
|
|
275
|
+
|
|
276
|
+
> 界面胶囊放在**输入框下方的 dock**,而不是输入框工具栏:工具栏是**共享插槽**,外壳自己的控件和别的插件都注册在那里,无法保证每个占用者都可见——同族插件就因为这个原因丢过一次读数。
|
|
277
|
+
|
|
268
278
|
## 卸载
|
|
269
279
|
|
|
270
280
|
```bash
|
package/lib/index.d.ts
CHANGED
|
@@ -312,8 +312,9 @@ interface CreditSnapshot {
|
|
|
312
312
|
* One grant of credits.
|
|
313
313
|
*
|
|
314
314
|
* Credits are granted in lots, and each lot carries its own expiry: the
|
|
315
|
-
* desktop app grants credits daily, and
|
|
316
|
-
*
|
|
315
|
+
* desktop app grants credits daily, and a lot falls due thirty calendar days
|
|
316
|
+
* after the day it was granted, at midnight in the account's own timezone.
|
|
317
|
+
* Credits in a lot are lost when that moment arrives.
|
|
317
318
|
*/
|
|
318
319
|
interface CreditLot {
|
|
319
320
|
/** How much this lot was granted. */
|
package/lib/index.js
CHANGED
|
@@ -994,9 +994,12 @@ function parseCreditLots(document) {
|
|
|
994
994
|
/**
|
|
995
995
|
* Fetch the credit ledger.
|
|
996
996
|
*
|
|
997
|
-
* The ledger is paginated,
|
|
998
|
-
*
|
|
999
|
-
*
|
|
997
|
+
* The ledger is paginated, and the page parameter is `page_number` — `page`
|
|
998
|
+
* is accepted and then ignored, which would make every page return the same
|
|
999
|
+
* rows. The page size is capped upstream at 100.
|
|
1000
|
+
*
|
|
1001
|
+
* The default view already excludes expired grants, which is what this wants:
|
|
1002
|
+
* a grant that expired has nothing left to lose.
|
|
1000
1003
|
*/
|
|
1001
1004
|
async function fetchCreditLots(credential, region, fetchImpl = fetch) {
|
|
1002
1005
|
const pageSize = 100;
|
|
@@ -1004,14 +1007,16 @@ async function fetchCreditLots(credential, region, fetchImpl = fetch) {
|
|
|
1004
1007
|
let page = 1;
|
|
1005
1008
|
let total = Number.POSITIVE_INFINITY;
|
|
1006
1009
|
while (lots.length < total && page <= 50) {
|
|
1007
|
-
const response = await fetchImpl(`${MINIMAX_ACCOUNT_HOSTS[region]}${CREDIT_DETAILS_PATH}?
|
|
1010
|
+
const response = await fetchImpl(`${MINIMAX_ACCOUNT_HOSTS[region]}${CREDIT_DETAILS_PATH}?page_number=${page}&page_size=${pageSize}`, { headers: { authorization: `Bearer ${credential.token}` } });
|
|
1008
1011
|
if (!response.ok) throw new Error(`credit ledger request failed: HTTP ${response.status}`);
|
|
1009
1012
|
const document = await response.json();
|
|
1010
1013
|
const batch = parseCreditLots(document);
|
|
1014
|
+
const before = lots.length;
|
|
1011
1015
|
lots.push(...batch);
|
|
1012
1016
|
const count = toNumber(document.total_count);
|
|
1013
1017
|
if (count !== void 0) total = count;
|
|
1014
1018
|
if (batch.length < pageSize) break;
|
|
1019
|
+
if (lots.length === before) break;
|
|
1015
1020
|
page += 1;
|
|
1016
1021
|
}
|
|
1017
1022
|
return lots;
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-connect-minimaxcode",
|
|
3
3
|
"displayName": "DSH Connect MiniMax Code",
|
|
4
|
-
"description": "把本机已登录的 MiniMax Code 桌面 App
|
|
5
|
-
"version": "0.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.4.2",
|
|
6
6
|
"author": "JeffTsuiCUG",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"private": false,
|
|
@@ -49,10 +49,13 @@
|
|
|
49
49
|
},
|
|
50
50
|
"keywords": [
|
|
51
51
|
"dsh-plugin",
|
|
52
|
+
"dsh",
|
|
52
53
|
"deepseek-harness",
|
|
53
54
|
"minimax",
|
|
54
55
|
"minimax-code",
|
|
55
|
-
"model-provider"
|
|
56
|
+
"model-provider",
|
|
57
|
+
"credits",
|
|
58
|
+
"usage"
|
|
56
59
|
],
|
|
57
60
|
"peerDependencies": {
|
|
58
61
|
"@deepseek-ai/cordis": ">=4.0.4 <5.0.0",
|