@chance722/dsh-inbox 0.2.6 → 0.2.8

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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Chance722
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Chance722
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,187 +1,170 @@
1
- # dsh-inbox
2
-
3
- ![dsh-inbox](https://raw.githubusercontent.com/Chance722/dsh-inbox/main/docs/assets/cover.png)
4
-
5
- A **local inbox plugin for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)** (`dsh`): file whatever you copy into one vault, get it back when you need it — including **by asking your assistant in conversation**.
6
-
7
- English | [中文](README.zh.md)
8
-
9
- ## The problem it solves
10
-
11
- The things you copy during a day — a link to read later, a screenshot, a snippet of config, an account and password — end up scattered across clipboard history, bookmark folders and temporary files. When you need them you cannot find them, and you cannot remember where they went.
12
-
13
- **dsh-inbox puts them in one local vault**: paste to file, automatic classification, browse and search from the sidebar and instead of digging through it yourself, just ask your assistant "what was that article about caching I saved last month?".
14
-
15
- It works for you alone: everything lands on your machine, and the model only sees a record when you ask it to look.
16
-
17
- ## Features
18
-
19
- | Feature | What it does |
20
- |---|---|
21
- | **Two ways in** | `/inbox <text or link>` in the composer (attach images to carry them along), or paste / drop / pick a file in the panel |
22
- | **Automatic classification** | Links are filed by platform and media type (Bilibili/YouTube videos, WeChat/掘金/Zhihu articles 60-odd sites), text by credential shape, images get a 疑似证件 tag when they have card proportions; what the rules cannot decide goes to the model, with a daily cap |
23
- | **Panel** | Filter by watch-later / category / tag, search across title, text, link and note, switch between two list densities; the detail pane edits name, category, note and tags, flags watch-later, deletes and restores; it follows dsh's dark and light themes **and its language** (switch dsh to English under 设置 → 常规 and the whole panel, dock, cards and manual come with you) |
24
- | **Everything has a name** | A link is named by the headline of the page it points at (no model tokens spent), a photo or file by the name it arrived with, and the name you type always wins. A page that will not be read — an anti-bot page, a dead link leaves the address itself as the name rather than a guess. The row shows the name; the glyph on the left says what kind of thing it is (a key for a credential) |
25
- | **Who judged the category** | A coloured badge next to the category: 规则判定 (grey, the local rules) / 模型判定 (violet, the capped model pass) / 手动判定 (blue, your own choice nothing overwrites it later) |
26
- | **Ask in conversation** | Ask for 收件箱 / 仓库 / inbox and the assistant searches by words, category, tag, watch-later flag or kind (ten at a time plus a count of the rest, with thumbnails right in the results), then opens one by id (text up to 1000 characters, link, note, tags, attachment facts). To look at one yourself: expand 「N 次工具调用」 above the answer and press 打开 the 仓库 tab opens on that record |
27
- | **Looking at a picture** | Image bytes stay out of the conversation by default; when you ask "look at this picture and tell me what it is", the assistant sends that one image to itself explicitly, per call |
28
- | **Credentials are safe** | A credential's body is **encrypted at rest** with a key derived from your master password; neither the password nor the key is ever written down. The list shows only the name you gave it; plain text never reaches a conversation or a model |
29
- | **Two-way sync** | Point it at a WebDAV folder or an S3 bucket: changes are pushed a few seconds after you make them, 刷新 runs a full sync (push, then pull, merged per record by `id` + timestamp), and emptying the recycle bin deletes the cloud copies too. Two machines see each other when they share one 「目录」 (blank, `/` and `inbox` are the same) |
30
- | **Conversation cards** | Tool results render as dsh-inbox cards — links become clickable, image markers become thumbnails drawn on your machine |
31
- | **Gateway quirks** | Some object-storage gateways bind each AccessKey to an "application" and identify clients by a header (refusing you with the same status a wrong password gets) — the plugin keeps **one client identity per protocol** for exactly that |
32
-
33
- ## Screenshots
34
-
35
- ![The panel: filters on the left, list in the middle, detail on the right](https://raw.githubusercontent.com/Chance722/dsh-inbox/main/docs/assets/panel.png)
36
-
37
- It all lives inside dsh: the left rail gains an **Inbox** entry that opens a full-page vault, and the panel's top right has 设置 (settings) and 使用手册 (a short manual).
38
-
39
- ## Two ways to use it
40
-
41
- **① File something from the conversation**
42
-
43
- Type `/inbox` in the composer followed by text or a link, and attach images directly — **this command never reaches the model**, it only goes into the vault. It is the way to file credentials and throwaway links that have no business appearing in a conversation.
44
-
45
- **② Ask for it later**
46
-
47
- No command needed, just talk:
48
-
49
- > which of my saved images is the mini-program code?
50
- >
51
- > show me that article about caching I saved last week
52
- >
53
- > list the links in my inbox I haven't read yet
54
-
55
- Two questions in the same conversation, on a real machine:
56
-
57
- ![Searching by topic: the one match first, then all seven records — the two credentials show only the names their owner gave them, never the plain text](https://raw.githubusercontent.com/Chance722/dsh-inbox/main/docs/assets/chat1.png)
58
-
59
- ![Asking for what is flagged watch-later: that one record comes back with its link and the time it was filed](https://raw.githubusercontent.com/Chance722/dsh-inbox/main/docs/assets/chat2.png)
60
-
61
- ## Install
62
-
63
- Needs Node ≥ 22 and a working `dsh`. `dsh plugin add` forwards to pnpm, so the installer brings pnpm along when your machine does not have it:
64
-
65
- **Platform**: fully accepted on **Windows** only so far; macOS and Linux are **not verified yet** (no platform-specific dependency in the code — try it and tell me how it goes).
66
-
67
- `dsh web` is just `dsh --profile web`, so install into the profile you already start:
68
-
69
- ```powershell
70
- npx @chance722/dsh-inbox init --profile web --install-pnpm
71
- ```
72
-
73
- Then start dsh the way you always do `dsh web`. The **Inbox** entry is in the left rail, and a new session's assistant can look things up for you ("what links in my inbox haven't I read yet?").
74
-
75
- On a machine that has never run dsh there is no `web` profile yet; `--create-profile` makes it first:
76
-
77
- ```powershell
78
- npx @chance722/dsh-inbox init --profile web --create-profile --install-pnpm
79
- ```
80
-
81
- `init` does three things, and running it twice is safe:
82
-
83
- 1. installs the plugin into that profile — the panel and the host half both come from here
84
- 2. copies dsh's shipped `standard` preset into `~/.dsh/.agent-presets/inbox/` and adds this plugin — **this is the step that decides whether the assistant can see the inbox tools**
85
- 3. points your user-level default preset at it (backing up `~/.dsh/settings.yaml` first), so new sessions in every profile get those tools
86
-
87
- Two things that changes, so you know: the plugin joins the profile you named, and your default agent preset becomes the 收件箱 copy — a snapshot of `standard` that will not follow later dsh upgrades. Both are reversible (see Uninstall).
88
-
89
- **Want to keep your daily dsh clean?** Give the plugin a profile and a port of its own:
90
-
91
- ```powershell
92
- npx @chance722/dsh-inbox init --create-profile # an isolated `inbox` profile
93
- dsh --profile inbox --no-open --port 3102 # start it there
94
- ```
95
-
96
- Other flags: `--profile <name>` installs elsewhere, `--install-pnpm` installs pnpm first when it is missing (the two commands above already carry it), `--no-default` leaves the default preset alone, `--help` lists everything. Which profile you install into only decides **where the panel runs** — the agent preset is shared by every profile (`~/.dsh/.agent-presets/inbox/`), so installing into a second one just fills in the missing row.
97
-
98
- ### From a local checkout
99
-
100
- ```powershell
101
- git clone <this repo> dsh-inbox ; cd dsh-inbox
102
- pnpm install ; pnpm build
103
- node lib/cli.js init --package <absolute path to this repo>
104
- ```
105
-
106
- ### Uninstall
107
-
108
- ```powershell
109
- # 1. remove the package from the profile you installed it into
110
- # (also drops it from dsh.profile.bundles)
111
- dsh plugin --profile <that profile> remove @chance722/dsh-inbox
112
-
113
- # 2. delete what init created
114
- rm -r ~/.dsh/.agent-presets/inbox # the preset copy
115
- # default preset: delete agent-presets.default in ~/.dsh/settings.yaml (falls back to the
116
- # deployment default) or set it to standard; every init left a settings.yaml.bak-* backup
117
-
118
- # 3. and the profile itself, if you made one just for this
119
- rm -r ~/.dsh/profiles/<that profile>
120
- ```
121
-
122
- **Uninstalling does not delete your vault.** To remove the records too: `rm -r ~/.dsh/storages/dsh_inbox`.
123
-
124
- ## Where things live
125
-
126
- All of it on your machine (`%DSH_HOME%`, i.e. `C:\Users\<you>\.dsh` on Windows):
127
-
128
- | What | Where |
129
- |---|---|
130
- | Records: text, links, category, note, tags, watch-later… | `storages\dsh_inbox\items\*.json`, one file each |
131
- | Attachment index (mime / size / original name) | `storages\dsh_inbox\attachments\*.json` |
132
- | The **bytes** of images, videos and files | `attachments\` — dsh's own content-addressed store, never auto-deleted |
133
- | Remote password / S3 AccessKey Secret | dsh's credential store, `.credentials.yaml` |
134
- | Remote settings (URL, bucket, client identity…) | dsh's own settings |
135
-
136
- ### What the remote looks like
137
-
138
- With a remote configured and `/inbox` as the directory:
139
-
140
- | Remote path | What it is |
141
- |---|---|
142
- | `inbox/<whatever you drop>` | The **drop folder**: any device drops files here and this one ingests them |
143
- | `inbox/sync/items/<record id>.json` | One record, **machine-readable** the source of truth for sync |
144
- | `inbox/sync/items/<record id>.txt` | The same record, **readable** (text, note, which attachments it points at) |
145
- | `inbox/sync/attachments/<attachment id>.<ext>` | Attachment **bytes** (images, video, PDFs open as themselves) |
146
- | `inbox/sync/attachments/<attachment id>.meta.json` | The attachment's metadata (original name, dimensions, size, digest) |
147
- | A 0-byte key ending in `/` | A folder marker the cloud drive made itself, not us |
148
-
149
- ### How syncing works
150
-
151
- - **Automatic**: a push goes out a few seconds after a capture or an edit (debounced — several quick saves become one push). 「刷新」 is a full sync: push → pull → re-read the list.
152
- - **Merging**: incoming records are settled one by one by `id` + timestamp — the newer write wins, no conflict copies. Attachment bytes come down when a record needs them.
153
- - **Two machines**: they see each other when both use the same 「目录」 (blank, `/` and `inbox` all mean the same directory). Records a machine left under an older directory can be pulled in by ticking **Merge other sync directories too** in the settings.
154
- - **Deleting**: 「删除」 only moves a record to the bin, and other devices learn it is gone instead of pushing it back; emptying the bin is what deletes the cloud copy as well.
155
-
156
- ## Privacy and security
157
-
158
- - **Credentials are encrypted at rest**: the body is stored as ciphertext (AES-256-GCM, key derived from your master password). **Neither the password nor the key is ever written down** — the vault locks again on every restart and you unlock it under 设置 → 账密加密; a forgotten password means unrecoverable ciphertext. With no master password set, a credential is **refused rather than stored in the clear**.
159
- - **What that covers**: only the **body** of credential records. Notes, categories, tags, timestamps and attachment **bytes** are not encrypted — a key inside a pasted file is still a key inside a file.
160
- - **Masked where it matters**: a credential is listed by the name you gave it, and its plain text never reaches a conversation or a model.
161
- - **Pictures**: classification does send an image to the model (a phone photo of an ID card has the same proportions as any other photo); the conversation gets an `[attachment:id]` marker by default. **The one exception**: when you explicitly ask the assistant to look at a picture, that single image is sent to it — per call, never by default.
162
- - **The model cannot see your vault** unless you ask it to look, and classification requests are redacted first.
163
- - **Your remote needs access control**: only credential bodies are ciphertext up there — text, links, notes and attachment bytes are in the clear, and the master password and key never sync.
164
- - **What the install changes outside the panel**: reading a pasted link's headline is this plugin's only outbound request — one GET, only for links captured on this machine, never for links that arrived through sync. The profile makes it with a browser-shaped identity (`… AppleWebKit/537.36 (KHTML, like Gecko) dsh-inbox Safari/537.36`), shipped in this package's `cordis.patch.yml` as an override of `web-fetch-http.userAgent`, because sites gate on the shape of that string. That identity is the whole profile's, the model's own web tools included; **your own `cordis.patch.yml` overrides it**. Measurements and reasoning: [docs/help/link-title-fetch.md](docs/help/link-title-fetch.md).
165
-
166
- ## Development
167
-
168
- ```powershell
169
- pnpm install
170
- pnpm build # lib/index.js (host) + lib/client.js (panel) + lib/cli.js (init) + lib/types
171
- pnpm typecheck
172
- pnpm test # vitest
173
- ```
174
-
175
- Client-side changes need `pnpm build` and a page reload (dsh's client-hmr reloads it for you); host-side changes need a restart. Details in [docs/help/dev-setup.md](docs/help/dev-setup.md); milestones and acceptance records in the [development bus](docs/feature/dev-bus.md).
176
-
177
- To switch the profile you actually run between the **published package** and **this checkout** (default profile `web`; set `DSH_PROFILE` for another):
178
-
179
- ```powershell
180
- pnpm dev:status # which one is in use right now
181
- pnpm dev:npm # point it at the published version
182
- pnpm dev:local # point it back here (builds first, then links)
183
- ```
184
-
185
- ## License
186
-
187
- MIT
1
+ # dsh-inbox
2
+
3
+ ![dsh-inbox](https://raw.githubusercontent.com/Chance722/dsh-inbox/main/docs/assets/banner.png)
4
+
5
+ A **local inbox plugin for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)** (`dsh`): file whatever you copy into one vault, get it back when you need it — including **by asking your assistant in conversation**.
6
+
7
+ English | [中文](README.zh.md)
8
+
9
+ ## What it is
10
+
11
+ The things you copy in a day — a link to read later, a screenshot, a config snippet, an account and password — end up scattered across clipboard history, bookmarks and temp files. dsh-inbox keeps them in one local vault: paste to file, automatic classification, browse and search from the sidebar and instead of digging through it yourself, ask your assistant "what was that article about caching I saved last month?".
12
+
13
+ Everything lands on your machine, and the model only sees a record when you ask it to look.
14
+
15
+ ## Features
16
+
17
+ | Feature | What it does |
18
+ |---|---|
19
+ | **Two ways in** | `/inbox <text or link>` in the composer (attach images to carry them along), or paste / drop / pick a file in the panel |
20
+ | **Automatic classification** | Links by platform and media type (60-odd sites: Bilibili, YouTube, WeChat, 掘金, Zhihu…), text by credential shape, images get a 疑似证件 tag at card proportions; the rest goes to the model, with a daily cap |
21
+ | **Panel** | Filter by watch-later / category / tag, search title, text, link and note, two list densities; the detail pane edits name, category, note and tags, flags watch-later, deletes and restores and it follows dsh's theme **and language** |
22
+ | **Every record has a name** | A link takes the page's own headline (no model tokens), a photo or file its file name, and the name you type always wins. A page that will not be read an anti-bot page, a dead link — leaves the address as the name rather than a guess |
23
+ | **Who judged the category** | A coloured badge: 规则判定 (local rules) / 模型判定 (the capped model pass) / 手动判定 (yours nothing overwrites it later) |
24
+ | **Ask in conversation** | Ask for 收件箱 / 仓库 / inbox and the assistant searches by words, category, tag, watch-later flag or kind (ten at a time plus a count, thumbnails inline) and opens one by id (text up to 1000 characters, link, note, tags, attachments). 「打开 ↗」 under an answer jumps to that record in the 仓库 tab |
25
+ | **Looking at a picture** | Image bytes stay out of the conversation; ask the assistant to look at one and that single image is sentexplicitly, per call |
26
+ | **Credentials are safe** | The body is encrypted at rest, with a key derived from your master password neither is ever written down. The list shows only the name you gave it, and plain text never reaches a conversation or a model |
27
+ | **Two-way sync** | Point it at a WebDAV folder or an S3 bucket: changes push a few seconds later, 刷新 runs a full push-then-pull merged per record by `id` + timestamp, and emptying the recycle bin deletes the cloud copies too. Two machines see each other when they share one 「目录」 |
28
+ | **Conversation cards** | Tool results render as dsh-inbox cards links clickable, image markers drawn as thumbnails on your machine |
29
+ | **Gateway quirks** | Some object-storage gateways bind each AccessKey to an "application" and identify clients by a header so the plugin keeps **one client identity per protocol** |
30
+
31
+ ## Screenshots
32
+
33
+ ![The panel: filters on the left, list in the middle, detail on the right](https://raw.githubusercontent.com/Chance722/dsh-inbox/main/docs/assets/panel.png?v=1)
34
+
35
+ ## Two ways to use it
36
+
37
+ **① File something from the conversation**
38
+
39
+ `/inbox` in the composer, followed by text or a link, with images attached right there — **this never reaches the model**, it only goes into the vault. That is the way to file credentials and throwaway links.
40
+
41
+ **② Ask for it later**
42
+
43
+ No command, just talk:
44
+
45
+ > which of my saved images is the mini-program code?
46
+ >
47
+ > show me that article about caching I saved last week
48
+ >
49
+ > list the links in my inbox I haven't read yet
50
+
51
+ Two questions in the same conversation, on a real machine:
52
+
53
+ ![Searching by topic the two credentials show only their names](https://raw.githubusercontent.com/Chance722/dsh-inbox/main/docs/assets/chat1.png)
54
+
55
+ ![Asking for what is flagged watch-later](https://raw.githubusercontent.com/Chance722/dsh-inbox/main/docs/assets/chat2.png)
56
+
57
+ ## Install
58
+
59
+ Needs Node 22 and a working `dsh`; the installer brings pnpm along when your machine does not have it. **Windows only so far** — macOS and Linux are unverified.
60
+
61
+ ```powershell
62
+ # install (`dsh web` is `dsh --profile web`, so this is the profile you already start)
63
+ npx @chance722/dsh-inbox init --profile web --install-pnpm
64
+
65
+ # never run dsh on this machine? create the profile in the same command
66
+ npx @chance722/dsh-inbox init --profile web --create-profile --install-pnpm
67
+
68
+ # update (init only installs and wires things up — re-running it never upgrades;
69
+ # minutes after a release, write the exact version instead: @0.2.8)
70
+ dsh plugin --profile web add @chance722/dsh-inbox@latest
71
+ ```
72
+
73
+ **Restart dsh** afterwards, then start it as usual. **Inbox** is in the left rail, and a new session's assistant can look things up ("what links in my inbox haven't I read yet?").
74
+
75
+ `init` also copies dsh's shipped `standard` preset to `~/.dsh/.agent-presets/inbox/` with this plugin added, and points your default preset at it — that is what lets the assistant see the inbox tools. It becomes a snapshot that will not follow later dsh upgrades; both it and the profile are reversible (see Uninstall).
76
+
77
+ To keep your daily dsh untouched, give the plugin its own profile and port: `npx @chance722/dsh-inbox init --create-profile`, then `dsh --profile inbox --no-open --port 3102`.
78
+
79
+ Other flags: `--profile <name>`, `--install-pnpm`, `--no-default`, `--help`.
80
+
81
+ ### From a local checkout
82
+
83
+ ```powershell
84
+ git clone <this repo> dsh-inbox ; cd dsh-inbox
85
+ pnpm install ; pnpm build
86
+ node lib/cli.js init --package <absolute path to this repo>
87
+ ```
88
+
89
+ ### Uninstall
90
+
91
+ ```powershell
92
+ # 1. remove the package from the profile you installed it into
93
+ # (also drops it from dsh.profile.bundles)
94
+ dsh plugin --profile <that profile> remove @chance722/dsh-inbox
95
+
96
+ # 2. delete what init created
97
+ rm -r ~/.dsh/.agent-presets/inbox # the preset copy
98
+ # default preset: delete agent-presets.default in ~/.dsh/settings.yaml (falls back to the
99
+ # deployment default) or set it to standard; every init left a settings.yaml.bak-* backup
100
+
101
+ # 3. and the profile itself, if you made one just for this
102
+ rm -r ~/.dsh/profiles/<that profile>
103
+ ```
104
+
105
+ **Uninstalling does not delete your vault.** To remove the records too: `rm -r ~/.dsh/storages/dsh_inbox`.
106
+
107
+ ## Where things live
108
+
109
+ Everything under `%DSH_HOME%` (`C:\Users\<you>\.dsh` on Windows):
110
+
111
+ | What | Where |
112
+ |---|---|
113
+ | Records: text, links, category, note, tags, watch-later… | `storages\dsh_inbox\items\*.json`, one file each |
114
+ | Attachment index (mime / size / original name) | `storages\dsh_inbox\attachments\*.json` |
115
+ | The **bytes** of images, videos and files | `attachments\` — dsh's own content-addressed store, never auto-deleted |
116
+ | Remote password / S3 AccessKey Secret | dsh's credential store, `.credentials.yaml` |
117
+ | Remote settings (URL, bucket, client identity…) | dsh's own settings |
118
+
119
+ ### What the remote looks like
120
+
121
+ With a remote configured and `/inbox` as the directory:
122
+
123
+ | Remote path | What it is |
124
+ |---|---|
125
+ | `inbox/<whatever you drop>` | The **drop folder**: any device drops files here and this one ingests them |
126
+ | `inbox/sync/items/<record id>.json` | One record, **machine-readable** the source of truth for sync |
127
+ | `inbox/sync/items/<record id>.txt` | The same record, **readable** (text, note, which attachments it points at) |
128
+ | `inbox/sync/attachments/<attachment id>.<ext>` | Attachment **bytes** (images, video, PDFs open as themselves) |
129
+ | `inbox/sync/attachments/<attachment id>.meta.json` | The attachment's metadata (original name, dimensions, size, digest) |
130
+ | A 0-byte key ending in `/` | A folder marker the cloud drive made itself, not us |
131
+
132
+ ### How syncing works
133
+
134
+ - **Automatic**: a push seconds after a capture or edit (debounced several quick saves are one push); 「刷新」 is a full sync: push → pull → re-read the list.
135
+ - **Merging**: per `id` + timestamp, the newer write wins, no conflict copies; needed attachment bytes come down with the record.
136
+ - **Two machines**: one shared 「目录」 (blank, `/` and `inbox` are the same). Records a machine left under an older directory come back if you tick **Merge other sync directories too** in the settings.
137
+ - **Deleting**: 「删除」 only moves a record to the bin and the other devices are told it is gone; emptying the bin deletes the cloud copy as well, and it stays deleted — a copy sitting in another sync directory cannot file it back in.
138
+
139
+ ## Privacy and security
140
+
141
+ - **Credential bodies are encrypted at rest** (AES-256-GCM, key derived from your master password). Neither the password nor the key is written down: the vault locks on every restart and you unlock it under 设置 → 账密加密, and a forgotten password means unrecoverable ciphertext. With no master password set, a credential is **refused rather than stored in the clear**.
142
+ - **That covers the body only**: notes, categories, tags, timestamps and attachment **bytes** are not encrypted a key inside a pasted file is still a key inside a file.
143
+ - **Masked where it matters**: a credential is listed by the name you gave it, and its plain text never reaches a conversation or a model.
144
+ - **Pictures**: classification does send an image to the model, and the conversation gets an `[attachment:id]` marker that one image is sent only when you explicitly ask the assistant to look at it.
145
+ - **The model cannot see your vault** unless you ask it to look, and classification requests are redacted first.
146
+ - **Your remote needs access control**: only credential bodies are ciphertext up there — text, links, notes and attachment bytes are in the clear, and the master password and key never sync.
147
+ - **One thing the install changes outside the panel**: reading a pasted link's headline is the plugin's only outbound request (one GET, only for links captured on this machine, never for links that came through sync). It goes out with a **browser-shaped** identity, an override of `web-fetch-http.userAgent` shipped in this package's `cordis.patch.yml`. That identity is the whole profile's, the model's own web tools included; **your own `cordis.patch.yml` overrides it**. Details: [docs/help/link-title-fetch.md](docs/help/link-title-fetch.md).
148
+
149
+ ## Development
150
+
151
+ ```powershell
152
+ pnpm install
153
+ pnpm build # lib/index.js (host) + lib/client.js (panel) + lib/cli.js (init) + lib/types
154
+ pnpm typecheck
155
+ pnpm test # vitest
156
+ ```
157
+
158
+ Client-side changes need `pnpm build` (dsh's client-hmr reloads the page); host-side changes need a restart. Details in [docs/help/dev-setup.md](docs/help/dev-setup.md), milestones in the [development bus](docs/feature/dev-bus.md).
159
+
160
+ To switch the profile you actually run between the **published package** and **this checkout** (default profile `web`; set `DSH_PROFILE` for another):
161
+
162
+ ```powershell
163
+ pnpm dev:status # which one is in use right now
164
+ pnpm dev:npm # point it at the published version
165
+ pnpm dev:local # point it back here (builds first, then links)
166
+ ```
167
+
168
+ ## License
169
+
170
+ MIT