dsh-reading-inbox 0.2.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md CHANGED
@@ -1,208 +1,214 @@
1
- # dsh-reading-inbox
2
-
3
- > **A reading inbox for DeepSeek Harness.** Clip a web page into clean Markdown, keep the original HTML, tag it, search it, and let the agent use it.
4
-
5
- [![license](https://img.shields.io/badge/license-MIT-green)](LICENSE)
6
- [![dsh-plugin](https://img.shields.io/badge/topic-dsh--plugin-6f42c1)](https://github.com/topics/dsh-plugin)
7
- [![node](https://img.shields.io/badge/node-%3E%3D22.12-339933)](package.json)
8
- [![dsh](https://img.shields.io/badge/dsh-%3E%3D0.2.0%20%3C0.3.0-1f6feb)](package.json)
9
-
10
- [中文](README.md) | English
11
-
12
- ![Reading inbox](docs/demo.jpg)
13
-
14
- ## Why an inbox
15
-
16
- Pages disappear. Links rot. Bookmarks turn into a pile nobody opens again.
17
-
18
- DSH already has `web_fetch` and `read_url` for reading a page once. They do not solve three things:
19
-
20
- 1. **Keep it** — turn the article into Markdown, keep the original HTML as an archive, so a dead link is still readable.
21
- 2. **Find it later** — full-text search over title, body, tags and source; unread / reading / read / archived states.
22
- 3. **Let the agent use it** — the model can clip, search, read and update clips instead of only seeing the current page.
23
-
24
- This plugin is the small implementation of those three things. Everything stays on your machine.
25
-
26
- ## Features
27
-
28
- - **One-step clipping** — paste a URL; Readability extracts the article; Markdown + original HTML + title/author/date/source/excerpt are saved.
29
- - **Inbox UI** — unread / reading / read / archived, search, tag filters, reading view, copy link, export Markdown.
30
- - **Highlights and notes** — select text to highlight it (yellow / green / blue / red) and add a note. Anchors use quote + surrounding context, so a re-clip re-locates them automatically; missing text becomes stale instead of landing on the wrong sentence. Markdown export includes active annotations.
31
- - **Local full-text search** — CJK is indexed as unigrams + bigrams, Latin as words; title and tags are boosted. No model call.
32
- - **Agent tools** — `reading_clip`, `reading_search`, `reading_list`, `reading_read`, `reading_update`, `reading_highlight`.
33
- - **Slash command** — `/inbox <url> [tag1,tag2]` without leaving the conversation.
34
- - **Chinese-web friendly** — detects GBK / GB2312 / UTF-8 / Big5 so pages do not turn into mojibake.
35
- - **Safe defaults** — http/https only; every redirect hop is re-validated; DNS answers are checked again at connect time (DNS rebinding defense); loopback, private networks, CGNAT, link-local and cloud metadata addresses are rejected; hard caps of 5 MB, 20 seconds and 5 redirects.
36
- - **Local-first** — no telemetry, no account, no third-party service.
37
- - **Exportable** — Markdown with YAML frontmatter, ready for Obsidian / Logseq / any notes folder.
38
-
39
- ## Install
40
-
41
- Requires **DSH >= 0.2.0 < 0.3.0** and **Node.js >= 22.12**. DSH 0.2.2 itself requires Node.js >= 24.9, so the DSH runtime is the effective floor.
42
-
43
- From npm:
44
-
45
- ```sh
46
- dsh plugin --profile web add dsh-reading-inbox
47
- ```
48
-
49
- > pnpm's supply-chain policy waits before adopting a freshly published version. If an install right after a release picks the previous version, pin it: `dsh plugin --profile web add dsh-reading-inbox@0.2.1`.
50
-
51
- From GitHub:
52
-
53
- ```sh
54
- dsh plugin --profile web add github:Bit0620/dsh-reading-inbox
55
- ```
56
-
57
- Local development:
58
-
59
- ```sh
60
- dsh plugin --profile web add file:/absolute/path/to/dsh-reading-inbox
61
- ```
62
-
63
- Restart `dsh web`. A **Reading inbox** row appears in the sidebar, and `/inbox` is available in chat.
64
-
65
- > DSH Desktop manages its own profile. If the row does not appear after a CLI install, install `dsh-reading-inbox` through **Plugins → Add plugin** in the desktop app, or install it into the profile the app uses.
66
-
67
- ## Usage
68
-
69
- ### In the inbox
70
-
71
- 1. Paste a URL into the top bar and press Enter.
72
- 2. Click an item to read it. Mark read, archive, copy the link, export Markdown, or edit tags on the right.
73
- 3. Select text in the article: a highlight toolbar appears. Pick a color, add an optional note, and save.
74
- 4. The search box searches title, body, tags and source as you type.
75
- 5. Click any tag to filter by it; click a highlight or “Locate” in the annotation list to jump back to the source sentence.
76
-
77
- ### Ask the agent
78
-
79
- ```text
80
- Clip https://example.com/article into my reading inbox, tags: architecture, reading
81
- ```
82
-
83
- ```text
84
- Search my saved articles about SSRF and read the key paragraphs
85
- ```
86
-
87
- ```text
88
- Mark that article as read and add the tag security
89
- ```
90
-
91
- The model calls `reading_clip`, `reading_search`, `reading_read`, `reading_update` and `reading_highlight`. The plugin adds a system-prompt section explaining when to use them.
92
-
93
- ### Slash command
94
-
95
- ```text
96
- /inbox https://example.com/article architecture, reading
97
- ```
98
-
99
- Command output is shown in the UI only; the full article is not pushed into model context.
100
-
101
- ## Tools
102
-
103
- | Tool | What it does |
104
- | --- | --- |
105
- | `reading_clip` | Fetch a URL, extract the article, save Markdown + original HTML, update the index. Duplicate URLs return the existing clip; `force: true` re-fetches. |
106
- | `reading_search` | Full-text search with `status` / `tag` filters and pagination. Metadata only, not the body. |
107
- | `reading_list` | List by date, filtered by status/tag. |
108
- | `reading_read` | Read a Markdown slice by id; use `offset` / `nextOffset` for long articles and `hasMore` to know whether it is complete. |
109
- | `reading_update` | Change status or tags. Status: `unread` / `reading` / `read` / `archived`. |
110
- | `reading_highlight` | Create/list/update/delete highlights and notes. `action` is `create` / `list` / `update` / `delete`; `create` takes a `quote` from the article (plain text or Markdown; formatting is stripped, or pass `startOffset`/`endOffset`), plus optional `note` and `color`. |
111
-
112
- ## Configuration
113
-
114
- Set these in the shell that starts DSH, or in the profile's `.env`, then restart.
115
-
116
- | Variable | Default | Meaning |
117
- | --- | --- | --- |
118
- | `DSH_READING_INBOX_DIR` | `~/.dsh-reading-inbox` | Data directory |
119
- | `DSH_READING_INBOX_TIMEOUT_MS` | `20000` | Per-fetch timeout |
120
- | `DSH_READING_INBOX_MAX_BYTES` | `5242880` | Max page size (5 MB) |
121
- | `DSH_READING_INBOX_MAX_MARKDOWN_CHARS` | `400000` | Max Markdown chars per article; longer content is truncated and flagged |
122
- | `DSH_READING_INBOX_MAX_REDIRECTS` | `5` | Max redirects |
123
- | `DSH_READING_INBOX_ALLOW_PRIVATE` | `0` | Set to `1` to allow localhost/private targets; for local tests only |
124
- | `DSH_READING_INBOX_USER_AGENT` | `dsh-reading-inbox/0.1 ...` | User-Agent for fetches |
125
- | `DSH_READING_INBOX_PROXY` | falls back to `HTTPS_PROXY` / `HTTP_PROXY` | HTTP proxy URL, e.g. `http://127.0.0.1:7890`; the proxy resolves the destination |
126
- | `DSH_READING_INBOX_BLOCK_FAKE_IP` | `0` | Set to `1` to reject Clash/Mihomo TUN fake-IPs in `198.18.0.0/15`; stricter, but fake-IP networks can no longer clip |
127
- | `DSH_READING_INBOX_DEFAULT_TAGS` | empty | Default tags, comma-separated; used only when the user supplies none |
128
-
129
- ## Data layout
130
-
131
- ```text
132
- ~/.dsh-reading-inbox/
133
- ├── index.json # metadata + the source for full-text search
134
- └── clips/
135
- └── <id>/
136
- ├── article.md # clean Markdown body
137
- ├── original.html # original HTML snapshot (archive only, never rendered)
138
- ├── annotations.json # highlights/notes (created on the first annotation)
139
- └── meta.json # title, URL, author, date, tags, status, annotation count
140
- ```
141
-
142
- Back up the whole directory, or sync `clips/` and `index.json`.
143
-
144
- ## Security and boundaries
145
-
146
- - **Loopback only** — every route accepts `127.0.0.1` / `::1` only, and checks Host, Origin and `Sec-Fetch-Site`; cross-site requests get 403.
147
- - **SSRF fence** — each redirect hop is re-resolved and re-validated; the DNS answer is checked again when the socket connects, closing the DNS rebinding window; loopback, private networks, CGNAT, link-local, multicast and cloud metadata addresses are rejected.
148
- - **Clash/Mihomo TUN exception** — fake-IPs in `198.18.0.0/15` are allowed by default, because blocking them would break clipping for many Chinese networks. In fake-IP mode the local pre-check only sees the fake address and cannot learn the real destination, so SSRF protection then depends on the proxy's routing rules. Set `DSH_READING_INBOX_BLOCK_FAKE_IP=1` to reject the range. With an HTTP proxy the destination is resolved by the proxy; use a trusted proxy.
149
- - **Bounded fetches** — hard limits of 5 MB, 20 seconds and 5 redirects.
150
- - **Raw HTML is never rendered** — `original.html` is an archive; the UI renders Turndown Markdown through a `sanitize-html` allowlist.
151
- - **No credentials** — the plugin does not read, store or print account passwords, and does not reuse page login sessions.
152
- - **No telemetry** — the only network requests are the URLs you explicitly clip.
153
- - **Copyright** — keep a personal reading copy only; do not use this to redistribute copyrighted content.
154
-
155
- ## Verify (source checkout)
156
-
157
- These commands run from a source checkout; the npm package ships runtime files only, without tests or development scripts.
158
-
159
- ```sh
160
- npm install
161
- npm test
162
- npm run verify
163
- ```
164
-
165
- `npm run verify` starts a local test page and walks the whole path: fetch → extract → index → search → read → annotate → export. It prints machine-readable JSON.
166
-
167
- Local UI:
168
-
169
- ```sh
170
- npm run seed # write four demo articles into .dev-inbox
171
- npm run dev # http://127.0.0.1:4173/dsh-reading-inbox/
172
- ```
173
-
174
- See [VERIFY.md](VERIFY.md) for the end-to-end check inside a real DSH.
175
-
176
- ## Development
177
-
178
- ```sh
179
- npm run build:client # rebuild client/client.js with esbuild
180
- npm test # 30 tests: extraction, rendering, SSRF, DNS checks, annotation anchoring, store races, search, routes, client bundle
181
- npm run verify # end-to-end self-check
182
- ```
183
-
184
- Layout:
185
-
186
- - `index.js` — DSH plugin entry: tools, routes, command, system prompt.
187
- - `src/store.js` — clipping, Markdown files, index, search, status.
188
- - `src/markdown.js` — Readability + Turndown + sanitize-html.
189
- - `src/fetch.js` — redirect loop, SSRF checks, charset detection, byte caps.
190
- - `src/routes.js` — loopback-only HTTP routes and JSON API.
191
- - `src/tools.js` — `reading_*` tools.
192
- - `web/` — the inbox UI (plain HTML/CSS/JS, no build).
193
- - `src/client.js` — DSH sidebar entry that frames `web/`.
194
-
195
- ## Limits and roadmap
196
-
197
- 0.2.1 is deliberately small:
198
-
199
- - [ ] SPA / login / anti-bot pages may yield no article; add a Playwright fallback.
200
- - [ ] Images still point at remote URLs; download them into `clips/<id>/assets/` for a full offline archive.
201
- - [ ] No PDF support; use `dsh-pdf-mineru` or a document reader for PDFs.
202
- - [ ] No browser extension or RSS import yet.
203
- - [ ] No sync/backup yet; the directory is portable.
204
- - [ ] Search is local BM25-style ranking; add chunking and result highlighting next.
205
-
206
- ## License
207
-
208
- MIT © 2026 Bit0620. See [LICENSE](LICENSE).
1
+ # dsh-reading-inbox
2
+
3
+ > **A reading inbox for DeepSeek Harness.** Clip a web page into clean Markdown, keep the original HTML, tag it, search it, and let the agent use it.
4
+
5
+ [![license](https://img.shields.io/badge/license-MIT-green)](LICENSE)
6
+ [![dsh-plugin](https://img.shields.io/badge/topic-dsh--plugin-6f42c1)](https://github.com/topics/dsh-plugin)
7
+ [![node](https://img.shields.io/badge/node-%3E%3D22.12-339933)](package.json)
8
+ [![dsh](https://img.shields.io/badge/dsh-%3E%3D0.2.0%20%3C0.3.0-1f6feb)](package.json)
9
+
10
+ [中文](README.md) | English
11
+
12
+ ![Reading inbox](docs/demo.jpg)
13
+
14
+ ## Why an inbox
15
+
16
+ Pages disappear. Links rot. Bookmarks turn into a pile nobody opens again.
17
+
18
+ DSH already has `web_fetch` and `read_url` for reading a page once. They do not solve three things:
19
+
20
+ 1. **Keep it** — turn the article into Markdown, keep the original HTML as an archive, so a dead link is still readable.
21
+ 2. **Find it later** — full-text search over title, body, tags and source; unread / reading / read / archived states.
22
+ 3. **Let the agent use it** — the model can clip, search, read and update clips instead of only seeing the current page.
23
+
24
+ This plugin is the small implementation of those three things. Everything stays on your machine.
25
+
26
+ ## Features
27
+
28
+ - **One-step clipping** — paste a URL; Readability extracts the article; Markdown + original HTML + title/author/date/source/excerpt are saved.
29
+ - **Text/selection capture** — when there is no fetchable URL, paste text, Markdown or HTML into the same inbox.
30
+ - **Import/export** — download all clips as JSON (optionally with original HTML) or one Markdown file; import JSON to restore clips, annotations and saved views.
31
+ - **Inbox UI** — unread / reading / read / archived, search, tag filters, reading view, copy link, export Markdown.
32
+ - **Highlights and notes** — select text to highlight it (yellow / green / blue / red) and add a note. Anchors use quote + surrounding context, so a re-clip re-locates them automatically; missing text becomes stale instead of landing on the wrong sentence. Markdown export includes active annotations.
33
+ - **Local full-text search** — CJK is indexed as unigrams + bigrams, Latin as words; title and tags are boosted. No model call.
34
+ - **Search grammar and saved views** — `tag:security`, `is:unread`, `site:example.com`, `after:2026-01-01`, `before:2026-12-31`, `has:highlight`; results include a matched snippet; save frequent queries as views.
35
+ - **Agent tools** — `reading_clip`, `reading_save_text`, `reading_search`, `reading_list`, `reading_read`, `reading_update`, `reading_highlight`.
36
+ - **Slash command** — `/inbox <url> [tag1,tag2]` without leaving the conversation.
37
+ - **Chinese-web friendly** — detects GBK / GB2312 / UTF-8 / Big5 so pages do not turn into mojibake.
38
+ - **Safe defaults** — http/https only; every redirect hop is re-validated; DNS answers are checked again at connect time (DNS rebinding defense); loopback, private networks, CGNAT, link-local and cloud metadata addresses are rejected; hard caps of 5 MB, 20 seconds and 5 redirects.
39
+ - **Local-first** — no telemetry, no account, no third-party service.
40
+ - **Exportable** — Markdown with YAML frontmatter, ready for Obsidian / Logseq / any notes folder.
41
+
42
+ ## Install
43
+
44
+ Requires **DSH >= 0.2.0 < 0.3.0** and **Node.js >= 22.12**. DSH 0.2.2 itself requires Node.js >= 24.9, so the DSH runtime is the effective floor.
45
+
46
+ From npm:
47
+
48
+ ```sh
49
+ dsh plugin --profile web add dsh-reading-inbox
50
+ ```
51
+
52
+ > pnpm's supply-chain policy waits before adopting a freshly published version. If an install right after a release picks the previous version, pin it: `dsh plugin --profile web add dsh-reading-inbox@0.4.0`.
53
+
54
+ From GitHub:
55
+
56
+ ```sh
57
+ dsh plugin --profile web add github:Bit0620/dsh-reading-inbox
58
+ ```
59
+
60
+ Local development:
61
+
62
+ ```sh
63
+ dsh plugin --profile web add file:/absolute/path/to/dsh-reading-inbox
64
+ ```
65
+
66
+ Restart `dsh web`. A **Reading inbox** row appears in the sidebar, and `/inbox` is available in chat.
67
+
68
+ > DSH Desktop manages its own profile. If the row does not appear after a CLI install, install `dsh-reading-inbox` through **Plugins → Add plugin** in the desktop app, or install it into the profile the app uses.
69
+
70
+ ## Usage
71
+
72
+ ### In the inbox
73
+
74
+ 1. Paste a URL into the top bar and press Enter; use “Paste text” for content without a URL.
75
+ 2. “Export” downloads all clips as JSON; “Import” restores a previous JSON export. Click an item to read it; mark read, archive, copy the link, export Markdown, or edit tags on the right.
76
+ 3. Select text in the article: a highlight toolbar appears. Pick a color, add an optional note, and save.
77
+ 4. The search box searches title, body, tags and source as you type. Combine `tag:`, `is:`, `site:`, `after:` and `has:highlight` filters when needed.
78
+ 5. Save the current query as a view below the search box; one click restores the same filters.
79
+ 6. Click any tag to filter by it; click a highlight or “Locate” in the annotation list to jump back to the source sentence.
80
+
81
+ ### Ask the agent
82
+
83
+ ```text
84
+ Clip https://example.com/article into my reading inbox, tags: architecture, reading
85
+ ```
86
+
87
+ ```text
88
+ Search my saved articles about SSRF and read the key paragraphs
89
+ ```
90
+
91
+ ```text
92
+ Mark that article as read and add the tag security
93
+ ```
94
+
95
+ The model calls `reading_clip`, `reading_search`, `reading_read`, `reading_update` and `reading_highlight`. The plugin adds a system-prompt section explaining when to use them.
96
+
97
+ ### Slash command
98
+
99
+ ```text
100
+ /inbox https://example.com/article architecture, reading
101
+ ```
102
+
103
+ Command output is shown in the UI only; the full article is not pushed into model context.
104
+
105
+ ## Tools
106
+
107
+ | Tool | What it does |
108
+ | --- | --- |
109
+ | `reading_clip` | Fetch a URL, extract the article, save Markdown + original HTML, update the index. Duplicate URLs return the existing clip; `force: true` re-fetches. |
110
+ | `reading_search` | Full-text search with `tag:` / `is:` / `site:` / `after:` / `before:` / `has:highlight` grammar, status/tag filters and pagination; returns metadata plus a matched snippet, not the body. |
111
+ | `reading_list` | List by date, filtered by status/tag. |
112
+ | `reading_read` | Read a Markdown slice by id; use `offset` / `nextOffset` for long articles and `hasMore` to know whether it is complete. |
113
+ | `reading_update` | Change status or tags. Status: `unread` / `reading` / `read` / `archived`. |
114
+ | `reading_highlight` | Create/list/update/delete highlights and notes. `action` is `create` / `list` / `update` / `delete`; `create` takes a `quote` from the article (plain text or Markdown; formatting is stripped, or pass `startOffset`/`endOffset`), plus optional `note` and `color`. |
115
+ | `reading_save_text` | Save pasted text / Markdown / HTML as a clip; use it for login walls, paywalled snippets, selections, or notes with no fetchable URL. Provide at least one of `text` / `markdown` / `html`. |
116
+
117
+ ## Configuration
118
+
119
+ Set these in the shell that starts DSH, or in the profile's `.env`, then restart.
120
+
121
+ | Variable | Default | Meaning |
122
+ | --- | --- | --- |
123
+ | `DSH_READING_INBOX_DIR` | `~/.dsh-reading-inbox` | Data directory |
124
+ | `DSH_READING_INBOX_TIMEOUT_MS` | `20000` | Per-fetch timeout |
125
+ | `DSH_READING_INBOX_MAX_BYTES` | `5242880` | Max page size (5 MB) |
126
+ | `DSH_READING_INBOX_MAX_MARKDOWN_CHARS` | `400000` | Max Markdown chars per article; longer content is truncated and flagged |
127
+ | `DSH_READING_INBOX_MAX_REDIRECTS` | `5` | Max redirects |
128
+ | `DSH_READING_INBOX_ALLOW_PRIVATE` | `0` | Set to `1` to allow localhost/private targets; for local tests only |
129
+ | `DSH_READING_INBOX_USER_AGENT` | `dsh-reading-inbox/0.1 ...` | User-Agent for fetches |
130
+ | `DSH_READING_INBOX_PROXY` | falls back to `HTTPS_PROXY` / `HTTP_PROXY` | HTTP proxy URL, e.g. `http://127.0.0.1:7890`; the proxy resolves the destination |
131
+ | `DSH_READING_INBOX_BLOCK_FAKE_IP` | `0` | Set to `1` to reject Clash/Mihomo TUN fake-IPs in `198.18.0.0/15`; stricter, but fake-IP networks can no longer clip |
132
+ | `DSH_READING_INBOX_DEFAULT_TAGS` | empty | Default tags, comma-separated; used only when the user supplies none |
133
+
134
+ ## Data layout
135
+
136
+ ```text
137
+ ~/.dsh-reading-inbox/
138
+ ├── index.json # metadata + the source for full-text search
139
+ ├── views.json # saved search views
140
+ └── clips/
141
+ └── <id>/
142
+ ├── article.md # clean Markdown body
143
+ ├── original.html # original HTML snapshot (archive only, never rendered)
144
+ ├── annotations.json # highlights/notes (created on the first annotation)
145
+ └── meta.json # title, URL, author, date, tags, status, annotation count
146
+ ```
147
+
148
+ Back up the whole directory, or sync `clips/` and `index.json`.
149
+
150
+ ## Security and boundaries
151
+
152
+ - **Loopback only** — every route accepts `127.0.0.1` / `::1` only, and checks Host, Origin and `Sec-Fetch-Site`; cross-site requests get 403.
153
+ - **SSRF fence** — each redirect hop is re-resolved and re-validated; the DNS answer is checked again when the socket connects, closing the DNS rebinding window; loopback, private networks, CGNAT, link-local, multicast and cloud metadata addresses are rejected.
154
+ - **Clash/Mihomo TUN exception** — fake-IPs in `198.18.0.0/15` are allowed by default, because blocking them would break clipping for many Chinese networks. In fake-IP mode the local pre-check only sees the fake address and cannot learn the real destination, so SSRF protection then depends on the proxy's routing rules. Set `DSH_READING_INBOX_BLOCK_FAKE_IP=1` to reject the range. With an HTTP proxy the destination is resolved by the proxy; use a trusted proxy.
155
+ - **Bounded fetches** — hard limits of 5 MB, 20 seconds and 5 redirects.
156
+ - **Raw HTML is never rendered** — `original.html` is an archive; the UI renders Turndown Markdown through a `sanitize-html` allowlist.
157
+ - **No credentials** — the plugin does not read, store or print account passwords, and does not reuse page login sessions.
158
+ - **No telemetry** — the only network requests are the URLs you explicitly clip.
159
+ - **Copyright** — keep a personal reading copy only; do not use this to redistribute copyrighted content.
160
+
161
+ ## Verify (source checkout)
162
+
163
+ These commands run from a source checkout; the npm package ships runtime files only, without tests or development scripts.
164
+
165
+ ```sh
166
+ npm install
167
+ npm test
168
+ npm run verify
169
+ ```
170
+
171
+ `npm run verify` starts a local test page and walks the whole path: fetch → extract → index → search → read → annotate → export. It prints machine-readable JSON.
172
+
173
+ Local UI:
174
+
175
+ ```sh
176
+ npm run seed # write four demo articles into .dev-inbox
177
+ npm run dev # http://127.0.0.1:4173/dsh-reading-inbox/
178
+ ```
179
+
180
+ See [VERIFY.md](VERIFY.md) for the end-to-end check inside a real DSH.
181
+
182
+ ## Development
183
+
184
+ ```sh
185
+ npm run build:client # rebuild client/client.js with esbuild
186
+ npm test # 38 tests: extraction, rendering, SSRF, DNS checks, annotation anchoring, store races, search, routes, client bundle
187
+ npm run verify # end-to-end self-check
188
+ ```
189
+
190
+ Layout:
191
+
192
+ - `index.js` — DSH plugin entry: tools, routes, command, system prompt.
193
+ - `src/store.js` — clipping, Markdown files, index, search, status.
194
+ - `src/markdown.js` — Readability + Turndown + sanitize-html.
195
+ - `src/fetch.js` — redirect loop, SSRF checks, charset detection, byte caps.
196
+ - `src/routes.js` — loopback-only HTTP routes and JSON API.
197
+ - `src/tools.js` — `reading_*` tools.
198
+ - `web/` — the inbox UI (plain HTML/CSS/JS, no build).
199
+ - `src/client.js` — DSH sidebar entry that frames `web/`.
200
+
201
+ ## Limits and roadmap
202
+
203
+ 0.4.0 is deliberately small:
204
+
205
+ - [ ] SPA / login / anti-bot pages may yield no article; add a Playwright fallback.
206
+ - [ ] Images still point at remote URLs; download them into `clips/<id>/assets/` for a full offline archive.
207
+ - [ ] No PDF support; use `dsh-pdf-mineru` or a document reader for PDFs.
208
+ - [ ] No browser extension or RSS import yet; URL, paste-text, JSON import/export and agent tools are covered.
209
+ - [ ] No sync/backup yet; the directory is portable.
210
+ - [ ] Search is local BM25-style ranking; add chunking and result highlighting next.
211
+
212
+ ## License
213
+
214
+ MIT © 2026 Bit0620. See [LICENSE](LICENSE).