rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:shijiezhiai/dsh-zhihu
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
English | 中文
One installable package puts Zhihu inside the harness: three model tools read the hot and recommendation feeds, one answer or column post and search results, and the same package draws a sidebar panel where a reader opens those rows, quotes a passage, discusses the item in a real Session and writes it to Obsidian. Nothing model-facing appears until a profile enables the plugin.
Add the package to a profile's bundles and enable one plugin:
// <profile>/package.json
{
"dsh": { "profile": { "bundles": ["@deepseek-ai/dsh-base", "@deepseek-ai/dsh-web-app", "@your-scope/dsh-zhihu"] } }
}
Each release publishes a prebuilt tarball at https://github.com/shijiezhiai/dsh-zhihu/releases/download/v<version>/dsh-zhihu.tgz, and the plugin-market entry pins the current version's URL. dsh plugin --profile <name> add <that url> installs it into a profile; pnpm records a tarball dependency by URL, so re-adding an installed URL stays on the version already there.
Store the signed-in cookie under the ref the provider reads, zhihu by default:
dsh credentials set zhihu # Cookie header value of a signed-in www.zhihu.com request
Zhihu answers 401 to anonymous callers, so the tools and the panel stay unavailable until that credential exists. Host plugins load at startup: enabling or updating this package needs a restart, and the browser panel arrives with it.
Every setting has a default and is validated at load:
| Field | Default | Meaning |
|---|---|---|
http.credential |
zhihu |
Credential ref holding the cookie |
http.userAgent |
Chrome 126 on macOS | User-Agent sent to Zhihu |
http.requestTimeoutMs |
20000 |
One request's deadline |
http.minIntervalMs |
1000 |
Spacing between calls to Zhihu |
http.maxContentChars |
30000 |
Longest body the provider keeps |
http.pageSize |
20 |
Rows per feed page |
http.maxFeedPages |
3 |
Pages one feed call may walk |
http.answerLimit |
1 |
Answers read with one question |
tool.maxItems |
20 |
Entries one tool call returns |
tool.maxAnswerLimit |
5 |
Answers a tool call may ask for |
tool.excerptMaxChars |
200 |
Excerpt length in feed rows |
tool.timeoutMs |
30000 |
One tool call's deadline |
remote.defaultLimit |
20 |
Rows a panel request returns |
remote.maxLimit |
50 |
Largest limit the Remote accepts |
remote.obsidianUrl |
https://127.0.0.1:27124 |
Obsidian REST endpoint |
remote.obsidianFolder |
zhihu |
Vault folder that notes land in |
remote.obsidianCredential |
OBSIDIAN_API_KEY |
Credential ref holding the Obsidian key |
What the reader gets: lanes for hot, recommendation, follow and search that page as you scroll and restore the lane you left, with the rows that are new, climbed or fell since that lane was last read marked beside them and the follow lane, which ranks nothing, counting above them what arrived since its last read; a list a reader can walk with the arrow keys or j and k, open with Enter and leave with Escape; a reader with right-click copy, and an export that files the item's whole discussion, question and answer in turn, under the note body and records a body the capture limit cut as frontmatter rather than a line in the note and names the cause the Host reported when the vault refuses the note; a passage bubble that merges several blocks into one quote, narrowing itself to the pane it opens in and stepping aside when the window resizes, and files it into a comparison that survives a reload, so passages read in different items open one discussion whose instruction names the kind and id of every item it quotes; a Discussion segment that keeps one Session per item and one per comparison; and a My discussions list that reopens any of them, naming the item a comparison started from, or files one away.
src/index.ts is the only Host entry: its apply mounts the ctx.zhihu seam, the credentialed HTTP provider, the model tools and the authenticated Remote, while package.json declares the browser half through dsh.client, so one install covers both planes. The seam answers feeds, reads and search; the provider owns the cookie, the spacing between calls and the typed failures; the tools render what the model reads; and the Remote serves bounded rows to the panel, which never calls Zhihu itself.
| Source | Contents |
|---|---|
src/service/ |
The ctx.zhihu seam: requests, typed failures, provider selection |
src/http/ |
Credentialed provider: cookie, rate limit, Markdown and text extraction |
src/tool/ |
zhihu_feed, zhihu_read, zhihu_search and their rendering |
src/remote/ |
Authenticated Remote, Obsidian capture, panel projections |
src/client/ |
Panel, reader, passage quoting, discussion segment, discussion list, tool cards |
tests/ |
Provider, tool, Remote and client tests |
zhihu_feed is declared once per Session of a profile that enables the plugin, with kind (hot, recommend, follow) and limit. A call returns the untrusted-content notice, a labelled list with one link per entry, and a follow-up that names zhihu_read for the entry the model picks; every row is readable that way, and an article row needs its id plus the title its own line shows. Excerpts are cut at tool.excerptMaxChars, and a failure carries its reason instead of rows.
The declaration rides every request of that Session; a call adds the notice, up to tool.maxItems rows and their links. Nothing accumulates: no page is kept in the conversation, so a second call costs what the first did.
The declarations never change between steps of a Session, so the cached prefix survives every call and results append to the log as ordinary tool results.
zhihu_read takes kind (question, answer, article), the id exactly as a listing returned it, the title for an article and answerLimit. Ids are decimal strings of varying length, so the description tells the model to pass one back verbatim rather than reconstruct it. The body arrives as text under the untrusted-content notice, cut at http.maxContentChars.
One read costs the notice, the header and up to http.maxContentChars characters of body — the largest single result of the three tools. A question read adds up to tool.maxAnswerLimit answers.
Same as the feed tool: a static declaration and an appended result, so the prefix is reused.
zhihu_search takes query, limit, an optional cursor, and two narrowing arguments: sort (relevance, newest or top) and timeWindow (day, week, month or year). Hits carry a title, a link, an excerpt and their creation date; the returned cursor resumes the same query, and a page that ends returns none. Zhihu's search endpoint offers a single relevance order and ignores every sort and date parameter, so an ordered or windowed call reads several pages itself, answers one slice, and returns no cursor.
A call adds the notice and up to tool.maxItems hits with their excerpts; the cursor is a short string, so paging costs about what one page does. An ordered or windowed call reads up to http.searchScanPages pages before it answers, which costs upstream requests but no result tokens beyond the same bounded slice.
Same as the other two: nothing in the declaration moves, and each page appends its result.
contentText the model reads, so a quote is capped at 1200 characters and a longer selection is cut.http.minIntervalMs and the tools report the failure rather than retrying, so a burst of calls can surface an error the reader has to repeat.Releasing:
version here, add that version's section to CHANGELOG.md, and mirror both in the publishing repository.node scripts/pack-dist.mjs --name @mayangyang/dsh-zhihu --out <dir> and copy src/, lib/, locale/, cordis.patch.yml, package.json, README.md and CHANGELOG.md into the publishing repository.git tag v<version> and push the tag. The workflow refuses a tag that disagrees with package.json, publishes dsh-zhihu.tgz, and installs that URL into a throwaway profile before it passes.CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: deepseek-harness。