ns-zzj/dsh-scrcpy-core

DSH 投屏控制的共用核心:界面、设备列表、投屏面板与 AI 工具(配合其他 provider 使用)

Project Overview项目介绍

ns-zzj/dsh-scrcpy-core is a DeepSeek Harness (DSH) desktop plugin core package, published on npm as @nszzj/dsh-scrcpy-core and self-described as the single facade for both users and AI. It is a bundle-layer plugin with dsh.bundle plus dsh.client declared in its package.json, and it ships a cordis.patch.yml that only inserts its own loader entry. The core itself recognizes no device platform: it owns the per-device tabbed screen-mirroring UI, jmuxer decoding, AI tool registration, prompt authoring, the four-gate permission model, focused-device state, and command routing. Actual device transport is delegated to provider packages — dsh-hos-scrcpy for HarmonyOS via hdc plus a Java sidecar using the HOScrcpy SDK, and dsh-android-scrcpy for Android via adb plus the official scrcpy-server.

Installation on the desktop profile must go through the in-app plugin panel because dsh plugin --profile desktop is rejected by the CLI with "profile 'desktop' is managed exclusively by the Electron application." The panel accepts an npm package name, a local .tgz path, or a github: spec, and both core plus the chosen platform provider must be installed together. For other CLI profiles such as web, the command dsh plugin --profile <profile> add dsh-scrcpy-core dsh-hos-scrcpy (or dsh-android-scrcpy) followed by restarting dsh web makes a "scrcpy menu" appear in the session header. The web GUI mostly works since the client half is browser code and RPC travels over the local HTTP loopback, yet it is not fully verified and the desktop build is the supported reference.

The AI tool surface is registered exactly once with neutral names: scrcpy_devices lists devices, the focused unit, and per-device permission states; scrcpy_screenshot captures and runs the bundled vision model; scrcpy_locate returns the control tree with normalized 0..1 coordinates; scrcpy_tap, scrcpy_longpress, scrcpy_key, and scrcpy_input execute taps, long-presses, provider-declared keys (Android currently back/home), and text injection into the focused input field including Chinese. All tools explicitly error when no device is focused and never guess. Each device independently gates four permissions — screenshot, control, key, and input — across three states: forbidden, require confirmation, or no confirmation, with control/key/input depending on screenshot. Typical users are DSH agents and humans running visual understanding, UI automation, or remote-assist flows against HarmonyOS or Android phones.

Dependencies and operational caveats: three packages version and install independently, providers declare a coreCompat string such as "1.0.0", "^1.0.0", or ">=1.0.0", and only core decides compatibility — failing providers are disabled without affecting siblings, and no provider-version table is maintained. Installing a provider without core leaves it pending (waiting for service: scrcpyProviders), which is by design, silent, and unusable. On desktop, enabling a plugin is hot while disabling is persistent but only takes effect after a restart, though dependencies are kept so re-enabling requires no reinstall. The Android provider has no log stream yet, the HarmonyOS provider exposes hilog, mirroring is change-driven so idle frames do not advance, and HarmonyOS pushes frames only on change. Android supports a real UHID external keyboard with on-device IME candidate selection, while HarmonyOS uses uinput whose IME feeding is untested. The repo is MIT-licensed.

ns-zzj/dsh-scrcpy-core 是 DeepSeek Harness(DSH)桌面端的投屏插件核心包(@nszzj/dsh-scrcpy-core),自称为"对用户、对 AI 都只有这一个门面"的共用层。它本身不直接驱动任何设备,只负责投屏面板 UI、按设备分页的标签页、jmuxer 解码、AI 工具注册、提示词、权限门禁、设备/聚焦状态与命令路由;鸿蒙(dsh-hos-scrcpy,hdc + Java sidecar)与安卓(dsh-android-scrcpy,adb + 官方 scrcpy-server)由独立的 provider 包承担。安装走应用内插件面板,桌面端必须如此——dsh plugin --profile desktop 会被 Electron 应用独占接管而报错;命令行 profile 可用 dsh plugin --profile <profile> add。

典型工作流:会话右上角出现"scrcpy 菜单"后,按平台分组列出设备,鸿蒙组附带 Java + hdc 检测,安卓组附带 adb 检测;点击"启动"即建立投屏标签页。AI 通过中性命名工具集操作:scrcpy_devices 列设备与权限、scrcpy_screenshot 截图识别、scrcpy_locate 读坐标、scrcpy_tap/longpress/key/input 执行动作;所有工具只作用于用户当前聚焦的那台设备,无聚焦时显式报错。每台设备四项权限(截图/控制/按键/输入)独立三态"禁止/需确认/无需确认",后三项依赖截图。它适用于需要在 DSH 内对鸿蒙、安卓手机做视觉理解、UI 自动化与远程协助的 AI 代理及用户。

