cloakllm 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/package.json +2 -2
- package/src/detector.js +8 -7
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2026
|
|
3
|
+
Copyright (c) 2026 The CloakLLM Authors (cloakllm@gmail.com)
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cloakllm",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "PII cloaking and tamper-evident audit logs for LLM API calls. EU AI Act Article 12 compliance.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"gdpr",
|
|
24
24
|
"data-protection"
|
|
25
25
|
],
|
|
26
|
-
"author": "
|
|
26
|
+
"author": "The CloakLLM Authors (cloakllm@gmail.com)",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"homepage": "https://github.com/cloakllm/CloakLLM-JS",
|
|
29
29
|
"repository": {
|
package/src/detector.js
CHANGED
|
@@ -78,13 +78,7 @@ class DetectionEngine {
|
|
|
78
78
|
_buildPatterns() {
|
|
79
79
|
const compiled = [];
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
if (this.config[configKey] !== false) {
|
|
83
|
-
compiled.push({ name, pattern });
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Add custom patterns
|
|
81
|
+
// Custom patterns first — user-defined patterns take priority
|
|
88
82
|
for (const { name, pattern: patternStr } of this.config.customPatterns) {
|
|
89
83
|
try {
|
|
90
84
|
const regex = new RegExp(patternStr, 'g');
|
|
@@ -98,6 +92,13 @@ class DetectionEngine {
|
|
|
98
92
|
}
|
|
99
93
|
}
|
|
100
94
|
|
|
95
|
+
// Built-in patterns second
|
|
96
|
+
for (const [name, { pattern, configKey }] of Object.entries(PATTERNS)) {
|
|
97
|
+
if (this.config[configKey] !== false) {
|
|
98
|
+
compiled.push({ name, pattern });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
101
102
|
return compiled;
|
|
102
103
|
}
|
|
103
104
|
|