dsh-connect-minimaxcode 0.5.4 → 0.5.6

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 CHANGED
@@ -85,6 +85,12 @@ dsh plugin --profile desktop add dsh-connect-minimaxcode
85
85
 
86
86
  Web profile 把 `--profile desktop` 换成 `--profile web`。
87
87
 
88
+ > **本地开发装自己改过的克隆**:不要把目录路径直接传给 `dsh plugin add`——pnpm 会以链接方式安装,把依赖的软链嵌进插件自己的 `node_modules`,宿主的插件沙箱 `stat` 这些链接会得到 `EPERM`,插件激活失败(`failed to import`)。先 `pnpm pack` 打成 tarball,再安装 tarball,依赖就会像 registry 安装一样解析在 profile 根 `node_modules`:
89
+
90
+ ```bash
91
+ pnpm pack
92
+ dsh plugin --profile desktop add ./dsh-connect-minimaxcode-0.5.6.tgz
93
+ ```
88
94
  > 桌面版的 profile 由 Electron 应用独占,若 `dsh` 命令不在 PATH 中,请使用 DSH 应用自带的载体 CLI(路径随安装位置而变,例如 `<DSH安装目录>\resources\runtime\cli\bin\dsh.cmd`)。
89
95
 
90
96
  安装后插件会热加载,模型随后出现在模型选择器的 **MiniMax Code** 分组中。
@@ -283,6 +289,32 @@ GET https://agent.minimax.cn/minimax-cloud/api/v1/credit/details?page_number=1&p
283
289
 
284
290
  > 官方价目表没有单列**缓存写入**(`cache_creation_input_tokens`)的单价,因此插件只统计它的 token 数、**不折算金额**,以免给出一个没有公开依据的数字。
285
291
 
292
+ ### 限额窗口(套餐的两个滚动窗口)
293
+
294
+ 套餐用量按两个滚动窗口计量(当前套餐为 5 小时与 7 天),插件会显示各窗口的已用百分比与重置倒计时:
295
+
296
+ ```
297
+ GET https://www.minimaxi.com/backend/account/token_plan/remains_percent?business=Agent&device_platform=desktop
298
+ Authorization: Bearer <OAuth 令牌>
299
+ ```
300
+
301
+ ```json
302
+ "model_remains": [{
303
+ "model_name": "general",
304
+ "start_time": 1793882204091, "end_time": 1793900204091, // 差值 = 5 小时
305
+ "current_interval_used_percent": "19%",
306
+ "weekly_start_time": 1793783898054, "weekly_end_time": 1794388698054, // 差值 = 7 天
307
+ "current_weekly_used_percent": "29%"
308
+ }]
309
+ ```
310
+
311
+ 几点实测结论:
312
+
313
+ - **窗口时长不写死**:从响应自身的起止字段推导(实测恰为 5 小时与 7 天),套餐条款变了显示会跟着变 —— 胶囊与详情行上的窗口名(`5h`、`7d`)也是这么来的,不是写死的字面量
314
+ - **无限量的窗口不报百分比**:上游用 `current_*_status` 标出没有额度的窗口(桌面 App 读作 `isUnlimited: 3 === status`),这类窗口不参与显示,避免出现「0%」这种没人能据此行动的读数
315
+ - **该接口在开放平台域**(`www.minimaxi.com`),只认 OAuth 令牌;JWT 打它返回 `1016 invalid api key`
316
+ - **接口异常时其余显示不受影响**:限额读不到,胶囊与卡片仍显示余额、签到与本机用量
317
+ - 上游还发 `current_*_count` 计数字段(无计数制时为 `-1`),插件只读百分比与起止时刻
286
318
  ### 关于续期
287
319
 
288
320
  OAuth 令牌有效期约 1 小时,由客户端自动续期。插件**只在自己的令牌已过期时**才用 App 已存的 refresh token 续一次,并把轮换后的新令牌按客户端**原格式原子写回**同一个文件(`generation` 保持不变),因此桌面 App 的登录态不受影响。插件不会发起登录、不会登出、也不会调用任何付费/订阅类接口。
