bowen507
dsh-whale-switch
DeepSeek Harness minimal on/off loop: a shortcut opens the web UI, an animated whale dives to shut it down (鲸鱼开关:快捷方式开、动画退出)
- Stars
- 0
- Language
- TypeScript
- Created
- Aug 15, 2026
- Updated
- Aug 15, 2026
Introduction
dsh-whale-switch 🐋
最小足迹的 DeepSeek Harness 开关闭环:快捷方式打开,鲸鱼跃水退出。
在 DeepSeek Harness(DSH)Web 上,用最小的改动解决"开/关"问题:
- 开:桌面快捷方式 → 无终端窗口、无编译地后台启动
dsh web,就绪后自动打开浏览器(优先预构建lib,其次 PATH 的dsh,最后npx兜底)。 - 关:两只小鲸鱼共用一条退出链路(先向 host 请求
appExit(0)优雅关进程,再关标签页):- 会话右上角一只 30px 小鲸鱼——悬停时它跃出水面(16 帧升起),点击时俯冲入水(16 帧下落 + 水花);
- 新建对话界面(header 隐藏处)一只无边框蓝色鲸鱼——运行时从雪碧图抠白染蓝,在对话背景里 DVD 式漫游(只在中列、永远在标题和输入卡后面,到不了工作区/详情栏),鼠标靠近停住,点击入水退出。
特性
| 🎬 16 帧逐帧动画 | 悬停武装(1→8 升起)→ 点击开火(9→16 俯冲+水花)→ 离开倒放;严格切帧,无补间/形变 |
| 🐋 背景漫游鲸鱼 | 新建对话界面专属:canvas 抠白染蓝 → 透明底蓝鲸,z-index 0 直插对话滚动体(在 hero 内容之后、仅中列),DVD 式漫游,指针靠近即停,点击入水退出;尊重 prefers-reduced-motion |
| ⚡ 最小足迹 | 一个启动脚本 + 一个小插件;无桌面壳、无额外运行时、无编译(预构建 lib) |
| 🛡️ 防误触 | 悬停本身就是确认:不悬停到第 8 帧无法"武装",点击才触发 |
| 🧹 优雅退出 | 经 launcher 的 ctx.appExit(0) 先释放应用树再退出;关闭标签页前先确保退出请求已送达 |
| 🔁 常驻 | 静态 web 插件(junction + profile patch 登记),进程重启后依然存在 |
| 🔌 免编译安装 | 把目录交给 DSH 内的 agent,读 INSTALL.md 即可完成全套安装与本机环境适配 |
安装
把整个 dsh-whale-switch 目录放到 agent 可访问的位置,然后对它说:
"把这个包安装到我的 harness,适配本机环境。"
Agent 会按 INSTALL.md 完成:环境探测 → 安装启动器 + 桌面快捷方式 → junction 挂载插件 → 登记 patch → 重启一次 → 验证。
手动安装(可选,Windows):见 INSTALL.md 第 1–3 节。
使用
- 双击桌面 DeepSeek Harness 快捷方式启动。
- 浏览器打开后,把鼠标移到右上角 session log 左侧的鲸鱼上:它跃出水面并出现红圈(武装态)。
- 点击:它俯冲入水,标签页关闭,进程优雅退出。
- 中途移开鼠标:鲸鱼倒放回水面,不会误触发。
- 在新建对话(空白 hero)界面:一只无边框蓝鲸在背景里 DVD 式漫游(只在中列、标题和输入卡之后);鼠标靠近它会停住并出现红圈,点击同样入水退出。正常对话里它自动消失(右上角小鲸鱼接管)。
交互细节
- 平时显示第 1 帧(静态 logo)
- 悬停:40ms/帧播放帧 2→8(升起),到达顶点停住 + 红色光环
- 点击:40ms/帧播放帧 9→16(俯冲入水 + 水花),帧 16 保持 80ms
- 播放结束后:先向 host 发送退出请求(
/dsh-whale-switch/exit→appExit(0)),响应后关闭标签页;1.5s 兜底防止标签页卡住 - 播放中忽略重复操作
- 漫游鲸鱼:72px 透明蓝鲸(雪碧图 16 帧全量抠白染蓝),56px/s 斜向匀速 + 边缘反弹;指针进入 90px 半径即停止漫游并播放跃起动画(1→8 帧,武装态),移开倒放回落;点击播放俯冲动画(9→16 帧)后退出;
prefers-reduced-motion: reduce时停驻右下角不漫游、点击直接退出
兼容性
- DeepSeek Harness
0.1.0-rc.5(web profile,含webServer与conversation.session.header.utilities槽位) - Windows(PowerShell 启动器 + NTFS junction);Linux/macOS 需把 junction 换成 symlink(见 INSTALL.md)
- 浏览器需支持
background-size百分比定位与color-mix(现代 Chrome/Edge/Firefox 均可)
目录结构
dsh-whale-switch/
├── plugin/ # 鲸鱼退出插件(lib/ 预构建 + src/ 源码 + 素材)
├── launcher/ # launch-dsh.ps1(启动)+ create-shortcut.ps1(建快捷方式)+ restart-dsh.ps1(重启)
├── INSTALL.md # ★ agent 安装指南
├── README.md
├── LICENSE # MIT
└── NOTICE # 素材来源
License
MIT。雪碧图素材为 AI 生成(见 NOTICE),随包以 MIT 分发。
dsh-whale-switch 🐋 (English)
A minimal-footprint on/off loop for DeepSeek Harness: a shortcut opens it, a diving whale closes it.
- Open: a desktop shortcut starts
dsh webin the background (no console window, no compilation — prefers prebuiltlib, falls back to PATHdsh, thennpx) and opens the browser when ready. - Close: a 30px whale in the session header rises out of the water on hover (16-frame sprite), dives with a splash on click, then gracefully shuts the process down and closes the tab. On blank new-conversation screens (where the header is hidden) a borderless blue whale (sprite art chroma-keyed at runtime) swims in the background — center column only, behind the hero chrome — freezes when the pointer comes near, and dives on click. No more Ctrl+C in a terminal.
See INSTALL.md for agent-driven installation, or hand the whole folder to your DSH agent and say "install this package and adapt it to this machine."
MIT licensed; the sprite is AI-generated (see NOTICE).