development-cdp
Skill2 starsChanged 3 months agoMITView on GitHub
Inspect and automate the DeepSeek Harness Web UI through Chrome DevTools Protocol (CDP). Use when verifying dsh-pihuo plugins in the browser, checking startup, composer, or tool cards, taking screenshots, or running scripts/cdp-check.mjs. Triggers: CDP, Chrome remote debugging, pageinfo, "网页调试", /development-cdp.
- Installs packages
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- dsh-plugin-authorSkill
- dsh-plugin-clientSkill
- dsh-plugin-composeSkill
- dsh-plugin-conventionsSkill
- dsh-plugin-reviewSkill
- dsh-plugin-runtimeSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 55
Do not --patch packages/bundle/cordis.patch.yml against a stock web profile: those names are not in the profile, and empty args refuse …
- Distinctive: line 68
Wait for both before automating:
- Very specific: line 130
React inputs ignore
.value =: Use the native setter + input. - Distinctive: line 135
Never bind CDP off loopback: No application auth on the debug port.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Development CDP (dsh Web)
This repo's UI is the dsh browser app, not PiHuo's Electron shell. Drive a
Chrome/Chromium tab whose origin is the dsh host. Do not attach to a random
tab, and do not treat router-agents :8315 as this project.
Authoritative checker: scripts/cdp-check.mjs (no extra npm deps; Node 22+).
Process map
Two processes, restarted separately:
| Process | Default | Role |
| dsh host | http://127.0.0.1:3080 | Cordis tree, /api, /plugins/<id>/client.js |
| Chrome with CDP | 127.0.0.1:9222 | The actual Web UI |
Web profile disables shared HMR. A plugin source change needs a dsh restart
(and a hard reload). A stale host serves an old __DSH_BOOT__.
Packaged Chrome without --remote-debugging-port cannot be attached after the fact.
Start
From this repo, after pnpm build:
node scripts/write-dev-patch.mjs /tmp/dsh-pihuo-web.patch.yml
# npm-published launcher (no harness build)
npx --yes @deepseek-ai/dsh web --patch /tmp/dsh-pihuo-web.patch.yml
# or a source checkout after `pnpm install && pnpm run build`
pnpm --dir ../deepseek-harness dsh web --patch /tmp/dsh-pihuo-web.patch.ymlwrite-dev-patch.mjs writes package-name rows and symlinks this checkout
into $DSH_HOME/profiles/web/node_modules. NODE_PATH is not enough:
Node ESM import() ignores it. Do not use absolute src/index.ts
paths for a dsh.client package: client-modules keys the graph by
Loader name, and a path id will not match lib/client.js.
Do not --patch packages/bundle/cordis.patch.yml against a stock web
profile: those names are not in the profile, and empty args refuse
start().
Chrome (loopback only — CDP has no auth):
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
--remote-debugging-port=9222 \
--user-data-dir=/tmp/dsh-pihuo-cdp \
http://127.0.0.1:3080Wait for both before automating:
curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:3080/
node scripts/cdp-check.mjs waitOverride ports:
CDP_PORT=9333 DSH_WEB_ORIGIN=127.0.0.1:8080 node scripts/cdp-check.mjs pageinfoCommands
node scripts/cdp-check.mjs list # CDP targets
node scripts/cdp-check.mjs wait # CDP + origin ready
node scripts/cdp-check.mjs pageinfo # first call every session
node scripts/cdp-check.mjs console
node scripts/cdp-check.mjs dom '[data-composer-card]'
node scripts/cdp-check.mjs text '[data-acp-worker]'
node scripts/cdp-check.mjs eval "<js>" # awaitPromise: true
node scripts/cdp-check.mjs shot /tmp/dsh.pngpageinfo reports URL, composer presence, [data-acp-worker] count, chat
anchors, and __DSH_BOOT__.entries ids (the wire is { rev, entries }, not
.plugins). The UI plugin is composed when hasUiAcpWorker is true.
Client bundle format: dsh-plugin-client.
Driving chat
Stateful inspection: eval in the page. Gestures you must see: DOM
clicks. Prefer visible text over :nth-child.
React controlled composer — native setter + input:
node scripts/cdp-check.mjs eval "(() => {
const ta = document.querySelector('[data-composer-card] textarea');
if (!ta) return 'no textarea';
const set = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, 'value').set;
set.call(ta, 'Call acp_worker to list the workspace root.');
ta.dispatchEvent(new Event('input', { bubbles: true }));
return { value: ta.value, phase: ta.getAttribute('data-phase') };
})()"Scope reads to the visible conversation. Prefer [data-composer-card] in the
visible column and [data-chat-anchor-key] for tool rows. Our Worker row is
[data-acp-worker]. Missing after a completed acp_worker call means the
generic card ran — the client factory is not in the boot graph, or
lib/client.js is not a __ModuleLoader__ bundle.
Pitfalls
- Wait for the host, not just CDP. A Chrome tab on a down
:3080is an error page.pageinfo.urlmust contain the dsh origin. - This is not Electron. PiHuo's
:8315andwindow.routerAgentsdo not exist here. Do not curl:4111. - React inputs ignore
.value =. Use the native setter +input. - HMR is off on the web profile. Restart
dshafter plugin edits. __DSH_BOOT__is{ rev, entries }.entries[].idis the loadername(the package name for adsh.clientrow).evalacceptsawait. Wrap fetches in an async IIFE.- Never bind CDP off loopback. No application auth on the debug port.
- Do not
session.appendnew event types to “make CDP see a node.” Chat state comes from first-partytool/call/tool/result(see HANDOVER). - Pick the dsh tab.
listthen confirmDSH_WEB_ORIGIN; DevTools windows are skipped, other localhost tabs are not.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

