UNPKG

@himorishige/noren-core

Version:

Core PII detection, masking, and tokenization library built on Web Standards

50 lines 2.58 kB
export { type AllowDenyConfig, AllowDenyManager } from './allowlist.js'; export { CONFIDENCE_THRESHOLDS, filterByConfidence } from './confidence.js'; export { CONTEXT_KEYWORDS, NEGATIVE_CONTEXT_KEYWORDS, STRICTNESS_LEVELS, type StrictnessLevel, } from './constants.js'; export { type ContextAnalysis, calculateContextScore, extractSurroundingText, meetsContextThreshold, } from './context-scoring.js'; export { createJSONDetector, JSONDetector, type JsonDetectionResult, type JsonHit, } from './json-detector.js'; export type { LazyPlugin } from './lazy.js'; export { clearPluginCache } from './lazy.js'; export { containsJsonRpcPattern, createMCPRedactionTransform, extractMethodName, extractSensitiveContent, getMessageType, isValidJsonRpcMessage, type JsonRpcMessage, type MCPRedactionOptions, parseJsonLines, redactJsonRpcMessage, } from './mcp-utils.js'; export { HitPool } from './pool.js'; export { createRedactionTransform } from './stream-utils.js'; export type { Action, DetectionSensitivity, Detector, DetectUtils, Hit, Masker, PiiType, Policy, ValidationStrictness, } from './types.js'; export { hmacToken, importHmacKey } from './utils.js'; export { debugValidation, type ValidationContext, type ValidationResult, validateCandidate, } from './validators.js'; import { type AllowDenyConfig, type Environment } from './allowlist.js'; import { type LazyPlugin } from './lazy.js'; import type { Detector, Hit, Masker, PiiType, Policy } from './types.js'; export interface RegistryOptions extends Policy { environment?: Environment; allowDenyConfig?: AllowDenyConfig; enableConfidenceScoring?: boolean; enableJsonDetection?: boolean; } export declare class Registry { private detectors; private maskers; private base; private contextHintsSet; private allowDenyManager; private enableConfidenceScoring; private enableJsonDetection; constructor(options: RegistryOptions); /** * Validate registry configuration options */ private validateOptions; use(detectors?: Detector[], maskers?: Record<string, Masker>, ctx?: string[]): void; useLazy(pluginName: string, plugin: LazyPlugin): Promise<void>; getPolicy(): Policy; maskerFor(t: PiiType): Masker | undefined; /** * Try JSON detection on the input text */ private tryJsonDetection; detect(raw: string, ctxHints?: string[]): Promise<{ src: string; hits: Hit[]; }>; } export declare function redactText(reg: Registry, input: string, override?: Policy): Promise<string>; //# sourceMappingURL=index.d.ts.map