返回目录
Agent 与会话 插件

dsh-device-deck

zhouatie/dsh-device-deck

Device mirror, emulator manager, and agent tools for DeepSeek Harness.

Stars
1
Forks
0
Issues
0
更新
7 天前

PROJECT TOPICS

项目标签

INSTALL REFERENCE

安装参考

未验证
dsh plugin --profile web add github:zhouatie/dsh-device-deck

该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。

PROJECT README

README

Device Deck

License: MIT

Device Deck is a DeepSeek Harness plugin for device work inside the Harness Web UI.

It starts with an Android device mirror, then grows into one control surface for Android, iOS, and Web devices, with the agent able to inspect and drive them.

Status: alpha (0.6.1). The Android and iOS mirrors are usable. Web mirroring and AI E2E testing are on the roadmap.

Features

Available now

  • Device menu in the Session header. One click lists running devices, stopped Android AVDs, iOS simulators, and connected iOS devices. The menu also pairs wireless ADB devices, and it refreshes every 5 seconds while open.
  • Android mirror. scrcpy video decoded with WebCodecs in the page.
  • Direct control. Tap, swipe, wheel scroll, back, home, recents, text input, and open URL or deep link. The iOS mirror uses a left-edge swipe for back.
  • Screen off. The physical display turns off while the mirror is open and turns back on when the mirror closes.
  • Android AVD management. List AVDs, start them headless, stop them, and open the mirror once they are ready.
  • iOS simulator management. List simulators, boot and shut down them, and open the Simulator app or Device Hub.
  • iOS simulator mirroring. The same WebDriverAgent pipeline as devices, with MJPEG video plus tap, swipe, wheel scroll, text input, and screenshots. Simulator builds need no signing.
  • iOS device mirroring. List connected iPhones and iPads with devicectl, then mirror the screen over WebDriverAgent MJPEG. Tap, swipe, wheel scroll, the back gesture, type text, open links, press Home, and capture screenshots. The first launch builds WebDriverAgent.
  • Wireless ADB. Connect a device with host or host:port.
  • File transfer (Android). Pick a file on the computer and push it to /sdcard/Download/ on the selected device.
  • Screenshots. Capture the current screen on Android or iOS, browse the latest shots, preview one, and copy it as a PNG image. Delete one shot or clear the history from the picker.
  • Copy page address (Android). Copy the foreground page address: an Activity, a React Native deep link, or a WebView URL.
  • Link history. The open-link popover keeps the last 20 links, plus pinned links. Pin, unpin, or delete any of them.
  • Screenshot picker. Open it from the composer's + menu or from the Device screenshot command in the command menu. The chosen shot becomes a draft attachment.
  • Mirror state. The mirror remembers whether it was open, its position, the selected device, and the link history. Switching Sessions keeps the stream.
  • Agent tool. device_screenshot returns a screenshot as an image. See Agent tool under Usage.
  • Bilingual UI. English and Chinese strings follow the Harness locale.
  • Shortcut. Ctrl+M opens or closes the mirror.

Roadmap

  • Web page preview and control.
  • AI E2E testing: plan, act, wait, and assert against a device or page.
  • Test recording and replay.
  • Multi-device decks.

Roadmap items are not implemented. Do not treat them as available features.

Requirements

  • DeepSeek Harness >=0.2.2-rc.1 <0.3.0 with plugin support.
  • Node.js 20 or newer for the Host half.
  • adb from Android platform-tools for Android devices.
  • Android SDK emulator for AVD management.
  • macOS with Xcode 15 or newer for iOS simulators and iOS devices. The command-line tools alone are not enough: the iOS mirror builds WebDriverAgent with xcodebuild.
  • For iOS devices: iproxy (libimobiledevice), and a device with Developer Mode enabled. An Apple ID must be signed in to Xcode for automatic signing.
  • For Copy page address: the host clipboard uses pbcopy on macOS, clip on Windows, and wl-copy, xclip, or xsel on Linux. If the host clipboard is unavailable, the browser clipboard is used.

The bundle ships scrcpy-server 3.3.3, so a separate scrcpy install is not required.

