@chatpanel/gateway 0.4.0 → 0.4.1
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/package.json +1 -1
- package/src/redact.js +6 -2
- package/src/server.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/gateway",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Local privacy gateway — redacts PII out of OpenAI/Anthropic API traffic before it reaches a model, then restores it in the reply. Point opencode, codex, aider, Claude Code, etc. at it.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/redact.js
CHANGED
|
@@ -29,9 +29,13 @@ export async function redactSegments(segments, redactionCfg, { signal, isPro = t
|
|
|
29
29
|
if (tier === 'full' && redactionCfg.detection?.backend && redactionCfg.detection.backend !== 'off') {
|
|
30
30
|
// One detection pass over the joined text — the detector is cached + fail-open,
|
|
31
31
|
// so a slow/broken NER service never blocks the request (deterministic layer
|
|
32
|
-
// still runs).
|
|
32
|
+
// still runs). Give it a generous CEILING (matching the extension): a fast NER
|
|
33
|
+
// returns in well under a second, but a slow/cold detector must be allowed to
|
|
34
|
+
// finish — if it times out, the turn falls back to dictionary/deterministic-only
|
|
35
|
+
// redaction (permanent pseudonyms the reply-restorer can't undo).
|
|
36
|
+
const detection = { ...redactionCfg.detection, timeoutMs: Math.max(Number(redactionCfg.detection.timeoutMs) || 0, 30000) };
|
|
33
37
|
try {
|
|
34
|
-
entities = await detectEntities(texts.join('\n\n'), { detection
|
|
38
|
+
entities = await detectEntities(texts.join('\n\n'), { detection }, { signal });
|
|
35
39
|
} catch {
|
|
36
40
|
entities = [];
|
|
37
41
|
}
|
package/src/server.js
CHANGED
|
@@ -33,7 +33,7 @@ import * as openai from './openai.js';
|
|
|
33
33
|
import * as responses from './responses.js';
|
|
34
34
|
import * as anthropic from './anthropic.js';
|
|
35
35
|
|
|
36
|
-
export const VERSION = '0.4.
|
|
36
|
+
export const VERSION = '0.4.1';
|
|
37
37
|
|
|
38
38
|
const KNOWN_AGENTS = new Set(['codex', 'claude', 'opencode', 'pi', 'kiro', 'antigravity']);
|
|
39
39
|
|