@@ -308,6 +340,20 @@ OAuth 令牌有效期约 1 小时,由客户端自动续期。插件**只在自
308
340
 
309
341
  ## 更新记录
310
342
 
343
+ ### 0.5.6(2026-11-09)
344
+
345
+ - **修复「模型请求全部失败,但积分/签到正常」**:这是两条凭证路径读的不是同一个文件。模型网关此前只认插件自登录与桌面 App 留下的**旧版 JWT**(`local-runtime.auth.json`),而新版 App 早已改用 OAuth 存储(`auth/prod/<region>/mcode-public/auth.json`,`mmoat_` 令牌)。旧 JWT 过期后网关一律回 `401 auth failed`,而积分走的是 OAuth 文件,于是出现「积分能看、模型不通」。现在网关依次尝试:插件自登录 → **桌面 App 的 OAuth 授权** → 旧版 JWT,三者取第一个可用的。
346
+ - **修复「令牌被上游吊销后永不重登」**:吊销不会改动本地记录的过期时间,而此前的续期判断**只看过期时间**,于是死令牌被一直使用,所有请求 401,界面却仍显示已登录、也没有重新登录入口。现在账户接口返回 `401` 会触发一次强制续期;续期被拒(`400`/`401`/`invalid_grant`,或凭据本身没有 refresh token)则删除该凭据、清空缓存状态,卡片改为提示重新登录。**续期的网络错误与 `5xx` 不算吊销**,不会因为上游一时抽风就把人登出。
347
+ - **修复状态卡把「可用」报成「已过期」**:卡片的登录态此前只读旧 JWT,因此网关明明能通也显示 `expired`。现在它描述的是**网关实际会用的那枚凭据**,并新增 `credential-revoked` / `credential-expired` 两种更贴切的提示文案(指向卡片上的登录按钮,而不是「去桌面 App 登录后重启 DSH」)。
348
+ - 新增 `tests/revoked-credential.spec.ts`(6 个用例)钉住:401 后凭据被删除且卡片转为未登录、被拒时给出「重新登录」提示、`503` 不会误删凭据、无桌面 App 时插件自登录显示为已登录、OAuth 授权优先于旧 JWT、状态文档不泄露任何令牌。全量 193 个用例通过。
349
+
350
+ ### 0.5.5(2026-11-07)
351
+
352
+ - **新增「限额窗口」显示**:读取开放平台的 `GET /backend/account/token_plan/remains_percent`(该接口来自桌面 App 每天真实调用的日志,同样未在官方文档中公开),展示套餐的**5 小时窗口**与**每周窗口**的已用百分比与重置倒计时。窗口时长从响应自身的起止字段推导,不写死 5 小时或 7 天——套餐条款变过不止一次,显示应跟随服务端所说。
353
+ - 该接口属于账户域,**只认 OAuth 令牌**(桌面 App 登录态或插件自登录均可);JWT 打它返回 `1016 invalid api key`。读取挂在积分轮询上,独立容错:限额读不到不影响余额显示,反之亦然。
354
+ - 显示位置:胶囊详情与插件页卡片各两行;新增 `tests/rate-limit.spec.ts` 钉住解析、URL、容错与轮询接线。
355
+ - 窗口名跟随服务端:胶囊主标签与详情行上的窗口长度(`5h`、`7d`)从响应的起止字段推导,而不是写死 —— 解析层早已「不写死窗口长度」,显示层此前却写着「5h」,两处现在一致。
356
+ - 无限量窗口不报百分比:上游用 `current_*_status` 标出没有额度的窗口,这类窗口不参与显示,避免出现没人能据此行动的「0%」。
311
357
  ### 0.5.4(2026-10-29)
312
358
 