Configuration

The Host half reads these environment variables. All are optional.

Variable Purpose Default
DSH_HOME Data root. Screenshots, uploads, state, and the WebDriverAgent cache live under $DSH_HOME/device-deck. ~/.dsh
DSH_DEVICE_MIRROR_ADB Path to adb. Search the common SDK folders, then PATH
DSH_DEVICE_DECK_WDA_PROJECT Path to WebDriverAgent.xcodeproj. Bundled appium-webdriveragent
DSH_DEVICE_DECK_WDA_BUNDLE_ID Bundle ID for the WebDriverAgent build. com.dsh.devicedeck.wda
DSH_DEVICE_DECK_IOS_TEAM Apple development team ID for device signing. Teams from the Xcode preferences, free personal team first
DSH_DEVICE_DECK_IPROXY Path to iproxy. /opt/homebrew/bin, /usr/local/bin, /usr/bin, then PATH
DSH_DEVICE_DECK_SIMULATOR_APP Simulator app or Device Hub to open. Resolved from xcode-select -p

Install

  1. Clone the repository:

    git clone https://github.com/zhouatie/dsh-device-deck.git
    cd dsh-device-deck
  2. Install dependencies:

    pnpm install
  3. Install this folder as a bundle in Harness. Use Settings → Plugins, or the plugin manager with the absolute path of this folder.

  4. Refresh the Harness Web page once.

For a local-folder install, the bundle is linked. Keep the folder in place and run pnpm install there after dependency changes.

Install from npm or the plugin market

The package is published as dsh-device-deck. Install the current version with:

dsh plugin --profile web add dsh-device-deck@0.6.1

To install from the plugin market, enable @deepseek-ai/dsh-experimental-plugin-market-bundle, then use Plugins → Discover → Add index source with:

https://raw.githubusercontent.com/zhouatie/dsh-device-deck/main/market/index.json

Usage

  1. Open a Session.
  2. Click the device icon in the Session header, at the top right.
  3. Pick a running Android device to open its mirror, or start a stopped AVD.
  4. The Android left rail holds back, home, recents, text, link, file, copy page address, screenshot history, screenshot, and minimize. The iOS rail holds the back gesture, home, text, link, screenshot history, screenshot, minimize, and stop mirror. History appears once a screenshot exists.
  5. The title bar holds the device switcher, connection status, reconnect, and the drag handle.
  6. Scroll the mirror with the mouse wheel. Wheel down moves the content down.
  7. Open the input's + menu, choose Device screenshot, then pick a shot. The shot is added to the composer; add text before sending. The command menu provides the same picker as Device screenshot.
  8. Send text with ⌘/Ctrl + Enter from the text popover.

To send a file, click the paperclip in the left rail and choose a file. The file is pushed to /sdcard/Download/<name> on the selected Android device.

To copy the current page address on Android, click the copy icon in the left rail. The address goes to the system clipboard.

Wireless ADB:

192.168.1.102:5555

A bare host is accepted; port 5555 is added automatically.

Agent tool: device_screenshot

The tool captures an Android device screen, or returns a saved screenshot, and attaches it to the conversation as an image.

Parameter Type Meaning
serial string, optional Android device serial. Defaults to the device selected in the mirror.
fresh boolean, optional true captures the screen now. The default uses the selected screenshot, or the newest shot of the device.

The result holds path, serial, width, and height, plus an image attachment when the attachments service is available. If that service is unavailable, the tool returns text only.

The tool uses adb. It does not capture iOS devices or simulators.

