DSH Plugins Marketplace

DSH Plugins

Plugins

/

Tools & Capabilities

/

dsh-plugin-zsxq

z

dsh-plugin-zsxq

Identified

面向 DSH 的知识星球知识工具集插件,通过 Agent 来整理你订阅的知识星球内容

dsh-plugin-zsxq

中文 | English

Turn the Knowledge Planet (知识星球 / zsxq) planets you subscribe to into a searchable local Markdown knowledge base — from inside DeepSeek Harness.

Sync posts and attachments, extract docx / PDF text and images, rebuild an index, and search it — all in pure JavaScript. No Python, no external services, no telemetry.

sync posts ──▶ download attachments ──▶ extract docx/PDF text + images ──▶ Markdown
                                                                             │
        ask your agent ◀── search ◀── build index ◀── enrich categories/summary/quotes (skill)

Why

Knowledge Planet content is awkward to keep: posts live behind an app, the substantial parts are attachments (docx, PDF, audio), and there is no full-text search across your own history. If you read on a computer — or want an agent to work with what you paid for — you end up exporting files by hand.

This plugin makes your own subscription local and queryable:

  • 📥 One call to sync — today, a date, a whole month, a count, or a hashtag
  • 📄 Attachments become text — docx paragraphs and embedded images, PDF text and page images, all written into the Markdown next to the post
  • 🔎 Search that respects your subscription — keyword / tag / channel / category / date over a local index
  • 🧠 Agent-friendly — seven typed tools; pair with the dsh-skill-zsxq skill for the enrichment conventions (category, summary, quotes)
  • 🔒 Local first — everything lives in a folder you choose; your Cookie never leaves config.json
  • 🐍 No Python — this is a from-scratch JS port of the Python skill, validated byte-for-byte

Install

# DSH profile (npm release once published)
dsh plugin --profile web add dsh-plugin-zsxq

# straight from GitHub today
dsh plugin --profile web add github:zhangcaiqian/dsh-plugin-zsxq

# local checkout while developing
dsh plugin --profile web add link:/path/to/dsh-plugin-zsxq

Restart DSH after installing (plugin modules are not hot-reloaded).

DSH Desktop users: install from Settings → Plugins, or point DSH_HOME at the desktop's harness directory when using the CLI, otherwise the plugin lands in a different profile.

Optional companion skill

The plugin executes; the skill teaches the agent how to enrich what was synced (topic category, ≤50-character summary, quote extraction, enrichment workflow). Install it for the full experience:

dsh plugin --profile web add github:zhangcaiqian/zsxq-skill

Without it, the tools still work — the agent just follows the tool descriptions instead of the full playbook.

Quick start

  1. Initialize a data directory

    Ask the agent: “initialize the zsxq knowledge base” → zsxq_init creates $DSH_HOME/zsxq-kb/{channels,assets,data,index} and a config.json template (the default location; a configured dataDir wins).

  2. Add your Cookie

    1. Open https://wx.zsxq.com, log in, and confirm your planets render;
    2. F12 → Network → filter api.zsxq.com → reload → click any request;
    3. Headers → Request Headers → Cookie → copy the whole value after the colon (usually zsxq_access_token=…; abtest_env=product; more than one pair is normal);
    4. Write it into config.json in the data directory — default $DSH_HOME/zsxq-kb/config.json, or <dataDir>/config.json when dataDir is configured:
    { "zsxq_cookie": "zsxq_access_token=…; abtest_env=product", "channels": {}, "tag_to_category": {} }
    
    • The Cookie is the account credential: do not commit it, and do not paste it into chats, screenshots, or issues;
    • It lasts about a month in practice; expiry shows up as HTTP 401 (ZSXQ_COOKIE_EXPIRED from the tools) — copy a fresh one and overwrite the value;
    • Verify with zsxq_doctor: it makes one real API call and only reports whether the Cookie works, never echoing it.
  3. Pick your planets

    Ask: “check the zsxq setup” → zsxq_doctor validates the Cookie against the live API and reports which planets your account can reach. Add the ones you want to config.json:

    {
      "channels": {
        "my-channel": {
          "name": "My Planet",
          "group_id": "123456789012",
          "default_scope": "digests"
        }
      }
    }
    
  4. Sync

    “sync today’s posts” → zsxq_sync with mode=today.

  5. Enrich, index, search

    Let the agent fill topic_category / keywords / summary and create .quotes.md (the skill describes the rules), then “rebuild the index” → zsxq_rebuild_index, and search: “search the knowledge base for liquidity” → zsxq_search.

