2672243194/dsh-read-url7

dsh-read-url

DeepSeek Harness 网页读取器:获取任意网页,自动检测编码,提取干净的正文内容并输出紧凑的文本或 Markdown 以节省 Token。零运行时依赖。

AI 分析

适合需要让 AI 阅读和总结网页内容的任务。支持多编码自动识别,提取纯净正文以节省 Token,无任何运行时依赖。

套件
dsh-read-url
版本
0.4.0
授權
MIT
最近更新
2026年8月16日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:2672243194/dsh-read-url

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

ParamTypeDefaultDescription
urlstringrequiredhttp(s) URL
maxCharsnumber6000Max body characters returned (500–20000)
offsetnumber0Resume reading from this character offset (long-article continuation; served from cache without repeating earlier text)
modestringtexttext = plain (most token-efficient); markdown = structured
includeLinksbooleanfalseAlso 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

ParamTypeDefaultDescription
urlsstring[]requiredhttp(s) URL list (1–10)
maxCharsnumber3000Max body characters per page (500–20000)
modestringtexttext = plain; markdown = structured
includeLinksbooleanfalseAlso 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_url capability 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

ParamTypeDefaultDescription
urlstringrequiredhttp(s) entry URL
maxPagesnumber15Max pages to crawl (2–50; bounds output)
maxDepthnumber2Max link depth from entry (1–5)
includeContentbooleanfalseAttach a short body summary per page (default off — structure first, token-efficient)
maxCharsPerPagenumber500Summary 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_url for JS-only pages.

read_url_links(url, limit?) — list the page's links without returning body text (lighter; good for sourcing / mapping a site)

ParamTypeDefaultDescription
urlstringrequiredhttp(s) URL
limitnumber20Max 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