FxRayHughes/dsh-coding-companion 预览 preview

FxRayHughes/dsh-coding-companion

Plugin插件 Native原生 ⭐ 2 Dev Workflow开发与代码工作流

Programming Companion · deepseek-harness Node-host plugin: AI plays in a separate window while working, suspends process and freezes playback when waiting, persists across multiple sites, Windows only.

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness (DSH), packaged with a DSH bundle manifest and designed only for DSH’s plugin system. Its core function is to open a standalone Chromium window that plays media while an AI task is running in the background of DSH. When the AI finishes processing and waits for user input, the plugin automatically minimizes the window and suspends the entire media process tree, freezing audio and video to free up CPU resources for the main coding workflow. The plugin can be installed directly via DSH’s built-in CLI command, no extra build steps are required.

After installation and enabling, the plugin automatically detects the running state of AI tasks in DSH. If there are multiple concurrent AI sessions, the plugin will only open the media window when all sessions are running in the background and do not require user interaction. As soon as any AI session needs user input, approval, or other interaction, the plugin will suspend the media process and cede window focus back to the DSH interface. It is designed for Windows-based developers who use DSH for AI-assisted coding, helping them make use of waiting time between AI interactions for leisure.

The plugin relies on Windows’ native Win32 and ntdll APIs for process control, and requires a system-installed Chromium-based browser (Edge or Chrome) to run the standalone media window. It is released under the open source MIT license, with no cost for use or modification. It currently only supports the Windows operating system, as all its low-level process control logic is Windows-specific. One known limitation is that enterprise-managed Chrome or Edge may block the injected “Back to Conversation” extension button due to security policies. Users experiencing this issue will need to adjust their browser security settings to resolve it.

这是一个专为 DeepSeek Harness (DSH) 开发的原生插件,核心功能是在 AI 工作过程中打开一个独立媒体窗口,在 AI 后台运行时播放媒体供用户休闲,AI 停止运行等待用户输入时,自动最小化窗口并挂起整个媒体进程树,冻结音视频、释放 CPU 资源。插件仅支持 Windows 系统,可通过 DSH 官方插件命令直接安装,无需额外构建步骤。

用户在使用 DSH 进行多轮 AI 编码开发时,开启插件后,只要 AI 在后台生成内容不需要用户操作,插件就会自动打开置顶媒体窗口播放内容。当 AI 生成结束需要用户进行输入、审批或其他交互时,插件会自动挂起媒体进程,让出窗口和资源给用户操作,继续对话后再恢复播放。它面向需要长时间和 AI 协同开发的 Windows 用户,优化等待 AI 响应间隙的休闲体验。

该插件基于 Windows 原生 Win32 和 ntdll 接口实现进程控制,依赖系统自带的 Chromium 浏览器(Edge/Chrome 均可)运行,使用 MIT 许可开源。目前已知限制是仅支持 Windows,部分企业策略受限的 Edge/Chrome 稳定版可能无法加载注入的「回到对话」扩展按钮,需要调整浏览器策略解决。安装后仅需重启 DSH 的 web profile 即可启用。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 2 warnings2 项注意
  • No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
  • Only 2 stars - very few users, little community feedback星标只有 2,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:FxRayHughes/dsh-coding-companion

把 FxRayHughes/dsh-coding-companion 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-coding-companion · 编程陪伴

一个 deepseek-harness 的 Node-host 插件:AI 工作时弹出一个独立窗口陪你「摸鱼」,AI 停下等你输入时把窗口最小化并挂起整个进程树(视频与声音冻结、不占 CPU),你继续对话时再从冻结帧恢复播放。

仅 Windows。媒体不限抖音——任意视频 / 直播 URL 皆可,每个站点各自保存登录,互不干扰。

演示

▶ 点此观看演示视频 demo.mp4(作为 v0.4.0 Release 附件发布)

主界面悬浮控件 设置页(多站点管理)
悬浮控件 设置页

特性

  • 跟随 AI 状态:有 AI 在后台工作且无人需要你输入时,窗口最大化置顶播放;一旦有任务需要你(提问 / 审批)或全部空闲,自动最小化 + NtSuspendProcess 挂起整棵进程树(Chromium --app 是多进程,只挂根进程停不住视频 / 声音)。恢复时从冻结帧续播,页面不重载。
  • 多任务不抢焦点:多个会话并行时,需要你操作就让出对话,纯后台跑才置顶。
  • 登录持久化:每个站点一个固定的 --user-data-dir(~/.dsh-coding-companion/<站点id>/),cookie / 登录跨重启保留,站点之间隔离。
  • 多站点:设置页维护站点列表(名称 + URL),单选切换当前站点。
  • 窗口内「回到对话」:随窗加载一个轻量扩展,在页面注入悬浮按钮;点击即挂起陪伴窗、露出对话。
  • 跟随父进程关闭:harness 退出(含 Ctrl+C)时先 resume 再 taskkill 整棵进程树,绝不留下「挂起」状态的僵尸进程。
  • 主界面悬浮控件:右下角右边缘手柄,展开后可见状态、「打开 / 恢复窗口」、「暂停陪伴」。

安装

本插件是纯 JS 组合包(bundle),无需构建,可直接从 GitHub 安装进 web profile:

dsh plugin --profile web add github:FxRayHughes/dsh-coding-companion

从源码仓库运行时用 pnpm dsh plugin --profile web add github:FxRayHughes/dsh-coding-companion。 因为无 prepare 构建脚本,pnpm ≥10 的安装期构建授权不需要;add 完直接重启 profile 即可。

也可锁定 commit 更稳妥:

dsh plugin --profile web add github:FxRayHughes/dsh-coding-companion#<sha>

卸载:

dsh plugin --profile web remove dsh-coding-companion

配置

插件从 coding-companion 设置命名空间读取配置,全部在设置侧栏 → 编程陪伴里操作:

字段 说明
sites 站点列表 { id, name, url },每个站点独立持久化目录
activeSiteId 当前显示的站点 id
enabled 是否启用陪伴
paused 暂停陪伴(保持关闭、不自动弹出)

设置页由配套的仓库客户端包 @deepseek-ai/dsh-client-ui-coding-companion 提供(注册 coding-companion 命名空间与「编程陪伴」设置页)。若你的部署单独启用该设置页,记得把 coding-companion 加入 api-proxy 的 web 设置白名单。

cordis.patch.yml 里的默认配置:

- insert:
    - id: coding-companion
      name: dsh-coding-companion
      config:
        activeSiteId: douyin
        sites:
          - id: douyin
            name: 抖音精选
            url: https://www.douyin.com/jingxuan
        enabled: true

实现要点

  • 窗口是 Chromium --app 独立窗口,用唯一的 --user-data-dir 路径同时作为进程标记,控制器据此定位根进程及其整棵进程树。
  • 窗口显隐用 Win32 ShowWindowAsync / SetForegroundWindow,冻结用 ntdll NtSuspendProcess / NtResumeProcess,进程句柄用 kernel32 OpenProcess,全部通过一段内联 PowerShell(P/Invoke)执行。
  • 「回到对话」按钮由 return-extension/(MV3 扩展)注入,点击经后台 service worker 调用 host 的 /coding-companion/return 路由触发挂起;host 在启动时把带端口的回调地址写入扩展的 config.js。

限制

  • 仅 Windows(窗口控制与进程挂起依赖 Win32 / ntdll)。
  • 部分 Edge / Chrome 稳定版可能对 --load-extension 有策略限制,若「回到对话」悬浮按钮不出现,属该限制所致。

许可

MIT

← 上一个 Prev auto-mouse 下一个 Next dsh-whale-aqua-theme →