Tools

ToolWhat it doesWrites
zsxq_initCreate the data directory and a config.json templateyes (first run)
zsxq_doctorValidate Cookie against the API, report reachable planets, check index healthno
zsxq_list_channelsList configured channelsno
zsxq_statusArticle/quote counts, index staleness, sync stateno
zsxq_searchKeyword/tag/channel/category/date search over index.jsonno
zsxq_syncSync posts + attachments + extracted text; dedupe by topic idchannels/, assets/, data/raw/, .synced_ids
zsxq_rebuild_indexRebuild INDEX.md, index.json, all by-* indices, quotes indexindex/, INDEX.md

Safety rails:

  • count is capped at 30 — the Knowledge Planet API rejects larger pages (code=14001)
  • refresh (re-pull a whole month) refuses to run without an explicit confirmDestructive, and only for a single channel — it deletes that month's local files, including your enrichment
  • every sync is idempotent through .synced_ids; re-running never duplicates posts

What gets extracted

AttachmentExtracted
.docxparagraphs (body-level, python-docx semantics) + word/media/* images
.pdfpage text (CJK included, via bundled CMaps) + page images as PNG
.mp3 / audiodownloaded only (transcription is out of scope)
post imagesremote signed URLs kept in Markdown
article posts (inline_article_url)HTML body → plain text

Images extracted from attachments are written next to the Markdown as embedded-<attachment>-<index>.<ext> and referenced from a ## 🖼️ … section.

Data layout

<dataDir>/
├── config.json            # Cookie + channels (keep out of Git!)
├── .synced_ids            # dedupe state
├── channels/<channel>/<YYYY>/<MM>/<DD>/<title>.md
│                                    └── <title>.quotes.md      # quotes (agent)
├── assets/<channel>/<YYYY>/<MM>/<DD>/…                       # docx / pdf / mp3 / *_images/
├── data/raw/<channel>/<YYYY>/<MM>/<DD>/<topic_id>.json       # raw API payload
├── index/index.json        # retrieval source of truth
├── index/by-{date,tag,topic,channel}/… , quotes-index.md
└── INDEX.md

Configuration

Set in the profile's cordis.patch.yml (row id zsxq-tools), or through Settings → Plugins for the volatile fields:

FieldDefaultMeaning
dataDir$DSH_HOME/zsxq-kbwhere the knowledge base lives; ZSXQ_BASE_DIR env var wins
requestIntervalMs1500throttle between API requests
syncTimeoutMs900000per-channel sync timeout
indexTimeoutMs120000index rebuild timeout
- id: zsxq-tools
  name: dsh-plugin-zsxq     # required: a patch row needs `name` to hit the bundle's row
  config:
    dataDir: /Users/you/knowledge-base

Design notes

This plugin is a from-scratch JavaScript port of a mature Python skill. The port was validated before writing any tool code:

CheckResult
docx text vs python-docx (41 real files)41/41 byte-identical (284,679 chars)
docx embedded images41/41 identical (names, sizes, SHA-256)
Markdown rendering vs the Python renderer (133 real posts)133/133 byte-identical
Rich-text <e> markers / hashtags / filenames63/63, 63/63, 133/133
PDF CJK text vs PyMuPDFidentical (with bundled CMaps)
docx extraction speed≈3.4× faster than the Python version
Install footprint≈8 MB of pure JS + CMaps (Python needs ~52 MB incl. PyMuPDF + a Python runtime)

Two non-obvious details worth knowing:

  • 18-digit topic ids: topic_id exceeds Number.MAX_SAFE_INTEGER, so JSON.parse silently corrupts ids (…514 becomes …510). The plugin parses JSON with json-bigint and serializes ids back as exact numeric literals (JSON.rawJSON).
  • PDF Chinese text needs the pdf.js CMaps. The plugin ships assets/pdf/cmaps (2.4 MB, Apache-2.0) and passes a local path — installing pdfjs-dist (+36 MB) is not required, and the optional @napi-rs/canvas peer (+29 MB) is not used for extraction.

Privacy & security

  • Everything is written locally under dataDir; the plugin never uploads content anywhere.
  • The Cookie is read from config.json on disk and sent only to api.zsxq.com / signed attachment URLs.
  • No analytics, no telemetry, no background network calls beyond the API requests you trigger.
  • Destructive operations require explicit confirmation; sync is idempotent.

Limitations

  • No ASR — audio is downloaded, not transcribed. (Voice placeholders are left in the Markdown.)
  • No image generation for quote posters.
  • Scanned PDFs have no text layer → text is empty (OCR is out of scope).
  • docx tables / headers / footers are not extracted (same as the Python original).
  • Article-post HTML extraction is best-effort: paywalled or JS-rendered pages may yield less text.
  • Requires a valid subscription Cookie; the plugin cannot access planets you are not a member of.

Troubleshooting

SymptomCause / fix
ZSXQ_COOKIE_EXPIRED / HTTP 401Cookie expired — copy a fresh one into config.json
code=14001count too large (API max 30)
ZSXQ_CONFIG_MISSINGno config.json or no zsxq_cookie — run zsxq_init
Search misses new postsindex stale — run zsxq_rebuild_index after enrichment
Markdown has a title but no bodyattachment extraction failed; check assets/… and the ## 📄 section
Plugin loads but no toolscheck the zsxq-tools row is in the profile's composed config (dsh --profile web --dump-config)

Roadmap

  • Voice transcription via a pluggable ASR backend
  • Incremental index builds for very large libraries
  • Optional Python backend switch for users who already run the original skill

Credits & license

MIT. PDF CMaps/fonts under assets/pdf/ come from Mozilla PDF.js (Apache-2.0, see assets/pdf/NOTICE.md).

Not affiliated with Knowledge Planet (知识星球 / zsxq.com). Use it for content you are entitled to access.

Comments

Loading…

Similar plugins

dsh-plugin-knowledge-laoboshi

by Modole

面向 DSH Agent 的本地知识库、检索与资料管理插件。

Manifest valid

★ 0

MIT

JavaScript

Aug 15, 2026

dsh plugin --profile web add @laobos/dsh-knowledge

by zlZayn

DSH 插件:基于知乎开放平台官方 API 的站内搜索、全网索引搜索与直答三个工具,自带原生设置卡片,结果带可引用的来源。

Tools & CapabilitiesManifest valid

★ 11

↓ 652/wk

MIT

TypeScript

Oct 10, 2026

dsh plugin --profile web add dsh-zhihu-search

by Asteroid0449

Agent 专用的 DSH 插件检索、审计、安装与验证工具桥;不提供可视化市场界面。

Tools & CapabilitiesDevelopment & InfrastructureManifest valid

★ 0

MIT

JavaScript

Aug 21, 2026

dsh plugin --profile web add dsh-agent-plugin-research

by dsh-plugin-lab

DSH 插件:基于知乎开放平台官方 API 创建的站内搜索、全网索引搜索与直答三个工具。搜索不幻觉,引用有出处。(原生嵌入“设置-插件-插件配置”)

Tools & CapabilitiesManifest valid

★ 19

↓ 474/wk

MIT

TypeScript

Nov 15, 2026

dsh plugin --profile web add dsh-zhihu-search

by pan17

DSH 工具管理插件:按 Agent Preset 开关和分组工具,像 Skill 一样按需加载工具,减少模型上下文占用。

Tools & CapabilitiesDevelopment & InfrastructureManifest valid

★ 7

↓ 848/wk

MIT

JavaScript

Nov 10, 2026

dsh plugin --profile web add dsh-tool-manager

by EricWang1358

StudyHub: a DeepSeek Harness (DSH) plugin that turns your own material into questions and spaced review · 把自己的资料变成题目与间隔复习的 DSH 学习插件

Tools & CapabilitiesManifest valid

★ 194

↓ 538/wk

MIT

JavaScript

Nov 18, 2026

dsh plugin --profile web add @ericwang1358/dsh-daily-flashcard