Skip to content
dsh.fish
Bundle

deepseek-status-monitor

DSH 对话页时段状态显示器:根据当前时段(低谷/过渡/高峰)在对话页浮层显示对应插画,引导用户在低谷时段使用。

Source
rison114514
stars
1 stars
License
MIT
Updated
Updated 22 days ago

Readme

# DeepSeek Status Monitor

DSH(DeepSeek Harness)对话页时段状态显示器。

根据当前时段,在对话页浮层显示对应插画,引导用户在**低谷时段**使用,控制使用成本。

## 时段划分

| 时段 | 触发 | 视觉 | 提示 |
|------|------|------|------|
| **低谷** (`low`) | `lowHours` 中包含当前小时 | 半透明静态图 + 缓慢呼吸 | 推荐使用,价格低 |
| **过渡** (`transition`) | `transitionHours` 中包含当前小时 | **红灯闪烁** + 警示边框脉冲 | 低谷即将结束 |
| **高峰** (`peak`) | `peakHours` 中包含当前小时 | 深色化 + 静默警示 | 价格高,谨慎使用 |
| 非配置时段 | — | 完全隐藏 | — |

## 安装

### 方式一:放入 `~/.dsh/bundles/`(推荐)

```sh
# 1. 拷贝整个目录
cp -R deepseek-status-monitor ~/.dsh/bundles/

# 2. 启动时启用
npx @deepseek-ai/dsh web --patch ~/.dsh/bundles/deepseek-status-monitor/cordis.patch.yml
```

### 方式二:作为 npm 包安装

在你的 profile 目录运行:

```sh
dsh plugin --profile web add /path/to/deepseek-status-monitor
```

会自动读取 `package.json` 中的 `dsh.bundle` / `dsh.client` 字段并加入 bundle 层。

### 方式三:直接放入 bundles 目录(仅用于快速验证)

```sh
mkdir -p ~/.dsh/bundles/deepseek-status-monitor
cp -R deepseek-status-monitor/* ~/.dsh/bundles/deepseek-status-monitor/
```

## 配置

完整配置见 `config.example.json`,通过 patch 文件覆盖 `cordis.patch.yml` 中的默认值。

最常用的自定义:

```yaml
plugins:
  - id: status-monitor
    config:
      lowHours: [0, 1, 2, 3, 4, 5, 6, 12, 13, 14, 15]
      transitionHours: [17]
      peakHours: [18, 19, 20, 21]
      opacity: 0.65
```

> ⚠️ dsh patch 是**整条 config 替换**,不是深度合并。要修改任何字段,都要把全部字段写出来(详见使用教程 §6.4)。

## 资源

插件启动时会按 phase 加载对应图片。**三张位图都是基于同一位用户(你自己)的真人照片制作**:

| 资源 | 路径 | 来源 | 说明 |
|------|------|------|------|
| 低谷期 | `assets/low.png` | `image#1`(蓝西装"嘘"手势照) | 已包含;缺失时降级为 CSS 蓝色渐变占位 |
| 过渡期 | `assets/transition.gif` | 你上传的 mp4(生成虚弱状态角色图片.mp4)逐帧 rembg 去背景 + 透明化 | 已包含;虚弱喘气循环动画,**手绘风虚线警示边框 + 红灯脉冲由浮层 CSS 实现** |
| 高峰期 | `assets/peak.png` | `image#3`(手绘风疲惫人物)+ rembg 透明合成 | 已包含;透明背景,**残血红边效果由浮层 CSS 实现** |

> 重新生成任意一张的步骤见 [`assets/README.md`](./assets/README.md)。

降级占位仍能传达时段语义(颜色 + 动画节奏),但视觉表达力弱于位图。

## 与其他插件互不干扰的保证

- `z-index: 2147483647`(32-bit 有符号整型上限)— 浮于所有元素
- `pointer-events: none` — 不拦截任何鼠标/触摸事件
- `aria-hidden: true` — 不污染 a11y 树
- `user-select: none` — 不会意外选中浮层文字
- 单 `<style data-dsh-plugin="status-monitor">` 标签 — 卸载时精准移除,无样式泄漏
- 所有 class / id 加 `dsh-sm-` / `#dsh-status-monitor-overlay` 前缀 — 不与 DSH 核心样式冲突

## 卸载

移除 `~/.dsh/bundles/deepseek-status-monitor/` 目录,并在下次启动时省略 `--patch` 参数即可。Cordis 的依赖声明 + effect disposer 保证:插件文件消失后,正在运行的 Harness 也会自动卸载(**不需要重启**)。

## 开发

本插件是纯 ESM JavaScript,**无构建步骤**,DSH 直接加载 `index.js`(服务端)与 `client.js`(客户端)。

```sh
# 本地实时开发:把目录 symlink 进 profile 的 node_modules,改完重启 dsh web 即生效
ln -sfn /path/to/deepseek-status-monitor \
       ~/.dsh/profiles/web/node_modules/deepseek-status-monitor
```

修改 `index.js` / `client.js` 后,重启 `dsh web` 即可看到变化。
也可以用 `preview/index.html` 本地预览浮层效果,无需启动 DSH。

## 目录结构

```
deepseek-status-monitor/
├── README.md               # 本文件
├── package.json            # 包定义(含 dsh.bundle / dsh.client 字段)
├── cordis.patch.yml        # cordis insert patch(启用插件 + 默认配置占位)
├── config.example.json     # 时段配置示例
├── index.js                # 服务端 Cordis Service:静态资源路由 + 设置面板
├── client.js               # 客户端浮层 DOM/CSS + 时段判断 + 配置卡片
├── preview/
│   └── index.html          # 本地预览页(mock DSH 聊天界面,无需启动 DSH)
└── assets/
    ├── README.md           # 三张插画的来源、节点 ID、重制方法
    ├── low.png             # 低谷期:image#1 去背景透明化
    ├── transition.gif      # 过渡期:mp4 逐帧去背景透明化的虚弱喘气循环动画(GIF,兼容性最好)
    ├── transition.apng     # 同源高质量备选(真 alpha, 17MB,可选)
    └── peak.png            # 高峰期:image#3 rembg 去背景透明 16:9
```

## License

MIT

Install

dsh plugin --profile web add github:rison114514/deepseek-status-monitor

Profile: web

  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source