DeepSeek Harness Plugin

yxqfg/phone-lens#phone-lens

Stars ★ 2 Downloads (30d) 3,263 Category Vision & Multimodal Added 2026-08-26 npm phone-lens

Turn a phone camera into a live viewfinder and photo input for your dsh session, over LAN or USB.

Install

# from npm (prebuilt)

dsh plugin --profile web add phone-lens

# from a prebuilt release tarball

dsh plugin --profile web add "https://github.com/yxqfg/phone-lens/releases/latest/download/phone-lens.tgz"

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:yxqfg/phone-lens#path:/packages/phone-lens

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README

This plugin publishes its README in Chinese only.

phone-lens 是一个 dsh 双面插件,让手机相机成为 dsh 会话的即时视觉输入:

  • host 半边:在 dsh 进程内起接收服务(Node HTTP + WebSocket,默认 0.0.0.0:8791),处理配对、上传、并将图片注入 dsh 会话输入框。
  • client 半边:在 dsh Web UI 右下角注册一个悬浮取景小窗(shell.overlay 插槽),实时画面 + 快门 + 配对二维码。

环境要求

  • Node.js ≥ 20、pnpm
  • 一个 dsh web 配置(dsh plugin --profile web)

安装

# 1. 构建
cd packages\phone-lens
pnpm install
pnpm build

# 2. 接入 dsh 的 web profile
dsh plugin --profile web add C:\Users\<you>\phone-lens\packages\phone-lens

也可以用仓库根的 scripts\dev-install.ps1 一键完成构建与接入,然后重启 dsh web, 终端会打印配对二维码。

发布到 npm 后,可直接 dsh plugin --profile web add phone-lens。

配置

默认配置见 cordis.patch.yml,可在你的 profile 层覆盖:

键 默认 说明
server.port 8791 接收服务端口
limits.maxUploadBytes 10485760 单张图片上限
limits.uploadsPerMinute 10 上传频率限制
pairing.codeTtlMs 900000 配对码有效期(15 分钟)
preview.fps 10 预览帧率
inject.notePrefix [手机拍照] 注入消息文本块前缀
target.mode latest 目标会话:latest(最近活跃)/ pinned(固定)

使用

  1. 手机 App 扫码配对
  2. 手机端拍照(可选裁剪)→ 图片进入当前 dsh 会话
  3. 手机端「启动预览」→ 电脑端悬浮小窗实时取景;多设备时手机端「设为主机」抢占预览

详见仓库根 README 与 docs/。

开发

pnpm build           # tsdown 构建 lib/index.js(host)与 dev.js
pnpm dev:standalone  # 不进入 dsh,独立起接收服务(上传落盘 ~/.dsh/phone-lens/uploads)
node --check lib/client.js   # 手写 client 的语法校验

协议与安全设计见 docs/protocol.md、docs/architecture.md。

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.