dsh-tokenbank 0.1.67 → 0.1.69

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
@@ -1,21 +1,24 @@
1
1
  # TokenBank 免费模型 (dsh-tokenbank)
2
2
 
3
- DeepSeek Harness(DSH)插件:一键用上 [TokenBank](https://bank.skillpie.cn) 的**免费 GLM 模型**——输入框模型选择器旁的橙色硬币按钮,点开即完成注册/登录/充值/托管全部操作,免费模型直接进你的模型列表,**无需自建中转、无需任何配置**。致敬 dsh-our-free-model。
3
+ DeepSeek Harness(DSH)插件:一键用上 [TokenBank](https://bank.skillpie.cn) 的**免费 GLM 模型**——输入框模型选择器旁的橙色「免费模型」标签,点开即完成注册/登录/充值/托管全部操作,免费模型直接进你的模型列表,**无需自建中转、无需任何配置**。致敬 dsh-our-free-model。
4
4
 
5
5
  ## 功能
6
6
 
7
7
  ```
8
- 模型选择器旁 [🪙] 按钮 ──▶ 账户弹窗(锚定抽屉)
9
- ├─ 未登录:注册(邮箱验证码,送 $5 体验金 + 免费API Key)/ 登录
10
- ├─ 余额与账户:昵称、$余额、每日签到(领词元)
8
+ 输入框工具行 [免费模型] 标签(未登录)──▶ 账户弹窗(锚定抽屉)
9
+ ├─ 注册:邮箱验证码,送 $5 体验金 + 免费API Key
10
+ ├─ 登录:登录后标签消失,底部状态栏出现余额
11
+ 底部状态栏 [ $ 余额 ] pill(登录态)
12
+ ├─ 每日签到(领词元)、充值(¥10/50/100/300,支付宝收银台在系统默认浏览器打开,
13
+ │ 支付后自动轮询到账并刷新余额)
11
14
  ├─ 获取免费模型:GLM 系列直进模型列表(协议/上下文窗口/图片/推理档位自动配置)
12
- └─ 充值:人民币套餐(¥10/50/100/300),支付宝收银台在系统默认浏览器打开,
13
- 支付后自动轮询到账并刷新余额
15
+ └─ 退出登录(二次确认);登录后余额 pill 橙色高亮提示可点击,点击后恢复常态
14
16
  模型设置页(设置 → 模型)├─ 每张自定义 provider 卡片上「一键托管」:
15
17
  把你的 API Key 托管到 TokenBank,闲置临时额度自动转永久余额(带上游探活校验)
16
18
  ```
17
19
 
18
20
  - **免费模型接入**:注册响应里的明文 Key 自动写入 DSH 凭据(`TOKENBANK_API_KEY`)与模型列表(`llm-pi-ai` 命名空间),协议(anthropic-messages / openai-completions)、能力(1M 上下文、图片输入、推理档位)从门户元数据自动带出,模型编辑器里所见即所得。
21
+ - **余额常驻状态栏**:登录后余额显示在会话输入框下方状态栏(与 tok/s、缓存命中率同行),hover/展开深灰背景,点击直达账户弹窗。
19
22
  - **密钥托管**:一键托管会先经 TokenBank 上游真打一次探活(不落库、不计费),无效 Key 直接拒绝;已托管的 Key 可一键取消。
20
23
  - **低余额提醒**:会话里模型因余额不足报错时,弹窗引导去充值。
21
24
  - **安全**:门户会话与身份持久化在 DSH 凭据记录 `dsh-tokenbank/identity`;可选记住密码用于静默重登;插件 HTTP API 仅限宿主同源访问。
@@ -37,7 +40,7 @@ DeepSeek Harness(DSH)插件:一键用上 [TokenBank](https://bank.skillpie.cn)
37
40
  dsh plugin --profile web add dsh-tokenbank
38
41
  ```
39
42
 
40
- 装完刷新 GUI,点模型选择器旁的橙色硬币按钮即可开始。
43
+ 装完刷新 GUI,点输入框模型选择器旁的橙色「免费模型」标签即可开始。
41
44
 
42
45
  ## 官网
43
46
 
package/lib/client.js CHANGED
@@ -109,8 +109,14 @@ window.__ModuleLoader__.load({
109
109
  probeRejected: '{n} 个 Key 探活失败已被剔除',
110
110
  keyRequired: '请先粘贴至少一个 Key',
111
111
  connectedAs: 'TokenBank 已连接:{email}',
112
- depositHint: '一键托管:把你的 API Key 托管到 TokenBank,临时额度自动转移为永久额度保留使用。适用于周重置快到了还没用完等情况。',
112
+ depositHint: "一键托管:把你的 API Key 凭证托管到 TokenBank,临时额度自动转移为永久额度保留使用。适用于:",
113
+ depositCase1: "1. 周重置快到期了还没用完,重置后白白浪费,不如卖给平台换取永久余额,类似银行的存款业务",
114
+ depositCase2: "2. 跨模型厂商调用,转换为 TokenBank 余额后,更换 TokenBank 提供的模型厂商继续使用",
115
+ depositCase3: "3. 托管的 API Key 优先被平台调用,被调用后获得一定的托管利息存进余额,类似银行的贷款业务",
116
+ depositCase4: "4. 自己使用时如果 TokenBank 余额不足会取出自己的 API Key 继续使用",
117
+ depositCase5: "5. TokenBank 会自动路由,解决您用量不足需要频繁切换模型的问题",
113
118
  learnMore: '了解 TokenBank →',
119
+ dismissHint: '不再显示',
114
120
  notConnected: 'TokenBank 未登录',
115
121
  modelLink: '已有 Key?手动接入',
116
122
  modelLinkHint: '粘贴 TokenBank 访问密钥(tb-…)',
@@ -198,8 +204,14 @@ window.__ModuleLoader__.load({
198
204
  depositDone: 'Deposited',
199
205
  keyRequired: 'Paste at least one key first',
200
206
  connectedAs: 'TokenBank connected: {email}',
201
- depositHint: 'One-click deposit: host your API key on TokenBank to convert its temporary quota into permanent balance — ideal when the weekly reset is close and quota remains unused.',
207
+ depositHint: "One-click deposit: host your API key credentials on TokenBank to convert temporary quota into permanent balance. Useful when:",
208
+ depositCase1: "1. The weekly reset is close and quota remains unused — sell it to the platform for permanent balance (like a bank deposit)",
209
+ depositCase2: "2. Cross-provider calls — convert to TokenBank balance and switch to the model providers TokenBank offers",
210
+ depositCase3: "3. Deposited API keys are called by the platform first, earning deposit interest into your balance (like a bank loan)",
211
+ depositCase4: "4. When your TokenBank balance runs short, your own API key is withdrawn and used directly",
212
+ depositCase5: "5. TokenBank routes automatically, so you no longer need to switch models frequently due to insufficient usage",
202
213
  learnMore: 'About TokenBank →',
214
+ dismissHint: "Don't show again",
203
215
  notConnected: 'TokenBank not signed in',
204
216
  modelLink: 'Have a key? Link manually',
205
217
  modelLinkHint: 'Paste your TokenBank access key (tb-…)',
@@ -346,8 +358,17 @@ window.__ModuleLoader__.load({
346
358
  var flash = React.useState(false)
347
359
  var prev = React.useRef(false)
348
360
  React.useEffect(function () {
349
- if (snap.loggedIn && !prev.current) flash[1](true)
350
- prev.current = snap.loggedIn
361
+ if (!snap.loggedIn) { prev.current = false; return }
362
+ // 仅「从未登录 → 登录」的跃迁触发一次;已标记过(本会话已提示)不再重亮
363
+ if (!prev.current) {
364
+ prev.current = true
365
+ var seen = false
366
+ try { seen = window.sessionStorage.getItem('tb-balance-flash-seen') === '1' } catch (e) {}
367
+ if (!seen) {
368
+ flash[1](true)
369
+ try { window.sessionStorage.setItem('tb-balance-flash-seen', '1') } catch (e) {}
370
+ }
371
+ }
351
372
  }, [snap.loggedIn])
352
373
  var onClick = function (e) {
353
374
  flash[1](false)
@@ -1258,12 +1279,46 @@ window.__ModuleLoader__.load({
1258
1279
  function DepositHint() {
1259
1280
  var snap = useTbStore()
1260
1281
  var portal = (tbStore.get().portalUrl) || 'https://bank.skillpie.cn'
1282
+ var hintClosed = React.useState(false)
1283
+ var seenLogin = React.useRef(false)
1284
+ React.useEffect(function () {
1285
+ if (snap.loggedIn && !seenLogin.current) {
1286
+ seenLogin.current = true
1287
+ // 每次登录后重新展示提示
1288
+ try { window.sessionStorage.removeItem('tb-deposit-hint-closed') } catch (e) {}
1289
+ hintClosed[1](false)
1290
+ }
1291
+ }, [snap.loggedIn])
1292
+ React.useEffect(function () {
1293
+ try { if (window.sessionStorage.getItem('tb-deposit-hint-closed') === '1') hintClosed[1](true) } catch (e) {}
1294
+ }, [])
1295
+ if (hintClosed[0]) return null
1261
1296
  return h('div', { style: { display: 'flex', flexDirection: 'column', gap: 4, marginTop: 8, padding: '8px 12px', borderRadius: 10, background: 'var(--dsw-alias-interactive-bg-subtle, transparent)', border: '0.5px solid var(--dsw-alias-border-l3)' } },
1262
- h('span', { style: { fontSize: 12, lineHeight: '18px', color: 'var(--dsw-alias-label-secondary)' } }, pageT('depositHint')),
1263
- h('a', {
1264
- href: portal, target: '_blank', rel: 'noreferrer',
1265
- style: { fontSize: 12, color: 'var(--dsw-alias-label-link, var(--dsw-alias-label-primary))', textDecoration: 'none', alignSelf: 'flex-start' },
1266
- }, pageT('learnMore')),
1297
+ h('div', { style: { display: 'flex', flexDirection: 'column', gap: 2, fontSize: 12, lineHeight: '18px', color: 'var(--dsw-alias-label-secondary)' } },
1298
+ h('span', null, pageT('depositHint')),
1299
+ h('span', null, pageT('depositCase1')),
1300
+ h('span', null, pageT('depositCase2')),
1301
+ h('span', null, pageT('depositCase3')),
1302
+ h('span', null, pageT('depositCase4')),
1303
+ h('span', null, pageT('depositCase5')),
1304
+ ),
1305
+ h('div', { style: { display: 'flex', alignItems: 'center', justifyContent: 'space-between' } },
1306
+ h('a', {
1307
+ href: portal, target: '_blank', rel: 'noreferrer',
1308
+ style: { fontSize: 12, color: 'var(--dsw-alias-label-link, var(--dsw-alias-label-primary))', textDecoration: 'none' },
1309
+ }, pageT('learnMore')),
1310
+ h('button', {
1311
+ type: 'button', title: pageT('dismissHint'), 'aria-label': pageT('dismissHint'),
1312
+ style: { border: 'none', background: 'transparent', cursor: 'pointer', padding: 2, display: 'inline-flex', alignItems: 'center', color: 'var(--dsw-alias-label-tertiary, #a0a3a8)' },
1313
+ onClick: function () {
1314
+ hintClosed[1](true)
1315
+ try { window.sessionStorage.setItem('tb-deposit-hint-closed', '1') } catch (e) {}
1316
+ },
1317
+ },
1318
+ h('svg', { viewBox: '0 0 24 24', width: 14, height: 14, fill: 'none', stroke: 'currentColor', 'stroke-width': 2, 'stroke-linecap': 'round' },
1319
+ h('path', { d: 'M18 6 6 18' }), h('path', { d: 'm6 6 12 12' })),
1320
+ ),
1321
+ ),
1267
1322
  )
1268
1323
  }
1269
1324
 
package/locale/en.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "probeInconclusive": "Upstream probe inconclusive; deposited anyway",
8
8
  "probeRejected": "{n} key(s) failed the live probe and were dropped",
9
9
  "notifyOk": "OK",
10
- "depositHint": "One-click deposit: host your API key on TokenBank to convert its temporary quota into permanent balance — ideal when the weekly reset is close and quota remains unused.",
10
+ "depositHint": "One-click deposit: host your API key credentials on TokenBank to convert temporary quota into permanent balance. Useful when:",
11
11
  "learnMore": "About TokenBank →",
12
12
  "freeModelsEntry": "TokenBank free models",
13
13
  "addFreeModels": "Get free models",
@@ -24,10 +24,16 @@
24
24
  "rechargeOpenPay": "Open payment page",
25
25
  "rechargeCancel": "Cancel",
26
26
  "goSwitch": "Switch now",
27
- "depositManageTip": "Deposit your API key into TokenBank — remaining temporary quota transfers to permanent credit. Useful when the weekly reset is near.",
27
+ "depositManageTip": "One-click deposit: host your API key credentials on TokenBank to convert temporary quota into permanent balance. Useful when: 1. The weekly reset is close and quota remains unused — sell it to the platform for permanent balance (like a bank deposit) 2. Cross-provider calls — convert to TokenBank balance and switch to the model providers TokenBank offers 3. Deposited API keys are called by the platform first, earning deposit interest into your balance (like a bank loan) 4. When your TokenBank balance runs short, your own API key is withdrawn and used directly 5. TokenBank routes automatically, so you no longer need to switch models frequently due to insufficient usage",
28
28
  "checkin": "Check in",
29
29
  "checkinDone": "Checked in",
30
30
  "checkinOk": "Check-in success",
31
31
  "checkinStreak": "{n}-day streak",
32
- "meta.detail": "docs/DETAIL.md"
33
- }
32
+ "meta.detail": "docs/DETAIL.md",
33
+ "depositCase1": "1. The weekly reset is close and quota remains unused — sell it to the platform for permanent balance (like a bank deposit)",
34
+ "depositCase2": "2. Cross-provider calls — convert to TokenBank balance and switch to the model providers TokenBank offers",
35
+ "depositCase3": "3. Deposited API keys are called by the platform first, earning deposit interest into your balance (like a bank loan)",
36
+ "depositCase4": "4. When your TokenBank balance runs short, your own API key is withdrawn and used directly",
37
+ "depositCase5": "5. TokenBank routes automatically, so you no longer need to switch models frequently due to insufficient usage",
38
+ "dismissHint": "Don't show again"
39
+ }
package/locale/zh.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "probeInconclusive": "上游探活未出结论,已放行托管",
8
8
  "probeRejected": "{n} 个 Key 探活失败已被剔除",
9
9
  "notifyOk": "知道了",
10
- "depositHint": "一键托管:把你的 API Key 托管到 TokenBank,临时额度自动转移为永久额度保留使用。适用于周重置快到了还没用完等情况。",
10
+ "depositHint": "一键托管:把你的 API Key 凭证托管到 TokenBank,临时额度自动转移为永久额度保留使用。适用于:",
11
11
  "learnMore": "了解 TokenBank →",
12
12
  "freeModelsEntry": "TokenBank 免费模型",
13
13
  "addFreeModels": "获取免费模型",
@@ -24,10 +24,16 @@
24
24
  "rechargeOpenPay": "打开支付页",
25
25
  "rechargeCancel": "取消",
26
26
  "goSwitch": "去切换",
27
- "depositManageTip": "把你的 API Key 托管到 TokenBank,临时额度自动转移为永久额度保留使用。适用于周重置快到了还没用完等情况。",
27
+ "depositManageTip": "一键托管:把你的 API Key 凭证托管到 TokenBank,临时额度自动转移为永久额度保留使用。适用于: 1. 周重置快到期了还没用完,重置后白白浪费,不如卖给平台换取永久余额,类似银行的存款业务 2. 跨模型厂商调用,转换为 TokenBank 余额后,更换 TokenBank 提供的模型厂商继续使用 3. 托管的 API Key 优先被平台调用,被调用后获得一定的托管利息存进余额,类似银行的贷款业务 4. 自己使用时如果 TokenBank 余额不足会取出自己的 API Key 继续使用 5. TokenBank 会自动路由,解决您用量不足需要频繁切换模型的问题",
28
28
  "checkin": "签到",
29
29
  "checkinDone": "已签到",
30
30
  "checkinOk": "签到成功",
31
31
  "checkinStreak": "已连签 {n} 天",
32
- "meta.detail": "docs/DETAIL.zh.md"
33
- }
32
+ "meta.detail": "docs/DETAIL.zh.md",
33
+ "depositCase1": "1. 周重置快到期了还没用完,重置后白白浪费,不如卖给平台换取永久余额,类似银行的存款业务",
34
+ "depositCase2": "2. 跨模型厂商调用,转换为 TokenBank 余额后,更换 TokenBank 提供的模型厂商继续使用",
35
+ "depositCase3": "3. 托管的 API Key 优先被平台调用,被调用后获得一定的托管利息存进余额,类似银行的贷款业务",
36
+ "depositCase4": "4. 自己使用时如果 TokenBank 余额不足会取出自己的 API Key 继续使用",
37
+ "depositCase5": "5. TokenBank 会自动路由,解决您用量不足需要频繁切换模型的问题",
38
+ "dismissHint": "不再显示"
39
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-tokenbank",
3
- "version": "0.1.67",
3
+ "version": "0.1.69",
4
4
  "description": "DSH 免费模型:一键注册 TokenBank 领免费 APIKey 送 $5 体验金,免费 GLM 模型直接进模型列表;自带余额查询、API Key 密钥托管(临时额度转永久)、每日签到、充值入口(支付宝),获取免费模型无需自建中转。致敬 dsh-our-free-model。官网 https://bank.skillpie.cn",
5
5
  "type": "module",
6
6
  "license": "MIT",