313
359
  - **修复长会话被误判为「上下文溢出」**:上游 `limit.context`(512,000)是**默认档位与计费分界**,网关实际执行的上限是 `context_window_options` 里的 1,000,000。此前按 512,000 声明,会话一旦超过这条线,**每一轮**都会被判定为 `pi-ai detected context overflow` —— 而模型其实正常答了,回复却被丢弃。现在按网关的真实上限声明窗口。
@@ -468,6 +514,7 @@ dsh plugin --profile web exec dsh-workbuddy-connect status
468
514
  ## 贡献者
469
515
 
470
516
  - **[eghrhegpe](https://github.com/eghrhegpe)** —— 提出了插件页图标与中英文文案的建议([#1](https://github.com/JeffTsuiCUG/dsh-connect-minimaxcode/issues/1))。这条建议促成了 0.5.2:插件页有了自己的 SVG 图标,标题与简介有了中英两版,界面文案也开始跟随宿主语言。
517
+ - **[azsora](https://github.com/azsora)** —— 从桌面 App 的实际调用里找出了套餐的**限额窗口接口**,并把 5 小时与每周两个窗口的用量接进了积分胶囊与插件页卡片([#4](https://github.com/JeffTsuiCUG/dsh-connect-minimaxcode/pull/4)):窗口时长从响应自身的起止字段推导,不写死。该功能成为 0.5.5。
471
518
  - **[qzz19970504](https://github.com/qzz19970504)** —— 定位并修复了「发图必然失败」的接线缺口([#3](https://github.com/JeffTsuiCUG/dsh-connect-minimaxcode/pull/3)):模型目录声明了 `image` 模态,但适配器没有把宿主的持久化附件服务接上,导致带图请求被 pi-ai 在发出前拒掉。该修复成为 0.5.3。
472
519
  - 插件作者:**[JeffTsuiCUG](https://github.com/JeffTsuiCUG)**
473
520
 
package/lib/client.js CHANGED
@@ -66,6 +66,8 @@
66
66
  signinAuto: '每天自动签到',
67
67
  signinClaim: '签到',
68
68
  claimableToday: '今日可签到',
69
+ usageWindow: '{duration}限额',
70
+ resetIn: '{duration}后',
69
71
  };
70
72
  const en = {
71
73
  title: 'MiniMax Code credits',
@@ -106,6 +108,8 @@
106
108
  signinAuto: 'Claim daily on its own',
107
109
  signinClaim: 'Claim',
108
110
  claimableToday: 'Claimable today',
111
+ usageWindow: '{duration} limit',
112
+ resetIn: 'resets in {duration}',
109
113
  };
110
114
  const loader = globalThis.__ModuleLoader__;
111
115
  if (loader === undefined)
@@ -208,6 +212,53 @@
208
212
  ? row(t('expiringSoon', { amount: credits(credits_.expiringSoon, 2) }), '')
209
213
  : null, next !== undefined ? row(t('nextExpiry'), day(next)) : null);
210
214
  }
215
+ /**
216
+ * A countdown to a window reset, coarse on purpose: minutes below an
217
+ * hour, hours and minutes below a day, days and hours beyond. It is
218
+ * computed at render time, so it is as fresh as the last status read.
219
+ */
220
+ function countdown(resetAtMs) {
221
+ const minutes = Math.max(0, Math.ceil((resetAtMs - Date.now()) / 60000));
222
+ if (minutes < 60)
223
+ return `${minutes}m`;
224
+ if (minutes < 1440)
225
+ return `${Math.floor(minutes / 60)}h${minutes % 60}m`;
226
+ return `${Math.floor(minutes / 1440)}d${Math.floor((minutes % 1440) / 60)}h`;
227
+ }
228
+ /**
229
+ * The length of a window, as the server defines it.
230
+ *
231
+ * The window's own edges give the length, so the label follows the plan
232
+ * instead of the plan's terms today: five hours today reads "5h", and a
233
+ * plan that moved to a three-hour window reads "3h" without a code
234
+ * change. Only the word around it is translated.
235
+ */
236
+ function windowLabel(window) {
237
+ const minutes = Math.max(1, Math.round((window.resetAtMs - window.startAtMs) / 60000));
238
+ if (minutes >= 1440)
239
+ return `${Math.round(minutes / 1440)}d`;
240
+ if (minutes >= 60) {
241
+ const hours = minutes / 60;
242
+ return Number.isInteger(hours) ? `${hours}h` : `${Math.floor(hours)}h${minutes % 60}m`;
243
+ }
244
+ return `${minutes}m`;
245
+ }
246
+ /**
247
+ * The plan's two rolling usage windows, shared by the pill's detail and
248
+ * the page card.
249
+ *
250
+ * The percent sits on the right with the reset countdown in
251
+ * parentheses, and the window length is derived from the window itself
252
+ * rather than written into the label: the plan's terms have changed
253
+ * before, and the display should follow whatever the server says.
254
+ */
255
+ function rateLimitBlock(t, rateLimit) {
256
+ if (rateLimit === undefined || rateLimit.state !== 'ok')
257
+ return null;
258
+ if (rateLimit.interval === undefined || rateLimit.weekly === undefined)
259
+ return null;
260
+ return h('div', { style: expiryBoxStyle, 'data-minimax-rate-limit': true }, row(t('usageWindow', { duration: windowLabel(rateLimit.interval) }), `${rateLimit.interval.usedPercent}%(${t('resetIn', { duration: countdown(rateLimit.interval.resetAtMs) })})`), row(t('usageWindow', { duration: windowLabel(rateLimit.weekly) }), `${rateLimit.weekly.usedPercent}%(${t('resetIn', { duration: countdown(rateLimit.weekly.resetAtMs) })})`));
261
+ }
211
262
  /** The pill itself; the gate decides whether it is drawn at all. */
212
263
  function CreditPill(props) {
213
264
  const [status] = useStatus();
@@ -218,14 +269,29 @@
218
269
  });
