Rainronin/dsh-balance-monitor2

@rainronin/dsh-balance-monitor

DSH 插件:DeepSeek API 余额实时监测,支持官方快照、查询工具及双风格侧边栏徽章。

AI 分析

核心用途是多维度监测 DeepSeek 余额,支持会话内查询和侧边栏徽章显示。适合需要直观掌控 API 额度与计价状态的用户。

包名
@rainronin/dsh-balance-monitor
版本
0.1.0
许可证
MIT
最近更新
2026年8月16日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Rainronin/dsh-balance-monitor

Usage

In-session query — just ask the agent:

查一下 DeepSeek 余额 / check my DeepSeek balance

Sidebar badge — at the sidebar footer next to Settings: 刷新 force-refreshes past the cache; polling follows the host-configured interval (30s by default); the collapsed (rail) state shows a single status lamp (green = 连接正常, amber = degraded). The 原生/矩阵 button switches between the Matrix CRT badge and a native dsh style; the choice is remembered in localStorage.

Configuration

KeyDefaultMeaning
apiKeyEnvDEEPSEEK_API_KEYCredential reference (env var name); change for a different account
cacheTtlMs30000Cache lifetime in ms
pollIntervalMs30000Background polling interval in ms
injectEveryTurnfalseWhether to inject the balance into context every turn (opt-in; the badge and ds_balance tool are on by default)
requestTimeoutMs5000Official-API request timeout in ms

Override in the profile's cordis.patch.yml:

- id: balance-monitor
  config:
    cacheTtlMs: 10000
    pollIntervalMs: 10000

使用

会话内查询——直接让 agent 查:

帮我查一下 DeepSeek 余额

侧边栏徽章——侧边栏底部(Settings 旁):刷新 按钮穿透缓存立即刷新; 轮询间隔跟随 host 配置(默认 30s);折叠态(rail)显示单色状态灯(绿 = 连接正常, 琥珀 = 异常)。原生/矩阵 按钮在 Matrix CRT 徽章与 dsh 原生风格之间切换,选择 保存在 localStorage

配置

默认值说明
apiKeyEnvDEEPSEEK_API_KEY凭证引用名(环境变量名),多账号时改这里
cacheTtlMs30000缓存有效期(毫秒)
pollIntervalMs30000后台轮询间隔(毫秒)
injectEveryTurnfalse是否每轮注入余额到模型上下文(默认关闭,按需开启)
requestTimeoutMs5000官方接口请求超时(毫秒)

覆盖示例(profile 的 cordis.patch.yml):

- id: balance-monitor
  config:
    cacheTtlMs: 10000
    pollIntervalMs: 10000