其他
完整应用
deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:Yogioo/dsh-balance
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
DeepSeek API 余额显示插件(dsh bundle):在 dsh web 的对话输入框下方常驻显示账户剩余金额,每 60 秒自动刷新,并为模型提供 check_balance 工具。
中文 | English
DeepSeek 余额:¥xx.xx,悬停显示赠送/充值明细check_balance,直接对 agent 说"查下余额"即可credentials 服务解析 DEEPSEEK_API_KEY),浏览器只拉取宿主缓存的 JSON 摘要dsh.bundle,安装后自动加入 profile 层并挂载自身 patch,无需手改任何配置文件对话输入框下方(与上下文统计同一排)显示一行小字:
DeepSeek 余额:¥14.39
赠送 0.00 / 充值 14.39fetch)credentials 服务可解析 DEEPSEEK_API_KEY(通常位于 $DSH_HOME/.credentials.yaml)dsh plugin --profile web add git+https://github.com/Yogioo/dsh-balance.git
安装器自动把 dsh-balance 追加到 dsh.profile.bundles(因为包声明了 dsh.bundle),自带 patch 完成挂载。重启 dsh web 后生效,刷新页面即可看到读数。
dsh plugin --profile web add ./dsh-balance-0.1.0.tgz
dsh plugin --profile web add file:C:/projects/dsh-balance
dsh --profile web --dump-config # 组合树中应出现 # == dsh-balance 行
curl http://127.0.0.1:3080/balance # 返回余额 JSON
默认无需配置。如需覆盖,在 profile 的 cordis.patch.yml 中按行 id 覆盖(整行替换 config):
- id: dsh-balance
config:
baseUrl: https://api.deepseek.com # 供应商 API 根地址
apiKeyEnv: DEEPSEEK_API_KEY # 凭据引用名(credentials 服务解析)
refreshMs: 60000 # 自动刷新间隔(毫秒)
routePath: /balance # webServer 路由路径
┌─────────────────────────────── 宿主进程 (Node) ───────────────────────────────┐
│ dsh-balance (lib/index.js) │
│ credentials.resolve('DEEPSEEK_API_KEY') → fetch(/user/balance) → 缓存 state │
│ ├─ ctx.interval(60s) 自动刷新 │
│ ├─ webServer route GET /balance → JSON(state) ← 浏览器同源拉取 │
│ └─ tools.register(check_balance) ← 模型可调用 │
└──────────────────────────────────────────────────────────────────────────────┘
▲
同源 fetch('/balance')(每 60s)
│
┌─────────────────────────────── 浏览器页面 ─────────────────────────────────────┐
│ dsh-balance (lib/client.js) │
│ conversation.composer.dock 槽位 → 常驻读数小部件 │
└──────────────────────────────────────────────────────────────────────────────┘
关键设计:
main → lib/index.js(宿主),exports["./client"] → lib/client.js(浏览器),dsh.client.platform: "web" 声明客户端入口,由 dsh 的 client-modules 扫描进 Web 启动图dsh-balance/
├── package.json # dsh.bundle.patch + dsh.client(web) 声明
├── cordis.patch.yml # bundle 自带的挂载 patch(插入 dsh-balance 行)
├── lib/
│ ├── index.js # Host 半区:查询/缓存余额 + /balance 路由 + check_balance 工具
│ └── client.js # Client 半区:输入框下方常驻读数小部件(编译后的 bundle 格式)
├── README.md
├── README.en.md
└── LICENSE
lib/client.js 后需重启 dsh web(client 模块图在启动时扫描,包元数据带缓存)npm pack # 生成 dsh-balance-<version>.tgz(已加入 .gitignore,不进版本库)
dsh plugin --profile web remove dsh-balance
MIT © Yogioo
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。