dsh-plugin
DayuanJiang/next-ai-draw-iodsh 的 draw.io 绘图插件:通过 next-ai-drawio MCP 服务器作图,点回复里的链接在右侧栏打开实时预览,可以手动修改图,AI 的每次修改都是可以恢复的版本。需 Node.js 18+,首次使用由 npx 下载 MCP 服务器。
读网页/头条文章全文的 webfetch 工具:三级策略(直连 → Edge 常驻无头浏览器 CDP → dump-dom 兜底),自动识别头条反爬质询页,附 toutiao-reader 实战经验技能。
中文 | English
Packaged real-world experience of reading Toutiao (今日头条) articles as a DeepSeek Harness (DSH) plugin: a webfetch tool + a toutiao-reader skill.
model calls webfetch(url)
├─ ① direct-fetch static direct ~1s (domain cache remembers which sites need a browser)
├─ ② resident Edge CDP cold start ~20s once → resident on port 9333, then ~3-6s per fetch
│ · reuses a persistent tab (saves ~4s) · blocks images + ByteDance CDNs for speed
│ · auto grace window for Toutiao challenge pages (安全验证/__ac_signature/acrawler)
└─ ③ dump-dom fallback one-shot render when CDP is unavailable
Toutiao's static HTML always trips its anti-bot layer (__ac_nonce/__ac_signature/acrawler) — a plain fetch gets a "security verification" page, and web_search only returns snippets. This plugin fills the gap: give it an article URL, get back title + full plain text. Tuned for Toutiao, and works for ordinary pages (blogs, news sites, anything reachable directly) too.
webfetch| Arg | Type | Notes |
|---|---|---|
url | string, required | Article URL (PC pages at www.toutiao.com/article/<id>/ work best; mobile/share pages are usually App-interstitials with no article text) |
maxChars | number | Cap on returned text, default 12000, max 60000; sets truncated when cut |
outfile | string | Optional: save full text to a file (title + blank line + body); absolute path, or relative to the workspace config |
Returns { method, title, text, textLength, truncated, outfile?, error? }
{ error } instead of throwing — fetching never breaks the main flowisConcurrencySafe: false (CDP reuses one tab, so calls are forced sequential) and timeoutMs: 120000method field tells you which tier served the requesttoutiao-readerA bundled experience doc (model-invocable): Toutiao URL forms, reading the method field, challenge-page handling and retry pacing, troubleshooting short/empty bodies (video pages, Q&A pages, App interstitials), managing the resident headless browser (port/pid/stop command), network-environment notes, and the fallback script path.
DSH Web → Settings → Plugin Market → search "toutiao" → install.
dsh plugin --profile web add dsh-toutiao-reader
# junction into the profile (no admin needed)
New-Item -ItemType Junction -Path "$env:USERPROFILE\.dsh\profiles\web\node_modules\dsh-toutiao-reader" -Target "<plugin dir>"
# profile package.json: add "dsh-toutiao-reader": "link:<plugin dir>" to dependencies and "dsh-toutiao-reader" to dsh.profile.bundles
Restart dsh web to load. Never run pnpm install inside the profile (it duplicates official packages as physical copies).
Use the id-override mode in the profile's cordis.patch.yml (id only — never re-insert):
- id: dsh-toutiao-reader
config:
workspace: D:/DSH_Workspace # base for relative outfile paths
cdpPort: 9333 # CDP debugging port
browserPath: "" # Edge/Chrome override; empty = auto-detect
maxChars: 12000 # default text cap
domainCachePath: "" # domain cache path; empty = %TEMP%/webfetch-domains.json
Slow fetches? The first cold start of the resident browser takes ~20s; afterwards ~3-6s per fetch. Image blocking and ByteDance CDN filtering in the CDP tier are intentional speedups.
Very short or empty text? Usually a video page, Q&A page, or App interstitial (mobile share pages carry only ~40 chars of promo text in practice). Switch to the PC URL (www.toutiao.com/article/<id>/).
Stuck in a challenge loop? Wait a few seconds and retry once; avoid hammering (stricter risk control). Solved domains are remembered by the domain cache.
Browser in a bad state? Read %TEMP%\webfetch-edge.pid, then taskkill /PID <pid> /T /F; the next call cold-starts a fresh one.
Already using a script? The plugin shares the resident browser and tab with the workspace script node tools/webfetch.mjs <url> [outfile] (same pid/tab/profile files) — they accelerate each other; the script is the fallback path when the plugin is unavailable.
outfile), reads no credentials, phones nowherebrowserPath)