219
270
  const credits_ = status?.credits;
220
271
  const usage = status?.usage;
272
+ const rateLimit = status?.rateLimit;
221
273
  const available = credits_?.state === 'ok' && credits_.total !== undefined;
222
- const label = available
274
+ const windows = rateLimit?.state === 'ok' && rateLimit.interval !== undefined && rateLimit.weekly !== undefined
275
+ ? { interval: rateLimit.interval, weekly: rateLimit.weekly }
276
+ : undefined;
277
+ // A window that is used up means the plan cannot serve the next
278
+ // request right now, so the balance is the number worth seeing.
279
+ // Otherwise the pill leads with the short window — the one that gates
280
+ // the next request — named by the length the server gives it. No
281
+ // windows, the balance again: the pill never shows nothing just
282
+ // because one read failed.
283
+ const exhausted = windows !== undefined
284
+ && (windows.interval.usedPercent >= 100 || windows.weekly.usedPercent >= 100);
285
+ const balance = available
223
286
  ? t('balance', { total: credits(credits_.total, 2) })
224
287
  : t(credits_?.state === 'expired' ? 'expired' : credits_?.state === 'signed-out' ? 'signedOut' : 'unavailable');
288
+ const label = windows === undefined || exhausted
289
+ ? balance
290
+ : `${windowLabel(windows.interval)} ${windows.interval.usedPercent}%(${t('resetIn', { duration: countdown(windows.interval.resetAtMs) })})`;
225
291
  const detail = available
