dsh-mask 0.2.19 → 0.2.22

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-pt.md CHANGED
@@ -26,12 +26,33 @@
26
26
  ---
27
27
 
28
28
 
29
+ **📖 Base de conhecimento do ecossistema** — dados medidos, não marketing: [guia de desenvolvimento · dados de seleção · critérios de manutenção](https://perrylink.github.io/dsh-plugin-guide/).
30
+
29
31
  <!-- star-cta -->
30
32
  ## ⭐ 如果它帮到了你
31
33
 
32
34
  Este plugin faz parte da [família de plugins DSH](https://github.com/PerryLink) (mais de 40, todos Apache-2.0). Se for útil, **deixe uma estrela**: não desbloqueia nada, mas ajuda a próxima pessoa a encontrá-lo.
33
35
 
34
36
  *English:* part of a 40+ plugin family for DeepSeek Harness. If it is useful, **a star helps the next person find it** — nothing is gated behind it.
37
+
38
+ ## What is dsh-mask?
39
+
40
+ Middleware de mascaramento de PII para o DeepSeek Harness: anonimize dados pessoais antes que cheguem ao modelo e restaure-os na camada de exibição.
41
+
42
+ Telefones, e-mails, documentos, cartões, chaves e mais viram marcadores no limite do modelo; o texto simples nunca entra no seu registro de sessão.
43
+
44
+ ![Demonstração de terminal do dsh-mask: dsh-mask — PII becomes placeholders before the model sees it](https://raw.githubusercontent.com/PerryLink/dsh-mask/main/docs/assets/dsh-mask-hero.png)
45
+
46
+ ![Animated terminal demo of dsh-mask](https://raw.githubusercontent.com/PerryLink/dsh-mask/main/docs/assets/dsh-mask-demo.gif)
47
+
48
+ *A mesma execução, animada.*
49
+
50
+ ## Comparison
51
+
52
+ ![Gráfico comparativo medido do dsh-mask](https://raw.githubusercontent.com/PerryLink/dsh-mask/main/docs/assets/dsh-mask-evidence.png)
53
+
54
+ 108 synthetic samples (60 positive, 48 negative) · from benchmark/RESULTS.md
55
+
35
56
  ## Compatibility
36
57
 
37
58
  | Superfície | Estado |
@@ -48,19 +69,23 @@ O `dsh-mask` anonimiza dados pessoais **no limite do modelo** e mantém uma tabe
48
69
  - **Mascaramento antes da requisição** — reescreve mensagens de `agent/pre-step` para que telefones, e-mails, documentos, cartões, chaves e IPs (opt-in) virem marcadores como `<PHONE_1>`. O texto mascarado é o que é registrado e enviado ao modelo.
49
70
  - **Tabela de restauração** — o mapa `marcador → original` vive só em memória e num domínio de armazenamento controlado (`dsh_mask`); o texto simples nunca entra no registro de sessão.
50
71
  - **Auditoria sem texto simples** — o evento `mask/applied` registra apenas «N valores substituídos + distribuição por tipo».
51
- - **Comando `/mask`** — `status`, `on`/`off`, `restore <text>`, `help`.
72
+ - **Comando `/mask`** — `status`, `on`/`off`, `restore <text>` (desmapeia marcadores e entrega o texto simples como arquivo, nunca como texto registrável), `help`.
52
73
  - **Ferramenta `mask_test`** — teste um trecho e veja o resultado com marcadores; nunca revela os originais.
53
74
 
54
75
  ```text
55
- mensagem do usuário ──agent/pre-step──▶ marcadores ──modelo──▶ marcadores ──restore──▶ tela
56
- ▲ │
57
- └──── tabela de restauração (memória + dsh_mask) ─┘
76
+ mensagem do usuário ──agent/pre-step──▶ marcadores ──modelo──▶ marcadores ──restore──▶ arquivo controlado
77
+ ▲ │
78
+ └──── tabela de restauração (memória + dsh_mask) ──┘
58
79
  ```
59
80
 
60
81
  ## Quick start
61
82
 
62
83
  ```sh
63
- dsh plugin --profile web add "github:PerryLink/dsh-mask#main"
84
+ dsh plugin --profile web add github:PerryLink/dsh-mask
85
+ ```
86
+
87
+ ```sh
88
+ dsh plugin --profile web add github:PerryLink/dsh-mask
64
89
  # ou via npm
65
90
  dsh plugin --profile web add dsh-mask
66
91
  dsh --profile web --dump-config | grep -A2 'id: mask'
@@ -77,11 +102,13 @@ dsh --profile web --dump-config | grep -A2 'id: mask'
77
102
  ```
78
103
  > /mask status
79
104
  > /mask restore <PHONE_1>
105
+ mask: restored 1 placeholder(s): <PHONE_1>
106
+ file: /tmp/dsh-mask-restore/restore-1f0c….txt (mode 0600, one file per session)
80
107
  ```
81
108
 
82
109
  ## Install & uninstall
83
110
 
84
- - **Canal git**: `dsh plugin --profile web add "github:PerryLink/dsh-mask#main"` (equivale a `git+https://github.com/PerryLink/dsh-mask.git`). Sem etapa de build.
111
+ - **Canal git**: `dsh plugin --profile web add github:PerryLink/dsh-mask` (equivale a `git+https://github.com/PerryLink/dsh-mask.git`). Sem etapa de build.
85
112
  - **Canal npm**: `dsh plugin --profile web add dsh-mask`.
86
113
  - **Canal tarball**: `pnpm pack` e depois `dsh plugin --profile web add ./dsh-mask-<version>.tgz`.
87
114
  - **Desinstalar**: `dsh plugin --profile web remove dsh-mask`.
@@ -103,6 +130,7 @@ Todas as opções são campos Schemastery `Config` (alteráveis via cordis.yml).
103
130
  | `persistRestoreTable` | `true` | Persiste a tabela no domínio `dsh_mask` |
104
131
  | `maxRestoreEntriesPerSession` | `500` | Limite de entradas por sessão |
105
132
  | `maxSessions` | `1000` | Limite de sessões em memória |
133
+ | `restoreDir` | `''` | Onde o `/mask restore` entrega o texto simples. Vazio = `os.tmpdir()/dsh-mask-restore`; um valor relativo é resolvido contra o cwd do processo host. O diretório é criado `0700` e o arquivo escrito `0600`, um por sessão |
106
134
 
107
135
  ## Tools & surfaces
108
136
 
@@ -111,20 +139,20 @@ Todas as opções são campos Schemastery `Config` (alteráveis via cordis.yml).
111
139
  | Mascaramento `agent/pre-step` | nunca | Reescreve mensagens para marcadores |
112
140
  | `/mask status` | nunca | Estado, total substituído, distribuição |
113
141
  | `/mask on` / `/mask off` | nunca | Alternância em tempo de execução |
114
- | `/mask restore <text>` | sim (explícito) | Desmapeia marcadores para os valores desta sessão |
142
+ | `/mask restore <text>` | sim (explícito) | Desmapeia marcadores para os valores desta sessão e os escreve num arquivo controlado (um por sessão, modo `0600`); o texto do resultado e o registro de sessão levam apenas esse caminho e os nomes dos marcadores |
115
143
  | `mask_test` | nunca | Mascara um trecho e reporta o resultado |
116
144
 
117
145
  ## Permissions & data
118
146
 
119
- - **Permissões**: sem rede, sem credenciais (`network:none`, `credentials:none`).
120
- - **Dados**: a tabela `marcador → original` vive em memória e, com `persistRestoreTable: true`, no domínio `dsh_mask`; nunca no registro de sessão.
147
+ - **Permissões**: sem rede, sem credenciais (`network:none`, `credentials:none`). O manifest declara `filesystem:write` por causa do arquivo de entrega do `/mask restore`.
148
+ - **Dados**: a tabela `marcador → original` vive em memória e, com `persistRestoreTable: true`, no domínio `dsh_mask`; nunca no registro de sessão. A única outra cópia em texto simples é o arquivo de entrega que um `/mask restore` explícito escreve (`restoreDir`, modo `0600`, um por sessão, sobrescrito pela próxima restauração); nada escreve texto simples em disco de forma implícita.
121
149
  - **Registro de sessão**: `mask/applied` é declarado em `types.d.ts` e anexado só quando o host registra o tipo.
122
150
 
123
151
  ## Security boundaries
124
152
 
125
- - **Texto simples nunca entra no registro de sessão.** O registrado e enviado é a forma mascarada; os originais ficam na tabela.
126
- - **Sanitizar antes de exibir/registrar.** `lib/sanitize.mjs` redige PII, segredos e credenciais de URL.
127
- - **Restauração controlada.** `/mask restore` é a única superfície de revelação explícita.
153
+ - **Texto simples nunca entra no registro de sessão.** O registrado e enviado é a forma mascarada; os originais ficam na tabela. A mesma regra vale para a revelação: o host registra o texto do resultado de um comando **literalmente** e o usa para renderizar a saída visível, então `/mask restore` escreve o texto simples num arquivo controlado e devolve apenas o caminho.
154
+ - **Sanitizar antes de exibir/registrar.** `lib/sanitize.mjs` redige PII, segredos e credenciais de URL; `mask_test`, `/mask status` e todos os caminhos de erro do `/mask` nunca exibem originais.
155
+ - **Restauração controlada.** `/mask restore` é a única superfície de revelação explícita. Se a entrega falhar, falha fechado: um erro, nunca um fallback que exiba o texto simples.
128
156
  - **Falha fechada.** `mode`/`scope`/entidades não implementados e números fora de faixa falham ao carregar.
129
157
  - **Registros como efeitos.** Listener, comando, ferramenta e fechamento de domínio são efeitos Cordis.
130
158
 
@@ -132,7 +160,8 @@ Todas as opções são campos Schemastery `Config` (alteráveis via cordis.yml).
132
160
 
133
161
  - **Somente regex.** `person` e `address` exigem um reconhecedor NER externo; falham ao carregar. Coberto de série: telefone, e-mail, documento, cartão, chave e IP (opt-in).
134
162
  - **Padrões específicos de região.** Os detectores `phone` e `id-card` reconhecem apenas formatos da China continental: `phone` é `1[3-9]` seguido de nove dígitos, e `id-card` é um documento de residente chinês de 18 caracteres (17 dígitos mais um dígito ou `X`). Telefones e documentos de outros países não são detectados. `email`, `ip` e `key` não dependem da região; `bank-card` aceita qualquer sequência de 16-19 dígitos com menor confiança.
135
- - **A restauração visual precisa de uma metade de cliente.** Mascarar é host-side; desmascarar bolhas na UI é uma função de navegador que esta forma host puro não inclui. O host mantém a tabela e o seam `RestoreStore` exportado (seus métodos pedem um id de sessão), então uma futura metade de cliente precisa consumi-los por um remoto do host, não diretamente; hoje a superfície de desmascaramento é o comando `/mask restore <text>`, e a chave `maskClientEnabled` é declarada e validada mas nenhum código em execução a lê ainda.
163
+ - **A restauração visual precisa de uma metade de cliente.** Mascarar é host-side; desmascarar bolhas na UI é uma função de navegador que esta forma host puro não inclui. O host mantém a tabela e o seam `RestoreStore` exportado (seus métodos pedem um id de sessão), então uma futura metade de cliente precisa consumi-los por um remoto do host, não diretamente; hoje a superfície de desmascaramento é o comando `/mask restore <text>`, que entrega o texto simples como arquivo porque o resultado de um comando é registrado literalmente, e a chave `maskClientEnabled` é declarada e validada mas nenhum código em execução a lê ainda.
164
+ - **Não há `/mask restore` sem argumentos.** Restaurar *todos* os marcadores da última mensagem do assistente não é oferecido, e o comando diz isso quando invocado sem texto. Dois fatos do host impedem: a tabela de restauração é um mapa plano `{marcador: original}` por sessão, **sem índice por mensagem**, então essa mensagem precisa ser localizada no registro de eventos da sessão; e o host marcou `Session.snapshotEvents()` / `eventAt()` / `ownEvents()` como obsoletos com um «proibido para novos chamadores», e a única alternativa sancionada (manter uma projeção incremental) não é confiável no corredor de hosts declarado (`>=0.1.2-rc.1`). Os marcadores continuam sendo restaurados um a um: `/mask restore <PHONE_1>`.
136
165
  - **Eventos em `0.1.7-rc.2`.** O host registra 59 tipos de evento de sessão e nenhum é `mask/*`; seu `Session.append` também não consegue estampar o envelope `ignorable`, então os appends de auditoria são omitidos (sessões continuam carregando). A porta não é silenciosa: a primeira recusa de cada sessão registra um aviso visível com o tipo omitido e esta limitação documentada. O append é habilitado automaticamente quando um host registra o tipo ou aceita o envelope `ignorable`.
137
166
 
138
167
  ## Development
@@ -182,24 +211,24 @@ Evidência estática: `dsh-plugin-doctor` K10–K13 retornam `pass` em todas as
182
211
 
183
212
  ## PerryLink DSH Plugin Family
184
213
 
185
- This project is one of the **45 DeepSeek Harness plugins** maintained by [PerryLink](https://github.com/PerryLink). If this one helps you, the others likely will too:
214
+ Este projeto é um dos **34 plugins ativamente mantidos** do DeepSeek Harness da [PerryLink](https://github.com/PerryLink): o registro tem **42**, dos quais **5** estão congelados e **3** aposentados; cada um mantém sua linha abaixo, com o motivo na coluna Status. Se este ajudou você, provavelmente os outros também ajudarão:
186
215
 
187
- | Plugin | One-liner |
188
- |---|---|
216
+ | Plugin | Em uma linha | Status |
217
+ |---|---|---|
189
218
  | **[dsh-auto-review](https://github.com/PerryLink/dsh-auto-review)** | Second-model auto-review on the approval chain, fail-closed by default | |
190
219
  | **[dsh-autotier](https://github.com/PerryLink/dsh-autotier)** | Automatic strong/cheap model-tier routing with deterministic risk guards and a `/tier` command | |
191
- | **[dsh-background-agents](https://github.com/PerryLink/dsh-background-agents)** | Durable background child agents with a Web UI sidebar, messaging and interrupt | |
192
- | **[dsh-budget](https://github.com/PerryLink/dsh-budget)** | Cost governance for DeepSeek Harness: budgets, carbon, and latency in one panel. | |
220
+ | **[dsh-background-agents](https://github.com/PerryLink/dsh-background-agents)** | Durable background child agents with a Web UI sidebar, messaging and interrupt | 🚫 **APOSENTADO** — ver a nota acima |
221
+ | **[dsh-budget](https://github.com/PerryLink/dsh-budget)** | Cost governance for DeepSeek Harness: budgets, carbon, and latency in one panel. | 🧊 CONGELADO — ver o README do repositório |
193
222
  | **[dsh-catalog](https://github.com/PerryLink/dsh-catalog)** | DSH Desktop Market standard catalog source for the PerryLink family | |
194
223
  | **[dsh-cert-mcp](https://github.com/PerryLink/dsh-cert-mcp)** | Read-only MCP server exposing the certification registry: grades, snapshots and five-dimension evidence | |
195
224
  | **[dsh-checkpoint-rewind](https://github.com/PerryLink/dsh-checkpoint-rewind)** | Claude Code /rewind-equivalent: snapshots, session forks, one-shot restore | |
196
- | **[dsh-claude-move](https://github.com/PerryLink/dsh-claude-move)** | Migrate Claude Code sessions, memory, skills and CLAUDE.md into DSH | |
225
+ | **[dsh-claude-move](https://github.com/PerryLink/dsh-claude-move)** | Migrate Claude Code sessions, memory, skills and CLAUDE.md into DSH | 🧊 CONGELADO — ver o README do repositório |
197
226
  | **[dsh-click](https://github.com/PerryLink/dsh-click)** | Cross-platform native desktop control for DeepSeek Harness — Windows first. | |
198
227
  | **[dsh-composer-history](https://github.com/PerryLink/dsh-composer-history)** | Terminal-style input history for the web composer: arrows, Ctrl+R search | |
199
228
  | **[dsh-data-quality](https://github.com/PerryLink/dsh-data-quality)** | Dataset quality checks and citation cross-checks (the optional numeric bridge consumed here) | |
200
- | **[dsh-defend](https://github.com/PerryLink/dsh-defend)** | Prompt-injection, jailbreak, and secret-leak defense for DeepSeek Harness. | |
229
+ | **[dsh-defend](https://github.com/PerryLink/dsh-defend)** | Prompt-injection, jailbreak, and secret-leak defense for DeepSeek Harness. | 🧊 CONGELADO — ver o README do repositório |
201
230
  | **[dsh-doublecheck](https://github.com/PerryLink/dsh-doublecheck)** | Engineering-discipline guard: requirements grill, test gates, adversary review | |
202
- | **[dsh-draw](https://github.com/PerryLink/dsh-draw)** | Unified static-image generation routing for DeepSeek Harness. | |
231
+ | **[dsh-draw](https://github.com/PerryLink/dsh-draw)** | Unified static-image generation routing for DeepSeek Harness. | 🧊 CONGELADO — ver o README do repositório |
203
232
  | **[dsh-fast](https://github.com/PerryLink/dsh-fast)** | Read-only performance diagnostics for DeepSeek Harness. | |
204
233
  | **[dsh-fund-research](https://github.com/PerryLink/dsh-fund-research)** | Deterministic research reports for Chinese public mutual funds | |
205
234
  | **[dsh-github](https://github.com/PerryLink/dsh-github)** | GitHub PR/issues integration for DSH, every write gated by approval | |
@@ -219,19 +248,19 @@ This project is one of the **45 DeepSeek Harness plugins** maintained by [PerryL
219
248
  | **[dsh-plugin-guide](https://github.com/PerryLink/dsh-plugin-guide)** | Plugin-development knowledge base as an on-demand agent skill | |
220
249
  | **[dsh-plugin-kit](https://github.com/PerryLink/dsh-plugin-kit)** | Shared zero-runtime-dependency toolkit for the PerryLink DSH plugins | |
221
250
  | **[dsh-plugin-upgrade](https://github.com/PerryLink/dsh-plugin-upgrade)** | One-package, one-corridor-index plugin upgrade skill: routes a repository to the matching closed corridor card | |
222
- | **[dsh-reach](https://github.com/PerryLink/dsh-reach)** | Multi-channel approval/question bridge: WeChat/Telegram/Feishu, session console | |
251
+ | **[dsh-plugin-upgrade-015](https://github.com/PerryLink/dsh-plugin-upgrade-015)** | Merged `0.1.3-alpha.1` → `0.1.5-rc.1` upgrade corridor card plus a zero-dependency seam scanner | 🚫 APOSENTADO — corredores assumidos por `dsh-plugin-upgrade` |
252
+ | **[dsh-reach](https://github.com/PerryLink/dsh-reach)** | Multi-channel approval/question bridge: WeChat/Telegram/Feishu, session console | 🧊 CONGELADO — ver o README do repositório |
223
253
  | **[dsh-research-report](https://github.com/PerryLink/dsh-research-report)** | Verifiable research-report engine: content-addressed evidence ledger and sealed versions | |
224
254
  | **[dsh-score](https://github.com/PerryLink/dsh-score)** | Multi-dimensional quality scoring for DeepSeek Harness plugins. | |
225
- | **[dsh-session-pin](https://github.com/PerryLink/dsh-session-pin)** | Pin sessions in the Web sidebar with durable ordering | |
255
+ | **[dsh-session-pin](https://github.com/PerryLink/dsh-session-pin)** | Pin sessions in the Web sidebar with durable ordering | 🚫 **APOSENTADO** — ver a nota acima |
226
256
  | **[dsh-session-sync](https://github.com/PerryLink/dsh-session-sync)** | Cross-device session sync for DeepSeek Harness — a dedicated git mirror of your session store. | |
227
257
  | **[dsh-skill-pack-security](https://github.com/PerryLink/dsh-skill-pack-security)** | Security-audit skill pack: secret scan, dependency and supply-chain review | |
228
258
  | **[dsh-talk](https://github.com/PerryLink/dsh-talk)** | Voice-first session loop for DeepSeek Harness: talk to it, hear it answer. | |
229
- | **[dsh-team-rooms](https://github.com/PerryLink/dsh-team-rooms)** | Cross-session team rooms: shared message bus, task board and timeline | |
259
+ | **[dsh-team-rooms](https://github.com/PerryLink/dsh-team-rooms)** | Cross-session team rooms: shared message bus, task board and timeline | 🚫 **APOSENTADO** — ver a nota acima |
230
260
  | **[dsh-test-drive](https://github.com/PerryLink/dsh-test-drive)** | Isolated install-and-smoke test drives for DeepSeek Harness plugins. | |
231
261
  | **[dsh-ticktick](https://github.com/PerryLink/dsh-ticktick)** | TickTick/Dida365 task bridge: session-header panel + 11 tools | |
232
262
  | **[dsh-translate](https://github.com/PerryLink/dsh-translate)** | Vendor parameter translation and deterministic JSON repair for DeepSeek Harness. | |
233
263
 
234
-
235
264
  ## License
236
265
 
237
266
  [LICENSE](LICENSE) (Apache License 2.0) © 2026 dsh-mask contributors
package/README-zh.md CHANGED
@@ -26,12 +26,33 @@
26
26
  ---
27
27
 
28
28
 
29
+ **📖 生态实测知识库**(实测数据,不是营销):[插件开发指南 · 选型实测数据 · 维护取舍判据](https://perrylink.github.io/dsh-plugin-guide/)。
30
+
29
31
  <!-- star-cta -->
30
32
  ## ⭐ 如果它帮到了你
31
33
 
32
34
  这个插件是 [DSH 插件家族](https://github.com/PerryLink)的一员(40+ 个,全部 Apache-2.0)。如果你在用,**给个 star** —— 它不会解锁任何功能,但会让下一个人在搜索里更容易找到它。
33
35
 
34
36
  *English:* part of a 40+ plugin family for DeepSeek Harness. If it is useful, **a star helps the next person find it** — nothing is gated behind it.
37
+
38
+ ## What is dsh-mask?
39
+
40
+ 面向 DeepSeek Harness 的 PII 脱敏中间件——在个人数据进入模型前匿名化,在展示层还原。
41
+
42
+ 电话、邮箱、身份证、银行卡、密钥等在模型边界变成占位符;原文绝不进入会话日志。
43
+
44
+ ![dsh-mask 终端演示:dsh-mask — PII becomes placeholders before the model sees it](https://raw.githubusercontent.com/PerryLink/dsh-mask/main/docs/assets/dsh-mask-hero.png)
45
+
46
+ ![Animated terminal demo of dsh-mask](https://raw.githubusercontent.com/PerryLink/dsh-mask/main/docs/assets/dsh-mask-demo.gif)
47
+
48
+ *同一次运行,动图版。*
49
+
50
+ ## Comparison
51
+
52
+ ![dsh-mask 的实测对比柱状图](https://raw.githubusercontent.com/PerryLink/dsh-mask/main/docs/assets/dsh-mask-evidence.png)
53
+
54
+ 108 synthetic samples (60 positive, 48 negative) · from benchmark/RESULTS.md
55
+
35
56
  ## Compatibility
36
57
 
37
58
  | 维度 | 状态 |
@@ -48,20 +69,24 @@
48
69
  - **请求前遮罩** —— 重写 `agent/pre-step` 消息,使电话、邮箱、身份证、银行卡、密钥(默认开启)与 IP(可选)变成 `<PHONE_1>` 之类的占位符。被遮罩的文本才是落盘并发送给模型的内容。
49
70
  - **恢复表** —— `占位符 → 原文` 映射只存内存与受控 storage domain(`dsh_mask`);原文绝不进会话日志。
50
71
  - **审计不含明文** —— `mask/applied` 会话事件只记「替换了 N 处 + 类型分布」,不记原文与映射。
51
- - **`/mask` 命令** —— `status`(计数 + 分布)、`on`/`off`(运行时开关)、`restore <text>`(还原占位符)、`help`。
72
+ - **`/mask` 命令** —— `status`(计数 + 分布)、`on`/`off`(运行时开关)、`restore <text>`(还原占位符,并把原文交付为文件而不是可落盘的文本)、`help`。
52
73
  - **`mask_test` 工具** —— 试跑一段文本看替换效果;绝不回显原文。
53
74
 
54
75
  ```text
55
- 用户消息 ──agent/pre-step──▶ 占位符 ──模型──▶ 占位符 ──restore──▶ 展示
76
+ 用户消息 ──agent/pre-step──▶ 占位符 ──模型──▶ 占位符 ──restore──▶ 受控文件
56
77
  ▲ │
57
78
  └──── 恢复表(内存 + dsh_mask)──────────┘
58
79
  ```
59
80
 
60
81
  ## Quick start
61
82
 
83
+ ```sh
84
+ dsh plugin --profile web add github:PerryLink/dsh-mask
85
+ ```
86
+
62
87
  ```sh
63
88
  # 1. 把 bundle 安装进 profile
64
- dsh plugin --profile web add "github:PerryLink/dsh-mask#main"
89
+ dsh plugin --profile web add github:PerryLink/dsh-mask
65
90
 
66
91
  # 或从 npm(发布版本)
67
92
  dsh plugin --profile web add dsh-mask
@@ -83,11 +108,13 @@ dsh --profile web --dump-config | grep -A2 'id: mask'
83
108
  ```
84
109
  > /mask status
85
110
  > /mask restore <PHONE_1>
111
+ mask: restored 1 placeholder(s): <PHONE_1>
112
+ file: /tmp/dsh-mask-restore/restore-1f0c….txt (mode 0600, one file per session)
86
113
  ```
87
114
 
88
115
  ## Install & uninstall
89
116
 
90
- - **git 通道**(最新 `main`):`dsh plugin --profile web add "github:PerryLink/dsh-mask#main"`(等价于从 `git+https://github.com/PerryLink/dsh-mask.git` 安装)。无构建步骤——`index.mjs` 与 `lib/` 即发布产物。
117
+ - **git 通道**(最新 `main`):`dsh plugin --profile web add github:PerryLink/dsh-mask`(等价于从 `git+https://github.com/PerryLink/dsh-mask.git` 安装)。无构建步骤——`index.mjs` 与 `lib/` 即发布产物。
91
118
  - **npm 通道**(发布版本):`dsh plugin --profile web add dsh-mask`。
92
119
  - **tarball 通道**:在本仓库 `pnpm pack`,再 `dsh plugin --profile web add ./dsh-mask-<version>.tgz`。
93
120
  - **卸载**:`dsh plugin --profile web remove dsh-mask`(或从 profile patch 删掉该行)。
@@ -109,6 +136,7 @@ dsh --profile web --dump-config | grep -A2 'id: mask'
109
136
  | `persistRestoreTable` | `true` | 把恢复表持久化到受控 `dsh_mask` 领域(`false` = 仅内存) |
110
137
  | `maxRestoreEntriesPerSession` | `500` | 每会话恢复条目上限(最旧先逐出) |
111
138
  | `maxSessions` | `1000` | 内存会话上限(LRU 逐出,映射按需回载) |
139
+ | `restoreDir` | `''` | `/mask restore` 交付原文的位置。空 = `os.tmpdir()/dsh-mask-restore`;相对值相对宿主进程 cwd 解析。目录按 `0700` 创建、文件按 `0600` 写入,每会话一个文件 |
112
140
 
113
141
  profile patch 覆盖示例:
114
142
 
@@ -129,20 +157,20 @@ profile patch 覆盖示例:
129
157
  | `agent/pre-step` 遮罩 | 永不 | 把消息重写为占位符后再落盘/送模型 |
130
158
  | `/mask status` | 永不 | 启用状态、替换总数、类型分布 |
131
159
  | `/mask on` / `/mask off` | 永不 | 运行时开关(重启回到 `config.enabled`) |
132
- | `/mask restore <text>` | 是(显式) | 把占位符还原为本会话存储的值 |
160
+ | `/mask restore <text>` | 是(显式) | 把占位符还原为本会话存储的值并写进受控文件(每会话一个,mode `0600`);结果文本与会话日志只带该路径与占位符名 |
133
161
  | `mask_test` | 永不 | 遮罩一段文本并报告占位符结果 + 计数 |
134
162
 
135
163
  ## Permissions & data
136
164
 
137
- - **权限**:`dsh-mask` 不做网络请求、不存凭据;只在 `agent/pre-step` 边界读取会话,并写入自己的 `dsh_mask` 领域。`dshWorkshop` manifest 声明 `network:none` 与 `credentials:none`。
138
- - **数据**:`占位符 → 原文` 恢复表存内存;`persistRestoreTable: true` 时另存受控 `dsh_mask` 领域——这是 PII 原文唯一落点,绝不写会话日志。
165
+ - **权限**:`dsh-mask` 不做网络请求、不存凭据;只在 `agent/pre-step` 边界读取会话,写入自己的 `dsh_mask` 领域,并写入 `/mask restore` 的交付文件(manifest 正是为此声明 `filesystem:write`)。`dshWorkshop` manifest 还声明 `network:none` 与 `credentials:none`。
166
+ - **数据**:`占位符 → 原文` 恢复表存内存;`persistRestoreTable: true` 时另存受控 `dsh_mask` 领域——绝不写会话日志。唯一另一份原文副本是显式 `/mask restore` 写下的交付文件(`restoreDir`,mode `0600`,每会话一个,下次还原覆盖);没有任何路径会隐式把原文写盘。
139
167
  - **会话日志**:`mask/applied` 在 `types.d.ts` 声明,仅在宿主收录该类型时 append(见 Known limitations)。载荷只有计数 + 类型分布。
140
168
 
141
169
  ## Security boundaries
142
170
 
143
- - **原文绝不进会话日志。** 落盘并送模型的是遮罩(占位符)形式,因此模型可见内容可自日志以占位符形式重建;原文留在恢复表。
144
- - **展示/日志前脱敏。** `lib/sanitize.mjs` 在文本进入模型或日志前打码 PII、密钥与 URL 凭据;`mask_test` 与 `/mask status` 永不回显原文。
145
- - **受控还原。** `/mask restore` 是唯一的显式还原面,且只读当前会话的映射。
171
+ - **原文绝不进会话日志。** 落盘并送模型的是遮罩(占位符)形式,因此模型可见内容可自日志以占位符形式重建;原文留在恢复表。还原方向同理:宿主把命令结果文本**原样**写进日志、并从那一条事件渲染用户可见输出,所以 `/mask restore` 把原文写进受控文件,只回路径。
172
+ - **展示/日志前脱敏。** `lib/sanitize.mjs` 在文本进入模型或日志前打码 PII、密钥与 URL 凭据;`mask_test`、`/mask status` 与所有 `/mask` 错误路径永不回显原文。
173
+ - **受控还原。** `/mask restore` 是唯一的显式还原面,且只读当前会话的映射。失败关闭:交付文件写不出时命令报错,绝不回退成回显原文。
146
174
  - **失败关闭。** 未实现的 `mode`(`regex+ner`)、`scope`(`tools`)、NER 实体与越界数值均在加载期响亮失败。
147
175
  - **注册即 effect。** 监听器、命令、工具与领域关闭都是 Cordis effect——停止/热重载即可撤销。
148
176
 
@@ -150,7 +178,8 @@ profile patch 覆盖示例:
150
178
 
151
179
  - **仅正则。** 姓名(`person`)与地址(`address`)识别需要外部 NER 识别器,纯 host 零依赖形态未捆绑;`mode: regex+ner` 与这些实体在加载期响亮失败。开箱即用覆盖电话、邮箱、身份证、银行卡、密钥与(可选)IP。
152
180
  - **正则具地域局限。** `phone` 与 `id-card` 只匹配中国大陆格式:`phone` 为 `1[3-9]` 加九位数字,`id-card` 为 18 位中国居民身份证(17 位数字加一位数字或 `X`)。其他国家的电话号码与证件号码不会被检出。`email`、`ip`、`key` 与地域无关;`bank-card` 以较低置信度接受任意 16-19 位数字串。
153
- - **展示层还原需要浏览器半。** 遮罩完全在 host 侧,但客户端 UI 中透明还原助手气泡属于浏览器半功能,本纯 host 形态未交付。host 侧保留恢复表与已导出的 `RestoreStore` seam(其方法需要会话 id),因此未来的客户端半需经 host 远程面间接消费,而非直接使用;当前的反遮罩入口是 `/mask restore <text>` 命令;`maskClientEnabled` 键会被 schema 声明与校验,但尚无任何运行时代码读取它。
181
+ - **展示层还原需要浏览器半。** 遮罩完全在 host 侧,但客户端 UI 中透明还原助手气泡属于浏览器半功能,本纯 host 形态未交付。host 侧保留恢复表与已导出的 `RestoreStore` seam(其方法需要会话 id),因此未来的客户端半需经 host 远程面间接消费,而非直接使用;当前的反遮罩入口是 `/mask restore <text>` 命令,它把原文交付为文件(因为命令结果会被原样记入日志,见「Security boundaries」);`maskClientEnabled` 键会被 schema 声明与校验,但尚无任何运行时代码读取它。
182
+ - **不提供无参 `/mask restore`。** 「还原最近一条助手消息里的全部占位符」这一形态未提供,且无参调用时命令会明确说明。两个宿主事实挡住了它:恢复表是每会话扁平的 `{占位符: 原文}` 映射、**没有按消息的索引**,因此必须去会话事件日志里定位那条消息;而宿主已把 `Session.snapshotEvents()` / `eventAt()` / `ownEvents()` 标为 deprecated 并明令**禁止新调用方**,其唯一被认可的替代(按投递事件增量维护投影)又超出本插件声明的宿主走廊(`>=0.1.2-rc.1`)所能依赖的范围。占位符仍可逐个还原:`/mask restore <PHONE_1>`。
154
183
  - **`0.1.7-rc.2` 会话事件。** 宿主收录 59 个会话事件类型,其中没有 `mask/*`;其 `Session.append` 也无法盖章 `ignorable` 信封,因此会话日志审计 append 被跳过(会话仍可加载)。门控不再静默:每个会话首次被拒时打一条可见告警,写明被跳过的事件类型与本限制。宿主收录该类型或支持 `ignorable` 信封后自动开启。
155
184
 
156
185
  ## Development
@@ -200,24 +229,24 @@ PII 基准(108 个合成样本的逐类 P/R/F1)见 [`benchmark/RESULTS.md`](
200
229
 
201
230
  ## PerryLink DSH Plugin Family
202
231
 
203
- This project is one of the **45 DeepSeek Harness plugins** maintained by [PerryLink](https://github.com/PerryLink). If this one helps you, the others likely will too:
232
+ 本项目是 [PerryLink](https://github.com/PerryLink) 维护的 DeepSeek Harness 插件家族成员:**34 个活跃维护**,名册共 **42** 个,其中 **5 个已冻结**、**3 个已退役**——每一个都在下表保留自己的行,原因见「状态」列。如果它能帮到你,其他的也会:
204
233
 
205
- | Plugin | One-liner |
206
- |---|---|
234
+ | Plugin | 一句话 | 状态 |
235
+ |---|---|---|
207
236
  | **[dsh-auto-review](https://github.com/PerryLink/dsh-auto-review)** | Second-model auto-review on the approval chain, fail-closed by default | |
208
237
  | **[dsh-autotier](https://github.com/PerryLink/dsh-autotier)** | Automatic strong/cheap model-tier routing with deterministic risk guards and a `/tier` command | |
209
- | **[dsh-background-agents](https://github.com/PerryLink/dsh-background-agents)** | Durable background child agents with a Web UI sidebar, messaging and interrupt | |
210
- | **[dsh-budget](https://github.com/PerryLink/dsh-budget)** | Cost governance for DeepSeek Harness: budgets, carbon, and latency in one panel. | |
238
+ | **[dsh-background-agents](https://github.com/PerryLink/dsh-background-agents)** | Durable background child agents with a Web UI sidebar, messaging and interrupt | 🚫 **已退役** — 见上方说明 |
239
+ | **[dsh-budget](https://github.com/PerryLink/dsh-budget)** | Cost governance for DeepSeek Harness: budgets, carbon, and latency in one panel. | 🧊 已冻结 — 见仓库 README |
211
240
  | **[dsh-catalog](https://github.com/PerryLink/dsh-catalog)** | DSH Desktop Market standard catalog source for the PerryLink family | |
212
241
  | **[dsh-cert-mcp](https://github.com/PerryLink/dsh-cert-mcp)** | Read-only MCP server exposing the certification registry: grades, snapshots and five-dimension evidence | |
213
242
  | **[dsh-checkpoint-rewind](https://github.com/PerryLink/dsh-checkpoint-rewind)** | Claude Code /rewind-equivalent: snapshots, session forks, one-shot restore | |
214
- | **[dsh-claude-move](https://github.com/PerryLink/dsh-claude-move)** | Migrate Claude Code sessions, memory, skills and CLAUDE.md into DSH | |
243
+ | **[dsh-claude-move](https://github.com/PerryLink/dsh-claude-move)** | Migrate Claude Code sessions, memory, skills and CLAUDE.md into DSH | 🧊 已冻结 — 见仓库 README |
215
244
  | **[dsh-click](https://github.com/PerryLink/dsh-click)** | Cross-platform native desktop control for DeepSeek Harness — Windows first. | |
216
245
  | **[dsh-composer-history](https://github.com/PerryLink/dsh-composer-history)** | Terminal-style input history for the web composer: arrows, Ctrl+R search | |
217
246
  | **[dsh-data-quality](https://github.com/PerryLink/dsh-data-quality)** | Dataset quality checks and citation cross-checks (the optional numeric bridge consumed here) | |
218
- | **[dsh-defend](https://github.com/PerryLink/dsh-defend)** | Prompt-injection, jailbreak, and secret-leak defense for DeepSeek Harness. | |
247
+ | **[dsh-defend](https://github.com/PerryLink/dsh-defend)** | Prompt-injection, jailbreak, and secret-leak defense for DeepSeek Harness. | 🧊 已冻结 — 见仓库 README |
219
248
  | **[dsh-doublecheck](https://github.com/PerryLink/dsh-doublecheck)** | Engineering-discipline guard: requirements grill, test gates, adversary review | |
220
- | **[dsh-draw](https://github.com/PerryLink/dsh-draw)** | Unified static-image generation routing for DeepSeek Harness. | |
249
+ | **[dsh-draw](https://github.com/PerryLink/dsh-draw)** | Unified static-image generation routing for DeepSeek Harness. | 🧊 已冻结 — 见仓库 README |
221
250
  | **[dsh-fast](https://github.com/PerryLink/dsh-fast)** | Read-only performance diagnostics for DeepSeek Harness. | |
222
251
  | **[dsh-fund-research](https://github.com/PerryLink/dsh-fund-research)** | Deterministic research reports for Chinese public mutual funds | |
223
252
  | **[dsh-github](https://github.com/PerryLink/dsh-github)** | GitHub PR/issues integration for DSH, every write gated by approval | |
@@ -237,19 +266,19 @@ This project is one of the **45 DeepSeek Harness plugins** maintained by [PerryL
237
266
  | **[dsh-plugin-guide](https://github.com/PerryLink/dsh-plugin-guide)** | Plugin-development knowledge base as an on-demand agent skill | |
238
267
  | **[dsh-plugin-kit](https://github.com/PerryLink/dsh-plugin-kit)** | Shared zero-runtime-dependency toolkit for the PerryLink DSH plugins | |
239
268
  | **[dsh-plugin-upgrade](https://github.com/PerryLink/dsh-plugin-upgrade)** | One-package, one-corridor-index plugin upgrade skill: routes a repository to the matching closed corridor card | |
240
- | **[dsh-reach](https://github.com/PerryLink/dsh-reach)** | Multi-channel approval/question bridge: WeChat/Telegram/Feishu, session console | |
269
+ | **[dsh-plugin-upgrade-015](https://github.com/PerryLink/dsh-plugin-upgrade-015)** | Merged `0.1.3-alpha.1` → `0.1.5-rc.1` upgrade corridor card plus a zero-dependency seam scanner | 🚫 已退役 —— 走廊由 `dsh-plugin-upgrade` 承担 |
270
+ | **[dsh-reach](https://github.com/PerryLink/dsh-reach)** | Multi-channel approval/question bridge: WeChat/Telegram/Feishu, session console | 🧊 已冻结 — 见仓库 README |
241
271
  | **[dsh-research-report](https://github.com/PerryLink/dsh-research-report)** | Verifiable research-report engine: content-addressed evidence ledger and sealed versions | |
242
272
  | **[dsh-score](https://github.com/PerryLink/dsh-score)** | Multi-dimensional quality scoring for DeepSeek Harness plugins. | |
243
- | **[dsh-session-pin](https://github.com/PerryLink/dsh-session-pin)** | Pin sessions in the Web sidebar with durable ordering | |
273
+ | **[dsh-session-pin](https://github.com/PerryLink/dsh-session-pin)** | Pin sessions in the Web sidebar with durable ordering | 🚫 **已退役** — 见上方说明 |
244
274
  | **[dsh-session-sync](https://github.com/PerryLink/dsh-session-sync)** | Cross-device session sync for DeepSeek Harness — a dedicated git mirror of your session store. | |
245
275
  | **[dsh-skill-pack-security](https://github.com/PerryLink/dsh-skill-pack-security)** | Security-audit skill pack: secret scan, dependency and supply-chain review | |
246
276
  | **[dsh-talk](https://github.com/PerryLink/dsh-talk)** | Voice-first session loop for DeepSeek Harness: talk to it, hear it answer. | |
247
- | **[dsh-team-rooms](https://github.com/PerryLink/dsh-team-rooms)** | Cross-session team rooms: shared message bus, task board and timeline | |
277
+ | **[dsh-team-rooms](https://github.com/PerryLink/dsh-team-rooms)** | Cross-session team rooms: shared message bus, task board and timeline | 🚫 **已退役** — 见上方说明 |
248
278
  | **[dsh-test-drive](https://github.com/PerryLink/dsh-test-drive)** | Isolated install-and-smoke test drives for DeepSeek Harness plugins. | |
249
279
  | **[dsh-ticktick](https://github.com/PerryLink/dsh-ticktick)** | TickTick/Dida365 task bridge: session-header panel + 11 tools | |
250
280
  | **[dsh-translate](https://github.com/PerryLink/dsh-translate)** | Vendor parameter translation and deterministic JSON repair for DeepSeek Harness. | |
251
281
 
252
-
253
282
  ## License
254
283
 
255
284
  [LICENSE](LICENSE)(Apache License 2.0)© 2026 dsh-mask contributors
package/README.md CHANGED
@@ -26,6 +26,8 @@
26
26
 
27
27
  ---
28
28
 
29
+ **📖 Ecosystem knowledge base** — measured data, not marketing: [plugin development guide · plugin-selection data · maintenance criteria](https://perrylink.github.io/dsh-plugin-guide/).
30
+
29
31
  <!-- star-cta -->
30
32
  ## ⭐ 如果它帮到了你
31
33
 
@@ -34,6 +36,24 @@
34
36
  *English:* part of a 40+ plugin family for DeepSeek Harness. If it is useful, **a star helps the next person find it** — nothing is gated behind it.
35
37
 
36
38
 
39
+ ## What is dsh-mask?
40
+
41
+ PII masking middleware for DeepSeek Harness — anonymize personal data before it reaches the model, keep it reversible host-side.
42
+
43
+ Phones, emails, ID cards, bank cards, keys, and more become placeholders at the model boundary; the plaintext never enters your session log.
44
+
45
+ ![Terminal demo of dsh-mask: dsh-mask — PII becomes placeholders before the model sees it](https://raw.githubusercontent.com/PerryLink/dsh-mask/main/docs/assets/dsh-mask-hero.png)
46
+
47
+ ![Animated terminal demo of dsh-mask](https://raw.githubusercontent.com/PerryLink/dsh-mask/main/docs/assets/dsh-mask-demo.gif)
48
+
49
+ *The same run, animated.*
50
+
51
+ ## Comparison
52
+
53
+ ![Measured comparison chart for dsh-mask](https://raw.githubusercontent.com/PerryLink/dsh-mask/main/docs/assets/dsh-mask-evidence.png)
54
+
55
+ 108 synthetic samples (60 positive, 48 negative) · from benchmark/RESULTS.md
56
+
37
57
  ## Compatibility
38
58
 
39
59
  | Surface | Status |
@@ -50,20 +70,24 @@
50
70
  - **Request-time masking** — `agent/pre-step` messages are rewritten so phones, emails, ID cards, bank cards, and keys (on by default) and IPs (opt-in) become `<PHONE_1>`-style placeholders. The masked text is what gets logged and sent to the model.
51
71
  - **Restore table** — the `placeholder → original` map lives only in memory and a controlled storage domain (`dsh_mask`); the plaintext never enters the session log.
52
72
  - **Audit, not plaintext** — the `mask/applied` session event records only "replaced N values + type distribution", never the original text or the mapping.
53
- - **`/mask` command** — `status` (counts + distribution), `on`/`off` (runtime toggle), `restore <text>` (unmap placeholders), `help`.
73
+ - **`/mask` command** — `status` (counts + distribution), `on`/`off` (runtime toggle), `restore <text>` (unmap placeholders and deliver the plaintext as a file, never as logged text), `help`.
54
74
  - **`mask_test` tool** — run a snippet through the detector and see the placeholder result; it never reveals the original values.
55
75
 
56
76
  ```text
57
- user message ──agent/pre-step──▶ placeholders ──model──▶ placeholders ──restore──▶ display
58
- ▲ │
59
- └──────── restore table (memory + dsh_mask) ────────┘
77
+ user message ──agent/pre-step──▶ placeholders ──model──▶ placeholders ──restore──▶ controlled file
78
+ ▲ │
79
+ └──────── restore table (memory + dsh_mask) ───────────┘
60
80
  ```
61
81
 
62
82
  ## Quick start
63
83
 
84
+ ```sh
85
+ dsh plugin --profile web add github:PerryLink/dsh-mask
86
+ ```
87
+
64
88
  ```sh
65
89
  # 1. install the bundle into your profile
66
- dsh plugin --profile web add "github:PerryLink/dsh-mask#main"
90
+ dsh plugin --profile web add github:PerryLink/dsh-mask
67
91
 
68
92
  # or from npm (published releases)
69
93
  dsh plugin --profile web add dsh-mask
@@ -85,11 +109,13 @@ Then tailor the entity list in your profile patch:
85
109
  ```
86
110
  > /mask status
87
111
  > /mask restore <PHONE_1>
112
+ mask: restored 1 placeholder(s): <PHONE_1>
113
+ file: /tmp/dsh-mask-restore/restore-1f0c….txt (mode 0600, one file per session)
88
114
  ```
89
115
 
90
116
  ## Install & uninstall
91
117
 
92
- - **git channel** (latest `main`): `dsh plugin --profile web add "github:PerryLink/dsh-mask#main"` (equivalent to installing from `git+https://github.com/PerryLink/dsh-mask.git`). No build step — `index.mjs` and `lib/` are the shipped artifacts.
118
+ - **git channel** (latest `main`): `dsh plugin --profile web add github:PerryLink/dsh-mask` (equivalent to installing from `git+https://github.com/PerryLink/dsh-mask.git`). No build step — `index.mjs` and `lib/` are the shipped artifacts.
93
119
  - **npm channel** (published releases): `dsh plugin --profile web add dsh-mask`.
94
120
  - **tarball channel**: `pnpm pack` in this repo, then `dsh plugin --profile web add ./dsh-mask-<version>.tgz`.
95
121
  - **uninstall**: `dsh plugin --profile web remove dsh-mask` (or remove the row from the profile patch).
@@ -112,6 +138,7 @@ All tunables are Schemastery `Config` fields (changeable from cordis.yml). An id
112
138
  | `maxRestoreEntriesPerSession` | `500` | Per-session restore entry cap (oldest evicted first) |
113
139
  | `maxSessions` | `1000` | In-memory session cap (least-recently-used evicted, mapping reloaded on demand) |
114
140
  | `maskClientEnabled` | `false` | Feature flag for the browser half "reveal" bubble (defensive; off by default until the live slot catalog verifies the target slot). The key is schema-declared and validated, but no runtime code reads it yet, so it changes nothing until the browser half ships |
141
+ | `restoreDir` | `''` | Where `/mask restore` delivers the restored plaintext. Empty = `os.tmpdir()/dsh-mask-restore`; a relative value resolves against the host process working directory. The directory is created `0700` and the file written `0600`, one file per session |
115
142
 
116
143
  Example override in your profile patch:
117
144
 
@@ -133,20 +160,20 @@ Example override in your profile patch:
133
160
  | `tools/post-execute` masking | never | Rewrites tool-result text blocks to placeholders before they are logged or fed back to the model (scope: `tools`) |
134
161
  | `/mask status` | never | Enabled state, total replaced, type distribution |
135
162
  | `/mask on` / `/mask off` | never | Runtime toggle (resets to `config.enabled` on restart) |
136
- | `/mask restore <text>` | yes (explicit) | Unmaps placeholders back to the values stored for this session |
163
+ | `/mask restore <text>` | yes (explicit) | Unmaps placeholders back to the values stored for this session and writes them to a controlled file (one per session, mode `0600`); the result text and the session log carry only that path and the placeholder names |
137
164
  | `mask_test` | never | Masks a snippet and reports the placeholder result + counts |
138
165
 
139
166
  ## Permissions & data
140
167
 
141
- - **Permissions**: `dsh-mask` performs no network requests and stores no credentials; it only reads the session at the `agent/pre-step` boundary and writes its own `dsh_mask` storage domain. The `dshWorkshop` manifest declares `network:none` and `credentials:none`.
142
- - **Data**: the `placeholder → original` restore table lives in memory and, when `persistRestoreTable: true`, in the controlled `dsh_mask` storage domain — this is the only place plaintext PII is stored, and it is never written to the session log.
168
+ - **Permissions**: `dsh-mask` performs no network requests and stores no credentials; it reads the session at the `agent/pre-step` boundary, writes its own `dsh_mask` storage domain, and writes the `/mask restore` delivery file (the manifest declares `filesystem:write` for exactly that). The `dshWorkshop` manifest also declares `network:none` and `credentials:none`.
169
+ - **Data**: the `placeholder → original` restore table lives in memory and, when `persistRestoreTable: true`, in the controlled `dsh_mask` storage domain — it is never written to the session log. The only other plaintext copy is the delivery file an explicit `/mask restore` writes under `restoreDir` (mode `0600`, one file per session, overwritten by the next restore); nothing writes plaintext to disk implicitly.
143
170
  - **Session log**: `mask/applied` is declared in `types.d.ts` and appended only when the host records the type (see Known limitations). Its payload is counts + type distribution only.
144
171
 
145
172
  ## Security boundaries
146
173
 
147
- - **Plaintext never enters the session log.** The masked (placeholder) form is what gets logged and sent to the model, so model-visible content is reconstructable from the log in placeholder form; the originals stay in the restore table.
148
- - **Sanitize before display/log.** `lib/sanitize.mjs` redacts PII, secrets, and URL credentials before any text reaches the model or the log; `mask_test` and `/mask status` never echo originals.
149
- - **Controlled restore.** `/mask restore` is the single explicit reveal surface, and it only reads the mapping for the active session.
174
+ - **Plaintext never enters the session log.** The masked (placeholder) form is what gets logged and sent to the model, so model-visible content is reconstructable from the log in placeholder form; the originals stay in the restore table. The same rule governs the reveal direction: a command's result text is logged **verbatim** by the host and rendered from that same event, so `/mask restore` writes the plaintext to a controlled file and returns only its path.
175
+ - **Sanitize before display/log.** `lib/sanitize.mjs` redacts PII, secrets, and URL credentials before any text reaches the model or the log; `mask_test`, `/mask status`, and every `/mask` error path never echo originals.
176
+ - **Controlled restore.** `/mask restore` is the single explicit reveal surface, and it only reads the mapping for the active session. Failure fails closed: if the delivery file cannot be written, the command reports an error and never falls back to echoing the plaintext.
150
177
  - **Fail closed.** Unimplemented `mode` (`regex+ner`), unknown `scope` values, NER-only entities, and out-of-bounds numbers all fail loudly at load.
151
178
  - **Registrations are effects.** The listener, command, tool, and storage-domain close are all Cordis effects — stop/hot-reload removes them.
152
179
 
@@ -154,7 +181,8 @@ Example override in your profile patch:
154
181
 
155
182
  - **Regex only.** Name (`person`) and address (`address`) recognition needs an external NER recognizer, which the pure-host zero-dependency form does not bundle; `mode: regex+ner` and those entities fail loudly at load. The PII types covered out of the box are phone, email, ID card, bank card, key, and (opt-in) IP.
156
183
  - **Region-specific patterns.** The `phone` and `id-card` detectors match mainland-China formats only: `phone` is `1[3-9]` followed by nine digits, and `id-card` is an 18-character Chinese resident ID (17 digits plus a digit or `X`). Phone numbers and national identifiers from other countries are not detected. `email`, `ip`, and `key` are region-agnostic; `bank-card` accepts any 16-19 digit run at a lower confidence score.
157
- - **Display-layer restore needs a client half.** Masking is fully host-side, but transparently un-masking the assistant bubbles in the client UI is a browser-half feature this pure-host form does not ship. The host side keeps the restore table and the exported `RestoreStore` seam (its methods take a session id), so a future client half would reach them through a host remote rather than directly; today the unmasking surface is the `/mask restore <text>` command, and the `maskClientEnabled` key is validated but read by no runtime code yet.
184
+ - **Display-layer restore needs a client half.** Masking is fully host-side, but transparently un-masking the assistant bubbles in the client UI is a browser-half feature this pure-host form does not ship. The host side keeps the restore table and the exported `RestoreStore` seam (its methods take a session id), so a future client half would reach them through a host remote rather than directly; today the unmasking surface is the `/mask restore <text>` command, which delivers the plaintext as a file because a command result is logged verbatim (see Security boundaries), and the `maskClientEnabled` key is validated but read by no runtime code yet.
185
+ - **No no-argument `/mask restore`.** Restoring *every* placeholder of the most recent assistant message is not offered, and the command says so when invoked without text. Two host facts block it: the restore table is a flat per-session `{placeholder: original}` map with no per-message index, so that message has to be located in the session event log; and the host deprecated `Session.snapshotEvents()` / `eventAt()` / `ownEvents()` with an explicit "new calls are prohibited", leaving an incremental projection as the only sanctioned route — which this plugin's declared host corridor (`>=0.1.2-rc.1`) cannot rely on. Placeholders keep working one at a time instead: `/mask restore <PHONE_1>`.
158
186
  - **Session events on `0.1.7-rc.2`.** The harness records 59 session event types and none of them is `mask/*`; its `Session.append` also cannot stamp the `ignorable` envelope, so the session-log audit appends are skipped and sessions keep loading. The gate is not silent about it: the first refusal per session logs one visible warning naming the skipped type and this documented limitation. The plugin enables the append automatically once a host records the type or supports the `ignorable` envelope.
159
187
 
160
188
  ## Development
@@ -204,24 +232,24 @@ Static evidence: `dsh-plugin-doctor` K10–K13 report `pass` for every check on
204
232
 
205
233
  ## PerryLink DSH Plugin Family
206
234
 
207
- This project is one of the **45 DeepSeek Harness plugins** maintained by [PerryLink](https://github.com/PerryLink). If this one helps you, the others likely will too:
235
+ This project is one of the **34 actively maintained** DeepSeek Harness plugins from [PerryLink](https://github.com/PerryLink) — the roster is **42**, of which **5** are frozen and **3** retired; every one keeps its row below, with the reason in the Status column. If this one helps you, the others likely will too:
208
236
 
209
- | Plugin | One-liner |
210
- |---|---|
237
+ | Plugin | One-liner | Status |
238
+ |---|---|---|
211
239
  | **[dsh-auto-review](https://github.com/PerryLink/dsh-auto-review)** | Second-model auto-review on the approval chain, fail-closed by default | |
212
240
  | **[dsh-autotier](https://github.com/PerryLink/dsh-autotier)** | Automatic strong/cheap model-tier routing with deterministic risk guards and a `/tier` command | |
213
- | **[dsh-background-agents](https://github.com/PerryLink/dsh-background-agents)** | Durable background child agents with a Web UI sidebar, messaging and interrupt | |
214
- | **[dsh-budget](https://github.com/PerryLink/dsh-budget)** | Cost governance for DeepSeek Harness: budgets, carbon, and latency in one panel. | |
241
+ | **[dsh-background-agents](https://github.com/PerryLink/dsh-background-agents)** | Durable background child agents with a Web UI sidebar, messaging and interrupt | 🚫 **RETIRED** — see the note above |
242
+ | **[dsh-budget](https://github.com/PerryLink/dsh-budget)** | Cost governance for DeepSeek Harness: budgets, carbon, and latency in one panel. | 🧊 FROZEN — see the repo README |
215
243
  | **[dsh-catalog](https://github.com/PerryLink/dsh-catalog)** | DSH Desktop Market standard catalog source for the PerryLink family | |
216
244
  | **[dsh-cert-mcp](https://github.com/PerryLink/dsh-cert-mcp)** | Read-only MCP server exposing the certification registry: grades, snapshots and five-dimension evidence | |
217
245
  | **[dsh-checkpoint-rewind](https://github.com/PerryLink/dsh-checkpoint-rewind)** | Claude Code /rewind-equivalent: snapshots, session forks, one-shot restore | |
218
- | **[dsh-claude-move](https://github.com/PerryLink/dsh-claude-move)** | Migrate Claude Code sessions, memory, skills and CLAUDE.md into DSH | |
246
+ | **[dsh-claude-move](https://github.com/PerryLink/dsh-claude-move)** | Migrate Claude Code sessions, memory, skills and CLAUDE.md into DSH | 🧊 FROZEN — see the repo README |
219
247
  | **[dsh-click](https://github.com/PerryLink/dsh-click)** | Cross-platform native desktop control for DeepSeek Harness — Windows first. | |
220
248
  | **[dsh-composer-history](https://github.com/PerryLink/dsh-composer-history)** | Terminal-style input history for the web composer: arrows, Ctrl+R search | |
221
249
  | **[dsh-data-quality](https://github.com/PerryLink/dsh-data-quality)** | Dataset quality checks and citation cross-checks (the optional numeric bridge consumed here) | |
222
- | **[dsh-defend](https://github.com/PerryLink/dsh-defend)** | Prompt-injection, jailbreak, and secret-leak defense for DeepSeek Harness. | |
250
+ | **[dsh-defend](https://github.com/PerryLink/dsh-defend)** | Prompt-injection, jailbreak, and secret-leak defense for DeepSeek Harness. | 🧊 FROZEN — see the repo README |
223
251
  | **[dsh-doublecheck](https://github.com/PerryLink/dsh-doublecheck)** | Engineering-discipline guard: requirements grill, test gates, adversary review | |
224
- | **[dsh-draw](https://github.com/PerryLink/dsh-draw)** | Unified static-image generation routing for DeepSeek Harness. | |
252
+ | **[dsh-draw](https://github.com/PerryLink/dsh-draw)** | Unified static-image generation routing for DeepSeek Harness. | 🧊 FROZEN — see the repo README |
225
253
  | **[dsh-fast](https://github.com/PerryLink/dsh-fast)** | Read-only performance diagnostics for DeepSeek Harness. | |
226
254
  | **[dsh-fund-research](https://github.com/PerryLink/dsh-fund-research)** | Deterministic research reports for Chinese public mutual funds | |
227
255
  | **[dsh-github](https://github.com/PerryLink/dsh-github)** | GitHub PR/issues integration for DSH, every write gated by approval | |
@@ -241,19 +269,19 @@ This project is one of the **45 DeepSeek Harness plugins** maintained by [PerryL
241
269
  | **[dsh-plugin-guide](https://github.com/PerryLink/dsh-plugin-guide)** | Plugin-development knowledge base as an on-demand agent skill | |
242
270
  | **[dsh-plugin-kit](https://github.com/PerryLink/dsh-plugin-kit)** | Shared zero-runtime-dependency toolkit for the PerryLink DSH plugins | |
243
271
  | **[dsh-plugin-upgrade](https://github.com/PerryLink/dsh-plugin-upgrade)** | One-package, one-corridor-index plugin upgrade skill: routes a repository to the matching closed corridor card | |
244
- | **[dsh-reach](https://github.com/PerryLink/dsh-reach)** | Multi-channel approval/question bridge: WeChat/Telegram/Feishu, session console | |
272
+ | **[dsh-plugin-upgrade-015](https://github.com/PerryLink/dsh-plugin-upgrade-015)** | Merged `0.1.3-alpha.1` → `0.1.5-rc.1` upgrade corridor card plus a zero-dependency seam scanner | 🚫 RETIRED — corridors carried by `dsh-plugin-upgrade` |
273
+ | **[dsh-reach](https://github.com/PerryLink/dsh-reach)** | Multi-channel approval/question bridge: WeChat/Telegram/Feishu, session console | 🧊 FROZEN — see the repo README |
245
274
  | **[dsh-research-report](https://github.com/PerryLink/dsh-research-report)** | Verifiable research-report engine: content-addressed evidence ledger and sealed versions | |
246
275
  | **[dsh-score](https://github.com/PerryLink/dsh-score)** | Multi-dimensional quality scoring for DeepSeek Harness plugins. | |
247
- | **[dsh-session-pin](https://github.com/PerryLink/dsh-session-pin)** | Pin sessions in the Web sidebar with durable ordering | |
276
+ | **[dsh-session-pin](https://github.com/PerryLink/dsh-session-pin)** | Pin sessions in the Web sidebar with durable ordering | 🚫 **RETIRED** — see the note above |
248
277
  | **[dsh-session-sync](https://github.com/PerryLink/dsh-session-sync)** | Cross-device session sync for DeepSeek Harness — a dedicated git mirror of your session store. | |
249
278
  | **[dsh-skill-pack-security](https://github.com/PerryLink/dsh-skill-pack-security)** | Security-audit skill pack: secret scan, dependency and supply-chain review | |
250
279
  | **[dsh-talk](https://github.com/PerryLink/dsh-talk)** | Voice-first session loop for DeepSeek Harness: talk to it, hear it answer. | |
251
- | **[dsh-team-rooms](https://github.com/PerryLink/dsh-team-rooms)** | Cross-session team rooms: shared message bus, task board and timeline | |
280
+ | **[dsh-team-rooms](https://github.com/PerryLink/dsh-team-rooms)** | Cross-session team rooms: shared message bus, task board and timeline | 🚫 **RETIRED** — see the note above |
252
281
  | **[dsh-test-drive](https://github.com/PerryLink/dsh-test-drive)** | Isolated install-and-smoke test drives for DeepSeek Harness plugins. | |
253
282
  | **[dsh-ticktick](https://github.com/PerryLink/dsh-ticktick)** | TickTick/Dida365 task bridge: session-header panel + 11 tools | |
254
283
  | **[dsh-translate](https://github.com/PerryLink/dsh-translate)** | Vendor parameter translation and deterministic JSON repair for DeepSeek Harness. | |
255
284
 
256
-
257
285
  ### Install from the DSH Desktop Market
258
286
 
259
287
  All PerryLink plugins are browsable in the built-in DSH Desktop Market: **Market → Sources → add source → paste** `https://perrylink-dsh-catalog.perrylink.workers.dev/catalog-source.json` **→ select it**. Installation still goes through the Market's npm-identity verification and your confirmation.
package/cordis.patch.yml CHANGED
@@ -58,3 +58,10 @@
58
58
  # already backs it; the client slot ships separately and is off by
59
59
  # default until the live slot catalog verifies the target slot.
60
60
  maskClientEnabled: false
61
+ # Where /mask restore delivers the restored plaintext. The host writes a
62
+ # command's result (command/done.text) into the session log verbatim,
63
+ # and the client renders that same event, so the plaintext can never
64
+ # live in the result text: it goes to one controlled file per session
65
+ # (mode 0600, overwritten by the next restore) and the result carries
66
+ # the path plus the placeholder names only. Empty = os.tmpdir()/dsh-mask-restore.
67
+ restoreDir: ''