@maskera/mcp 0.4.4 → 0.4.6
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.md +1 -1
- package/dist/cli.js +10 -5
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +3 -7
- package/dist/index.js +10 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Local Swedish PII redaction for any AI agent or LLM client:
|
|
|
8
8
|
4. **Hook / pipe guard (`maskera-mcp guard`)**: blocks PII in Claude Code / Cursor hooks or Unix pipelines (`exit 2`, never echoes raw PII) or redacts streams via `--redact`.
|
|
9
9
|
5. **Client installer and diagnostics (`maskera-mcp install` / `maskera-mcp doctor`)**: auto-detects or configures clients (`--apply`, `--project`, `--with-hook`), runs an automatic Swedish PII self-test + live `/mcp` probe, and prints (or saves via `--receipt <file.json>`) a zero-PII setup receipt (`maskera-setup-receipt/v1`).
|
|
10
10
|
|
|
11
|
-
All redaction runs 100% locally using `maskera` (deterministic Swedish rules + the
|
|
11
|
+
All redaction runs 100% locally using `maskera` (deterministic Swedish rules + the open Swedish ONNX NER model `joelhagvall/maskera-sv-ner`, about 59 MB in the default q8 build on Node, 43 MB in q4).
|
|
12
12
|
|
|
13
13
|
## 1. Local LLM proxy + warm Streamable HTTP MCP
|
|
14
14
|
|
package/dist/cli.js
CHANGED
|
@@ -190,7 +190,7 @@ function createMaskeraEngine(options = {}) {
|
|
|
190
190
|
if (!recognizer) {
|
|
191
191
|
const dtype = options.nerOptions?.dtype ?? (options.nerOptions?.localModelPath ? "q4" : "q8");
|
|
192
192
|
const loadStartedAt = Date.now();
|
|
193
|
-
options.onModelStatus?.({ phase: "loading", model });
|
|
193
|
+
options.onModelStatus?.({ phase: "loading", model, dtype });
|
|
194
194
|
recognizer = createNerRecognizer({
|
|
195
195
|
...options.nerOptions,
|
|
196
196
|
model,
|
|
@@ -401,6 +401,11 @@ function createMaskeraEngine(options = {}) {
|
|
|
401
401
|
}
|
|
402
402
|
};
|
|
403
403
|
}
|
|
404
|
+
var MODEL_DOWNLOAD_MB = { q4: 43, q8: 59 };
|
|
405
|
+
function downloadSize(dtype) {
|
|
406
|
+
const mb = dtype ? MODEL_DOWNLOAD_MB[dtype] : void 0;
|
|
407
|
+
return mb ? `, ~${mb} MB on first run` : "";
|
|
408
|
+
}
|
|
404
409
|
function createModelProgressLogger(write = (line) => process.stderr.write(`${line}
|
|
405
410
|
`), delayMs = 350) {
|
|
406
411
|
let timer = null;
|
|
@@ -412,7 +417,7 @@ function createModelProgressLogger(write = (line) => process.stderr.write(`${lin
|
|
|
412
417
|
timer = setTimeout(() => {
|
|
413
418
|
announcedLoading = true;
|
|
414
419
|
write(
|
|
415
|
-
`[maskera] Loading Swedish ONNX model (${event.model},
|
|
420
|
+
`[maskera] Loading Swedish ONNX model (${event.model}${downloadSize(event.dtype)}, cached locally)...`
|
|
416
421
|
);
|
|
417
422
|
}, delayMs);
|
|
418
423
|
timer.unref?.();
|
|
@@ -754,7 +759,7 @@ description: Redact Swedish personal data (names, personnummer, addresses, phone
|
|
|
754
759
|
|
|
755
760
|
# Maskera: local Swedish PII redaction
|
|
756
761
|
|
|
757
|
-
Maskera runs 100% locally on-device using deterministic Swedish rules plus the
|
|
762
|
+
Maskera runs 100% locally on-device using deterministic Swedish rules plus the Swedish ONNX NER model (\`joelhagvall/maskera-sv-ner\`). Raw PII and restore maps stay local so cloud LLMs only see placeholders such as \`[NAMN_1]\` and \`[PERSONNUMMER_1]\`.
|
|
758
763
|
|
|
759
764
|
## Choose the right mode
|
|
760
765
|
|
|
@@ -1162,7 +1167,7 @@ var COUNTS_SCHEMA = {
|
|
|
1162
1167
|
var TOOLS = [
|
|
1163
1168
|
{
|
|
1164
1169
|
name: "maskera_redact",
|
|
1165
|
-
description: "Redact Swedish PII (names, personnummer, addresses, emails, phones, IBAN, etc.) locally on-device using Maskera's
|
|
1170
|
+
description: "Redact Swedish PII (names, personnummer, addresses, emails, phones, IBAN, etc.) locally on-device using Maskera's Swedish NER model and deterministic rules. Stores the restore map locally under session_id so placeholders stay consistent across calls and can be restored later without exposing raw PII to the LLM.",
|
|
1166
1171
|
annotations: {
|
|
1167
1172
|
title: "Redact Swedish PII locally",
|
|
1168
1173
|
readOnlyHint: true,
|
|
@@ -4203,7 +4208,7 @@ var SWEDISH_STOP_WORDS = /* @__PURE__ */ new Set([
|
|
|
4203
4208
|
"telefon",
|
|
4204
4209
|
"adress"
|
|
4205
4210
|
]);
|
|
4206
|
-
var CLI_SYSTEM_HEADER_RE = /^(?:x-anthropic-billing-header:|you are claude code\b|you are a claude agent\b|you are codex\b|you are opencode\b|sessionstart:|# gitstatus\b|current branch:|recent commits:|status:)/i;
|
|
4211
|
+
var CLI_SYSTEM_HEADER_RE = /^(?:x-anthropic-billing-header:|you are claude code\b|you are a claude agent\b|you are codex\b|you are opencode\b|sessionstart:|# gitstatus\b|# currentdate\b|today's date is\b|current branch:|recent commits:|status:)/i;
|
|
4207
4212
|
var ENGLISH_BOILERPLATE_WORDS = /* @__PURE__ */ new Set([
|
|
4208
4213
|
"the",
|
|
4209
4214
|
"and",
|