依赖与限制:core + provider 必须各自单独装为核心直接依赖;只装 provider 时状态为 pending (waiting for service: scrcpyProviders),不报错但不可用。桌面端禁用插件需重启才生效,启用是即时的。provider 声明 coreCompat(精确/同 major/下限三种),由 core 单向判定版本兼容性,不通过即停用该 provider 设备,不拖垮其它。安卓 provider 暂无日志,鸿蒙为 hilog。鸿蒙 SDK 仅在画面变化时推帧,安卓投屏为变化驱动、静止时帧数不增。键盘方面安卓已实现真外接键盘,"输入"按钮走 INJECT_TEXT 可注入任意中文;鸿蒙侧用 uinput,能否喂给输入法未实测。MIT 协议,首次使用需同时安装 core 与目标平台 provider。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • 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 dsh-scrcpy-core dsh-hos-scrcpy

把 ns-zzj/dsh-scrcpy-core 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-scrcpy-core

DSH 的 scrcpy 共用核心 —— 对用户、对 AI 都只有这一个门面。

它自己不认识任何平台:鸿蒙、安卓各由一个 provider 包提供"这类设备怎么说话"。

包 作用
@nszzj/dsh-scrcpy-core(本包) 投屏面板 UI、每设备一个标签页、jmuxer 解码、AI 工具、提示词、权限门禁、设备与聚焦状态、命令路由
dsh-hos-scrcpy 鸿蒙 provider:hdc 传输 + Java sidecar(HOScrcpy SDK)
dsh-android-scrcpy 安卓 provider:adb 传输 + 官方 scrcpy-server

provider 不注册 UI、不注册 AI 工具、不写 AI 提示词、不关心"当前聚焦哪台" —— 那些全在 core。


安装

桌面端(0.1.7,当前主力)

dsh plugin --profile desktop … 会被 CLI 拒绝:

error: profile "desktop" is managed exclusively by the Electron application

必须走应用内的插件面板。面板接受三种形式:

  • npm 包名(core 是 @nszzj/dsh-scrcpy-core;鸿蒙是 @nszzj/dsh-hos-scrcpy;安卓是 @nszzj/dsh-android-scrcpy)
  • 本地 tgz 路径(例如 nszzj-dsh-scrcpy-core-1.0.0.tgz)
  • github: 规格(例如 github:ns-zzj/dsh-scrcpy-core)

要装两个包:core + 你要的平台 provider。

命令行(web 等 profile)

dsh plugin --profile <profile> add dsh-scrcpy-core dsh-hos-scrcpy      # 或 dsh-android-scrcpy

然后重启 dsh web,会话右上角出现「scrcpy 菜单」即成功。

三件必须知道的事

  1. core 必须装成 profile 的直接依赖(就是上面那样把它单独列出来)。 只装 provider 时 core 只是传递依赖,不会被登记成 bundle 层 —— 层不挂载、那一行没人插, 而且不会有任何警告(2026-09-25 两组对照实测)。
  2. 装 provider 不会自动带 core("自由装")。没装 core 时 provider 的状态是 pending (waiting for service: scrcpyProviders) —— 不报错,但也用不了,这是设计如此,不是 bug。
  3. 桌面端:禁用 / 启用后想立刻看到效果要重启。 实测:启用是热的(立刻生效、不用重启);禁用只写文件 —— 它会把这个包从 profile 的 dsh.profile.bundles 里摘掉(依赖保留,所以恢复时不用重装), 但已经装载的插件实例不会在运行中卸载,所以要重启才真正消失。

支持范围

主力是桌面端(Electron)。dsh web(在浏览器里打开 GUI)大体也能用 —— 客户端半区本来就是浏览器代码,RPC 也走宿主 HTTP —— 但未做完整验证,出问题请以桌面端为准。

WS 握手的 Origin 校验同时放行 dsh-app://(桌面端渲染进程的真实 Origin,2026-09-26 实测; 不是 http://127.0.0.1:19387)与本机 http 回环(127.0.0.1 / localhost / [::1],端口不限), 所以 web 版不会因为这条被挡;只有外部网页(以及 DNS rebinding)会拿到 403。


怎么用

  1. 会话右上角点「scrcpy 菜单」→ 按平台分组的设备列表(鸿蒙设备 / 安卓设备),每组还带自己的环境检测 (鸿蒙组显示 Java + hdc,安卓组显示 adb)。
  2. 设备那行点「启动」→ 起服务、打开这台设备的投屏标签页(每台设备一张,互不干扰)。
  3. 投屏面板上可以:鼠标点/拖 = 触摸、返回/主页/音量 按键、「输入」按钮(向当前聚焦的输入框注入文本)、 「添加截图至聊天框」、以及该平台支持时的「日志」。
  4. 切走别的标签页不断流:画面只是暂停广播(省解码与内存),回来接着放。

设置

  • AI 控制设置(每台设备的投屏面板 →「设置」):四项权限 + 识别模型。
  • 连接设置(菜单里各平台组右上角):由该 provider 自己提供字段与检测,core 不认识 "Java 路径 / hdc / adb" 这些概念,只负责把它渲染成表单。
  • 识别模型下拉列出所有 provider 的所有模型(不按"是否支持图片"筛 —— 非官方 API 大多不报这个字段, 会误伤)。选了不支持图片的模型,就由上游 API 自己报错。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev awesome-dsh-plugins 下一个 Next KISS_Law-DSH →