dsh-bili-scroll
c1overzz
DSH 插件:每天替你刷一轮 B站,读字幕挑出值得的、写一份日报,值得的 @ 你
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:LISHUANGXI1412/dsh-page-struct
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Read-only page structure for DSH, attached to the CUA browser. Extract table coordinates, shadow-DOM fields, code blocks, and confidence labels — without screenshots or a full-page dump.
只读的页面结构读取器:CUA 负责浏览器和登录,page-struct 只负责把页面读成结构。不做点击、输入或页面操作。
CUA browser (profile: %LOCALAPPDATA%\CuaDriver\BrowserProfiles\dsh-page-struct)
│ CDP 127.0.0.1:<port>
├── CUA tools: browser_navigate / browser_click / browser_type
└── dsh-page-struct: page_structure / page_region
→ same process, same cookies, same localStorage
The plugin does not launch or keep a browser alive. It reads the port that
browser_prepare wrote for the named CUA profile, attaches over CDP, and opens a
page in that same browser. CUA owns the browser lifecycle and the login state.
Native snapshots often lose the structure an agent needs:
等级 = Lv.42);<table>;high / partial / unreliable).On the project's 4-page × 13-question benchmark, the structured representation made
13/13 answers determinable versus 2/13 for a flat snapshot, with 10× fewer
characters. See the upstream page-struct project for the benchmark and its caveats.
Start the named CUA profile once:
browser_prepare({ profile: { mode: "isolated_named", name: "dsh-page-struct" } })
A visible Chrome window opens. Log in to the sites you need in that window. The profile persists, so persistent cookies and localStorage survive restarts.
Then the plugin's default endpoint works:
{ "url": "https://example.com" }
If the CUA browser is not running, the tool returns a clear error. Start it with
browser_prepare and retry. The plugin cannot start or keep it alive.
| Tool | Purpose |
|---|---|
page_structure |
Region index, table matrices, shadow-DOM fields, code blocks, confidence evidence. |
page_region |
One region (T1 / P1 / X1 / S:<host> / C1) after the index was truncated. Reuses the latest analysis when possible. |
Both tools are read-only. Use CUA/browser tools for clicks, typing, and navigation.
config:
proxy: ''
endpoint: cua:dsh-page-struct
cuaProfile: dsh-page-struct
exe: ''
cacheTtlMs: 120000
cacheMax: 3
| Key | Meaning |
|---|---|
endpoint |
cua:<profile> (default), host:port, or "" for a one-shot temporary browser. auto is an alias for cua:<cuaProfile>. |
cuaProfile |
Named CUA profile. Default dsh-page-struct. |
proxy |
Only for endpoint: "". CUA/another browser must be configured with its own proxy at launch. |
exe |
Optional Edge/Chrome path for the one-shot temporary browser. |
cacheTtlMs / cacheMax |
In-memory snapshot cache used by page_region. |
cua:dsh-page-struct — attach to the running CUA browser. No new browser.host:port — attach to any browser already exposing CDP."" — launch a one-shot temporary browser (with proxy if set); useful for
fixtures, offline snapshots, or foreign pages that need a proxy.CUA's isolated_named profile is a normal persistent Chrome profile:
persistent cookies and localStorage survive closing and re-running
browser_prepare. Session cookies (no Max-Age) still expire by design.
The plugin never touches your daily Edge/Chrome profile and never copies cookies.
page_structure({ tab: "current" }) attaches to an existing page in the CUA browser
without creating a tab or navigating. It shares cookies/login state and reads the
DOM as it is now (post-click, post-login, SPA route).
Selection order:
targetId;url), then URL prefix match;CDP does not expose the "active" tab, so with multiple tabs pass targetId for an
exact target. The output's 页面: line reports the URL that was actually read.
Examples:
{ "tab": "current" }
{ "tab": "current", "url": "https://example.com/report" }
{ "tab": "current", "targetId": "A95662CFE231DF63DE2DAEF4049DAB6F" }
page_region accepts the same tab/targetId and reuses the analysis when the
cache key matches.
proxy can route temporary-browser traffic through a proxy; CUA browser traffic
follows the CUA browser's own launch configuration.browser_prepare.tab:"current" may pick the
wrong one; pass targetId for an exact target.page_region for details.unreliable.MIT. The vendored page-struct core (vendor/page-struct/) is also MIT; see its
package.json and upstream project for attribution.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。