DeepSeek Harness Plugin Hub

Publish and manage complete Harness Profiles. Discover Plugins for your next setup.

Explore

PluginsPresetsDocsNews

Community

Publish a pluginContactReport an issue

Resources

Plugin Hub on GitHubDeepSeek HarnessSystem statusPrivacy notice
© 2026 DeepSeek Harness Plugin HubPowered byPaxTech

Independent and unofficial. Not affiliated with, authorized by, or endorsed by DeepSeek.

DeepSeek Harness Plugin Hub
ProfilesPluginsCategoriesNewsDocsSign inManage Profiles
ProfilesPluginsCategoriesNewsDocsSign in
← Plugins

dsh-ai-monitor

Ai Monitor

DeepSeek Harness plugin: query AI Monitor balance / usage from local SQLite — cost-aware agent, auto bookkeeping with the AI Monitor proxy.

The plugin will be installed here. Keep web if you are unsure.

npx -y @deepseek-ai/dsh plugin --profile web add dsh-ai-monitor@0.1.0
READMECompatibilityVersions

Compatibility and provenance

Ai Monitor is published as dsh-ai-monitor and currently resolves to version 0.1.0. The Hub verifies its manifest and preserves the exact installation source for reproducible installs.

DSH compatibility
*
Runtime surfaces
any
Release source
npm
Registry updated
9/20/2026

Versions

0.1.0stable
8/14/2026

Related plugins

Loading related plugins…

Latest
0.1.0
DSH
*
HMR
Process restart
Tree shaking
Safe tree shaking not declared
Unpacked size
12.6 kB
Files
5
Surface
any
License
MIT
Source
npm
GitHub
★ 1
Weekly downloads
28
Last push
8/13/2026
View source ↗Project homepage ↗
README badge

Click the badge to copy Markdown for your README.

Do you maintain this Plugin?Claim benefit · Priority security scan

Verify the GitHub repository declared in package.json to manage this listing. After you claim it, Hub will prioritize a security scan of the current version and publish the result when it passes.

Claim this Plugin →
Report an issue
Ai Monitor — DSH Plugin for DeepSeek Harness

Related plugins

More verified plugins in models-usage.

Whale Widgetdsh-whale-widgetDeepSeek balance whale widget in the bottom-right corner of the DSH Web interface: balance/today’s usage/peak-off-peak pricing, customizable bubble click sequence (text/balance/today/peak-off-peak/image/random phrases and parallel weighted selection), per-line styles and fonts, floating quick editinUsage Stats@ychris12138/dsh-usage-statsToken usage heatmap, provider balances, and subscription quotas for the dsh web GUICodex Connectdsh-codex-connectChatGPT OAuth and Codex models for DeepSeek Harness.Ui Usage Billing@kenz1117/dsh-ui-usage-billingUsage billing dashboard for DeepSeek Harness: sidebar cost metrics plus a full dashboard modal, priced from a current multi-provider catalog with real usage aggregated from session logs.

README

dsh-ai-monitor — DeepSeek Harness 插件

AI Monitor 与 DeepSeek Harness 的桥接插件:让 dsh agent 在跑任务前能感知 AI 预算, 任务后能汇报账单。只读本机 AI Monitor SQLite,不改动其数据。

安装(npm 发布后)

# 方式一:直接添加到 dsh profile
cd ~/.dsh/profiles/web
npm install dsh-ai-monitor

# 方式二:dsh CLI(若已支持 plugin add)
dsh plugin add dsh-ai-monitor

然后在 dsh 启动时叠加 bundle(或通过 profile 引用)加载插件。

前置要求

  • 本机已安装并运行 AI Monitor,且至少添加了一个账户
  • dsh 已配置好模型(Settings → Models 填入 API key)
  • 数据库路径:~/Library/Application Support/com.ai-monitor.app/ai-monitor.db(可用 DSH_AI_MONITOR_DB 环境变量覆盖)

功能

  • query_ai_balance 工具:查询各 AI 平台账户余额 + 今日 token 用量 + 消耗金额
  • 数据来源:AI Monitor 本地 SQLite
  • 只读模式(readonly: true + WAL 兼容),不锁库、不改数据

配合 AI Monitor 代理使用(推荐)

