@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/README.zh.md CHANGED
@@ -1,186 +1,168 @@
1
- # dsh-inbox
2
-
3
- ![dsh-inbox](https://raw.githubusercontent.com/Chance722/dsh-inbox/main/docs/assets/cover.png)
4
-
5
- 给 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(`dsh`)的**本地收件箱插件**:把随手复制的东西收进一个仓库,需要的时候找得回来——包括**在对话里让助手替你取**。
6
-
7
- [English](README.md) | 中文
8
-
9
- ## 它解决什么问题
10
-
11
- 一天里复制过的东西——一条待读的链接、一张截图、一段配置、一个账号密码——散落在剪贴板历史、收藏夹和临时文件里,要用的时候找不到,也记不住放在哪。
12
-
13
- **dsh-inbox 把它们收进一个本地仓库**:粘贴即存、自动分类、侧栏里能翻能搜;想找的时候不必自己翻,直接在对话里问助手「我上个月存的那篇讲缓存的文章呢」。
14
-
15
- 它只服务于你自己:数据全部落在本机,只有你让助手查的时候,模型才看得到内容。
16
-
17
- ## 主要功能
18
-
19
- | 功能 | 说明 |
20
- |---|---|
21
- | **两个入口** | 输入框里 `/inbox <文字或链接>`(图片附在输入框上一起收),或面板里粘贴 / 拖拽 / 选择文件 |
22
- | **自动分类** | 链接按平台与类型分(B 站/YouTube 视频,公众号/掘金/知乎文章…共 60 多个站点)、文本按密钥形状分、图片按比例加「疑似证件」标签;规则判不出的交给模型兜底,有每日上限 |
23
- | **面板** | 待看 / 类目 / 标签筛选 + 跨标题正文链接备注的搜索;两种列表密度;详情里能改名称、类目、备注、标签,能标待看,能删除与恢复;**跟着 dsh 的深色/浅色主题走,也跟着它的语言走**(在「设置 → 常规」里把 dsh 切成 English,面板、右侧 dock、对话卡片与使用手册一起变) |
24
- | **每条都有名字** | 链接自动抓页面标题(不花模型 token)、图片文件用原文件名;你自己起的名字永远优先。读不到的页面——对方是反爬页、或者链接已经死了——名字位就留链接本身,不猜一个。列表里显示名字本身,类型交给左侧图标(密钥就是一把钥匙) |
25
- | **类目是谁判的** | 类目旁带颜色标签:规则判定(灰)/ 模型判定(紫)/ 手动判定(蓝)。你改过的类目,后续任何流程都不会覆盖 |
26
- | **对话里取回** | 直接问「我的收件箱 / 仓库 / inbox 里有哪些还没看的链接」就行,助手按关键词/类目/标签/待看/类型查(最多 10 条 + 还剩几条,带图的结果直接显示缩略图),按 id 打开一条(正文最多 1000 字、链接、备注、标签、附件信息)。想直接看某一条:展开回答上方的「N 次工具调用」,记录后面的「打开 ↗」会在右侧「仓库」里停到那一条 |
27
- | **看图** | 默认图片字节不进对话;你说「帮我看这张图是什么」时,助手才会把那张图发给自己看(一次性、显式要) |
28
- | **密钥安全** | 账密正文**加密落盘**:主密码派生密钥,密码与密钥都不落盘;列表只显示你起的名字;明文永不进对话、永不发给模型 |
29
- | **双向同步** | 配一个 WebDAV 目录或 S3 桶:入库后自动推送,点「刷新」做一次完整同步(先推后拉、按记录 `id` + 时间合并),清空回收站连云端一起删;两台机器用同一个「目录」就能互通(留空 / `/` / `inbox` 同义) |
30
- | **对话卡片** | 工具结果渲染成 dsh-inbox 卡片:链接可点,图片标记在本机渲染成缩略图 |
31
- | **网关兼容** | 有些对象存储网关把每把 AccessKey 绑在"应用"上并按客户端标识认人(状态码与"密码错"一样)——插件支持**按协议各存一份客户端标识** |
32
-
33
- ## 界面
34
-
35
- ![面板:左侧筛选、中间列表、右侧详情](https://raw.githubusercontent.com/Chance722/dsh-inbox/main/docs/assets/panel.png)
36
-
37
- 界面都在 dsh 里:左侧栏多一个 **Inbox** 入口,点开是整页仓库管理;面板右上角有「设置」和「使用手册」(手册把常见场景讲了一遍)。
38
-
39
- ## 两种用法
40
-
41
- **① 存:在对话里转存**
42
-
43
- 输入框里写 `/inbox` 再跟文字或链接,图片直接附在输入框上——**这条命令不会发给模型**,只进仓库。适合存账号密码、临时链接这类不该出现在对话里的东西。
44
-
45
- **② 取:在对话里问**
46
-
47
- 不用记命令,正常说话就行:
48
-
49
- > 我收件库里那个小程序码是哪张?
50
- >
51
- > 上周存的讲缓存的文章给我看看
52
- >
53
- > 帮我把还没看过的链接列一下
54
-
55
- 同一段对话里的两次提问(真机截图):
56
-
57
- ![按主题查仓库:助手先给命中的那一条,再把 7 条记录列成表——密钥那两行只显示你起的名字,没有明文](https://raw.githubusercontent.com/Chance722/dsh-inbox/main/docs/assets/chat1.png)
58
-
59
- ![问「有没有待看的」:按「待看」标记把那一条取回来,带链接与存入时间](https://raw.githubusercontent.com/Chance722/dsh-inbox/main/docs/assets/chat2.png)
60
-
61
- ## 安装
62
-
63
- 前置:Node ≥ 22,以及一个能用的 `dsh`。`dsh plugin add` 是转发给 pnpm 的,所以机器上没有 pnpm 时,安装命令会顺手替你装好:
64
-
65
- **平台**:目前只在 **Windows** 上做过完整验收;macOS / Linux **尚未验证**(代码里没有平台特定依赖,欢迎试用后反馈)。
66
-
67
- `dsh web` 就是 `dsh --profile web`,所以直接装进你日常启动的那个 profile:
68
-
69
- ```powershell
70
- npx @chance722/dsh-inbox init --profile web --install-pnpm
71
- ```
72
-
73
- 然后照旧启动——`dsh web`。左栏出现 **Inbox**;新会话里问「我的收件箱里有哪些还没看的链接」,助手就会去查。
74
-
75
- 全新机器(从没跑过 dsh,还没有 `web` 这个 profile)加 `--create-profile` 让它先建:
76
-
77
- ```powershell
78
- npx @chance722/dsh-inbox init --profile web --create-profile --install-pnpm
79
- ```
80
-
81
- `init` 做三件事,重复运行是安全的:
82
-
83
- 1. 把插件装进这个 profile——面板和宿主半边都从这里来
84
- 2. 复制 dsh 自带的 `standard` preset 到 `~/.dsh/.agent-presets/inbox/` 并加入本插件——**这一步决定助手能不能看到收件箱工具**
85
- 3. 把你**用户级**的默认 preset 指向它(会先备份 `~/.dsh/settings.yaml`),于是所有 profile 的新会话都带上这套工具
86
-
87
- 有两件事跟你的设置有关,先说清楚:插件会进你点名的那个 profile;你的默认 agent preset 变成「收件箱」那份——**它是 `standard` 的副本快照,dsh 以后升级 standard 不会自动跟着变**。两件都能退(见「卸载」)。
88
-
89
- **想让日常 dsh 保持干净?** 给插件单独一个 profile 和端口:
90
-
91
- ```powershell
92
- npx @chance722/dsh-inbox init --create-profile # 建一个隔离的 inbox profile
93
- dsh --profile inbox --no-open --port 3102 # 在那个 profile 里起
94
- ```
95
-
96
- 其它选项:`--profile <名字>` 装到别处,`--install-pnpm` 在没有 pnpm 时先替你装(上面两条命令已经带上它),`--no-default` 不动默认 preset,`--help` 列全。装进哪个 profile 只决定**面板跑在哪儿**——agent preset 是所有 profile 共享的(`~/.dsh/.agent-presets/inbox/`),装第二个 profile 只会补上缺的那行。
97
-
98
- ### 从本地仓库装
99
-
100
- ```powershell
101
- git clone <本仓库> dsh-inbox ; cd dsh-inbox
102
- pnpm install ; pnpm build
103
- node lib/cli.js init --package <本仓库的绝对路径>
104
- ```
105
-
106
- ### 卸载
107
-
108
- ```powershell
109
- # 1. 从你装进去的那个 profile 里摘掉(同时会从 dsh.profile.bundles 移除)
110
- dsh plugin --profile <你装的 profile> remove @chance722/dsh-inbox
111
-
112
- # 2. 删掉 init 建的东西
113
- rm -r ~/.dsh/.agent-presets/inbox # 那个 preset 副本
114
- # 默认 preset:把 ~/.dsh/settings.yaml agent-presets.default 删掉(继承部署默认),
115
- # 或改成 standard;init 每次都留了 settings.yaml.bak-* 备份,也可以直接还原
116
-
117
- # 3. 想连这个 profile 一起删(只为这个插件建过才需要)
118
- rm -r ~/.dsh/profiles/<你装的 profile>
119
- ```
120
-
121
- **卸载不会删掉你的仓库。** 连记录一起删:`rm -r ~/.dsh/storages/dsh_inbox`。
122
-
123
- ## 东西存在哪
124
-
125
- 全部在本机(`%DSH_HOME%`,Windows 上就是 `C:\Users\<你>\.dsh`):
126
-
127
- | 什么 | 在哪 |
128
- |---|---|
129
- | 记录:文本、链接、类目、备注、标签、待看… | `storages\dsh_inbox\items\*.json`(一条一个文件) |
130
- | 附件索引(mime / 尺寸 / 原文件名) | `storages\dsh_inbox\attachments\*.json` |
131
- | 图片 / 视频 / 文件的**字节** | `attachments\`(dsh 自己的附件仓库,按内容寻址,永不自动删) |
132
- | 远端密码 / S3 AccessKey Secret | dsh 的凭证库 `.credentials.yaml` |
133
- | 远端设置(地址、桶、客户端标识…) | dsh 的 settings |
134
-
135
- ### 云端长什么样
136
-
137
- 配了远端(WebDAV 目录或 S3 桶)、目录填 `/inbox` 时:
138
-
139
- | 远端路径 | 是什么 |
140
- |---|---|
141
- | `inbox/<你扔的文件>` | **投放区**:任何设备往这儿扔文件,本机拉取时读它们并入库 |
142
- | `inbox/sync/items/<记录 id>.json` | 一条记录的**机器可读版**(同步的真相来源) |
143
- | `inbox/sync/items/<记录 id>.txt` | 同一条记录的**可读版**(云盘里直接能看:正文、备注、附件指向) |
144
- | `inbox/sync/attachments/<附件 id>.<扩展名>` | 附件**字节**(图片 / 视频 / PDF 直接能打开) |
145
- | `inbox/sync/attachments/<附件 id>.meta.json` | 附件元数据(原文件名、宽高、字节数、摘要) |
146
- | 0 字节、以 `/` 结尾的 key | 云盘自己建的目录占位,不是插件写的 |
147
-
148
- ### 同步怎么走
149
-
150
- - **自动**:入库或改动后几秒推一次(防抖,连着存几条只推一次);「刷新」= 一次完整同步(先推 → 再拉 → 重读列表)。
151
- - **合并**:拉回来的记录按 `id` + 更新时间逐条判——谁新谁赢,不留冲突副本;需要的附件字节一起下来。
152
- - **两台机器**:用同一个「目录」就互通(留空 / `/` / `inbox` 是同一个意思)。换过目录的机器留在别处的记录,可以在设置里打开「**同时合并别的同步目录**」一起拉回来。
153
- - **删除**:「删除」只进回收站,别的设备会知道它被删了(不会又推回来);「清空回收站」才连云端那份一起删。
154
-
155
- ## 隐私与安全
156
-
157
- - **账密加密落盘**:账密正文以密文保存(AES-256-GCM,密钥由你设的主密码派生)。**主密码和密钥都不落盘**——服务每次重启都要在「设置 → 账密加密」解锁一次;密码忘了就解不开已有密文,没有找回。没设主密码时,账密**不会被存进去**。
158
- - **加密的边界**:只加密账密的**正文**。备注、类目、标签、时间与附件的**字节**不在内——附件里装着密钥,它就是明文。别把"账密加密"理解成"整个仓库加密"。
159
- - **列表与对话脱敏**:密钥类记录在列表里只显示你起的名字;明文永不进对话、永不发给模型。
160
- - **图片**:分类时会把图片发给模型判断(手机拍的证件照比例与普通照片无异);对话里默认只回 `[attachment:id]` 标记,字节不进对话。**唯一的例外**:你明确让助手「看这张图」时,它会把那一张发给自己看——每次都要显式要求,默认永不发。
161
- - **模型看不到你的仓库**,除非你让它查(它调工具时才读得到),且分类请求先过脱敏。
162
- - **云端要有访问控制**:同步上去的内容里只有账密正文是密文,其余(文本、链接、备注、附件字节)是明文;主密码与密钥从不同步。
163
- - **装它会改到面板之外的一处**:抓链接标题是本插件唯一的对外请求——一次 GET,只在本机捕获的链接上发,同步拉进来的链接不抓。抓取身份是**浏览器形状**(`… AppleWebKit/537.36 (KHTML, like Gecko) dsh-inbox Safari/537.36`),由本包的 `cordis.patch.yml` 覆盖 `web-fetch-http.userAgent` 写成,因为站点按这个字符串的**形状**认客户端。这层身份是整个 profile 的,模型的 web 工具也一起用;**你自己的 `cordis.patch.yml` 覆盖得掉**。实测与理由见 [docs/help/link-title-fetch.md](docs/help/link-title-fetch.md)。
164
-
165
- ## 开发
166
-
167
- ```powershell
168
- pnpm install
169
- pnpm build # lib/index.js(宿主)+ lib/client.js(面板)+ lib/cli.js(init)+ lib/types
170
- pnpm typecheck
171
- pnpm test # vitest
172
- ```
173
-
174
- 改客户端代码:`pnpm build` 后刷新页面即可(dsh 的 client-hmr 会自己重载);改宿主代码要重启服务。细节见 [docs/help/dev-setup.md](docs/help/dev-setup.md),阶段与验收记录在[开发总线](docs/feature/dev-bus.md)。
175
-
176
- 日常想在**线上发布版**和**本地改动**之间切换(默认 profile 是 `web`,换 profile 加 `DSH_PROFILE`):
177
-
178
- ```powershell
179
- pnpm dev:status # 现在用的是哪一个:本仓库 / 线上包
180
- pnpm dev:npm # 切到 npm 上发布的版本(体验发布版)
181
- pnpm dev:local # 切回当前仓库(会先 pnpm build 再链接)
182
- ```
183
-
184
- ## 许可
185
-
186
- MIT
1
+ # dsh-inbox
2
+
3
+ ![dsh-inbox](https://raw.githubusercontent.com/Chance722/dsh-inbox/main/docs/assets/banner.png)
4
+
5
+ 给 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness)(`dsh`)的**本地收件箱插件**:把随手复制的东西收进一个仓库,需要的时候找得回来——包括**在对话里让助手替你取**。
6
+
7
+ [English](README.md) | 中文
8
+
9
+ ## 它是什么
10
+
11
+ 一天里复制过的东西——一条待读的链接、一张截图、一段配置、一个账号密码——散落在剪贴板历史、收藏夹和临时文件里。dsh-inbox 把它们收进一个本地仓库:粘贴即存、自动分类、侧栏里能翻能搜;要找回什么,直接问助手「我上个月存的那篇讲缓存的文章呢」。
12
+
13
+ 数据全部落在本机;只有你让助手查的时候,模型才看得到内容。
14
+
15
+ ## 主要功能
16
+
17
+ | 功能 | 说明 |
18
+ |---|---|
19
+ | **两个入口** | 输入框里 `/inbox <文字或链接>`(图片附在输入框上一起收),或面板里粘贴 / 拖拽 / 选择文件 |
20
+ | **自动分类** | 链接按平台与类型分(60 多个站点:B 站、YouTube、公众号、掘金、知乎…)、文本按密钥形状分、图片按比例加「疑似证件」标签;规则判不出的交给模型兜底,有每日上限 |
21
+ | **面板** | 待看 / 类目 / 标签筛选 + 跨标题正文链接备注的搜索;两种列表密度;详情里能改名称、类目、备注、标签,能标待看、删除与恢复;**跟着 dsh 的主题和语言走** |
22
+ | **每条都有名字** | 链接抓页面自己的标题(不花模型 token)、图片文件用原文件名,你自己起的名字永远优先。读不到的页面——反爬页、死链——名字位留链接本身,不猜一个 |
23
+ | **类目是谁判的** | 类目旁的颜色标签:规则判定 / 模型判定 / 手动判定(你改过的,后续不会覆盖) |
24
+ | **对话里取回** | 问「我的收件箱 / 仓库 / inbox 里有哪些还没看的链接」即可,助手按关键词/类目/标签/待看/类型查(最多 10 条 + 还剩几条,带图的直接显示缩略图),按 id 打开一条(正文最多 1000 字、链接、备注、标签、附件信息);回答上方的「打开 ↗」会跳到右侧「仓库」里那一条 |
25
+ | **看图** | 默认图片字节不进对话;你说「帮我看这张图是什么」时,才会把那一张发给自己看(一次性、显式要) |
26
+ | **密钥安全** | 账密正文**加密落盘**(主密码派生密钥,两者都不落盘);列表只显示你起的名字;明文永不进对话、永不发给模型 |
27
+ | **双向同步** | WebDAV 目录或 S3 桶:改动后几秒自动推送,「刷新」= 先推后拉完整同步、按 `id` + 时间合并;清空回收站连云端一起删;两台机器用同一个「目录」就互通 |
28
+ | **对话卡片** | 工具结果渲染成卡片:链接可点,图片标记在本机渲染成缩略图 |
29
+ | **网关兼容** | 有些对象存储网关把 AccessKey 绑在「应用」上、按客户端标识认人——插件**按协议各存一份客户端标识** |
30
+
31
+ ## 界面
32
+
33
+ ![面板:左侧筛选、中间列表、右侧详情](https://raw.githubusercontent.com/Chance722/dsh-inbox/main/docs/assets/panel.png?v=1)
34
+
35
+ ## 两种用法
36
+
37
+ **① 存:在对话里转存**
38
+
39
+ 输入框里写 `/inbox` 再跟文字或链接,图片直接附在输入框上——**这条命令不会发给模型**,只进仓库。适合存账号密码、临时链接这类东西。
40
+
41
+ **② 取:在对话里问**
42
+
43
+ 不用记命令,正常说话就行:
44
+
45
+ > 我收件库里那个小程序码是哪张?
46
+ >
47
+ > 上周存的讲缓存的文章给我看看
48
+ >
49
+ > 帮我把还没看过的链接列一下
50
+
51
+ 同一段对话里的两次提问(真机截图):
52
+
53
+ ![按主题查仓库——密钥那两行只显示你起的名字](https://raw.githubusercontent.com/Chance722/dsh-inbox/main/docs/assets/chat1.png)
54
+
55
+ ![问「有没有待看的」:按「待看」标记把那一条取回来,带链接与存入时间](https://raw.githubusercontent.com/Chance722/dsh-inbox/main/docs/assets/chat2.png)
56
+
57
+ ## 安装
58
+
59
+ 前置:Node ≥ 22 和一个能用的 `dsh`;没装 pnpm 时安装命令会顺手装好。**目前只在 Windows 上验收过**,macOS / Linux 未验证。
60
+
61
+ ```powershell
62
+ # 安装(`dsh web` 就是 `dsh --profile web`,所以装进你日常启动的那个 profile)
63
+ npx @chance722/dsh-inbox init --profile web --install-pnpm
64
+
65
+ # 全新机器(还没跑过 dsh、没有这个 profile)多带一个 --create-profile
66
+ npx @chance722/dsh-inbox init --profile web --create-profile --install-pnpm
67
+
68
+ # 更新(init 只管装和接线,重复跑不会升级;刚发布的几分钟内请写确切版本:@0.2.8)
69
+ dsh plugin --profile web add @chance722/dsh-inbox@latest
70
+ ```
71
+
72
+ 装完**重启 dsh**,然后照旧启动。左栏出现 **Inbox**;新会话里问「我的收件箱里有哪些还没看的链接」,助手就会去查。
73
+
74
+ `init` 还会把 dsh 自带的 `standard` preset 复制到 `~/.dsh/.agent-presets/inbox/` 并加上本插件、把默认 preset 指向它——助手能看见收件箱工具就是靠这一步。那份快照不会跟着 dsh 以后升级 `standard` 一起变;它和 profile 都能退掉(见「卸载」)。
75
+
76
+ 想让日常 dsh 保持干净:`npx @chance722/dsh-inbox init --create-profile`,然后 `dsh --profile inbox --no-open --port 3102`。
77
+
78
+ 其它选项:`--profile <名字>`、`--install-pnpm`、`--no-default`、`--help`。
79
+
80
+ ### 从本地仓库装
81
+
82
+ ```powershell
83
+ git clone <本仓库> dsh-inbox ; cd dsh-inbox
84
+ pnpm install ; pnpm build
85
+ node lib/cli.js init --package <本仓库的绝对路径>
86
+ ```
87
+
88
+ ### 卸载
89
+
90
+ ```powershell
91
+ # 1. 从你装进去的那个 profile 里摘掉(同时会从 dsh.profile.bundles 移除)
92
+ dsh plugin --profile <你装的 profile> remove @chance722/dsh-inbox
93
+
94
+ # 2. 删掉 init 建的东西
95
+ rm -r ~/.dsh/.agent-presets/inbox # 那个 preset 副本
96
+ # 默认 preset:把 ~/.dsh/settings.yaml agent-presets.default 删掉(继承部署默认),
97
+ # 或改成 standard;init 每次都留了 settings.yaml.bak-* 备份,也可以直接还原
98
+
99
+ # 3. 想连这个 profile 一起删(只为这个插件建过才需要)
100
+ rm -r ~/.dsh/profiles/<你装的 profile>
101
+ ```
102
+
103
+ **卸载不会删掉你的仓库。** 连记录一起删:`rm -r ~/.dsh/storages/dsh_inbox`。
104
+
105
+ ## 东西存在哪
106
+
107
+ 全部在 `%DSH_HOME%` 下(Windows 上就是 `C:\Users\<你>\.dsh`):
108
+
109
+ | 什么 | 在哪 |
110
+ |---|---|
111
+ | 记录:文本、链接、类目、备注、标签、待看… | `storages\dsh_inbox\items\*.json`(一条一个文件) |
112
+ | 附件索引(mime / 尺寸 / 原文件名) | `storages\dsh_inbox\attachments\*.json` |
113
+ | 图片 / 视频 / 文件的**字节** | `attachments\`(dsh 自己的附件仓库,按内容寻址,永不自动删) |
114
+ | 远端密码 / S3 AccessKey Secret | dsh 的凭证库 `.credentials.yaml` |
115
+ | 远端设置(地址、桶、客户端标识…) | dsh settings |
116
+
117
+ ### 云端长什么样
118
+
119
+ 配了远端(WebDAV 目录或 S3 桶)、目录填 `/inbox` 时:
120
+
121
+ | 远端路径 | 是什么 |
122
+ |---|---|
123
+ | `inbox/<你扔的文件>` | **投放区**:任何设备往这儿扔文件,本机拉取时读它们并入库 |
124
+ | `inbox/sync/items/<记录 id>.json` | 一条记录的**机器可读版**(同步的真相来源) |
125
+ | `inbox/sync/items/<记录 id>.txt` | 同一条记录的**可读版**(云盘里直接能看:正文、备注、附件指向) |
126
+ | `inbox/sync/attachments/<附件 id>.<扩展名>` | 附件**字节**(图片 / 视频 / PDF 直接能打开) |
127
+ | `inbox/sync/attachments/<附件 id>.meta.json` | 附件元数据(原文件名、宽高、字节数、摘要) |
128
+ | 0 字节、以 `/` 结尾的 key | 云盘自己建的目录占位,不是插件写的 |
129
+
130
+ ### 同步怎么走
131
+
132
+ - **自动**:入库或改动后几秒推一次(防抖);「刷新」= 先推 再拉 重读列表。
133
+ - **合并**:按 `id` + 更新时间逐条判——谁新谁赢,不留冲突副本;需要的附件字节一起下来。
134
+ - **两台机器**:用同一个「目录」就互通(留空 / `/` / `inbox` 同义)。换过目录的机器留在别处的记录,可以在设置里打开「**同时合并别的同步目录**」一起拉回来。
135
+ - **删除**:「删除」只进回收站,别的设备会知道它被删了;「清空回收站」才连云端那份一起删,而且**清掉就是清掉**——另一套同步目录里那份副本不会再把它塞回来。
136
+
137
+ ## 隐私与安全
138
+
139
+ - **账密加密落盘**:账密正文以密文保存(AES-256-GCM,密钥由主密码派生)。主密码和密钥都不落盘——每次重启都要在「设置 账密加密」解锁一次;密码忘了就解不开,没有找回。没设主密码时,账密**不会被存进去**。
140
+ - **加密的边界**:只加密账密的**正文**。备注、类目、标签、时间与附件的**字节**不在内——附件里装着密钥,它就是明文。
141
+ - **列表与对话脱敏**:密钥类记录在列表里只显示你起的名字;明文永不进对话、永不发给模型。
142
+ - **图片**:分类时会把图片发给模型判断;对话里默认只回 `[attachment:id]` 标记。只有你明确让助手「看这张图」时,它才会把那一张发给自己看。
143
+ - **模型看不到你的仓库**,除非你让它查(它调工具时才读得到),且分类请求先过脱敏。
144
+ - **云端要有访问控制**:同步上去的内容里只有账密正文是密文,其余(文本、链接、备注、附件字节)是明文;主密码与密钥从不同步。
145
+ - **装它会改到面板之外的一处**:抓链接标题是本插件唯一的对外请求(一次 GET,只在本机捕获的链接上发,同步拉进来的不抓)。它用的是**浏览器形状**的身份,由本包的 `cordis.patch.yml` 覆盖 `web-fetch-http.userAgent` 写成。这层身份是整个 profile 的,模型的 web 工具也一起用;**你自己的 `cordis.patch.yml` 覆盖得掉**。细节见 [docs/help/link-title-fetch.md](docs/help/link-title-fetch.md)。
146
+
147
+ ## 开发
148
+
149
+ ```powershell
150
+ pnpm install
151
+ pnpm build # lib/index.js(宿主)+ lib/client.js(面板)+ lib/cli.js(init)+ lib/types
152
+ pnpm typecheck
153
+ pnpm test # vitest
154
+ ```
155
+
156
+ 改客户端代码:`pnpm build` 后页面会自己重载(dsh 的 client-hmr);改宿主代码要重启服务。细节见 [docs/help/dev-setup.md](docs/help/dev-setup.md),阶段记录在[开发总线](docs/feature/dev-bus.md)。
157
+
158
+ 日常想在**线上发布版**和**本地改动**之间切换(默认 profile 是 `web`,换 profile 加 `DSH_PROFILE`):
159
+
160
+ ```powershell
161
+ pnpm dev:status # 现在用的是哪一个:本仓库 / 线上包
162
+ pnpm dev:npm # 切到 npm 上发布的版本(体验发布版)
163
+ pnpm dev:local # 切回当前仓库(会先 pnpm build 再链接)
164
+ ```
165
+
166
+ ## 许可
167
+
168
+ MIT
package/cordis.patch.yml CHANGED
@@ -1,32 +1,32 @@
1
- # The dsh-inbox bundle patch. Loaded when this package is named in the profile's
2
- # `dsh.profile.bundles`; it inserts one host row, and the browser half arrives
3
- # through the same package's `dsh.client` declaration (the client-modules node
4
- # half scans enabled rows for packages that declare one).
5
- #
6
- # Row ids are addressed by later layers (the profile's cordis.patch.yml, --patch
7
- # overlays), so `dsh-inbox` is the id other people should target to reconfigure us.
8
-
9
- - insert:
10
- - id: dsh-inbox
11
- name: '@chance722/dsh-inbox'
12
-
13
- # The identity this profile fetches pages with, restated here because our own
14
- # link-title fetch needs a browser-shaped one: sites gate on the *shape* of this
15
- # string, and bilibili answers the `Mozilla/5.0 (compatible; ...)` form with an
16
- # anti-bot page that carries a real-looking `<title>` (measured 2026-09-21:
17
- # 20/29 refused for the compatible form, 0/15 for the one below). Details,
18
- # measurements and the refusal heuristics live in docs/help/link-title-fetch.md.
19
- #
20
- # It still says who is asking — `dsh-inbox` sits where a browser puts
21
- # `Chrome/140.0.0.0` — with no version token, because one that goes stale on every
22
- # release is worse than none. A parenthetical `(+url)` or a suffix after a browser
23
- # token lands in the refused bucket exactly like `(compatible; ...)` does, so
24
- # there is none of either.
25
- #
26
- # Scope: this is the profile's fetch identity, so the model's own web tools use it
27
- # too. The user's own cordis.patch.yml is applied after this layer and wins,
28
- # which is how anyone picks a different identity without touching the package.
29
- - id: web-fetch-http
30
- name: '@deepseek-ai/dsh-web-fetch-http'
31
- config:
32
- userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) dsh-inbox Safari/537.36'
1
+ # The dsh-inbox bundle patch. Loaded when this package is named in the profile's
2
+ # `dsh.profile.bundles`; it inserts one host row, and the browser half arrives
3
+ # through the same package's `dsh.client` declaration (the client-modules node
4
+ # half scans enabled rows for packages that declare one).
5
+ #
6
+ # Row ids are addressed by later layers (the profile's cordis.patch.yml, --patch
7
+ # overlays), so `dsh-inbox` is the id other people should target to reconfigure us.
8
+
9
+ - insert:
10
+ - id: dsh-inbox
11
+ name: '@chance722/dsh-inbox'
12
+
13
+ # The identity this profile fetches pages with, restated here because our own
14
+ # link-title fetch needs a browser-shaped one: sites gate on the *shape* of this
15
+ # string, and bilibili answers the `Mozilla/5.0 (compatible; ...)` form with an
16
+ # anti-bot page that carries a real-looking `<title>` (measured 2026-09-21:
17
+ # 20/29 refused for the compatible form, 0/15 for the one below). Details,
18
+ # measurements and the refusal heuristics live in docs/help/link-title-fetch.md.
19
+ #
20
+ # It still says who is asking — `dsh-inbox` sits where a browser puts
21
+ # `Chrome/140.0.0.0` — with no version token, because one that goes stale on every
22
+ # release is worse than none. A parenthetical `(+url)` or a suffix after a browser
23
+ # token lands in the refused bucket exactly like `(compatible; ...)` does, so
24
+ # there is none of either.
25
+ #
26
+ # Scope: this is the profile's fetch identity, so the model's own web tools use it
27
+ # too. The user's own cordis.patch.yml is applied after this layer and wins,
28
+ # which is how anyone picks a different identity without touching the package.
29
+ - id: web-fetch-http
30
+ name: '@deepseek-ai/dsh-web-fetch-http'
31
+ config:
32
+ userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) dsh-inbox Safari/537.36'
package/lib/cli.js CHANGED
@@ -327,6 +327,7 @@ ${hint}`);
327
327
  \xB7 \u7528\u4F60\u5E73\u65F6\u90A3\u6761\u547D\u4EE4\u542F\u52A8\u5B83\uFF1A${profile === "web" ? "dsh web" : `dsh --profile ${profile}`}
328
328
  \xB7 \u65B0\u5EFA\u4E00\u4E2A\u4F1A\u8BDD\uFF0C\u5B83\u5C31\u4F1A\u5E26\u4E0A\u6536\u4EF6\u7BB1\u5DE5\u5177\uFF1B\u60F3\u8BA9\u52A9\u624B\u67E5\u4ED3\u5E93\uFF0C\u76F4\u63A5\u95EE\u300C\u6211\u7684\u6536\u4EF6\u7BB1\u91CC\u6709\u54EA\u4E9B\u8FD8\u6CA1\u770B\u7684\u94FE\u63A5\u300D
329
329
  \xB7 \u9762\u677F\uFF08\u4FA7\u680F Inbox\uFF09\u4E0D\u9700\u8981 preset\uFF0C\u88C5\u5B8C\u5C31\u5728
330
+ \xB7 \u4EE5\u540E\u8981\u66F4\u65B0\u5230\u7EBF\u4E0A\u6700\u65B0\u7248\uFF1Adsh plugin --profile ${profile} add ${PACKAGE_NAME}@latest\uFF08\u91CD\u590D\u8DD1 init \u53EA\u4F1A\u91CD\u590D\u68C0\u67E5\uFF0Cpnpm \u56DE\u4E00\u53E5 "Already up to date"\uFF0C\u4E0D\u4F1A\u5347\u7EA7\uFF09
330
331
  `
331
332
  );
332
333
  return 0;
package/lib/client.js CHANGED
@@ -869,6 +869,7 @@ window.__ModuleLoader__.load({
869
869
  "sync.detailPulled": "\u62C9\u53D6 {count} \u6761 \xB7 \u4E91\u7AEF {records} \u6761\u8BB0\u5F55 / {files} \u4E2A\u9644\u4EF6",
870
870
  "sync.detailAdded": "\uFF08\u5176\u4E2D {count} \u6761\u662F\u65B0\u8BB0\u5F55\uFF09",
871
871
  "sync.detailDeleted": "\uFF08\u5176\u4E2D {count} \u6761\u662F\u5220\u9664\uFF0C\u4F1A\u8FDB\u56DE\u6536\u7AD9\uFF09",
872
+ "sync.detailPurged": "\uFF08\u6E05\u7A7A\u8FC7 {count} \u6761\uFF1A\u4E91\u7AEF\u7684\u65E7\u526F\u672C\u6CA1\u6709\u62C9\u56DE\u6765\uFF09",
872
873
  "sync.pullForeignSync": " \xB7 \u26A0\uFE0F \u53E6\u6709 {records} \u6761\u8BB0\u5F55\u5728\u522B\u7684\u540C\u6B65\u76EE\u5F55\uFF1A{roots}",
873
874
  "sync.detailForeign": " \xB7 \u26A0\uFE0F \u522B\u7684\u540C\u6B65\u76EE\u5F55\uFF1A{roots}\uFF08{records} \u6761\u8BB0\u5F55\uFF1B\u672C\u673A {ours}\uFF09",
874
875
  // The toast: two numbers, nothing else. Everything else about a sync is
@@ -1132,6 +1133,7 @@ window.__ModuleLoader__.load({
1132
1133
  "sync.detailPulled": "pulled {count} \xB7 the cloud holds {records} records / {files} attachments",
1133
1134
  "sync.detailAdded": " ({count} of them new)",
1134
1135
  "sync.detailDeleted": " ({count} of them deletions \u2014 they land in the recycle bin)",
1136
+ "sync.detailPurged": " ({count} emptied out of the bin: their older cloud copies stayed out)",
1135
1137
  "sync.pullForeignSync": " \xB7 \u26A0\uFE0F {records} records live in another sync directory: {roots}",
1136
1138
  "sync.detailForeign": " \xB7 \u26A0\uFE0F another sync directory: {roots} ({records} records; ours is {ours})",
1137
1139
  "sync.shortPushed": "pushed {count}",
@@ -3298,7 +3300,8 @@ window.__ModuleLoader__.load({
3298
3300
  });
3299
3301
  const gained = (result.added ?? 0) === 0 ? "" : t("sync.detailAdded", { count: result.added ?? 0 });
3300
3302
  const deleted = (result.deletions ?? 0) === 0 ? "" : t("sync.detailDeleted", { count: result.deletions ?? 0 });
3301
- return `${head}${gained}${deleted}${warningsOf(result, true)}`;
3303
+ const purged = (result.purged ?? 0) === 0 ? "" : t("sync.detailPurged", { count: result.purged ?? 0 });
3304
+ return `${head}${gained}${deleted}${purged}${warningsOf(result, true)}`;
3302
3305
  }
3303
3306
  function EncryptionSettings({ call }) {
3304
3307
  const [status, setStatus] = import_react8.default.useState();