dsh-agent-sdk-bridge 1.1.1 → 1.1.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.
Files changed (3) hide show
  1. package/FAQ.md +5 -0
  2. package/client.js +30 -4
  3. package/package.json +1 -1
package/FAQ.md CHANGED
@@ -107,6 +107,11 @@ subscription` 拒绝,此时卡片只显示积分,不虚构窗口。额度读
107
107
  已读到的账号并给出原因;点击「刷新额度」可重试。凭据过期时先启动一次带该凭据的会话(或重新
108
108
  登录),CLI 会自动续期。
109
109
 
110
+ **MiniMax 卡片上的「凭据到期」为什么总是今天?** 那一行显示的不是账号或套餐到期日,而是 mcode
111
+ 的 OAuth **访问令牌**有效期,它只有约 1 小时:无论什么时候打开页面,绝对日期都会落在今天,看起来
112
+ 像「今天到期」。现在这一行改成倒计时(「访问令牌剩余 58 分钟」,超过一小时改用小时),并注明 CLI
113
+ 会在下次调用时自动续期、无需重新登录;套餐自己的到期日仍单独显示为「套餐到期」。
114
+
110
115
  **MiniMax 回复到一半切到别的对话,再切回来报 `failed to project session`,提示
111
116
  `uncachedInputTokens` / `outputTokens` 需要整数?** 已修复。此前 MiniMax 的用量直接上报了
112
117
  按字符估算出的**小数**(例如 `1399.5`),流式时看不出问题,但 DSH 的用量投影用
package/client.js CHANGED
@@ -181,7 +181,11 @@ window.__ModuleLoader__.load({
181
181
  minimaxHideOutput: '收起输出',
182
182
  minimaxNoUsage: '登录后会显示账号、套餐与剩余额度。',
183
183
  minimaxCliRequired: '请先安装 MiniMax Code CLI,再登录。',
184
- minimaxExpires: '凭据到期',
184
+ minimaxPlanExpires: '套餐到期',
185
+ minimaxTokenRemaining: '访问令牌剩余 {n} 分钟',
186
+ minimaxTokenRemainingHours: '访问令牌剩余 {n} 小时',
187
+ minimaxTokenExpired: '访问令牌已过期',
188
+ minimaxTokenRenew: 'CLI 会在下次调用时自动续期,无需重新登录',
185
189
  minimaxAccount: '账号',
186
190
  minimaxAccountUnknown: '未知账号',
187
191
  minimaxPlan: '当前套餐',
@@ -362,7 +366,11 @@ window.__ModuleLoader__.load({
362
366
  minimaxHideOutput: 'Hide output',
363
367
  minimaxNoUsage: 'Sign in to see the account, plan and remaining quota.',
364
368
  minimaxCliRequired: 'Install the MiniMax Code CLI before signing in.',
365
- minimaxExpires: 'Credential expires',
369
+ minimaxPlanExpires: 'Plan expires',
370
+ minimaxTokenRemaining: 'Access token: {n} min left',
371
+ minimaxTokenRemainingHours: 'Access token: {n} h left',
372
+ minimaxTokenExpired: 'Access token expired',
373
+ minimaxTokenRenew: 'the CLI renews it automatically on the next call; no re-login needed',
366
374
  minimaxAccount: 'Account',
367
375
  minimaxAccountUnknown: 'Unknown account',
368
376
  minimaxPlan: 'Plan',
@@ -698,6 +706,22 @@ window.__ModuleLoader__.load({
698
706
  try { return new Date(ms).toLocaleDateString('zh-CN') } catch { return String(ms) }
699
707
  }
700
708
 
709
+ /**
710
+ * How long a short-lived credential still has, phrased as a countdown.
711
+ *
712
+ * The MiniMax CLI's OAuth access token lives about an hour and the CLI
713
+ * renews it on its next call, so an absolute date is always "today" and
714
+ * reads like a problem that does not exist. A countdown carries the
715
+ * information the date pretended to give.
716
+ */
717
+ function tokenExpiryText(t, ms, now = Date.now()) {
718
+ if (typeof ms !== 'number' || !Number.isFinite(ms) || ms <= 0) return t('minimaxTokenExpired')
719
+ const minutes = Math.round((ms - now) / 60_000)
720
+ if (minutes <= 0) return t('minimaxTokenExpired')
721
+ if (minutes < 60) return t('minimaxTokenRemaining').replace('{n}', String(minutes))
722
+ return t('minimaxTokenRemainingHours').replace('{n}', String(Math.floor(minutes / 60)))
723
+ }
724
+
701
725
  /**
702
726
  * One quota bucket as a line: label, `remaining / total`, percentage.
703
727
  *
@@ -1414,7 +1438,7 @@ window.__ModuleLoader__.load({
1414
1438
  plan.hasTokenPlan === true ? h('span', { style: { ...css.tag, marginLeft: '6px' } }, t('minimaxPlanTokenPlan')) : null,
1415
1439
  plan.expiresAt === undefined
1416
1440
  ? null
1417
- : h('span', { style: css.note }, `${t('minimaxExpires')} ${dateLabel(plan.expiresAt)}`),
1441
+ : h('span', { style: css.note }, `${t('minimaxPlanExpires')} ${dateLabel(plan.expiresAt)}`),
1418
1442
  ),
1419
1443
  credits === undefined
1420
1444
  ? null
@@ -1492,7 +1516,8 @@ window.__ModuleLoader__.load({
1492
1516
  quotaBlock,
1493
1517
  typeof auth?.expiresAt === 'number' && !blocked
1494
1518
  ? h('div', { style: css.usageFoot },
1495
- h('span', null, `${t('minimaxExpires')} ${dateLabel(auth.expiresAt)}`),
1519
+ h('span', null, tokenExpiryText(t, auth.expiresAt)),
1520
+ h('span', { style: css.note }, t('minimaxTokenRenew')),
1496
1521
  )
1497
1522
  : null,
1498
1523
  typeof auth?.url === 'string' && signingIn
@@ -2404,6 +2429,7 @@ window.__ModuleLoader__.load({
2404
2429
  exports.__test = {
2405
2430
  windowLabel, priceSuffix, ADVANCED, BRANDS, zh, en,
2406
2431
  SettingsPage, BundleSettings, UsageCard, CodeBuddyCard, QuotaLine, creditsOf, neverExpires,
2432
+ dateLabel, tokenExpiryText,
2407
2433
  readCache, writeCache,
2408
2434
  }
2409
2435
  return module.exports
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "dsh-agent-sdk-bridge",
3
3
  "displayName": "Agent SDK Bridge",
4
4
  "description": "DeepSeek Harness LLM adapter bridge for Qoder CN, Qoder International, Tencent CodeBuddy and MiniMax Code subscriptions. It reuses each provider's own SDK or official ACP server and CLI login, shows available quota, and exposes per-provider settings pages with independent international and mainland login regions.",
5
- "version": "1.1.1",
5
+ "version": "1.1.2",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "author": "k1-h2",