226
292
  ? h('div', { style: detailStyle, 'data-minimax-credits-detail': true }, row(t('free'), credits(credits_.free, 3)), row(t('purchased'), credits(credits_.purchased, 3)), credits_.consumed !== undefined && credits_.consumed > 0
227
293
  ? row(t('consumed'), credits(credits_.consumed, 3))
228
- : null, expiryBlock(t, credits_), usage !== undefined
294
+ : null, expiryBlock(t, credits_), rateLimitBlock(t, status?.rateLimit), usage !== undefined
229
295
  ? h('div', { style: rowStyle }, h('span', null, t('tokens', { count: tokens(usage.inputTokens + usage.outputTokens + usage.cacheReadTokens) })), h('span', null, t('cost', { amount: money(usage.estimatedCny) })))
230
296
  : null, credits_.updatedAtMs !== undefined
231
297
  ? row(t('updated', { time: new Date(credits_.updatedAtMs).toLocaleTimeString() }), '')
@@ -366,7 +432,7 @@
366
432
  if (!available) {
367
433
  return h('div', { style: cardStyle, 'data-minimax-credits-card': true }, h('div', { style: cardTitleStyle }, t('title')), h('div', { style: rowStyle }, h('span', null, t('unavailable')), h('span', null, credits_?.state === 'expired' ? t('expired') : '')), loginBlock(t, login, refresh));
368
434
  }
369
- return h('div', { style: cardStyle, 'data-minimax-credits-card': true }, h('div', { style: cardTitleStyle }, t('title')), h('div', { style: bigNumberStyle }, t('balance', { total: credits(credits_.total, 2) })), row(t('free'), credits(credits_.free, 3)), row(t('purchased'), credits(credits_.purchased, 3)), expiryBlock(t, credits_), signinBlock(t, signin, refresh), h('div', { style: sectionTitleStyle }, t('lots')), (credits_.upcoming ?? []).length === 0
435
+ return h('div', { style: cardStyle, 'data-minimax-credits-card': true }, h('div', { style: cardTitleStyle }, t('title')), h('div', { style: bigNumberStyle }, t('balance', { total: credits(credits_.total, 2) })), row(t('free'), credits(credits_.free, 3)), row(t('purchased'), credits(credits_.purchased, 3)), expiryBlock(t, credits_), rateLimitBlock(t, status?.rateLimit), signinBlock(t, signin, refresh), h('div', { style: sectionTitleStyle }, t('lots')), (credits_.upcoming ?? []).length === 0
370
436
  ? h('div', { style: mutedStyle }, t('noLots'))
371
437
  : h('ul', { style: listStyle }, ...(credits_.upcoming ?? []).map((lot, index) => h('li', { key: `${lot.expireAtMs}-${index}`, style: rowStyle }, h('span', null, day(lot.expireAtMs)), h('span', null, credits(lot.amount, 2))))), usage !== undefined
372
438
  ? h('div', { style: usageBoxStyle }, row(t('tokens', { count: tokens(usage.inputTokens + usage.outputTokens + usage.cacheReadTokens) }), ''), row(t('cost', { amount: money(usage.estimatedCny) }), ''), usage.requests > 0 ? row(t('requests', { count: usage.requests }), usage.lastModel ?? '') : null)
package/lib/index.d.ts CHANGED
@@ -208,6 +208,8 @@ 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
+ /** Rate-limit window endpoint: the 5-hour and weekly usage the plan meters. */
212
+ declare const REMAINS_PERCENT_PATH = "/backend/account/token_plan/remains_percent";
211
213
  /** The OAuth credential the account endpoints accept. */
212
214
  interface OAuthCredential {
213
215
  /** The `mmoat_` bearer token. */
@@ -336,6 +338,48 @@ interface CreditLot {
336
338
  /** The upstream's kind of lot, when it says. */
337
339
  creditType?: number;
338
340
  }
341
+ /** One metered window: a span of time and how much of its allowance went. */
342
+ interface UsageWindow {
343
+ /** The share of the window's allowance already used, in percent. */
344
+ usedPercent: number;
345
+ /** When the window opened, in milliseconds since the epoch. */
346
+ startAtMs: number;
347
+ /** When the window closes and the allowance resets, in milliseconds since the epoch. */
348
+ resetAtMs: number;
349
+ }
350
+ /** The two rolling windows the plan meters usage in. */
351
+ interface RateLimitWindows {
352
+ /** The short window (five hours on the plans seen so far). */
353
+ interval: UsageWindow;
354
+ /** The weekly window (seven days on the plans seen so far). */
355
+ weekly: UsageWindow;
356
+ }
357
+ /**
358
+ * Read the two rate-limit windows out of a remains-percent response.
359
+ *
360
+ * The upstream answers with one entry per metered group; the general one is
361
+ * the only one the plan meters today, and the first entry is used when it is
362
+ * absent. The percents arrive as strings ("19%"), and the counts arrive as -1
363
+ * when the plan does not meter by count, so only the percents and the window
364
+ * edges are read. The window length is derived from the entry's own endpoints
365
+ * rather than assumed to be five hours or seven days — the plan's terms have
366
+ * changed before, and the display should follow whatever the server says.
367
+ *
368
+ * A window the server marks as unlimited (`current_*_status` of 3) carries no
369
+ * allowance to be a percentage of, so it produces no window at all: reporting
370
+ * "0%" of an unlimited quota would be a number nobody can act on.
371
+ */
372
+ declare function parseRateLimitWindows(document: unknown): RateLimitWindows | undefined;
373
+ /**
374
+ * Fetch the plan's two rate-limit windows.
375
+ *
376
+ * The endpoint lives on the open-platform host, like the usage summary, and
377
+ * answers the same OAuth credential the membership endpoint takes. The JWT the
378
+ * model gateway accepts does not work here: this is an account endpoint.
379
+ *
380
+ * @returns The windows, or `undefined` when the response carries none.
381
+ */
382
+ declare function fetchRateLimitWindows(credential: OAuthCredential, region: MinimaxRegion, fetchImpl?: typeof fetch): Promise<RateLimitWindows | undefined>;
339
383
  /** What the lots say about credits that are about to be lost. */
340
384
  interface ExpirySummary {
341
385
  /** Credits in lots that expire within {@link EXPIRING_WINDOW_DAYS} days. */
@@ -374,12 +418,20 @@ declare class MinimaxCredits {
374
418
  get ledgerAtMs(): number | undefined;
375
419
  /** Why the ledger could not be read, when it could not. */
376
420
  get ledgerError(): string | undefined;
421
+ /** The plan's rate-limit windows as last read. */
422
+ get rateLimit(): RateLimitWindows | undefined;
423
+ /** Why the windows could not be read, when they could not. */
424
+ get rateLimitError(): string | undefined;
425
+ /** When the windows were last read. */
426
+ get rateLimitAtMs(): number | undefined;
377
427
  /**
378
428
  * Read the balance and record how much was consumed since the last read.
379
429
  *
380
430
  * The credit ledger is read alongside it, but a ledger that cannot be read
381
431
  * never hides the balance: the two come from different endpoints and only
382
- * the balance is essential.
432
+ * the balance is essential. The rate-limit windows ride along under the
433
+ * same rule — they come from yet another endpoint, and none of the three
434
+ * takes the others down with it.
383
435
  *
384
436
  * @returns Whether the balance changed.
385
437
  */
@@ -392,6 +444,13 @@ declare class MinimaxCredits {
392
444
  * take it down with it.
393
445
  */
394
446
  refreshLedger(credential: OAuthCredential, region: MinimaxRegion, fetchImpl?: typeof fetch, now?: number): Promise<void>;
447
+ /**
448
+ * Read the plan's rate-limit windows.
449
+ *
450
+ * Same rule as the ledger: a failure is remembered but never thrown, and a
451
+ * window that cannot be read leaves the last one on display.
452
+ */
453
+ refreshRateLimit(credential: OAuthCredential, region: MinimaxRegion, fetchImpl?: typeof fetch, now?: number): Promise<void>;
395
454
  }
396
455
  //#endregion
397
456
  //#region src/usage.d.ts
@@ -552,6 +611,8 @@ declare function pluginStatePath(env?: NodeJS.ProcessEnv): string;
552
611
  declare function readPluginCredential(env?: NodeJS.ProcessEnv): Promise<PluginCredential | undefined>;
553
612
  /** Write the plugin's own credential. */
554
613
  declare function writePluginCredential(credential: PluginCredential, env?: NodeJS.ProcessEnv): Promise<void>;
614
+ /** Remove the plugin's own credential, which is what signing out means. */
615
+ declare function deletePluginCredential(env?: NodeJS.ProcessEnv): Promise<void>;
555
616
  /** Read the plugin's own state. */
556
617
  declare function readPluginState(env?: NodeJS.ProcessEnv): Promise<PluginState>;
557
618
  /** Write the plugin's own state. */
@@ -831,6 +892,27 @@ interface UsageStatus {
831
892
  /** How many requests were measured. */
832
893
  requests: number;
833
894
  }
895
+ /** The plan's two rolling usage windows, as the card reads them. */
896
+ interface RateLimitStatus {
897
+ /** Whether the windows could be read. */
898
+ state: 'ok' | 'unavailable' | 'expired' | 'signed-out';
899
+ /** The short window (five hours on the plans seen so far). */
900
+ interval?: {
901
+ usedPercent: number;
902
+ startAtMs: number;
903
+ resetAtMs: number;
904
+ };
905
+ /** The weekly window. */
906
+ weekly?: {
907
+ usedPercent: number;
908
+ startAtMs: number;
909
+ resetAtMs: number;
910
+ };
911
+ /** When the windows were read, in milliseconds since the epoch. */
912
+ updatedAtMs?: number;
913
+ /** Why the windows could not be read. */
914
+ error?: string;
915
+ }
834
916
  /** What the card renders. */
835
917
  interface StatusDocument {
836
918
  state: 'signed-in' | 'signed-out' | 'expired';
@@ -853,6 +935,8 @@ interface StatusDocument {
853
935
  refreshing?: boolean;
854
936
  /** The account's credit balance, when it could be read. */
855
937
  credits?: CreditStatus;
938
+ /** The plan's rolling usage windows, when they could be read. */
939
+ rateLimit?: RateLimitStatus;
856
940
  /** What this host's requests have used. */
857
941
  usage?: UsageStatus;
858
942
  /** The daily check-in, when it could be read. */
@@ -879,6 +963,8 @@ interface StatusDeps {
879
963
  refreshing: boolean;
880
964
  /** The account's credit balance, when the account API could be reached. */
881
965
  credits?: CreditStatus;
966
+ /** The plan's rolling usage windows, when the open platform could be reached. */
967
+ rateLimit?: RateLimitStatus;
882
968
  /** What this host's requests have used. */
883
969
  usage?: UsageStatus;
884
970
  /** The daily check-in, when the account API could be reached. */
@@ -953,7 +1039,6 @@ interface AdapterBundle {
953
1039
  declare function createMinimaxCodeAdapter(options: AdapterOptions): AdapterBundle;
954
1040
  //#endregion
955
1041
  //#region src/index.d.ts
956
- /** Loader entry name; also the id the bundle patch inserts. */
957
1042
  declare const name = "dsh-connect-minimaxcode";
958
1043
  /** Services this plugin needs before it can serve anything. */
959
1044
  declare const inject: string[];
@@ -968,4 +1053,4 @@ declare const inject: string[];
968
1053
  */
969
1054
  declare function apply(ctx: Context): void;
970
1055
  //#endregion
971
- export { type AuthState, type CatalogModel, type CatalogSource, type Credential, type CreditSummary, DEVICE_CODE_GRANT, DEVICE_CODE_PATH, type DeviceLoginState, EMPTY_USAGE, FALLBACK_MODELS, MEMBERSHIP_PATH, MINIMAXCODE_PROVIDER_ID, MINIMAX_ACTION_PATH, MINIMAX_AUTH_FILENAME, MINIMAX_DATA_DIR, MINIMAX_GATEWAYS, MINIMAX_OAUTH_CLIENT_ID, MINIMAX_REGIONS, MINIMAX_STATUS_PATH, MINIMAX_STREAM_IDLE_TIMEOUT_MS, MODEL_PRICES, MinimaxCatalog, MinimaxCredits, type MinimaxRegion, type ModelUsage, type OAuthCredential, type OAuthState, PLUGIN_CREDENTIAL_FILENAME, PLUGIN_STATE_FILENAME, type PluginCredential, type PluginState, SIGNIN_CLAIM_PATH, SIGNIN_CLAIM_RESULT, SIGNIN_CYCLE_DAYS, SIGNIN_DAY_STATUS, SIGNIN_PANEL_PATH, type SigninClaim, type SigninDay, type SigninPanel, type StatusDocument, type TokenClaims, UsageMeter, apply, authPath, bearerToken, catalogUrl, chatBaseUrl, claimSignin, createMinimaxCodeAdapter, dataDir, daysRemaining, decodeClaims, dshHome, ensureOAuthCredential, estimateCny, expiresInMs, expiryLevel, fetchCreditSummary, fetchSigninPanel, inject, localDay, makePkce, name, parseAuthDocument, parseCatalog, parseCreditSummary, parseOAuthDocument, parseSigninClaim, parseSigninPanel, pluginCredentialPath, pluginStatePath, pollDeviceLogin, priceFor, readCredential, readOAuthCredential, readPluginCredential, readPluginState, refreshOAuthCredential, refreshPluginCredential, startDeviceLogin, statusDocument, timezoneId, writeOAuthCredential, writePluginCredential, writePluginState };
1056
+ export { type AuthState, type CatalogModel, type CatalogSource, type Credential, type CreditSummary, DEVICE_CODE_GRANT, DEVICE_CODE_PATH, type DeviceLoginState, EMPTY_USAGE, FALLBACK_MODELS, MEMBERSHIP_PATH, MINIMAXCODE_PROVIDER_ID, MINIMAX_ACTION_PATH, MINIMAX_AUTH_FILENAME, MINIMAX_DATA_DIR, MINIMAX_GATEWAYS, MINIMAX_OAUTH_CLIENT_ID, MINIMAX_REGIONS, MINIMAX_STATUS_PATH, MINIMAX_STREAM_IDLE_TIMEOUT_MS, MODEL_PRICES, MinimaxCatalog, MinimaxCredits, type MinimaxRegion, type ModelUsage, type OAuthCredential, type OAuthState, PLUGIN_CREDENTIAL_FILENAME, PLUGIN_STATE_FILENAME, type PluginCredential, type PluginState, REMAINS_PERCENT_PATH, type RateLimitWindows, SIGNIN_CLAIM_PATH, SIGNIN_CLAIM_RESULT, SIGNIN_CYCLE_DAYS, SIGNIN_DAY_STATUS, SIGNIN_PANEL_PATH, type SigninClaim, type SigninDay, type SigninPanel, type StatusDocument, type TokenClaims, UsageMeter, apply, authPath, bearerToken, catalogUrl, chatBaseUrl, claimSignin, createMinimaxCodeAdapter, dataDir, daysRemaining, decodeClaims, deletePluginCredential, dshHome, ensureOAuthCredential, estimateCny, expiresInMs, expiryLevel, fetchCreditSummary, fetchRateLimitWindows, fetchSigninPanel, inject, localDay, makePkce, name, parseAuthDocument, parseCatalog, parseCreditSummary, parseOAuthDocument, parseRateLimitWindows, parseSigninClaim, parseSigninPanel, pluginCredentialPath, pluginStatePath, pollDeviceLogin, priceFor, readCredential, readOAuthCredential, readPluginCredential, readPluginState, refreshOAuthCredential, refreshPluginCredential, startDeviceLogin, statusDocument, timezoneId, writeOAuthCredential, writePluginCredential, writePluginState };