Releases: SeverusZh/dsh-ollama-usage
Releases · SeverusZh/dsh-ollama-usage
Release list
v0.1.3 — 修复 webServer 路由注册被跳过
⚡ dsh-ollama-usage v0.1.3
修复启动时 RPC 路由注册被跳过的问题
修复 Fix
- 此前插件在
apply()里用ctx.get('webServer')软读取宿主服务,但 Cordis 启动时序上该服务尚未激活(提供方 fiber 未就绪),导致启动日志报[ollama-usage] webServer 服务不可用,跳过 RPC 路由注册,/ollama-usage前缀路由未注册,客户端用量面板无法取数。 - 修复方式:
inject声明['timer', 'webServer'](与 dsh-client-connection、dsh-yolo-mode/bridge 一致),Cordis 会等待 webServer 可用后再调用apply,路由注册不再依赖启动顺序。 - 保留诊断日志:成功注册时打印
[ollama-usage] RPC 路由已注册: /ollama-usage。
验证
- Cordis 集成测试:异步 webServer 提供方场景下,旧版跳过注册、新版成功注册
- 17 项桥接冒烟测试全部通过
安装
dsh plugin --profile web add dsh-ollama-usagev0.1.1 — API Key 描述修正
dsh-ollama-usage v0.1.1
修正 Fix
- 移除「API Key 以 ollama- 开头」的错误描述(Ollama API Key 并无该前缀),同步修正客户端登录引导文案、README 与 npm 元数据。
- 其余功能与 v0.1.0 一致。
安装
dsh plugin --profile web add dsh-ollama-usagev0.1.0 — Ollama Cloud 用量余量可视化
⚡ dsh-ollama-usage v0.1.0
Ollama Cloud 用量余量可视化 · DeepSeek Harness 插件
首个正式版本 🎉 —— 可视化 Ollama Cloud 账号的用量余量(每 5 小时会话用量 + 周用量),
数据来自官方接口 GET https://ollama.com/api/usage,与 ollama.com 设置页一致。
✨ 功能
| 能力 | |
|---|---|
| 🎯 | 会话用量(每 5 小时):5h 会话配额,置顶展示「已用 X% · 剩余 Y%」 |
| 📅 | 周用量(Weekly):本周配额进度 |
| 🎨 | 侧边栏极简双横条:会话 5h 淡紫 + 周用量深紫,各带百分比,悬停详情,60s 自动更新 |
| 🖥️ | 设置页完整面板:周期起止、近 4 周费用、模型请求数排行、最近 5 条会话用量历史 |
| 💾 | 持久化:Key 与快照写入 $DSH_HOME/storages/ollama-usage/usage.json(600 权限),跨对话/重启恢复 |
| 🔄 | 自动刷新:Host 每 10 分钟查询(页面关闭也持续),Key 失效自动清除并提示 |
| 🔑 | 登录引导:一键打开 ollama.com/settings 登录、settings/keys 创建 API Key;兼容 ~/.ollama/auth.json |
📦 安装
dsh plugin --profile web add dsh-ollama-usage
dsh --profile web🚀 使用
- 设置 → Ollama 用量 → 按引导登录并粘贴 API Key 检测
- 展开侧边栏即可看到底部双横条常驻显示
- 面板可随时查看详情、历史,或「清除已存 Key」
📝 说明
- 架构:宿主
lib/index.js(webServer RPC 桥/ollama-usage,四个端点
check / snapshot / forget / auth-state)+ 客户端 bundlelib/client.js - 17 项桥接冒烟测试全部通过
- 首个版本:无历史包袱,功能即上文所列
🔗 链接
- npm:dsh-ollama-usage
- 源码:SeverusZh/dsh-ollama-usage
- 许可:MIT