-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
50 lines (49 loc) · 1.59 KB
/
Copy pathindex.ts
File metadata and controls
50 lines (49 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/**
* @nationaldesignstudio/rampart
*
* Client-side PII filter for LLM chat. Strips names, SSNs, card numbers, and
* every other PII class out of text before it leaves the device — keeping only
* {city, state, zip} — so raw PII never reaches our servers or logs.
*
* Layers: offset-preserving heuristics + validators (structured PII, any
* separator form), an optional small wasm token-classifier (contextual PII),
* a default-deny keep-set policy, and a reversible placeholder/rehydrate
* session table for coherent multi-turn chat.
*/
export {
ChatGuard,
createGuard,
DEFAULT_ALIASES,
DEFAULT_MAX_INPUT_CHARS,
DEFAULT_WORKER_TIMEOUT_MS,
type GuardOptions,
type NerDetector,
} from "./src/guard";
export {
StreamingReveal,
createRevealTransform,
type PlaceholderResolver,
} from "./src/streaming";
export {
SessionEntityTable,
PLACEHOLDER_PATTERN,
neutralizePlaceholders,
type ScrubResult,
type PlaceholderAliases,
} from "./src/session";
export { detectHeuristics } from "./src/heuristics";
export { mergeSpans, applyPolicy } from "./src/policy";
export { premask, projectMaskedSpan, sentinelFor, type PremaskResult } from "./src/premask";
export { KEEP_LABELS, resolveKeepLabels, shouldRedact, type PiiLabel, type Span } from "./src/types";
export {
detectNer,
loadNerClassifier,
CURTAIN_MODEL_NAME,
NER_TOKEN_BUDGET,
NER_TOKEN_OVERLAP,
type NerOptions,
type TokenClassifier,
type TokenCounter,
} from "./src/ner/classifier";
export { registerNerWorker, createWorkerClassifier } from "./src/ner/worker";
export { isLuhnValid, isValidSsn } from "./src/validators";