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(固定) |
使用
- 手机 App 扫码配对
- 手机端拍照(可选裁剪)→ 图片进入当前 dsh 会话
- 手机端「启动预览」→ 电脑端悬浮小窗实时取景;多设备时手机端「设为主机」抢占预览
详见仓库根 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。
Links
More in this category
liustack/modlens★ 4183
Vision bridge for text-only models: paste an image, get structured JSON evidence (OCR, layout, semantics).
ysr666/dsh-vision-router★ 1137
Free vision for text-only agents: built-in keyless vision chain plus pixel tools (Q&A, grounding, crop, pixel diff, colors, OCR, SVG trace, cutout, screenshots); paste an image to use it.
Anionex/dsh-vision-toolkit★ 886
Vision for text-only models: paste an image and the model switches to a Vision Toolkit variant for image Q&A, multi-image comparison, long-screenshot OCR, screenshot-to-UI reproduction, element grounding, and pixel diff. No API key by default — images are processed by the author-hosted free service, 100 per machine per day; configurable to your own provider.
fandc520/dsh-comfyui★ 105
Drive a local or remote ComfyUI server from DeepSeek Harness: comfyui_run / comfyui_object_info / comfyui_workflow tools generate and edit images and videos, with a workflow library (graph extraction: per component / main flow / all), a load area with resolution auto-match, a live queue, SDXL and Wan 2.1 templates, a companion skill, and a same-origin media proxy.
dickpy/dsh-imagegen★ 101
AI image generation for the DSH Web GUI: text-to-image and image-to-image through a configurable OpenAI-compatible endpoint (gpt-image-2 / gpt-image-1 / dall-e-3), with an api_url/api_key settings card and a sidebar split-pane generation studio.
sunxin-ai/dsh-design-qa★ 44
Design-fidelity QA for text-only models: a `deepseek_vision` tool borrows an eye from any OpenAI-compatible vision route, so the model can judge whether an implementation matches its mock — shipped with the benchmark behind that judgement (four fixtures, 23 injected defects, raw transcripts) and the questioning discipline it depends on.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.