deepseek-harness
deepseek-ai
DeepSeek Harness: Everything is a Plugin.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:AAAsangyu/dsh-unfocus-reminder
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
DeepSeek Harness 失焦任务完成提醒 · Unfocus task-completion reminder for DeepSeek Harness
当 Harness 页面失焦时,任务一完成,任务栏的 Harness 图标右上角就会弹出数字徽章(可闪烁/常亮、自选颜色、跟随图标移动);回到页面徽章立即消失。 When the Harness page loses focus, a number badge pops up on the top-right corner of its taskbar icon as soon as a task completes (blink/steady, custom colors, follows the icon); it disappears the moment you return.

| Part | Implementation |
|---|---|
| Completion detection | Host listens to agent/status (running → idle) of the current session's agent, filtered by agent identity (subagents ignored) |
| Focus detection | Browser blur/focus/visibilitychange + 300 ms polling + 5 s heartbeat (hidden pages don't poll, avoiding multi-tab races) |
| Badge rendering | PowerShell + WPF borderless topmost window (click-through, no focus steal); the script is delivered via environment variable (avoids the powershell.exe 8191-char command-line limit) |
| Icon locating | UI Automation scan of the taskbar (Shell_TrayWnd → Taskbar.TaskListButton*, Win11 24H2 XAML taskbar compatible), matched by Harness/DeepSeek or the page title |
| Communication | Client → Host package-private RPC (focus-state / set-mode / set-color / test-dot / dismiss / status) |
DSH is a dynamic-plugin system; plugins are defined inside a session.
Option A (recommended): hand plugin-host.js and plugin-client.js to your Harness session and ask the agent to define them via cordis_define (idPrefix: "tbdot") and run with cordis_run.
Option B (manual): in a session say:
Read plugin-host.js and plugin-client.js from this repo, define a plugin named "taskbar-dot 失焦任务完成蓝点" with cordis_define, and run it.
The first Client activation requires clicking Allow on the Run card.
The control panel appears in the latest Run card:
#1E90FF)| Scenario | Behavior |
|---|---|
| Conversation completes while unfocused | Badge appears, counter +1 |
| Several complete in a row | Counter accumulates, badge refreshes live |
| Harness regains focus | Badge disappears immediately, counter reset |
| New message (new task starts) | Badge cleared (fallback) |
| Badge shown longer than 10 minutes | Auto-hides (safety; counter retained) |
Badge not appearing? Check the panel status line: owner agent: NO means the session agent wasn't captured; focus: focused means the page wasn't unfocused (check 2 s after switching away); log skip: focused means the same.
Badge not disappearing? Make sure you switched back to the Harness tab; check the log for focus return: badge cleared. The plugin sweeps orphan badge processes by command line, so leftovers should not persist.
Icon not found? The badge falls back to the bottom-right of the work area. If the window title contains neither Harness nor DeepSeek, adjust the matcher in Find-BadgeButton.
Other OS? Windows-only for now; a macOS Dock badge would need setAppBadge or a native implementation — PRs welcome.
dsh-unfocus-reminder/
├── plugin-host.js # Host half (events + RPC + PowerShell dispatch)
├── plugin-client.js # Client half (focus reporting + control panel UI)
├── scripts/
│ └── dot-badge.ps1 # Badge rendering script template (%%MS%% etc. placeholders)
├── docs/
│ └── badge-demo.png # Demo image
├── README.md
└── LICENSE
| 部分 | 实现 |
|---|---|
| 任务完成检测 | Host 监听 agent/status 事件(当前会话 agent running → idle),按 agent 身份过滤,子代理不误报 |
| 失焦检测 | 浏览器 blur/focus/visibilitychange 事件 + 300ms 轮询 + 5s 心跳(隐藏页面不轮询,避免多标签竞态) |
| 徽章渲染 | PowerShell + WPF 无边框置顶窗口(点击穿透、不抢焦点),脚本经环境变量传入(规避 powershell.exe 8191 字符命令行限制) |
| 图标定位 | UI Automation 扫描任务栏(Shell_TrayWnd → Taskbar.TaskListButton*,兼容 Win11 24H2 XAML 任务栏),匹配 Harness/DeepSeek 或页面标题 |
| 通信 | Client → Host 通过 Package-private RPC(focus-state/set-mode/set-color/test-dot/dismiss/status) |
DSH 是动态插件系统,插件定义在会话内完成。两种方式任选:
方式一(推荐):把本仓库的 plugin-host.js 和 plugin-client.js 两个文件发给你的 Harness 会话,让 Agent 用 cordis_define(idPrefix: "tbdot")定义并 cordis_run 运行。
方式二(手动):在会话中直接说:
读取本仓库的 plugin-host.js 和 plugin-client.js,用 cordis_define 定义一个名为 "taskbar-dot 失焦任务完成蓝点" 的插件并运行它。
首次运行 Client 半体需要你在 Run 卡片上点击“允许”。
激活后,对话流最近的 Run 卡片内会出现控制面板:
#1E90FF)| 场景 | 表现 |
|---|---|
| 失焦期间完成对话 | 徽章出现,数字 +1 |
| 连续完成多个 | 数字累加,徽章实时刷新 |
| Harness 夺回焦点 | 徽章立即消失,计数清零 |
| 发新消息(新任务开始) | 徽章清除(兜底) |
| 徽章显示超过 10 分钟 | 自动消失(安全兜底,计数保留) |
徽章没出现? 检查控制面板状态行:主人agent: NO 说明未能捕获当前会话 agent;焦点:在 说明页面未失焦(切走后 2 秒再看);日志里 skip: focused 同理。
徽章不消失? 确认切回的是 Harness 所在标签页;查看日志是否有 focus return: badge cleared。插件自带“按命令行特征清理进程”的兜底,理论上不会残留。
图标找不到? 徽章会回退到屏幕右下角工作区边缘显示;如果 Harness 窗口标题不含 Harness/DeepSeek,可修改 Find-BadgeButton 的匹配条件。
其他系统? 目前仅支持 Windows 任务栏;macOS Dock 徽章需要 setAppBadge/原生实现,欢迎 PR。
dsh-unfocus-reminder/
├── plugin-host.js # 插件 Host 半体(事件监听 + RPC + PowerShell 调度)
├── plugin-client.js # 插件 Client 半体(焦点上报 + 控制面板 UI)
├── scripts/
│ └── dot-badge.ps1 # 徽章渲染脚本模板(%%MS%% 等为占位符)
├── docs/
│ └── badge-demo.png # 效果示意图
├── README.md
└── LICENSE
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。