# pixelxzen/zisuzi-weread-mp architecture

> Architecture diagram of the GitHub repository pixelxzen/zisuzi-weread-mp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pixelxzen/zisuzi-weread-mp
- Repository: https://github.com/pixelxzen/zisuzi-weread-mp
- Video tour (about a minute): https://gitdiagram.com/pixelxzen/zisuzi-weread-mp/video

## Overview

Zisuzi-Weread-MP is an Obsidian desktop plugin that imports WeRead public-account articles into a local Markdown vault. The main workflow is QR login, choosing shelf accounts, scheduled or manual polling, fetching article content and media, converting it to Markdown, and saving notes. The plugin also supports historical backfills, multiple library views, optional AI and local-agent workflows, and a companion skill pack. Some connections are documented in the README or SOURCE INDEX rather than shown in sampled implementation excerpts; those limits are reflected in the evidence paths.

Main entry points: [`src/main.ts`](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/main.ts) (Plugin orchestration), [`src/core/weread.ts`](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/weread.ts) (WeRead API client), [`src/host/backfill-modal.ts`](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/host/backfill-modal.ts) (Backfill dialog), [`src/host/view-linear.ts`](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/host/view-linear.ts) (Library views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["Obsidian plugin"]
  node_plugin_entry["Plugin orchestration<br/>[main.ts]"]
  node_login["QR login and access probe<br/>[main.ts]"]
  node_library_views["Library views<br/>[view-linear.ts]"]
  node_alternate_views["Alternate view modes<br/>[view-modes.ts]"]
  node_cards_view["Card view<br/>[view-cards.ts]"]
  node_backfill_ui["Backfill dialog<br/>[backfill-modal.ts]"]
end

subgraph group_capture["Article capture"]
  node_api_client["WeRead API client<br/>[weread.ts]"]
  node_api_helpers["API transport helpers<br/>[weread-api.ts]"]
  node_pagination["Article pagination<br/>[paging.ts]"]
  node_backfill_state["Backfill state model<br/>[bf.ts]"]
  node_markdown["HTML to Markdown<br/>[html2md.ts]"]
  node_media["Image and media assets<br/>[assets.ts]"]
end

subgraph group_library["Local library"]
  node_vault_archive["Note archive<br/>[main.ts]"]
  node_typed["Parsing and runtime adapters<br/>[typed.ts]"]
end

subgraph group_extensions["Optional extensions"]
  node_ai["AI article processing<br/>[llm.ts]"]
  node_skill_pack["Agent skill pack<br/>[skill-pack.ts]"]
  node_monitor_skill["Feed monitor companion"]
end

node_user(("WeRead user"))
node_obsidian["Obsidian host"]
node_weread["WeRead services"]
node_vault[("Markdown vault")]
node_llm_service["OpenAI-compatible endpoint"]
node_local_agent["Local agent CLI"]

node_user -->|"operates"| node_plugin_entry
node_obsidian -->|"hosts"| node_plugin_entry
node_plugin_entry -->|"manages login"| node_login
node_login -->|"probes access"| node_weread
node_login -->|"checks session"| node_api_client
node_plugin_entry -->|"requests articles"| node_api_client
node_api_client -->|"fetches feeds"| node_weread
node_plugin_entry -->|"uses paging"| node_pagination
node_api_client -->|"uses API helpers"| node_api_helpers
node_plugin_entry -->|"converts content"| node_markdown
node_plugin_entry -->|"downloads media"| node_media
node_plugin_entry -->|"writes notes"| node_vault_archive
node_media -->|"saves assets"| node_vault
node_vault_archive -->|"stores Markdown"| node_vault
node_plugin_entry -->|"provides library"| node_library_views
node_plugin_entry -->|"registers modes"| node_alternate_views
node_plugin_entry -->|"registers view"| node_cards_view
node_library_views -->|"opens dialog"| node_backfill_ui
node_alternate_views -->|"opens dialog"| node_backfill_ui
node_backfill_ui -->|"runs archive"| node_plugin_entry
node_plugin_entry -->|"tracks progress"| node_backfill_state
node_plugin_entry -->|"uses parsing"| node_typed
node_api_client -->|"parses responses"| node_typed
node_plugin_entry -->|"offers AI actions"| node_ai
node_ai -.->|"sends completions"| node_llm_service
node_plugin_entry -->|"renders and installs"| node_skill_pack
node_skill_pack -->|"guides archive queries"| node_vault
node_user -.->|"runs companion"| node_monitor_skill
node_monitor_skill -.->|"monitors feeds"| node_weread
node_plugin_entry -.->|"invokes CLI"| node_local_agent

click node_plugin_entry "https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/main.ts"
click node_login "https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/main.ts"
click node_library_views "https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/host/view-linear.ts"
click node_alternate_views "https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/host/view-modes.ts"
click node_cards_view "https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/host/view-cards.ts"
click node_backfill_ui "https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/host/backfill-modal.ts"
click node_api_client "https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/weread.ts"
click node_api_helpers "https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/weread-api.ts"
click node_pagination "https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/paging.ts"
click node_backfill_state "https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/bf.ts"
click node_markdown "https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/html2md.ts"
click node_media "https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/assets.ts"
click node_vault_archive "https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/main.ts"
click node_typed "https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/typed.ts"
click node_ai "https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/llm.ts"
click node_skill_pack "https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/skill-pack.ts"
click node_monitor_skill "https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/skill/weread-mp-monitor/scripts/weread_mp_monitor.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_plugin_entry,node_login,node_library_views,node_alternate_views,node_cards_view,node_backfill_ui,node_user toneBlue
class node_api_client,node_api_helpers,node_pagination,node_backfill_state,node_markdown,node_media,node_vault toneAmber
class node_vault_archive,node_typed toneMint
class node_ai,node_skill_pack,node_monitor_skill toneRose
class node_obsidian,node_weread,node_llm_service,node_local_agent toneIndigo
```

## Components

### Obsidian plugin

- [Plugin orchestration](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/main.ts): `src/main.ts`
- [QR login and access probe](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/main.ts): `src/main.ts`
- [Library views](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/host/view-linear.ts): `src/host/view-linear.ts`
- [Alternate view modes](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/host/view-modes.ts): `src/host/view-modes.ts`
- [Card view](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/host/view-cards.ts): `src/host/view-cards.ts`
- [Backfill dialog](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/host/backfill-modal.ts): `src/host/backfill-modal.ts`

### Article capture

- [WeRead API client](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/weread.ts): `src/core/weread.ts`
- [API transport helpers](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/weread-api.ts): `src/core/weread-api.ts`
- [Article pagination](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/paging.ts): `src/core/paging.ts`
- [Backfill state model](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/bf.ts): `src/core/bf.ts`
- [HTML to Markdown](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/html2md.ts): `src/core/html2md.ts`
- [Image and media assets](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/assets.ts): `src/core/assets.ts`

### Local library

- [Note archive](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/main.ts): `src/main.ts`
- [Parsing and runtime adapters](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/typed.ts): `src/core/typed.ts`

### Optional extensions

- [AI article processing](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/llm.ts): `src/core/llm.ts`
- [Agent skill pack](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/src/core/skill-pack.ts): `src/core/skill-pack.ts`
- [Feed monitor companion](https://github.com/pixelxzen/zisuzi-weread-mp/blob/master/skill/weread-mp-monitor/scripts/weread_mp_monitor.js): `skill/weread-mp-monitor/scripts/weread_mp_monitor.js`

### Other components

- **WeRead user**
- **Obsidian host**
- **WeRead services**
- **Markdown vault**
- **OpenAI-compatible endpoint**
- **Local agent CLI**

## Connections

- WeRead user → Plugin orchestration: operates (evidence: `README.md`)
- Obsidian host → Plugin orchestration: hosts (evidence: `README.md`)
- Plugin orchestration → QR login and access probe: manages login (evidence: `src/main.ts`)
- QR login and access probe → WeRead services: probes access (evidence: `src/main.ts`)
- QR login and access probe → WeRead API client: checks session (evidence: `src/main.ts`)
- Plugin orchestration → WeRead API client: requests articles (evidence: `src/main.ts`)
- WeRead API client → WeRead services: fetches feeds (evidence: `README.md`)
- Plugin orchestration → Article pagination: uses paging (evidence: `src/main.ts`)
- WeRead API client → API transport helpers: uses API helpers (evidence: `src/core/weread.ts`)
- Plugin orchestration → HTML to Markdown: converts content (evidence: `src/main.ts`)
- Plugin orchestration → Image and media assets: downloads media (evidence: `src/main.ts`)
- Plugin orchestration → Note archive: writes notes (evidence: `README.md`)
- Image and media assets → Markdown vault: saves assets (evidence: `README.md`)
- Note archive → Markdown vault: stores Markdown (evidence: `README.md`)
- Plugin orchestration → Library views: provides library (evidence: `src/main.ts`)
- Plugin orchestration → Alternate view modes: registers modes (evidence: `src/main.ts`)
- Plugin orchestration → Card view: registers view (evidence: `src/main.ts`)
- Library views → Backfill dialog: opens dialog (evidence: `src/host/view-linear.ts`)
- Alternate view modes → Backfill dialog: opens dialog (evidence: `src/host/view-modes.ts`)
- Backfill dialog → Plugin orchestration: runs archive (evidence: `src/host/backfill-modal.ts`)
- Plugin orchestration → Backfill state model: tracks progress (evidence: `src/main.ts`)
- Plugin orchestration → Parsing and runtime adapters: uses parsing (evidence: `src/main.ts`)
- WeRead API client → Parsing and runtime adapters: parses responses (evidence: `src/core/weread.ts`)
- Plugin orchestration → AI article processing: offers AI actions (evidence: `src/main.ts`)
- AI article processing → OpenAI-compatible endpoint: sends completions (evidence: `README.md`)
- Plugin orchestration → Agent skill pack: renders and installs (evidence: `src/main.ts`)
- Agent skill pack → Markdown vault: guides archive queries (evidence: `src/core/skill-pack.ts`)
- WeRead user → Feed monitor companion: runs companion
- Feed monitor companion → WeRead services: monitors feeds
- Plugin orchestration → Local agent CLI: invokes CLI (evidence: `README.md`)