How it works

  • The Host half registers /api/device-deck/* routes and starts one scrcpy session per Android device.
  • The Host opens the scrcpy control channel, turns the display power off after the stream starts, and restores it when the last mirror client leaves.
  • Video packets travel over same-origin chunked HTTP and are decoded with WebCodecs.
  • The Client half registers into the Session header and renders the device menu and the floating mirror. The mirror lives in the root overlay, so a Session switch keeps the stream and canvas.
  • For iOS devices, the Host builds and launches WebDriverAgent, forwards ports with iproxy, and relays the MJPEG stream. Input actions go through the WebDriverAgent HTTP API.
  • Screenshots live under $DSH_HOME/device-deck/screenshots. The newest 30 per device are kept; the selected screenshot is never removed.
  • Copy page address reads the foreground Activity from dumpsys, a React Native deep link from logcat, or a WebView URL through the WebView DevTools socket. The result is written to the system clipboard.
  • The mirror keeps its open state, position, selected device, and link history in browser local storage. The selected screenshot and the last device serial live in $DSH_HOME/device-deck/state.json.
  • File uploads are written to a temporary folder under $DSH_HOME/device-deck/uploads, pushed with adb push, and deleted after the transfer.
  • The plugin keeps no cloud service. Device commands go to local adb or xcrun. Screenshots go to the current chat only when you add them to the composer and send them.

Limitations

  • The mirror supports Android, iOS devices, and iOS simulators.
  • The first iOS device mirror builds WebDriverAgent and takes 2–5 minutes. Build output is cached under $DSH_HOME/device-deck/wda.
  • iOS simulator mirroring also uses WebDriverAgent and builds in about a minute. It needs the full Xcode app, not only the command-line tools.
  • iOS device signing uses the Apple ID signed in to Xcode. Free accounts expire after 7 days, so the build must then be repeated.
  • The iOS device must be unlocked and stay awake while mirroring. Set Auto-Lock to Never, or the stream shows the lock screen.
  • iOS devices cannot be mirrored with the physical screen off. WebDriverAgent has no display power control, unlike the scrcpy channel used on Android.
  • The iOS back action uses a left-edge swipe gesture, and works only on screens that support it.
  • Open link on iOS devices uses WebDriverAgent's /url endpoint and needs iOS 16.4 or later. Older versions fall back to Siri and may fail.
  • H.264 only. H.265 devices show an error.
  • Text input uses adb shell input text for ASCII on Android. Other text is pasted through the scrcpy clipboard, so the Android mirror must be open.
  • One device is mirrored at a time.
  • iOS device mirroring depends on WebDriverAgent and keeps one session per device.
  • Every cold start installs WDA again and takes 10–40 seconds. Reopening the mirror within 10 minutes reuses the running session without reinstalling.
  • Web devices are not supported yet.
  • File transfer and copy page address are Android only.
  • Copy page address depends on the foreground app. A React Native deep link must appear in logcat within the last 10 minutes, and an H5 URL needs WebView debugging enabled.
  • File transfer sends one file at a time, up to 2 GB, to /sdcard/Download.
  • Screen-off uses the scrcpy control channel. Some OEM builds may ignore it. If the plugin process crashes while the screen is off, press the power button.

Development

pnpm install
pnpm build
pnpm check

The Client half is authored in src/client/ and bundled into lib/client.js by scripts/build-client.mjs (esbuild). Do not edit lib/client.js directly. Run pnpm build after changing src/client/, then commit the rebuilt lib/client.js and lib/client.js.map.

The Host half is split across host/*.js. index.js only registers the plugin and its routes. pnpm check rebuilds the Client bundle, checks its syntax, and loads every Host module.

Layout:

Path Purpose
index.js Host plugin entry: routes and teardown
host/ Host modules: adb, android, config, devices, emulator, http, ios, ios-mirror, screenshots, state, stream, tool, util
src/client/ Client source: UI, mirror, picker, store, API, styles
lib/client.js Generated Client bundle (esbuild)
lib/client.js.map Generated source map
scripts/ Build and check scripts
bin/ Bundled scrcpy server and its version file
cordis.patch.yml Bundle patch
locale/ Plugin Manager titles and descriptions
market/ Plugin market index and its README
RELEASING.md npm release flow
icon.svg Plugin icon

Read CONTRIBUTING.md before opening a pull request.

License

Plugin code: MIT.

The bundled scrcpy server is Apache-2.0. See LICENSE-scrcpy and NOTICE.

中文文档

README.zh-CN.md

CLASSIFICATION EVIDENCE

分类依据

项目类型插件
功能分类Agent 与会话
规则置信度高

系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: agent。