把 dsh 的 LLM 请求也指向 AI Monitor 本地代理(127.0.0.1:8899),可以实现自动记账闭环:

# ~/.dsh/settings.yaml
llm-deepseek:
  baseURL: http://127.0.0.1:8899/v1

这样 dsh 的每次调用都会自动进入 AI Monitor 账本,agent 又能通过本插件查询余额—— 形成一个「消耗可查、余额可知」的完整闭环。

目录结构

ai-monitor-dsh-plugin/
├── package.json          # dsh.bundle manifest(发布用)
├── cordis.patch.yml      # 补丁层:把插件插入 web profile
├── tsconfig.json         # TS 编译配置(src → .)
├── src/index.ts          # 插件源码(TS)
├── index.js              # 编译产物(dsh 实际加载的 JS)
└── node_modules/         # better-sqlite3(原生模块)

本地开发 / 加载

# 1. 安装依赖
cd ai-monitor-dsh-plugin
npm install better-sqlite3
npx tsc                          # 编译 src/index.ts → index.js

# 2. 生成带补丁的启动配置
cat > /tmp/patch-abs.yml << 'EOF'
- insert:
    - id: ai-monitor
      name: '/绝对路径/ai-monitor-dsh-plugin/index.js'
EOF

# 3. 启动(需先停掉已有 dsh)
pkill -f "dsh" ; sleep 2
cd ai-monitor-dsh-plugin
nohup dsh --profile web --patch /tmp/patch-abs.yml > /tmp/dsh-web-plugin.log 2>&1 &

# 4. 验证加载成功(日志应出现)
tail /tmp/dsh-web-plugin.log
# [ai-monitor] plugin loaded. db=...

验证记录(2026-08-14)

  • ✅ dsh --patch xxx --dump-config 确认补丁合成进配置树
  • ✅ 带补丁启动,日志出现 [ai-monitor] plugin loaded. db=/Users/chen/Library/Application Support/com.ai-monitor.app/ai-monitor.db
  • ✅ 查询 SQL 独立验证:DeepSeek 余额 ¥8.16、今日 27.7 万 tokens / 约 ¥2.15
  • ✅ 端到端验证通过(用户实测):在 dsh Web UI 配置 DeepSeek API key 后,agent 成功调用 query_ai_balance, 返回真实数据——DeepSeek 余额 ¥8.07、今日 281K tokens / 约 ¥2.25,并自动附带数据边界说明

发布到 npm(bundle 形式)

  1. 改 package.json 的 dsh.bundle.patch 指向 ./cordis.patch.yml(已是)
  2. cordis.patch.yml 中插件 name 应为包名(如 dsh-ai-monitor),不要用绝对路径
  3. 发布:npm publish(确保 files 包含 index.js、cordis.patch.yml、README.md)
  4. GitHub 仓库加 dsh-plugin topic,便于社区发现
  5. 用户安装:dsh plugin add dsh-ai-monitor

后续方向

  • 方案 C(已完成 2026-08-14):dsh 模型请求走 AI Monitor 代理自动记账

    • 配置:~/.dsh/settings.yaml 加 llm-deepseek.baseURL: http://127.0.0.1:8899/v1
    • 原理:dsh 的 deepseek 适配器原生支持 baseURL 覆盖(config → $DEEPSEEK_BASE_URL → 官方默认), API key 不变,协议不变;每次请求动态重读配置,无需重启
    • 验证:ping 请求后 usage_events ID +5、今日 tokens +769/+1187、花费 +¥0.004,代理路由真实生效
    • 注意:8899/v1 默认路由 → DeepSeek;其他平台用对应前缀(moonshot/siliconflow/openrouter/openai)
  • 余额告警工具:agent 检测到余额低于阈值时主动提醒用户充值

  • 成本感知路由:查询结果参与模型选择(余额紧张切便宜模型)

  • 导出工具:把 AI Monitor 月度账单拉到对话里

  • Windows 支持:通过 DSH_AI_MONITOR_DB 环境变量指定数据库路径(已支持,待实测)

数据边界

  • 只统计本机经过 AI Monitor 代理(127.0.0.1:8899)的调用;其他机器/直连不计入
  • 插件只读,不写 AI Monitor 的任何数据