ZSeven-W/dsh-ios 预览 preview

ZSeven-W/dsh-ios

DeepSeek Harness (DSH) plugin: a live iOS Simulator — and a USB-connected iPhone — inside the conversation. 21 agent tools for booting, building, driving the UI by accessibility identity, OCR text or list rows, plus a streaming sidebar panel you can tap and drag on.

编辑导读Editor's Brief

## 核心特性
- 该插件通过持久化的 MJPEG 侧边栏面板,将 iOS Simulator 或经 USB 连接的 iPhone 置入 DeepSeek Harness 对话中,支持点按、拖拽、旋转、Home、截图和刷新操作。
- 它提供 21 个 agent 工具,用于设备发现、启动与关机、截图、交互、应用列表与启动、Xcode 或 Swift package 构建与运行、unified logs、进程、backtraces、leaks 和应用信息。
- UI 自动化可使用基于 AXe 的 accessibility tree、按 label 或 identifier 点按元素、Vision OCR 文本检测,以及在 accessibility tree 为空或退化时基于文本的点按。
- 列表与信息流处理会将深层 accessibility 快照转换为带索引的行,并可通过检查解析出的计数器是否按预期变化来验证某一行点按。
- SwiftUI preview 热重载会将 previews 构建为一次性宿主应用和 dylib,然后在约两到五秒内将源码修改替换进运行中的模拟器,无需重新启动。

## 使用场景
- agent 可以在模拟器上构建并运行 Xcode 项目或 Swift package,同时用户在实时面板中查看结果。
- 用户在构建、启动 WebDriverAgent 并通过 loopback 端口建立隧道后,可以经 USB 检查并控制实体 iPhone。
- 自动化工作流可通过 accessibility identity 或屏幕上的文本定位控件,而不是使用猜测的坐标。
- 开发者可以迭代 SwiftUI previews,并在调试期间读取日志、进程、backtraces 或 leaks。

## 技术细节
- 模拟器流通过已签名的 /_dsh/dsh-ios/* 路由代理到 DSH Web 界面,同时 serve-sim 绑定到 127.0.0.1,路由需要 loopback peer、Host、Fetch-Metadata 和 Origin 检查。
- 真机支持会从本地 checkout 构建并启动 WebDriverAgent,通过 loopback usbmux 转发为其 REST 控制和 MJPEG 屏幕端口建立隧道,并自动通过 WebDriverAgent 路由实体设备 UDID。
- 工具结果返回纯 JSON,视觉字节仅通过展示元数据以及带签名、会过期的 URL 到达 UI,而不是通过 image blocks。
- 受保护路由的 HMAC capabilities 会在十分钟内过期;空闲流在没有消费者五分钟后停止,并在下一次工具调用或打开面板时重新启动。

## 注意事项
- 模拟器启动、设备控制和大多数工具路径需要安装必要 Xcode 工具链的 macOS;非 macOS 主机仍会注册工具,但除 preview status 外会返回说明性错误。
- 在模拟器上使用 accessibility-tree 和 row 工具需要 AXe,text-find 和 text-tap 工具需要 Vision OCR,lldb attach 需要 macOS Developer Mode。
- 实体 iPhone 操作需要已解锁设备、Developer Mode、支持数据传输的 USB 线、本地 WebDriverAgent checkout,并处理 free-team 签名七天后过期的问题。

## Core Features
- The plugin places an iOS Simulator or a USB-connected iPhone inside a DeepSeek Harness conversation through a persistent MJPEG sidebar panel that supports tap, drag, rotation, Home, screenshot, and refresh actions.
- It exposes 21 agent tools for device discovery, boot and shutdown, screenshots, interaction, app listing and launch, Xcode or Swift package build and run, unified logs, processes, backtraces, leaks, and app information.
- UI automation can use an AXe-backed accessibility tree, element taps by label or identifier, Vision OCR text detection, and text-based taps when the accessibility tree is empty or degenerate.
- List and feed handling converts deep accessibility snapshots into indexed rows and can verify a row tap by checking whether a parsed counter changes by the expected amount.
- SwiftUI preview hot reload builds previews as a disposable host app and dylib, then swaps source edits into the running simulator without relaunching in about two to five seconds.

## Use Cases
- An agent can build and run an Xcode project or Swift package on a simulator while the user watches the result in the live panel.
- A user can inspect and control a physical iPhone over USB after WebDriverAgent is built, launched, and tunneled through loopback ports.
- Automation workflows can locate controls by accessibility identity or on-screen text instead of using guessed coordinates.
- Developers can iterate on SwiftUI previews and read logs, processes, backtraces, or leaks during debugging.

## Technical Details
- Simulator streams are proxied through signed /_dsh/dsh-ios/* routes into the DSH web interface, while serve-sim binds to 127.0.0.1 and routes require loopback peer, Host, Fetch-Metadata, and Origin checks.
- Real-device support builds and launches WebDriverAgent from a local checkout, tunnels its REST control and MJPEG screen ports over loopback usbmux forwards, and routes physical-device UDIDs through WebDriverAgent automatically.
- Tool results return plain JSON, and visual bytes reach the UI only through presentation metadata and signed, expiring URLs rather than image blocks.
- HMAC capabilities for protected routes expire within ten minutes, and the idle stream stops after five minutes without consumers before restarting on the next tool call or panel open.

## Notes
- Simulator boot, device control, and most tool paths require macOS with the necessary Xcode toolchain, while non-macOS hosts keep tools registered but return explanatory errors except preview status.
- AXe is required for accessibility-tree and row tools on a simulator, Vision OCR is required for text-find and text-tap tools, and lldb attach requires macOS Developer Mode.
- Real iPhone operation requires an unlocked device, Developer Mode, a data-capable USB cable, a local WebDriverAgent checkout, and handling of free-team signing expiry after seven days.

安装Install

dsh plugin --profile web add @zseven-w/dsh-ios@latest

ZSeven-W/dsh-ios 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

上一个 Prev dsh-super-injector 下一个 Next dsh-liang-skin