sandbase-harness
sandbaseai
Local-first, self-hosted AI agent runtime and MCP bridge with sandboxed sessions, memory, credentials, audit/replay, and a local Console.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:LucasleeCN/dsh-token-api
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
DeepSeek Harness 官方 Web UI 的客户端插件:在界面右下角注入一个紧凑的浮动面板,
展示当前会话的 API Token 用量、上下文窗口占用、推理等级和费用估算。
UI 使用 Harness 官方设计变量(--dsw-alias-*),自动适配浅色/深色主题,并参考
Claude Code 的紧凑信息框布局。
| 项 | 内容 |
|---|---|
| 仓库 | https://github.com/LucasleeCN/dsh-token-api |
| 插件类型 | dsh.client 双面包(Web UI 客户端插件) |
| 最新版本 | 1.0.0 |
| 许可证 | MIT |
| 发现方式 | GitHub topic dsh-plugin |
session.list RPC 返回的 projection:tokenUsage:输入 / 输出 / 缓存读 / 缓存写 token;contextPressure:上次请求压力、下次预计压力、上下文窗口;sessionStats:步骤数与耗时等会话统计。session.models 显示当前模型,并读取模型支持的推理等级。off / high / max 等推理等级,
内部调用官方 session.selectModel RPC。https://api-docs.deepseek.com/zh-cn/quick_start/pricing/,通过同源路由
/plugins/dsh-client-ui-token-billing/pricing 提供给浏览器,避开跨域限制。localStorage。dsh-client-ui-token-billing/
├─ package.json
├─ cordis.patch.yml
├─ CHANGELOG.md
├─ lib/
│ ├─ index.js # Host 半侧(官方价格抓取 + 同源价格路由)
│ └─ client.js # Browser 半侧(浮动面板)
├─ test/
│ └─ client.test.mjs
└─ .github/workflows/
├─ check.yml
└─ release.yml
该插件是一个标准的 dsh.client 双面包,必须能被 profile 的
ctx.baseUrl 解析到(通常就是 profile 自己的 node_modules)。
从 Git 安装(推荐):
{
"dependencies": {
"dsh-client-ui-token-billing": "github:LucasleeCN/dsh-token-api"
}
}
也可以从 GitHub Release 下载 dsh-client-ui-token-billing-1.0.0.tgz 后解压到
<DSH_HOME>/profiles/web/node_modules/dsh-client-ui-token-billing。
将插件目录复制或链接到 profile 可解析的位置,例如复制到
<DSH_HOME>/profiles/web/node_modules/dsh-client-ui-token-billing。
编辑 <DSH_HOME>/profiles/web/package.json:
{
"dependencies": {
"dsh-client-ui-token-billing": "github:LucasleeCN/dsh-token-api"
},
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-web-app",
"dsh-client-ui-token-billing"
]
}
}
}
重启 DeepSeek Harness Web。
将插件目录复制到 <DSH_HOME>/profiles/web/node_modules/dsh-client-ui-token-billing。
编辑 <DSH_HOME>/profiles/web/cordis.patch.yml:
- insert:
- id: ui-token-billing
name: 'dsh-client-ui-token-billing'
config:
enabled: true
重启 DeepSeek Harness Web。
重启后打开 Harness Web UI,右下角出现 Token 胶囊按钮;点击展开面板。
如果页面已经打开,刷新即可(dsh web 会注入新的 boot manifest)。
也可以直接调用 RPC 确认数据源可用:
POST /api/session.list
Content-Type: application/json
{
"type": "client-request",
"rpcId": "manual-check",
"method": "session.list",
"payload": {}
}
返回中的 items[].projections.values.tokenUsage 即本插件展示的原始数据。
当前 / 高峰 / 空闲 / 手动)。localStorage(键:dsh-client-ui-token-billing.prices.v1)。每次推送 v* 标签,GitHub Actions 会自动:
npm run checknpm pack.tgz 附件git tag v1.0.0
git push origin v1.0.0
dsh-plugindeepseek-harness、dsh、plugin、token-billingnpm run check # 语法检查 + 测试
npm test # 运行测试
测试包括:
node:vm 加载 lib/client.js,以模拟的 session.list /
session.models RPC 返回验证面板渲染、费用计算、推理等级展示和
未配置价格提示。MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: token-billing。