dsh-read-url
DeepSeek Harness 网页读取器:获取任意网页,自动检测编码,提取干净的正文内容并输出紧凑的文本或 Markdown 以节省 Token。零运行时依赖。
AI 分析
适合需要让 AI 阅读和总结网页内容的任务。支持多编码自动识别,提取纯净正文以节省 Token,无任何运行时依赖。
安裝
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:2672243194/dsh-read-url說明文件
閱讀完整 README ↗Usage
Just talk to the agent:
Read https://example.com/article and summarize the key points
Read https://docs.example.org/guide in markdown mode
Tools
read_url(url, maxChars?, offset?, mode?, includeLinks?) — fetch and extract clean body
| Param | Type | Default | Description |
|---|---|---|---|
url | string | required | http(s) URL |
maxChars | number | 6000 | Max body characters returned (500–20000) |
offset | number | 0 | Resume reading from this character offset (long-article continuation; served from cache without repeating earlier text) |
mode | string | text | text = plain (most token-efficient); markdown = structured |
includeLinks | boolean | false | Also return up to 20 page links (title+URL) |
read_url_batch(urls, maxChars?, mode?, includeLinks?) — read multiple URLs (1–10) in parallel, each cleaned individually, merged into one compact report
| Param | Type | Default | Description |
|---|---|---|---|
urls | string[] | required | http(s) URL list (1–10) |
maxChars | number | 3000 | Max body characters per page (500–20000) |
mode | string | text | text = plain; markdown = structured |
includeLinks | boolean | false | Also return links per page (title+URL) |
- Concurrency capped at 4 (avoids rate-limiting); a failing page is isolated (
[失败]+ reason in the output) and does not affect the others; - Reuses every
read_urlcapability and the session cache (encoding, cleaning, SPA rendering, 5-min cache — repeat batches hit the cache).
read_url_site(url, maxPages?, maxDepth?, includeContent?, maxCharsPerPage?) — recursive site crawl: BFS from the entry URL across same-host pages, returns a compact site map
| Param | Type | Default | Description |
|---|---|---|---|
url | string | required | http(s) entry URL |
maxPages | number | 15 | Max pages to crawl (2–50; bounds output) |
maxDepth | number | 2 | Max link depth from entry (1–5) |
includeContent | boolean | false | Attach a short body summary per page (default off — structure first, token-efficient) |
maxCharsPerPage | number | 500 | Summary length per page when includeContent=true (200–2000) |
- Same-host only; login/API/static-asset paths are skipped; URLs deduped (fragment stripped);
- Concurrency 2 (gentle on the target site); per-page failures recorded as
[失败]without aborting; - Output is an indented tree:
[depth] title (chars) URL; - No SPA rendering here (crawling favors speed/breadth) — use
read_urlfor JS-only pages.
read_url_links(url, limit?) — list the page's links without returning body text (lighter; good for sourcing / mapping a site)
| Param | Type | Default | Description |
|---|---|---|---|
url | string | required | http(s) URL |
limit | number | 20 | Max links returned (1–50) |
Configuration (optional)
Plugin-level config is overridable via the profile's cordis.patch.yml (defaults in the plugin's own cordis.patch.yml):
- id: dsh-read-url
config:
timeoutMs: 15000 # per-request timeout
maxBytes: 3145728 # response body cap (bytes)
maxChars: 6000 # default body truncation
maxLinks: 20 # read_url_links default count
spaRender: true # SPA rendering enhancement (needs playwright installed; degrades with a hint otherwise)
userAgent: '...' # request UA
Output (compact)
{
"url": "...",
"title": "...",
"siteName": "...",
"lang": "zh-CN",
"charset": "gbk",
"mode": "text",
"truncated": true,
"charsTotal": 12990,
"charsReturned": 6000,
"text": "...",
"links": [] // only when includeLinks=true
}
PTC mode
Output is pure JSON and composable; orchestrate parallel multi-URL reads in PTC mode:
const results = await Promise.all([
read_url({ url: 'https://a.example.com', maxChars: 4000 }),
read_url({ url: 'https://b.example.com', maxChars: 4000 }),
])
Configuration (optional)
Plugin-level config is overridable via the profile's cordis.patch.yml (defaults in the plugin's own cordis.patch.yml):
- id: dsh-read-url
config:
timeoutMs: 15000 # per-request timeout
maxBytes: 3145728 # response body cap (bytes)
maxChars: 6000 # default body truncation
maxLinks: 20 # read_url_links default count
spaRender: true # SPA rendering enhancement (needs playwright installed; degrades with a hint otherwise)
userAgent: '...' # request UA