dsh-mask 0.2.10 → 0.2.11
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/CHANGELOG.md +19 -0
- package/README-es.md +15 -4
- package/README-hi.md +15 -4
- package/README-pt.md +15 -4
- package/README-zh.md +16 -5
- package/README.md +15 -5
- package/index.mjs +14 -5
- package/lib/gate.mjs +15 -5
- package/package.json +20 -18
- package/types.d.ts +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,25 @@ All notable changes to this project are documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.2.11] - 2026-09-18
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Close the storage domain through an effect registered before the open resolves. The previous shape registered the `close()` effect from inside the open's `then()`, so unmounting while the open was still in flight threw `INACTIVE_EFFECT` and the domain handle was never closed; that rejection was then swallowed by an empty `catch`. The effect is now registered first and reads the open promise from its closure, so the handle is closed exactly once even when the unmount wins the race, and a failed open is reported with a visible warning instead of a silent swallow. Covered by two lifecycle tests: unmount-during-open (close still called exactly once) and rejected open (no unhandled rejection).
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- The session-event gate now announces every refused audit append once per session and type. `mask/applied` is still not written on hosts that neither record the type nor stamp the `ignorable` envelope (sessions keep loading), but the refusal is no longer silent: the first refusal per session logs a visible warning naming the type and the documented limitation. No `session.append` behavior changed.
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- `dsh.manifestVersion: 1` and the canonical three-clause `engines.dsh` range (honest manifest declaration; no runtime reader yet).
|
|
21
|
+
|
|
22
|
+
### Docs
|
|
23
|
+
|
|
24
|
+
- Re-anchor the five-language compatibility row to `dsh-v0.1.6-alpha.2` (adapted 2026-09-18) and state the audit-gate facts for that line: the host records 58 session event types, none of them `mask/*`, and `Session.append` still cannot stamp the `ignorable` envelope, so audit appends stay skipped while sessions keep loading.
|
|
25
|
+
- Describe the two typecheck rulers in the development section: `typecheck` runs the alpha.2 development face and `typecheck:ci` runs the published-line face with cleared paths.
|
|
26
|
+
|
|
8
27
|
## [0.2.10] - 2026-09-12
|
|
9
28
|
|
|
10
29
|
### Fixed
|
package/README-es.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*Teléfonos, correos, documentos, tarjetas, claves y más se convierten en marcadores de posición en el límite del modelo; el texto plano nunca entra en tu registro de sesión.*
|
|
9
9
|
|
|
10
10
|
[](LICENSE)
|
|
11
|
+
[](https://gitee.com/perrylink/dsh-mask)
|
|
11
12
|
[](https://github.com/topics/dsh-plugin)
|
|
12
13
|
[](https://github.com/PerryLink/dsh-plugin-doctor#verified-徽章)
|
|
13
14
|
[](#)
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
|
|
27
28
|
| Superficie | Estado |
|
|
28
29
|
|---|---|
|
|
29
|
-
| Harness | DeepSeek Harness `dsh-v0.1.
|
|
30
|
+
| Harness | DeepSeek Harness `dsh-v0.1.6-alpha.2` (adaptado el 2026-09-18): el sobre de sesión conserva su campo ignorable solo para compatibilidad de lectura de logs almacenados - Session.append aún no puede estamparlo, por lo que el comportamiento de la puerta no cambia. Verificado el 2026-09-18 contra el checkout master `dsh-v0.1.6-alpha.2` (cadena completa de puertas + smoke de instalación de perfil). |
|
|
30
31
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
31
32
|
| Plataformas | Donde corra DSH (host puro, regex sin dependencias; sin mitad de navegador) |
|
|
32
33
|
| Modelo | Modelos de texto totalmente soportados |
|
|
@@ -123,7 +124,7 @@ Todas las opciones son campos Schemastery `Config` (modificables desde cordis.ym
|
|
|
123
124
|
- **Solo regex.** `person` y `address` requieren un reconocedor NER externo; fallan al cargar. Cubierto de serie: teléfono, correo, documento, tarjeta, clave e IP (opt-in).
|
|
124
125
|
- **Patrones específicos de región.** Los detectores `phone` e `id-card` solo reconocen formatos de China continental: `phone` es `1[3-9]` seguido de nueve dígitos, e `id-card` es un documento de residente chino de 18 caracteres (17 dígitos más un dígito o `X`). Los teléfonos y documentos de otros países no se detectan. `email`, `ip` y `key` no dependen de la región; `bank-card` acepta cualquier secuencia de 16-19 dígitos con menor confianza.
|
|
125
126
|
- **La restauración visual necesita una mitad de cliente.** Enmascarar es host-side; desenmascarar burbujas en la UI es una función de navegador que esta forma host puro no incluye. El host conserva la tabla y el seam `RestoreStore` exportado (sus métodos piden un id de sesión), así que una futura mitad de cliente debe consumirlos mediante un remoto del host, no directamente; hoy la superficie de desenmascarado es el comando `/mask restore <text>`, y la clave `maskClientEnabled` se declara y valida pero ningún código en ejecución la lee todavía.
|
|
126
|
-
- **Eventos en `0.1.
|
|
127
|
+
- **Eventos en `0.1.6-alpha.2`.** El host registra 58 tipos de evento de sesión y ninguno es `mask/*`; su `Session.append` tampoco puede estampar el sobre `ignorable`, así que los appends de auditoría se omiten (las sesiones siguen cargando). La puerta no es silenciosa: la primera negativa de cada sesión registra un aviso visible con el tipo omitido y esta limitación documentada. El append se habilita automáticamente cuando un host registra el tipo o admite el sobre `ignorable`.
|
|
127
128
|
|
|
128
129
|
## Development
|
|
129
130
|
|
|
@@ -153,7 +154,7 @@ El benchmark de PII (P/R/F1 por tipo sobre 108 muestras sintéticas) está en [`
|
|
|
153
154
|
|
|
154
155
|
## PerryLink DSH Plugin Family
|
|
155
156
|
|
|
156
|
-
Este proyecto es uno de los [
|
|
157
|
+
Este proyecto es uno de los [40 complementos de DeepSeek Harness](https://github.com/PerryLink) mantenidos por [PerryLink](https://github.com/PerryLink). Si este te ayuda, probablemente los demás también:
|
|
157
158
|
|
|
158
159
|
| Plugin | One-liner |
|
|
159
160
|
|---|---|
|
|
@@ -182,6 +183,7 @@ Este proyecto es uno de los [37 complementos de DeepSeek Harness](https://github
|
|
|
182
183
|
| **[dsh-permission-rules](https://github.com/PerryLink/dsh-permission-rules)** | Reglas de permisos declarativas allow/deny/ask estilo Claude Code con auditoría | |
|
|
183
184
|
| **[dsh-personal-directive](https://github.com/PerryLink/dsh-personal-directive)** | Inyector de directivas personales con interruptor en la barra superior (edición framework) |
|
|
184
185
|
| **[dsh-plugin-guide](https://github.com/PerryLink/dsh-plugin-guide)** | Base de conocimiento de desarrollo de plugins como habilidad de agente bajo demanda | |
|
|
186
|
+
| **[dsh-plugin-doctor](https://github.com/PerryLink/dsh-plugin-doctor)** | Zero-dependency static + sandbox smoke detector for DSH plugins | |
|
|
185
187
|
| **[dsh-reach](https://github.com/PerryLink/dsh-reach)** | Puente multicanal de aprobación/preguntas: WeChat/Telegram/Feishu, consola de sesión |
|
|
186
188
|
| **[dsh-research-report](https://github.com/PerryLink/dsh-research-report)** | Motor de informes de investigación verificables con evidencia direccionada por contenido | |
|
|
187
189
|
| **[dsh-score](https://github.com/PerryLink/dsh-score)** | Puntuación de calidad multidimensional para plugins de DeepSeek Harness. | |
|
|
@@ -192,7 +194,16 @@ Este proyecto es uno de los [37 complementos de DeepSeek Harness](https://github
|
|
|
192
194
|
| **[dsh-test-drive](https://github.com/PerryLink/dsh-test-drive)** | Pruebas de instalación y humo aisladas para plugins de DeepSeek Harness. | |
|
|
193
195
|
| **[dsh-ticktick](https://github.com/PerryLink/dsh-ticktick)** | Puente de tareas TickTick/Dida365: panel de cabecera de sesión + 11 herramientas |
|
|
194
196
|
| **[dsh-translate](https://github.com/PerryLink/dsh-translate)** | Traducción de parámetros entre proveedores y reparación determinista de JSON para DeepSeek Harness. | |
|
|
195
|
-
| **[dsh-wechat](https://github.com/
|
|
197
|
+
| **[dsh-wechat](https://github.com/pan17/dsh-wechat)** | Puente WeChat ↔ DSH (bot Tencent iLink): texto/imagen/archivo/voz, aprobaciones en el chat |
|
|
198
|
+
| **[dsh-autotier](https://github.com/PerryLink/dsh-autotier)** | Automatic strong/cheap model-tier routing with deterministic risk guards and a `/tier` command | |
|
|
199
|
+
| **[dsh-catalog](https://github.com/PerryLink/dsh-catalog)** | DSH Desktop Market standard catalog source for the PerryLink family | |
|
|
200
|
+
| **[dsh-cert-mcp](https://github.com/PerryLink/dsh-cert-mcp)** | Read-only MCP server exposing the certification registry: grades, snapshots and five-dimension evidence | |
|
|
201
|
+
| **[dsh-kit](https://github.com/PerryLink/dsh-kit)** | One-command starter pack that installs the core family | |
|
|
202
|
+
| **[dsh-plugin-certification](https://github.com/PerryLink/dsh-plugin-certification)** | Community certification registry with repro-checkable grades and badges | |
|
|
203
|
+
| **[dsh-plugin-kit](https://github.com/PerryLink/dsh-plugin-kit)** | Shared zero-runtime-dependency toolkit for the PerryLink DSH plugins | |
|
|
204
|
+
| **[dsh-plugin-portal](https://github.com/PerryLink/dsh-plugin-portal)** | Zero-dependency static portal rendering the whole plugin family as one page | |
|
|
205
|
+
| **[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 | |
|
|
206
|
+
| **[dsh-team-rooms](https://github.com/PerryLink/dsh-team-rooms)** | Cross-session team rooms: shared message bus, task board and timeline | |
|
|
196
207
|
|
|
197
208
|
## License
|
|
198
209
|
|
package/README-hi.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*फ़ोन, ईमेल, आईडी कार्ड, बैंक कार्ड, कुंजियाँ आदि मॉडल सीमा पर प्लेसहोल्डर बन जाते हैं; मूल पाठ आपके सत्र लॉग में कभी नहीं जाता।*
|
|
9
9
|
|
|
10
10
|
[](LICENSE)
|
|
11
|
+
[](https://gitee.com/perrylink/dsh-mask)
|
|
11
12
|
[](https://github.com/topics/dsh-plugin)
|
|
12
13
|
[](https://github.com/PerryLink/dsh-plugin-doctor#verified-徽章)
|
|
13
14
|
[](#)
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
|
|
27
28
|
| सतह | स्थिति |
|
|
28
29
|
|---|---|
|
|
29
|
-
| Harness | DeepSeek Harness `dsh-v0.1.
|
|
30
|
+
| Harness | DeepSeek Harness `dsh-v0.1.6-alpha.2` (2026-09-18 को अनुकूलित): सत्र लिफ़ाफ़ा अपना ignorable फ़ील्ड केवल संग्रहीत-लॉग पठन संगतता के लिए रखता है - Session.append अभी भी इसे स्टैम्प नहीं कर सकता, इसलिए गेट व्यवहार अपरिवर्तित है। 2026-09-18 को `dsh-v0.1.6-alpha.2` master checkout के विरुद्ध सत्यापित (पूर्ण गेट शृंखला + profile इंस्टॉल स्मोक)। |
|
|
30
31
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
31
32
|
| प्लेटफ़ॉर्म | जहाँ DSH चले (शुद्ध host, शून्य-निर्भरता regex; कोई ब्राउज़र आधा नहीं) |
|
|
32
33
|
| मॉडल | टेक्स्ट मॉडल पूर्ण रूप से समर्थित |
|
|
@@ -123,7 +124,7 @@ dsh --profile web --dump-config | grep -A2 'id: mask'
|
|
|
123
124
|
- **केवल regex।** `person` और `address` को बाहरी NER पहचानकर्ता चाहिए; लोड पर विफल। बॉक्स में: फ़ोन, ईमेल, आईडी कार्ड, बैंक कार्ड, कुंजी और IP (opt-in)।
|
|
124
125
|
- **क्षेत्र-विशिष्ट पैटर्न।** `phone` और `id-card` डिटेक्टर केवल मुख्य भूमि चीन के प्रारूप पहचानते हैं: `phone` = `1[3-9]` के बाद नौ अंक, और `id-card` = 18 वर्णों वाला चीनी निवासी आईडी (17 अंक और एक अंक या `X`)। अन्य देशों के फ़ोन नंबर और राष्ट्रीय पहचान पत्र नहीं पकड़े जाते। `email`, `ip` और `key` क्षेत्र-निरपेक्ष हैं; `bank-card` किसी भी 16-19 अंकों की श्रृंखला को कम विश्वास के साथ स्वीकार करता है।
|
|
125
126
|
- **डिस्प्ले-लेयर पुनर्स्थापना को क्लाइंट आधा चाहिए।** मास्किंग host-side है; UI बुलबुलों को खोलना एक ब्राउज़र-आधा सुविधा है जो यह शुद्ध-host रूप नहीं देता। host तालिका और निर्यातित `RestoreStore` seam रखता है (उसके मेथड को session id चाहिए), इसलिए भविष्य का क्लाइंट आधा उन्हें host remote से लेगा, सीधे नहीं; आज अनमास्किंग का सतह `/mask restore <text>` कमांड है, और `maskClientEnabled` कुंजी schema में घोषित व मान्य होती है पर अभी कोई रनटाइम कोड उसे नहीं पढ़ता।
|
|
126
|
-
- **`0.1.
|
|
127
|
+
- **`0.1.6-alpha.2` पर इवेंट।** host 58 सत्र-इवेंट प्रकार दर्ज करता है और उनमें `mask/*` नहीं है; उसका `Session.append` `ignorable` लिफ़ाफ़ा भी नहीं लगा सकता, इसलिए ऑडिट appends छोड़े जाते हैं (सत्र लोड होते रहते हैं)। गेट मौन नहीं है: प्रत्येक सत्र की पहली अस्वीकृति पर छोड़े गए प्रकार और इस प्रलेखित सीमा के साथ एक दृश्य चेतावनी दर्ज होती है। जब host प्रकार दर्ज करे या `ignorable` लिफ़ाफ़ा स्वीकार करे, append स्वतः सक्षम हो जाता है।
|
|
127
128
|
|
|
128
129
|
## Development
|
|
129
130
|
|
|
@@ -153,7 +154,7 @@ PII बेंचमार्क (108 सिंथेटिक नमूनों
|
|
|
153
154
|
|
|
154
155
|
## PerryLink DSH Plugin Family
|
|
155
156
|
|
|
156
|
-
यह प्रोजेक्ट [PerryLink](https://github.com/PerryLink) द्वारा अनुरक्षित [
|
|
157
|
+
यह प्रोजेक्ट [PerryLink](https://github.com/PerryLink) द्वारा अनुरक्षित [40 DeepSeek Harness प्लगइनों](https://github.com/PerryLink) में से एक है। अगर यह आपकी मदद करता है, तो बाकी भी करेंगे:
|
|
157
158
|
|
|
158
159
|
| Plugin | One-liner |
|
|
159
160
|
|---|---|
|
|
@@ -182,6 +183,7 @@ PII बेंचमार्क (108 सिंथेटिक नमूनों
|
|
|
182
183
|
| **[dsh-permission-rules](https://github.com/PerryLink/dsh-permission-rules)** | ऑडिट के साथ Claude Code-शैली घोषणात्मक allow/deny/ask अनुमति नियम | |
|
|
183
184
|
| **[dsh-personal-directive](https://github.com/PerryLink/dsh-personal-directive)** | शीर्ष-बार टॉगल के साथ व्यक्तिगत निर्देश इंजेक्टर (फ्रेमवर्क संस्करण) |
|
|
184
185
|
| **[dsh-plugin-guide](https://github.com/PerryLink/dsh-plugin-guide)** | माँग पर एजेंट कौशल के रूप में प्लगइन-विकास ज्ञान आधार | |
|
|
186
|
+
| **[dsh-plugin-doctor](https://github.com/PerryLink/dsh-plugin-doctor)** | Zero-dependency static + sandbox smoke detector for DSH plugins | |
|
|
185
187
|
| **[dsh-reach](https://github.com/PerryLink/dsh-reach)** | मल्टी-चैनल अनुमोदन/प्रश्न ब्रिज: WeChat/Telegram/Feishu, सत्र कंसोल |
|
|
186
188
|
| **[dsh-research-report](https://github.com/PerryLink/dsh-research-report)** | सामग्री-पता साक्ष्य और सीलबंद संस्करणों वाला सत्यापन-योग्य अनुसंधान-रिपोर्ट इंजन | |
|
|
187
189
|
| **[dsh-score](https://github.com/PerryLink/dsh-score)** | DeepSeek Harness प्लगिनों की बहु-आयामी गुणवत्ता स्कोरिंग। | |
|
|
@@ -192,7 +194,16 @@ PII बेंचमार्क (108 सिंथेटिक नमूनों
|
|
|
192
194
|
| **[dsh-test-drive](https://github.com/PerryLink/dsh-test-drive)** | DeepSeek Harness प्लगिनों के लिए पृथक इंस्टॉल-एंड-स्मोक टेस्ट ड्राइव। | |
|
|
193
195
|
| **[dsh-ticktick](https://github.com/PerryLink/dsh-ticktick)** | TickTick/Dida365 कार्य ब्रिज: सत्र-हेडर पैनल + 11 टूल |
|
|
194
196
|
| **[dsh-translate](https://github.com/PerryLink/dsh-translate)** | DeepSeek Harness के लिए वेंडर पैरामीटर अनुवाद और नियतात्मक JSON मरम्मत। | |
|
|
195
|
-
| **[dsh-wechat](https://github.com/
|
|
197
|
+
| **[dsh-wechat](https://github.com/pan17/dsh-wechat)** | WeChat ↔ DSH ब्रिज (Tencent iLink bot): टेक्स्ट/इमेज/फ़ाइल/आवाज़, चैट में अनुमोदन |
|
|
198
|
+
| **[dsh-autotier](https://github.com/PerryLink/dsh-autotier)** | Automatic strong/cheap model-tier routing with deterministic risk guards and a `/tier` command | |
|
|
199
|
+
| **[dsh-catalog](https://github.com/PerryLink/dsh-catalog)** | DSH Desktop Market standard catalog source for the PerryLink family | |
|
|
200
|
+
| **[dsh-cert-mcp](https://github.com/PerryLink/dsh-cert-mcp)** | Read-only MCP server exposing the certification registry: grades, snapshots and five-dimension evidence | |
|
|
201
|
+
| **[dsh-kit](https://github.com/PerryLink/dsh-kit)** | One-command starter pack that installs the core family | |
|
|
202
|
+
| **[dsh-plugin-certification](https://github.com/PerryLink/dsh-plugin-certification)** | Community certification registry with repro-checkable grades and badges | |
|
|
203
|
+
| **[dsh-plugin-kit](https://github.com/PerryLink/dsh-plugin-kit)** | Shared zero-runtime-dependency toolkit for the PerryLink DSH plugins | |
|
|
204
|
+
| **[dsh-plugin-portal](https://github.com/PerryLink/dsh-plugin-portal)** | Zero-dependency static portal rendering the whole plugin family as one page | |
|
|
205
|
+
| **[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 | |
|
|
206
|
+
| **[dsh-team-rooms](https://github.com/PerryLink/dsh-team-rooms)** | Cross-session team rooms: shared message bus, task board and timeline | |
|
|
196
207
|
|
|
197
208
|
## License
|
|
198
209
|
|
package/README-pt.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*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.*
|
|
9
9
|
|
|
10
10
|
[](LICENSE)
|
|
11
|
+
[](https://gitee.com/perrylink/dsh-mask)
|
|
11
12
|
[](https://github.com/topics/dsh-plugin)
|
|
12
13
|
[](https://github.com/PerryLink/dsh-plugin-doctor#verified-徽章)
|
|
13
14
|
[](#)
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
|
|
27
28
|
| Superfície | Estado |
|
|
28
29
|
|---|---|
|
|
29
|
-
| Harness | DeepSeek Harness `dsh-v0.1.
|
|
30
|
+
| Harness | DeepSeek Harness `dsh-v0.1.6-alpha.2` (adaptado em 2026-09-18): o envelope de sessão mantém seu campo ignorable apenas para compatibilidade de leitura de logs armazenados - o Session.append ainda não consegue estampá-lo, então o comportamento da porta não muda. Verificado em 2026-09-18 contra o checkout master `dsh-v0.1.6-alpha.2` (cadeia completa de portas + smoke de instalação de perfil). |
|
|
30
31
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
31
32
|
| Plataformas | Onde o DSH rodar (host puro, regex sem dependências; sem metade de navegador) |
|
|
32
33
|
| Modelo | Modelos de texto totalmente suportados |
|
|
@@ -123,7 +124,7 @@ Todas as opções são campos Schemastery `Config` (alteráveis via cordis.yml).
|
|
|
123
124
|
- **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).
|
|
124
125
|
- **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.
|
|
125
126
|
- **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.
|
|
126
|
-
- **Eventos em `0.1.
|
|
127
|
+
- **Eventos em `0.1.6-alpha.2`.** O host registra 58 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`.
|
|
127
128
|
|
|
128
129
|
## Development
|
|
129
130
|
|
|
@@ -153,7 +154,7 @@ O benchmark de PII (P/R/F1 por tipo em 108 amostras sintéticas) está em [`benc
|
|
|
153
154
|
|
|
154
155
|
## PerryLink DSH Plugin Family
|
|
155
156
|
|
|
156
|
-
Este projeto é um dos [
|
|
157
|
+
Este projeto é um dos [40 plugins de DeepSeek Harness](https://github.com/PerryLink) mantidos por [PerryLink](https://github.com/PerryLink). Se este ajuda você, os outros provavelmente também:
|
|
157
158
|
|
|
158
159
|
| Plugin | One-liner |
|
|
159
160
|
|---|---|
|
|
@@ -182,6 +183,7 @@ Este projeto é um dos [37 plugins de DeepSeek Harness](https://github.com/Perry
|
|
|
182
183
|
| **[dsh-permission-rules](https://github.com/PerryLink/dsh-permission-rules)** | Regras de permissão declarativas allow/deny/ask estilo Claude Code com auditoria | |
|
|
183
184
|
| **[dsh-personal-directive](https://github.com/PerryLink/dsh-personal-directive)** | Injetor de diretivas pessoais com alternância na barra superior (edição framework) |
|
|
184
185
|
| **[dsh-plugin-guide](https://github.com/PerryLink/dsh-plugin-guide)** | Base de conhecimento de desenvolvimento de plugins como habilidade de agente sob demanda | |
|
|
186
|
+
| **[dsh-plugin-doctor](https://github.com/PerryLink/dsh-plugin-doctor)** | Zero-dependency static + sandbox smoke detector for DSH plugins | |
|
|
185
187
|
| **[dsh-reach](https://github.com/PerryLink/dsh-reach)** | Ponte multicanal de aprovação/perguntas: WeChat/Telegram/Feishu, console de sessão |
|
|
186
188
|
| **[dsh-research-report](https://github.com/PerryLink/dsh-research-report)** | Motor de relatórios de pesquisa verificáveis com evidência endereçada por conteúdo | |
|
|
187
189
|
| **[dsh-score](https://github.com/PerryLink/dsh-score)** | Pontuação de qualidade multidimensional para plugins de DeepSeek Harness. | |
|
|
@@ -192,7 +194,16 @@ Este projeto é um dos [37 plugins de DeepSeek Harness](https://github.com/Perry
|
|
|
192
194
|
| **[dsh-test-drive](https://github.com/PerryLink/dsh-test-drive)** | Test drives isolados de instalação e smoke para plugins de DeepSeek Harness. | |
|
|
193
195
|
| **[dsh-ticktick](https://github.com/PerryLink/dsh-ticktick)** | Ponte de tarefas TickTick/Dida365: painel no cabeçalho da sessão + 11 ferramentas |
|
|
194
196
|
| **[dsh-translate](https://github.com/PerryLink/dsh-translate)** | Tradução de parâmetros entre fornecedores e reparo determinístico de JSON para DeepSeek Harness. | |
|
|
195
|
-
| **[dsh-wechat](https://github.com/
|
|
197
|
+
| **[dsh-wechat](https://github.com/pan17/dsh-wechat)** | Ponte WeChat ↔ DSH (bot Tencent iLink): texto/imagem/arquivo/voz, aprovações no chat |
|
|
198
|
+
| **[dsh-autotier](https://github.com/PerryLink/dsh-autotier)** | Automatic strong/cheap model-tier routing with deterministic risk guards and a `/tier` command | |
|
|
199
|
+
| **[dsh-catalog](https://github.com/PerryLink/dsh-catalog)** | DSH Desktop Market standard catalog source for the PerryLink family | |
|
|
200
|
+
| **[dsh-cert-mcp](https://github.com/PerryLink/dsh-cert-mcp)** | Read-only MCP server exposing the certification registry: grades, snapshots and five-dimension evidence | |
|
|
201
|
+
| **[dsh-kit](https://github.com/PerryLink/dsh-kit)** | One-command starter pack that installs the core family | |
|
|
202
|
+
| **[dsh-plugin-certification](https://github.com/PerryLink/dsh-plugin-certification)** | Community certification registry with repro-checkable grades and badges | |
|
|
203
|
+
| **[dsh-plugin-kit](https://github.com/PerryLink/dsh-plugin-kit)** | Shared zero-runtime-dependency toolkit for the PerryLink DSH plugins | |
|
|
204
|
+
| **[dsh-plugin-portal](https://github.com/PerryLink/dsh-plugin-portal)** | Zero-dependency static portal rendering the whole plugin family as one page | |
|
|
205
|
+
| **[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 | |
|
|
206
|
+
| **[dsh-team-rooms](https://github.com/PerryLink/dsh-team-rooms)** | Cross-session team rooms: shared message bus, task board and timeline | |
|
|
196
207
|
|
|
197
208
|
## License
|
|
198
209
|
|
package/README-zh.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*电话、邮箱、身份证、银行卡、密钥等在模型边界变成占位符;原文绝不进入会话日志。*
|
|
9
9
|
|
|
10
10
|
[](LICENSE)
|
|
11
|
+
[](https://gitee.com/perrylink/dsh-mask)
|
|
11
12
|
[](https://github.com/topics/dsh-plugin)
|
|
12
13
|
[](https://github.com/PerryLink/dsh-plugin-doctor#verified-徽章)
|
|
13
14
|
[](#)
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
|
|
27
28
|
| 维度 | 状态 |
|
|
28
29
|
|---|---|
|
|
29
|
-
| Harness | DeepSeek Harness `dsh-v0.1.
|
|
30
|
+
| Harness | DeepSeek Harness `dsh-v0.1.6-alpha.2`(2026-09-18 已适配):会话信封保留 ignorable 字段但仅用于存量日志读取兼容——Session.append 仍无法盖章,门控行为不变。已于 2026-09-18 针对 `dsh-v0.1.6-alpha.2` master checkout 核验(全量门禁链 + profile 安装冒烟测试)。 |
|
|
30
31
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
31
32
|
| 平台 | 任何 DSH 可运行处(纯 host、零依赖正则;无浏览器半) |
|
|
32
33
|
| 模型 | 文本模型完全支持;无需额外模型能力 |
|
|
@@ -141,13 +142,13 @@ profile patch 覆盖示例:
|
|
|
141
142
|
- **仅正则。** 姓名(`person`)与地址(`address`)识别需要外部 NER 识别器,纯 host 零依赖形态未捆绑;`mode: regex+ner` 与这些实体在加载期响亮失败。开箱即用覆盖电话、邮箱、身份证、银行卡、密钥与(可选)IP。
|
|
142
143
|
- **正则具地域局限。** `phone` 与 `id-card` 只匹配中国大陆格式:`phone` 为 `1[3-9]` 加九位数字,`id-card` 为 18 位中国居民身份证(17 位数字加一位数字或 `X`)。其他国家的电话号码与证件号码不会被检出。`email`、`ip`、`key` 与地域无关;`bank-card` 以较低置信度接受任意 16-19 位数字串。
|
|
143
144
|
- **展示层还原需要浏览器半。** 遮罩完全在 host 侧,但客户端 UI 中透明还原助手气泡属于浏览器半功能,本纯 host 形态未交付。host 侧保留恢复表与已导出的 `RestoreStore` seam(其方法需要会话 id),因此未来的客户端半需经 host 远程面间接消费,而非直接使用;当前的反遮罩入口是 `/mask restore <text>` 命令;`maskClientEnabled` 键会被 schema 声明与校验,但尚无任何运行时代码读取它。
|
|
144
|
-
- **`0.1.
|
|
145
|
+
- **`0.1.6-alpha.2` 会话事件。** 宿主收录 58 个会话事件类型,其中没有 `mask/*`;其 `Session.append` 也无法盖章 `ignorable` 信封,因此会话日志审计 append 被跳过(会话仍可加载)。门控不再静默:每个会话首次被拒时打一条可见告警,写明被跳过的事件类型与本限制。宿主收录该类型或支持 `ignorable` 信封后自动开启。
|
|
145
146
|
|
|
146
147
|
## Development
|
|
147
148
|
|
|
148
149
|
```sh
|
|
149
150
|
pnpm install # node ^22.19 || >=24
|
|
150
|
-
pnpm run typecheck && pnpm run typecheck:ci #
|
|
151
|
+
pnpm run typecheck && pnpm run typecheck:ci # 两把尺子:alpha.2 开发面 + 已发布线(清 paths)
|
|
151
152
|
pnpm test # node --test
|
|
152
153
|
pnpm run verify:self-contained # 依赖 spec 均来自 registry
|
|
153
154
|
pnpm run verify:artifacts # 发布文件齐全 + index.mjs 可 import
|
|
@@ -171,7 +172,7 @@ PII 基准(108 个合成样本的逐类 P/R/F1)见 [`benchmark/RESULTS.md`](
|
|
|
171
172
|
|
|
172
173
|
## PerryLink DSH Plugin Family
|
|
173
174
|
|
|
174
|
-
这是 [PerryLink](https://github.com/PerryLink) 维护的 [
|
|
175
|
+
这是 [PerryLink](https://github.com/PerryLink) 维护的 [40 个 DeepSeek Harness 插件](https://github.com/PerryLink) 之一。如果它能帮到你,其他的也会:
|
|
175
176
|
|
|
176
177
|
| Plugin | One-liner |
|
|
177
178
|
|---|---|
|
|
@@ -200,6 +201,7 @@ PII 基准(108 个合成样本的逐类 P/R/F1)见 [`benchmark/RESULTS.md`](
|
|
|
200
201
|
| **[dsh-permission-rules](https://github.com/PerryLink/dsh-permission-rules)** | Claude Code 风格声明式 allow/deny/ask 权限规则,带审计 | |
|
|
201
202
|
| **[dsh-personal-directive](https://github.com/PerryLink/dsh-personal-directive)** | 个人指令注入器:顶栏开关(框架版) |
|
|
202
203
|
| **[dsh-plugin-guide](https://github.com/PerryLink/dsh-plugin-guide)** | 作为按需代理技能的插件开发知识库 | |
|
|
204
|
+
| **[dsh-plugin-doctor](https://github.com/PerryLink/dsh-plugin-doctor)** | Zero-dependency static + sandbox smoke detector for DSH plugins | |
|
|
203
205
|
| **[dsh-reach](https://github.com/PerryLink/dsh-reach)** | 多渠道审批/提问桥接:微信/Telegram/飞书,会话控制台 |
|
|
204
206
|
| **[dsh-research-report](https://github.com/PerryLink/dsh-research-report)** | 可验证研究报告引擎:内容寻址证据账本与封存版本 | |
|
|
205
207
|
| **[dsh-score](https://github.com/PerryLink/dsh-score)** | DeepSeek Harness 插件的多维质量评分。 | |
|
|
@@ -210,7 +212,16 @@ PII 基准(108 个合成样本的逐类 P/R/F1)见 [`benchmark/RESULTS.md`](
|
|
|
210
212
|
| **[dsh-test-drive](https://github.com/PerryLink/dsh-test-drive)** | DeepSeek Harness 插件的隔离试装冒烟。 | |
|
|
211
213
|
| **[dsh-ticktick](https://github.com/PerryLink/dsh-ticktick)** | TickTick/滴答清单任务桥接:会话头面板 + 11 个工具 |
|
|
212
214
|
| **[dsh-translate](https://github.com/PerryLink/dsh-translate)** | DeepSeek Harness 的厂商参数翻译与确定性 JSON 修复。 | |
|
|
213
|
-
| **[dsh-wechat](https://github.com/
|
|
215
|
+
| **[dsh-wechat](https://github.com/pan17/dsh-wechat)** | 微信 ↔ DSH 桥接(Tencent iLink 机器人):文本/图片/文件/语音,聊天内审批卡片 |
|
|
216
|
+
| **[dsh-autotier](https://github.com/PerryLink/dsh-autotier)** | Automatic strong/cheap model-tier routing with deterministic risk guards and a `/tier` command | |
|
|
217
|
+
| **[dsh-catalog](https://github.com/PerryLink/dsh-catalog)** | DSH Desktop Market standard catalog source for the PerryLink family | |
|
|
218
|
+
| **[dsh-cert-mcp](https://github.com/PerryLink/dsh-cert-mcp)** | Read-only MCP server exposing the certification registry: grades, snapshots and five-dimension evidence | |
|
|
219
|
+
| **[dsh-kit](https://github.com/PerryLink/dsh-kit)** | One-command starter pack that installs the core family | |
|
|
220
|
+
| **[dsh-plugin-certification](https://github.com/PerryLink/dsh-plugin-certification)** | Community certification registry with repro-checkable grades and badges | |
|
|
221
|
+
| **[dsh-plugin-kit](https://github.com/PerryLink/dsh-plugin-kit)** | Shared zero-runtime-dependency toolkit for the PerryLink DSH plugins | |
|
|
222
|
+
| **[dsh-plugin-portal](https://github.com/PerryLink/dsh-plugin-portal)** | Zero-dependency static portal rendering the whole plugin family as one page | |
|
|
223
|
+
| **[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 | |
|
|
224
|
+
| **[dsh-team-rooms](https://github.com/PerryLink/dsh-team-rooms)** | Cross-session team rooms: shared message bus, task board and timeline | |
|
|
214
225
|
|
|
215
226
|
## License
|
|
216
227
|
|
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
| Surface | Status |
|
|
29
29
|
|---|---|
|
|
30
|
-
| Harness | DeepSeek Harness `dsh-v0.1.
|
|
30
|
+
| Harness | DeepSeek Harness `dsh-v0.1.6-alpha.2` (adapted 2026-09-18): the session envelope keeps its ignorable field for stored-log read compatibility only - Session.append still cannot stamp it, so audit-gate behavior is unchanged. Verified 2026-09-18 against the dsh-v0.1.6-alpha.2 master checkout (full gate chain + profile install smoke). |
|
|
31
31
|
| Node | `^22.19.0 \|\| >=24.0.0` |
|
|
32
32
|
| Platforms | Anywhere DSH runs (pure host, zero-dependency regex; no browser half) |
|
|
33
33
|
| Model | Text models fully supported; no extra model capability required |
|
|
@@ -144,13 +144,13 @@ Example override in your profile patch:
|
|
|
144
144
|
- **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.
|
|
145
145
|
- **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.
|
|
146
146
|
- **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.
|
|
147
|
-
- **Session events on `0.1.
|
|
147
|
+
- **Session events on `0.1.6-alpha.2`.** The harness records 58 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.
|
|
148
148
|
|
|
149
149
|
## Development
|
|
150
150
|
|
|
151
151
|
```sh
|
|
152
152
|
pnpm install # node ^22.19 || >=24
|
|
153
|
-
pnpm run typecheck && pnpm run typecheck:ci #
|
|
153
|
+
pnpm run typecheck && pnpm run typecheck:ci # two rulers: alpha.2 dev face + published-line face (paths cleared)
|
|
154
154
|
pnpm test # node --test
|
|
155
155
|
pnpm run verify:self-contained # dependency specs resolve from the registry
|
|
156
156
|
pnpm run verify:artifacts # shipped files present + index.mjs importable
|
|
@@ -174,7 +174,7 @@ The PII benchmark (per-type P/R/F1 over 108 synthetic samples) is published in [
|
|
|
174
174
|
|
|
175
175
|
## PerryLink DSH Plugin Family
|
|
176
176
|
|
|
177
|
-
This project is one of the [
|
|
177
|
+
This project is one of the [40 DeepSeek Harness plugins](https://github.com/PerryLink) maintained by [PerryLink](https://github.com/PerryLink). If this one helps you, the others likely will too:
|
|
178
178
|
|
|
179
179
|
| Plugin | One-liner |
|
|
180
180
|
|---|---|
|
|
@@ -203,6 +203,7 @@ This project is one of the [37 DeepSeek Harness plugins](https://github.com/Perr
|
|
|
203
203
|
| **[dsh-permission-rules](https://github.com/PerryLink/dsh-permission-rules)** | Claude Code-style declarative allow/deny/ask permission rules with audit | |
|
|
204
204
|
| **[dsh-personal-directive](https://github.com/PerryLink/dsh-personal-directive)** | Personal directive injector with top-bar toggle (framework edition) |
|
|
205
205
|
| **[dsh-plugin-guide](https://github.com/PerryLink/dsh-plugin-guide)** | Plugin-development knowledge base as an on-demand agent skill | |
|
|
206
|
+
| **[dsh-plugin-doctor](https://github.com/PerryLink/dsh-plugin-doctor)** | Zero-dependency static + sandbox smoke detector for DSH plugins | |
|
|
206
207
|
| **[dsh-reach](https://github.com/PerryLink/dsh-reach)** | Multi-channel approval/question bridge: WeChat/Telegram/Feishu, session console |
|
|
207
208
|
| **[dsh-research-report](https://github.com/PerryLink/dsh-research-report)** | Verifiable research-report engine: content-addressed evidence ledger and sealed versions | |
|
|
208
209
|
| **[dsh-score](https://github.com/PerryLink/dsh-score)** | Multi-dimensional quality scoring for DeepSeek Harness plugins. | |
|
|
@@ -213,7 +214,16 @@ This project is one of the [37 DeepSeek Harness plugins](https://github.com/Perr
|
|
|
213
214
|
| **[dsh-test-drive](https://github.com/PerryLink/dsh-test-drive)** | Isolated install-and-smoke test drives for DeepSeek Harness plugins. | |
|
|
214
215
|
| **[dsh-ticktick](https://github.com/PerryLink/dsh-ticktick)** | TickTick/Dida365 task bridge: session-header panel + 11 tools |
|
|
215
216
|
| **[dsh-translate](https://github.com/PerryLink/dsh-translate)** | Vendor parameter translation and deterministic JSON repair for DeepSeek Harness. | |
|
|
216
|
-
| **[dsh-wechat](https://github.com/
|
|
217
|
+
| **[dsh-wechat](https://github.com/pan17/dsh-wechat)** | WeChat ↔ DSH bridge (Tencent iLink bot): text/image/file/voice, approvals in chat |
|
|
218
|
+
| **[dsh-autotier](https://github.com/PerryLink/dsh-autotier)** | Automatic strong/cheap model-tier routing with deterministic risk guards and a `/tier` command | |
|
|
219
|
+
| **[dsh-catalog](https://github.com/PerryLink/dsh-catalog)** | DSH Desktop Market standard catalog source for the PerryLink family | |
|
|
220
|
+
| **[dsh-cert-mcp](https://github.com/PerryLink/dsh-cert-mcp)** | Read-only MCP server exposing the certification registry: grades, snapshots and five-dimension evidence | |
|
|
221
|
+
| **[dsh-kit](https://github.com/PerryLink/dsh-kit)** | One-command starter pack that installs the core family | |
|
|
222
|
+
| **[dsh-plugin-certification](https://github.com/PerryLink/dsh-plugin-certification)** | Community certification registry with repro-checkable grades and badges | |
|
|
223
|
+
| **[dsh-plugin-kit](https://github.com/PerryLink/dsh-plugin-kit)** | Shared zero-runtime-dependency toolkit for the PerryLink DSH plugins | |
|
|
224
|
+
| **[dsh-plugin-portal](https://github.com/PerryLink/dsh-plugin-portal)** | Zero-dependency static portal rendering the whole plugin family as one page | |
|
|
225
|
+
| **[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 | |
|
|
226
|
+
| **[dsh-team-rooms](https://github.com/PerryLink/dsh-team-rooms)** | Cross-session team rooms: shared message bus, task board and timeline | |
|
|
217
227
|
|
|
218
228
|
### Install from the DSH Desktop Market
|
|
219
229
|
|
package/index.mjs
CHANGED
|
@@ -279,7 +279,7 @@ export function apply(ctx, config = {}) {
|
|
|
279
279
|
|
|
280
280
|
const logger = ctx.logger(PLUGIN_NAME)
|
|
281
281
|
const warn = (message) => logger.warn(message)
|
|
282
|
-
const eventGate = makeEventGate(KNOWN_SESSION_EVENT_TYPES, probeIgnorableAppend())
|
|
282
|
+
const eventGate = makeEventGate(KNOWN_SESSION_EVENT_TYPES, probeIgnorableAppend(), warn)
|
|
283
283
|
|
|
284
284
|
// --- 恢复表:可选 storageDomain 的 'dsh_mask' 领域(异步打开,操作路径 await)。
|
|
285
285
|
// storageDomain 缺失(bare profile 未组合存储栈)时降级为纯内存恢复表,
|
|
@@ -288,11 +288,20 @@ export function apply(ctx, config = {}) {
|
|
|
288
288
|
/** @type {Promise<any>|null} 打开的领域(含 table/close),RestoreStore 按需消费。 */
|
|
289
289
|
let domainPromise = null
|
|
290
290
|
if (storageDomain !== undefined) {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
291
|
+
// V2 形态(A02 T1,与 dsh-score/src/index.ts 同构):effect 先注册,disposer
|
|
292
|
+
// 通过闭包读取 domainPromise,因此卸载竞态(apply 期间卸载)不再把 close 挂在
|
|
293
|
+
// 一个 INACTIVE_EFFECT 的 ctx.effect 上——句柄要么被消费方持有、要么由本
|
|
294
|
+
// disposer 关闭,绝不泄漏,也不再有浮空 promise 被静默吞掉。
|
|
295
|
+
domainPromise = (async () => storageDomain.open(dshMaskDomainSpec))()
|
|
296
|
+
// 拒绝必须可见:打开失败在此响亮告警一次(绝不空 catch 吞掉);消费方
|
|
297
|
+
// (RestoreStore)按操作继续走各自 onError 路径。
|
|
298
|
+
domainPromise.catch((error) => {
|
|
299
|
+
warn(`storage domain unavailable: ${messageOf(error)}`)
|
|
294
300
|
})
|
|
295
|
-
|
|
301
|
+
ctx.effect(() => () => {
|
|
302
|
+
// 打开失败时没有句柄可关,故这里只忽略「无句柄可关」这一种情况。
|
|
303
|
+
void domainPromise.then((domain) => domain.close()).catch(() => {})
|
|
304
|
+
}, `${PLUGIN_NAME}.domain.close`)
|
|
296
305
|
} else if (resolved.persistRestoreTable) {
|
|
297
306
|
warn('storageDomain not composed: the restore table is memory-only (lost on restart). Compose the storage stack (storage / storage-json / storage-domain) in the profile, or set persistRestoreTable: false.')
|
|
298
307
|
}
|
package/lib/gate.mjs
CHANGED
|
@@ -7,14 +7,24 @@ import { PLUGIN_NAME } from './constants.mjs'
|
|
|
7
7
|
* 宿主 KNOWN_SESSION_EVENT_TYPES 收录的类型直接 append;未收录但宿主 append
|
|
8
8
|
* 支持 ignorable 信封(运行时探测)时以 { ignorable: true } append;其余
|
|
9
9
|
* 拒绝(rc.2:未收录类型落盘会让会话下次加载被持久化层拒绝)。
|
|
10
|
+
*
|
|
11
|
+
* 拒绝**不再静默**:首次遇到某会话的某个被拒类型时打一次可见告警(会话维度去重,
|
|
12
|
+
* 同一会话同一类型只报一次),说明审计事件按文档所述不落盘、会话因此保持可加载。
|
|
10
13
|
* @param {ReadonlySet<string>} knownTypes - KNOWN_SESSION_EVENT_TYPES。
|
|
11
14
|
* @param {boolean} [ignorableAppend] - 宿主 append 是否盖章 ignorable 信封。
|
|
12
|
-
* @
|
|
15
|
+
* @param {(message: string) => void} [warn] - 可见告警出口(缺省静默,测试可注入)。
|
|
16
|
+
* @returns {(type: string, sessionKey?: string) => {append: boolean, ignorable: boolean}} 决策函数。
|
|
13
17
|
*/
|
|
14
|
-
export function makeEventGate(knownTypes, ignorableAppend = false) {
|
|
15
|
-
|
|
18
|
+
export function makeEventGate(knownTypes, ignorableAppend = false, warn = () => {}) {
|
|
19
|
+
const warned = new Set()
|
|
20
|
+
return (type, sessionKey) => {
|
|
16
21
|
if (knownTypes.has(type)) return { append: true, ignorable: false }
|
|
17
22
|
if (ignorableAppend) return { append: true, ignorable: true }
|
|
23
|
+
const key = `${sessionKey ?? 'unknown-session'}:${type}`
|
|
24
|
+
if (!warned.has(key)) {
|
|
25
|
+
warned.add(key)
|
|
26
|
+
warn(`${PLUGIN_NAME} session event ${type} is not recorded by this host and cannot carry the ignorable envelope: the audit event is skipped so the session keeps loading (documented limitation, not a silent failure).`)
|
|
27
|
+
}
|
|
18
28
|
return { append: false, ignorable: false }
|
|
19
29
|
}
|
|
20
30
|
}
|
|
@@ -24,13 +34,13 @@ export function makeEventGate(knownTypes, ignorableAppend = false) {
|
|
|
24
34
|
* @param {object|null|undefined} session - Session(缺失即跳过)。
|
|
25
35
|
* @param {string} type - 事件类型。
|
|
26
36
|
* @param {object} data - 载荷。
|
|
27
|
-
* @param {(type: string) => {append: boolean, ignorable: boolean}} gate - makeEventGate 产物。
|
|
37
|
+
* @param {(type: string, sessionKey?: string) => {append: boolean, ignorable: boolean}} gate - makeEventGate 产物。
|
|
28
38
|
* @param {(message: string) => void} warn - 日志警告。
|
|
29
39
|
* @returns {unknown} 已 append 事件或 undefined。
|
|
30
40
|
*/
|
|
31
41
|
export function maybeAppendSessionEvent(session, type, data, gate, warn) {
|
|
32
42
|
if (session === null || session === undefined) return undefined
|
|
33
|
-
const decision = gate(type)
|
|
43
|
+
const decision = gate(type, session.id)
|
|
34
44
|
if (!decision.append) return undefined
|
|
35
45
|
try {
|
|
36
46
|
return session.append(type, data, decision.ignorable ? { ignorable: true } : undefined)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mask",
|
|
3
3
|
"description": "PII masking middleware for DeepSeek Harness: regex-detect and replace phones, emails, ID cards, bank cards, keys, and (opt-in) IPs with placeholders before they reach the model, keep the restore table host-side (memory plus a controlled storage domain, never the session log) with the /mask restore command and the exported RestoreStore seam, and expose /mask status and the mask_test tool. Name and address recognition needs an external NER recognizer, which this pure-host form does not bundle: mode \"regex+ner\" and the person/address entities fail loudly at load. The phone and ID-card detectors match mainland-China formats only.",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.11",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/PerryLink/dsh-mask.git"
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"THIRD_PARTY_NOTICES.md"
|
|
40
40
|
],
|
|
41
41
|
"dsh": {
|
|
42
|
+
"manifestVersion": 1,
|
|
42
43
|
"bundle": {
|
|
43
44
|
"patch": "./cordis.patch.yml"
|
|
44
45
|
}
|
|
@@ -86,30 +87,30 @@
|
|
|
86
87
|
},
|
|
87
88
|
"peerDependencies": {
|
|
88
89
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
89
|
-
"@deepseek-ai/dsh-commands": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
|
|
90
|
-
"@deepseek-ai/dsh-session": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
|
|
91
|
-
"@deepseek-ai/dsh-storage": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
|
|
92
|
-
"@deepseek-ai/dsh-storage-domain": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
|
|
93
|
-
"@deepseek-ai/dsh-storage-json": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
|
|
94
|
-
"@deepseek-ai/dsh-tools": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0",
|
|
90
|
+
"@deepseek-ai/dsh-commands": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
|
|
91
|
+
"@deepseek-ai/dsh-session": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
|
|
92
|
+
"@deepseek-ai/dsh-storage": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
|
|
93
|
+
"@deepseek-ai/dsh-storage-domain": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
|
|
94
|
+
"@deepseek-ai/dsh-storage-json": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
|
|
95
|
+
"@deepseek-ai/dsh-tools": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0",
|
|
95
96
|
"@deepseek-ai/schemastery": "^3.18.2"
|
|
96
97
|
},
|
|
97
98
|
"dependencies": {
|
|
98
99
|
"zod": "^4.4.3"
|
|
99
100
|
},
|
|
100
101
|
"devDependencies": {
|
|
101
|
-
"@deepseek-ai/dsh-attachment": "0.1.
|
|
102
|
+
"@deepseek-ai/dsh-attachment": "0.1.6-alpha.2",
|
|
102
103
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
103
104
|
"@deepseek-ai/cordis-plugin-include": "^1.0.7",
|
|
104
105
|
"@deepseek-ai/cordis-plugin-loader": "^1.0.3",
|
|
105
|
-
"@deepseek-ai/dsh-agent": "0.1.
|
|
106
|
-
"@deepseek-ai/dsh-commands": "0.1.
|
|
107
|
-
"@deepseek-ai/dsh-session": "0.1.
|
|
108
|
-
"@deepseek-ai/dsh-storage": "0.1.
|
|
109
|
-
"@deepseek-ai/dsh-storage-domain": "0.1.
|
|
110
|
-
"@deepseek-ai/dsh-storage-json": "0.1.
|
|
111
|
-
"@deepseek-ai/dsh-system-prompt": "0.1.
|
|
112
|
-
"@deepseek-ai/dsh-tools": "0.1.
|
|
106
|
+
"@deepseek-ai/dsh-agent": "0.1.6-alpha.2",
|
|
107
|
+
"@deepseek-ai/dsh-commands": "0.1.6-alpha.2",
|
|
108
|
+
"@deepseek-ai/dsh-session": "0.1.6-alpha.2",
|
|
109
|
+
"@deepseek-ai/dsh-storage": "0.1.6-alpha.2",
|
|
110
|
+
"@deepseek-ai/dsh-storage-domain": "0.1.6-alpha.2",
|
|
111
|
+
"@deepseek-ai/dsh-storage-json": "0.1.6-alpha.2",
|
|
112
|
+
"@deepseek-ai/dsh-system-prompt": "0.1.6-alpha.2",
|
|
113
|
+
"@deepseek-ai/dsh-tools": "0.1.6-alpha.2",
|
|
113
114
|
"@deepseek-ai/schemastery": "^3.18.2",
|
|
114
115
|
"@types/node": "^22.19.0",
|
|
115
116
|
"oxlint": "0.18.1",
|
|
@@ -117,7 +118,7 @@
|
|
|
117
118
|
},
|
|
118
119
|
"scripts": {
|
|
119
120
|
"typecheck": "tsc -p tsconfig.check.json",
|
|
120
|
-
"typecheck:ci": "tsc -p tsconfig.check.json",
|
|
121
|
+
"typecheck:ci": "tsc -p tsconfig.check.ci.json",
|
|
121
122
|
"test": "node --test \"test/*.test.mjs\"",
|
|
122
123
|
"coverage": "node --test --experimental-test-coverage \"test/*.test.mjs\"",
|
|
123
124
|
"lint": "oxlint",
|
|
@@ -138,7 +139,8 @@
|
|
|
138
139
|
"security"
|
|
139
140
|
],
|
|
140
141
|
"engines": {
|
|
141
|
-
"node": "^22.19.0 || >=24.0.0"
|
|
142
|
+
"node": "^22.19.0 || >=24.0.0",
|
|
143
|
+
"dsh": ">=0.1.2-rc.1 <0.2.0 || >=0.1.5-alpha.1 <0.2.0 || >=0.1.6-0 <0.2.0"
|
|
142
144
|
},
|
|
143
145
|
"packageManager": "pnpm@11.7.0",
|
|
144
146
|
"publishConfig": {
|
package/types.d.ts
CHANGED
|
@@ -4,9 +4,11 @@ declare module '@deepseek-ai/dsh-session' {
|
|
|
4
4
|
interface SessionEventMap {
|
|
5
5
|
/**
|
|
6
6
|
* 一次请求前脱敏的审计记录(log-only):只记"替换了多少处 + 类型分布",
|
|
7
|
-
* 绝不携带 PII
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* 绝不携带 PII 原文或占位符映射。事实陈述:当前宿主代际
|
|
8
|
+
* (KNOWN_SESSION_EVENT_TYPES,0.1.6-alpha.2 的 58 项快照)未收录 mask/*,
|
|
9
|
+
* 且 append 无法盖章 ignorable 信封,因此运行时自适应门**不落盘**该事件、
|
|
10
|
+
* 并在每个会话首次拒绝时打一条可见告警(审计缺失是文档化限制,不是静默失败)。
|
|
11
|
+
* 宿主收录该类型后同一门自动开启落盘(见 README「会话事件」)。
|
|
10
12
|
*/
|
|
11
13
|
'mask/applied': {
|
|
12
14
|
sessionId: string
|