插件目录 / Developer / dsh-cdp-browser
dsh-cdp-browser
已验证 · 实测可装 zaiwenJ
功能简介
Zero-spawn CDP browser control plugin for DeepSeek Harness: screenshots, pixel assertions, page JS — no vision model, no per-use approval
可用 — 实测通过,早期项目
Zero-spawn CDP browser control plugin for DeepSeek Harness: screenshots, pixel assertions, page JS — no vision model, no per-use approval 实测能干净安装、正常启动。早期项目,但功能可用。
「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。
README
dsh-cdp-browser
Zero-spawn browser automation + pixel-level visual verification as a DeepSeek
Harness plugin. Drives an already-running Chrome/Edge over CDP using Node
built-ins only: global fetch + global WebSocket (Node ≥ 22) + zlib PNG
decode. No child_process, no npm dependencies, no per-use approval.
Why zero-spawn
Plugins that spawn an engine and pipe its stdio (e.g. modlens) collide with
the harness sandbox's pipe ban (EPERM/EINVAL) on every call. Connecting to a
browser the user started themselves is plain network I/O — allowed in confined
mode. The one manual step (launching the browser) happens outside the
harness, so the model never needs approval again for visual checks.
Setup (once)
Install into the profile (done via
dsh plugin --profile web add file:<path>).Start your browser with CDP (the provided
edge-debug.cmddoes this):msedge.exe --remote-debugging-port=9222 --remote-allow-origins=* --user-data-dir=<dir> <url>Restart the Web GUI. The
cdp_*tools appear in the next session.
Tools
| Tool | What it does |
|---|---|
cdp_status |
List tabs/targets of the CDP browser + browser version |
cdp_open |
Open (or reuse) a tab for a url; returns target id |
cdp_eval |
Evaluate JS in a page (awaitPromise, returnByValue) |
cdp_shot |
Navigate + PNG screenshot, saved to an absolute path |
cdp_assert |
Scripted interaction + deterministic checks (pixel / css / dom / js) with a pass/fail report |
cdp_assert check shapes
checks: [
{ type: 'pixel', x: 0.5, y: 0.96, color: '#245edb', tolerance: 16 }, // relative coords 0..1 or absolute px
{ type: 'css', selector: '#taskbar', property: 'background-color', equals: 'rgb(36, 94, 219)' },
{ type: 'css', selector: '.xp-window', property: 'border-radius', matches: '^\\d+px' },
{ type: 'dom', selector: '.xp-desk-icon', text: 'My Computer' },
{ type: 'js', expression: 'window.__XP.selfTest()', equals: { ok: true } },
]
// every check accepts click: '#start-btn' | { selector } | { x, y } and waitMs
Development
node plugins/dsh-cdp-browser/test/e2e.mjs # needs dev server + CDP Edge, starts nothing
Determinism notes (learned from the XP app's first plugin e2e):
- Reload the page per test run. A long-lived tab accumulates state across
scripted sweeps (windows, dialogs, menus) and can wedgeopenApp; a freshnavigate+skipBootper suite is deterministic.probe-apps.mjsbisects
per-app hangs when an app regresses. - Synthetic clicks toggle state.
el.click()runs the real handlers —
clicking a toggle twice flips it twice. One click per assertion. - Gradient surfaces need stop-aware sampling. Sample where a gradient stop
dominates (flat zones or edges), not mid-gradient blends, or use
tolerance-awarenearColoragainst computed-style values.
The package exposes ./cdp (targets, openTarget, withPage, Cdp,decodePng, samplePixel, nearColor, runChecks, savePng) for reuse
outside the harness.
安装
装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:
dsh plugin add dshbase-catalog 然后对 agent 说「帮我装 dsh-cdp-browser」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。
该插件是 GitHub 源码(未发 npm)——直接从仓库装:
Web profile:
dsh plugin --profile web add github:zaiwenJ/dsh-cdp-browser Headless(CLI)profile:
dsh plugin --profile headless add github:zaiwenJ/dsh-cdp-browser 实测报告
验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。