DSH Plugins Marketplace

DSH Plugins

Plugins

/

Tools & Capabilities

/

dsh-student-perks

d

dsh-student-perks

Manifest valid

Two pills in the bottom bar show the Aliyun student cash coupon (unclaimed, N days left, or expired) and the DeepSeek API balance; the panel adds voucher and cash balance, the peak/off-peak pricing ph

UI (client)hasBundlePatch

dsh-student-perks

窗口最底部状态栏常驻的三枚小胶囊(shell.bottom 槽,root 作用域,布局单独让出一行):

  • 🎓 阿里云券 / 账户余额:配了 AccessKey 就自动查——显示学生券面额、剩余天数,点开还有账户可用余额、现金余额与全部代金券;没配就退回手动记账。
    • 面板大数字可切换口径(卡片顶部 券 / 账户 / 现金 / 信控 四段选择器):券看的是代金券余额(独立记账,和账户余额不是一回事,所以账户显示 ¥0.00、券还有一百多是正常的);账户 / 现金 / 信控看的是 QueryAccountBalance 那三个字段。选过的口径记在本机 localStorage,宿主重启后还会写进 state.json 的 prefs.aliyunMetric(跨设备一起记)。
  • 💳 DeepSeek API 余额:CNY 总额,点开面板还有赠金、充值余额与更新时间。
  • 🌙/☀️ DeepSeek 计价时段:谷期(绿)或峰期(红),后面是当前时段还剩多久(剩 13h04m)。纯本地按北京时间算,不打接口:官方价目表规定周一至周五 9:00–12:00、14:00–18:00 是高峰价,其余时段(含周末)是空闲价,价格只有高峰的一半。法定节假日官方也按空闲价,但插件不认识节假日表,那几天会误显示成峰期。

为什么不挂在会话里、也不浮在右下角:conversation.session.header.actions 属于 session 作用域,新建对话、空会话时没有那个 header,胶囊会整组消失;sidebar.footer.action 被别的插件占了,且 Windows 标题栏模式下侧边栏折叠会隐藏。shell.overlay 是浮层(position:absolute 盖在内容上),在窗口右下角正好压在输入框的发送按钮上。shell.bottom 是 .frame 网格里 minmax(0,1fr) auto 的第二行、grid-column:1/-1,属于真正的布局行:状态栏占自己的高度,聊天区自动让位,永远不会遮挡任何控件。

安装

dsh plugin add github:ixxgal/dsh-student-perks

装完重启一次 DSH(宿主侧要挂 /dsh-student-perks/*.json 四个端点),状态栏底部才会出现胶囊。

也可以从插件索引装(插件 → 实验性插件 → 打开「自定义插件索引」→ 插件 → 发现 → 添加索引源):

https://ixxgal.github.io/dsh-plugins/index.json

本地开发用 dsh plugin add link:<插件目录的绝对路径>。

这个仓库里没有任何钥匙。 阿里云 AccessKey、DeepSeek API Key、桌面版账号会话都不进 git(见下面「密钥放哪」与 .gitignore),装完是「未配置」状态,你在面板里填一次就行。

数据从哪来

  • 阿里云(自动):费用与成本 OpenAPI BssOpenApi 2017-12-14
    • QueryAccountBalance → 可用余额 / 现金余额 / 信控额度(Data.AvailableAmount 等)
    • QueryCashCoupons → 代金券列表(面额 NominalValue、余额 Balance、状态 Available|Expired|Cancelled、ExpiryTime)
    • 签名是 RPC 那套:参数排序 → GET&%2F&percentEncode(query) → HMAC-SHA1(secret + "&") → base64,见 aliyun.js。
    • 需要的权限:AliyunBSSReadOnlyAccess(只读就够)。国内站 business.aliyuncs.com,国际站 business.ap-southeast-1.aliyuncs.com。
    • 学生券规则:学生认证后每年 1 张 300 元无门槛券,领券起 1 年内有效,不与 99 元学生机叠加;活动页 https://www.aliyun.com/activity/ecs/student-benefits。接口里它只是一张 NominalValue=300 的代金券,面板会优先挑它来显示。
  • DeepSeek:两种口径,优先用 Key,没有就用桌面版登录的账号会话
    • 有 API Key:GET https://api.deepseek.com/user/balance,Authorization: Bearer <key>,返回 CNY/USD 各自的总额、赠金、充值余额;面板优先显示 CNY。
    • 没有 Key:GET https://platform.deepseek.com/api/v0/users/get_user_summary,带 x-dsh-auth-token: <token>,token 取自 $DSH_HOME/.credentials.yaml 的 records["deepseek-account-platform/default"].payload.token(D·S·H 自己登录桌面版时写下的)。这就是「用量」页那个钱包:normal_wallets + bonus_wallets,外加 total_costs 当累计消耗显示。只读,不发到别处。
    • 想彻底用 API Key 口径:面板里填 Key,或在 cordis.patch.yml 里把 useAccountBalance 设成 false。

密钥放哪

阿里云 AccessKey(ID + Secret 必须成对)与 DeepSeek API Key 都按同一个顺序取:

  1. 面板里填的(存 $DSH_HOME/student-perks/state.json,本地明文,注意备份权限)
  2. 配置里的 aliyunAccessKeyId/aliyunAccessKeySecret、apiKey
  3. 环境变量 ALIBABA_CLOUD_ACCESS_KEY_ID/ALIBABA_CLOUD_ACCESS_KEY_SECRET、DEEPSEEK_API_KEY
  4. $DSH_HOME/.credentials.yaml 的 refs[...]

DeepSeek 这一路还有第 5 层兜底:以上都没有、且 useAccountBalance !== false 时,直接用 .credentials.yaml 里桌面版账号的 grant token 读钱包(面板会标「本机账号会话」,不可「清除」,因为那不是你填的密钥)。

HTTP 响应只回 LTAI…abcd / sk-…abcd 这种提示,不回明文密钥。

凭据和插件本体怎么隔开

凡是「绑第三方账号」的插件都按同一条规矩做,这个插件是第一个落地样本:

层放哪有没有进仓库
面板里填的密钥$DSH_HOME/student-perks/state.json(默认 %USERPROFILE%\.dsh\student-perks\state.json)永不进 —— 这个路径在插件目录之外
环境变量ALIBABA_CLOUD_ACCESS_KEY_ID / _SECRET、DEEPSEEK_API_KEY不进 —— 只写变量名,不写值
账号会话 token$DSH_HOME/.credentials.yaml(DSH 登录桌面版时自己写的)不进 —— 只读引用
配置文件cordis.patch.yml 里 aliyunAccessKeyId / apiKey 留空进仓库,但值是空串

仓库侧的防线有三道:.gitignore 拦掉 state.json / .env / cookies*.json / *.pem 这类文件;cordis.patch.yml 只允许出现变量名(aliyunKeyIdEnv: ALIBABA_CLOUD_ACCESS_KEY_ID),出现明文值就被拦;发布脚本 dsh-plugins/scripts/add-plugin.mjs 在登记前再扫一遍明文密钥与凭据文件,命中直接中止。

所以:换了电脑,插件照装,钥匙要重新填一次;反过来说,仓库被人看光也拿不到任何账号。

共享这台机器的第二个人要注意:state.json 是本机明文(写权限 0600),能读你用户目录的人就能读到——那已经不是插件该管的边界了。

端点

方法路径作用
GET/dsh-student-perks/state.json快照(券视图 + 阿里云账户 + 余额缓存)
POST/dsh-student-perks/refresh.json两边都强制刷新一次
POST/dsh-student-perks/deepseek.json存/清 API Key、改 baseUrl({"apiKey":null} 清空)
POST/dsh-student-perks/aliyun.json存/清 AccessKey(accessKeyId/accessKeySecret/endpoint)或改手动券状态(claimed/expiresAt/amount/link),带 "refresh":true 时立刻重查

写请求只接受回环 Host;快照里没有明文密钥。缓存默认 5 分钟(refreshMs),阿里云和 DeepSeek 各算各的;某个接口失败时保留上一轮数字,只把错误写进 error。

配置

见 cordis.patch.yml:aliyunAmount、aliyunLink、aliyunAccessKeyId、aliyunAccessKeySecret、aliyunKeyIdEnv、aliyunKeySecretEnv、aliyunKeyIdRef、aliyunKeySecretRef、aliyunEndpoint、apiKey、apiKeyEnv、credentialsRef、baseUrl、refreshMs、timeoutMs、autoRefresh、controlRoute。

controlRoute: false 时不注册任何端点,胶囊退化成静态提示(券状态与余额都读不到,显示 … / 未配置)。

本地状态

{
  "version": 2,
  "aliyun": { "claimed": false, "claimedAt": null, "expiresAt": null, "amount": null, "link": null },
  "aliyunCreds": { "accessKeyId": "LTAI…", "accessKeySecret": "…", "endpoint": "cn", "updatedAt": 1763500000000 },
  "aliyunCache": {
    "at": 1763500000000,
    "cash": { "available": "12.34", "cash": "10.00", "credit": "0.00", "mybankCredit": "0.00", "currency": "CNY" },
    "coupons": [{ "id": 123, "no": "…", "amount": 300, "balance": 300, "state": "available", "expiresAt": 1820000000000, "note": "高校学生 300 元无门槛券" }],
    "error": null
  },
  "deepseek": { "apiKey": "sk-…", "baseUrl": "", "updatedAt": 1763500000000 },
  "cache": { "at": 1763500000000, "currency": "CNY", "total": "12.34", "granted": "0.00", "toppedUp": "12.34", "available": true, "error": null }
}

原子写(先写 .tmp-<pid> 再 rename)。删掉这个文件等于恢复出厂设置。

开发

node --test test/host.test.js test/client.test.js test/aliyun.test.js

测试全用假 fetch,不会打真接口,也不需要任何密钥。

Comments

Loading…

From the same category

reactive-resume

DeepSeek Harness plugin for Reactive Resume: bridges your resumes and job applications into a Harness session over MCP.

Tools & CapabilitiesManifest valid

★ 41.7k

↓ 58/wk

MIT

Aug 24, 2026

dsh plugin --profile web add dsh-plugin-reactive-resume

by dsh-market

The plugin market inside DeepSeek Harness — browse, search, one-click install · DSH 可视化插件市场

Tools & CapabilitiesManifest valid

★ 13.3k

↓ 275.8k/wk

MIT

TypeScript

Nov 23, 2026

dsh plugin --profile web add dshmarket

by kingcharleslzy-ai

Community-maintained dsh-purge fork with host-policy patches, prompt and rule settings, diagnostics, separate update-check and install controls, and local backup/rollback.

Tools & CapabilitiesTerminal & ClientsManifest valid

★ 12k

MIT

JavaScript

Nov 18, 2026

dsh plugin --profile web add dsh-purge-community

by Tencent

Let AI agents use your real, logged-in browser without interrupting your work. CLI + extension for browser automation across any shell-capable AI agent.

Tools & CapabilitiesManifest valid

★ 10.7k

↓ 17.5k/wk

MIT

TypeScript

Nov 23, 2026

dsh plugin --profile terminal add @wxg-prc-cpg/browser-skill-dsh-plugin

by superdesigndev

OpenRouter for agent tools. Join community here: https://discord.gg/6mQYYfFMAn

Tools & CapabilitiesManifest valid

★ 8.8k

NOASSERTION

Python

Nov 24, 2026

dsh plugin --profile web add treg-dsh

by yjh051108

dsh-routing-suite — injector + router-standard kit: install the runtime injector first, then the task-aware reasoning-mode router preset (measured P1-P23).

Tools & CapabilitiesManifest valid

★ 7k

MIT

JavaScript

Sep 18, 2026

dsh plugin --profile web add @dsh-external/dsh-super-injector