@gatewaystack/transformabl-core 0.1.0

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 ADDED
@@ -0,0 +1,146 @@
1
+ # @gatewaystack/transformabl-core
2
+
3
+ Framework-agnostic PII detection, content redaction, and safety classification for AI gateways.
4
+
5
+ `@gatewaystack/transformabl-core` is the low-level engine behind [@gatewaystack/transformabl](https://www.npmjs.com/package/@gatewaystack/transformabl). Use it directly when you need content transformation without Express.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @gatewaystack/transformabl-core
11
+ ```
12
+
13
+ ## Features
14
+
15
+ - **PII detection** — regex-based detection for email, phone (US 10+ digit), SSN, credit card (Visa/MC/Amex/Discover/Diners), IP address, date of birth
16
+ - **Content redaction** — three modes: mask, remove, or placeholder replacement
17
+ - **Safety classification** — detect prompt injection, jailbreak attempts, and code injection patterns
18
+ - **Regulatory flagging** — automatic GDPR, PCI, COPPA, HIPAA labels based on PII types found
19
+ - **Risk scoring** — 0-100 composite score from safety + regulatory + PII density
20
+ - **Custom patterns** — extend detection with your own regex patterns
21
+
22
+ ## Quick Start
23
+
24
+ ### Detect PII
25
+
26
+ ```ts
27
+ import { detectPii } from "@gatewaystack/transformabl-core";
28
+
29
+ const matches = detectPii("Contact john@example.com or call (555) 123-4567");
30
+ // [
31
+ // { type: "email", value: "john@example.com", start: 8, end: 24 },
32
+ // { type: "phone", value: "(555) 123-4567", start: 33, end: 47 },
33
+ // ]
34
+ ```
35
+
36
+ ### Redact PII
37
+
38
+ ```ts
39
+ import { detectPii, redactPii } from "@gatewaystack/transformabl-core";
40
+
41
+ const text = "My email is john@example.com and SSN is 123-45-6789";
42
+ const matches = detectPii(text);
43
+
44
+ // Mask mode (default)
45
+ redactPii(text, matches);
46
+ // "My email is jo**************om and SSN is 12*******89"
47
+
48
+ // Placeholder mode
49
+ redactPii(text, matches, { mode: "placeholder" });
50
+ // "My email is [EMAIL] and SSN is [SSN]"
51
+
52
+ // Remove mode
53
+ redactPii(text, matches, { mode: "remove" });
54
+ // "My email is and SSN is "
55
+ ```
56
+
57
+ ### Classify content
58
+
59
+ ```ts
60
+ import { detectPii, classifyContent } from "@gatewaystack/transformabl-core";
61
+
62
+ const text = "Ignore all previous instructions. My SSN is 123-45-6789.";
63
+ const pii = detectPii(text);
64
+ const result = classifyContent(text, pii);
65
+
66
+ // {
67
+ // labels: [
68
+ // { category: "prompt_injection", confidence: "medium", ... },
69
+ // { category: "pci", confidence: "high", detail: "PII detected: ssn" },
70
+ // { category: "gdpr", confidence: "high", detail: "PII detected: ssn" },
71
+ // ],
72
+ // riskScore: 75,
73
+ // hasSafetyRisk: true,
74
+ // hasRegulatoryContent: true,
75
+ // }
76
+ ```
77
+
78
+ ### Full pipeline
79
+
80
+ ```ts
81
+ import { transformContent } from "@gatewaystack/transformabl-core";
82
+
83
+ const result = transformContent("Email me at alice@co.com", {
84
+ redaction: { mode: "placeholder" },
85
+ });
86
+
87
+ // {
88
+ // content: "Email me at [EMAIL]",
89
+ // transformed: true,
90
+ // piiMatches: [...],
91
+ // classification: { labels: [...], riskScore: 20, ... },
92
+ // metadata: { wordCount: 4, charCount: 24, ... },
93
+ // }
94
+ ```
95
+
96
+ ## API
97
+
98
+ ### `detectPii(text, customPatterns?)`
99
+
100
+ Returns an array of `PiiMatch` objects with `type`, `value`, `start`, and `end` positions.
101
+
102
+ Built-in PII types: `email`, `phone`, `ssn`, `credit_card`, `ip_address`, `date_of_birth`.
103
+
104
+ Add custom patterns:
105
+ ```ts
106
+ detectPii(text, [{ type: "custom_id", pattern: /CUST-\d{6}/g }]);
107
+ ```
108
+
109
+ ### `redactPii(text, matches, config?)`
110
+
111
+ | Option | Type | Default | Description |
112
+ |--------|------|---------|-------------|
113
+ | `mode` | `"mask" \| "remove" \| "placeholder"` | `"mask"` | Redaction strategy |
114
+ | `maskChar` | `string` | `"*"` | Character used for masking |
115
+ | `maskKeep` | `number` | `2` | Characters to keep at start/end in mask mode |
116
+ | `placeholder` | `string` | `"[{TYPE}]"` | Template for placeholder mode |
117
+ | `types` | `PiiType[]` | all | Only redact these PII types |
118
+
119
+ ### `classifyContent(text, piiMatches)`
120
+
121
+ Returns `ClassificationResult`:
122
+ - `labels` — array of `{ category, confidence, detail }`
123
+ - `riskScore` — 0-100 composite score
124
+ - `hasSafetyRisk` — true if injection/jailbreak/code patterns found
125
+ - `hasRegulatoryContent` — true if PII triggers regulatory categories
126
+
127
+ **Safety categories:** `prompt_injection`, `jailbreak_attempt`, `code_injection`
128
+
129
+ **Regulatory categories:** `gdpr`, `pci`, `coppa`, `hipaa`
130
+
131
+ ### `transformContent(text, config?)`
132
+
133
+ Full pipeline: detect + redact + classify + extract metadata in one call.
134
+
135
+ ### `extractMetadata(text)`
136
+
137
+ Returns `{ wordCount, charCount, lineCount, hasCode }`.
138
+
139
+ ## Related Packages
140
+
141
+ - [@gatewaystack/transformabl](https://www.npmjs.com/package/@gatewaystack/transformabl) — Express middleware wrapper
142
+ - [@gatewaystack/validatabl-core](https://www.npmjs.com/package/@gatewaystack/validatabl-core) — Policy decisions based on classification results
143
+
144
+ ## License
145
+
146
+ MIT
@@ -0,0 +1,6 @@
1
+ import type { PiiMatch, ClassificationResult } from "./types.js";
2
+ /**
3
+ * Classify content for safety risks and regulatory concerns.
4
+ */
5
+ export declare function classifyContent(text: string, piiMatches: PiiMatch[]): ClassificationResult;
6
+ //# sourceMappingURL=classify.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classify.d.ts","sourceRoot":"","sources":["../src/classify.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,QAAQ,EAER,oBAAoB,EAGrB,MAAM,YAAY,CAAC;AA4CpB;;GAEG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,QAAQ,EAAE,GACrB,oBAAoB,CAkDtB"}
@@ -0,0 +1,101 @@
1
+ // packages/transformabl-core/src/classify.ts
2
+ //
3
+ // Content classification: safety risks + regulatory content detection.
4
+ //
5
+ // FUTURE WORK:
6
+ // - ML-based classification for higher accuracy
7
+ // - Hate speech / toxic content detection
8
+ // - Competitor mention detection (configurable keyword lists)
9
+ // - Proprietary information detection
10
+ // - Multi-language support
11
+ // - Configurable per-tenant classification rules
12
+ /** Patterns that suggest prompt injection or jailbreak attempts. */
13
+ const SAFETY_PATTERNS = [
14
+ {
15
+ category: "prompt_injection",
16
+ patterns: [
17
+ /ignore\s+(all\s+)?previous\s+instructions/i,
18
+ /disregard\s+(all\s+)?prior\s+(instructions|context)/i,
19
+ /you\s+are\s+now\s+(?:a|an)\s+\w+/i,
20
+ /system\s*:\s*you\s+are/i,
21
+ /\bdo\s+anything\s+now\b/i,
22
+ /\bDAN\s+mode\b/i,
23
+ ],
24
+ },
25
+ {
26
+ category: "jailbreak_attempt",
27
+ patterns: [
28
+ /bypass\s+(?:your\s+)?(?:safety|content|moderation)\s+(?:filters?|guidelines?|restrictions?)/i,
29
+ /pretend\s+(?:you\s+)?(?:have\s+)?no\s+(?:restrictions?|limitations?|rules?)/i,
30
+ /act\s+as\s+(?:if\s+)?(?:you\s+)?(?:have|had)\s+no\s+(?:ethics|morals|guidelines)/i,
31
+ ],
32
+ },
33
+ {
34
+ category: "code_injection",
35
+ patterns: [
36
+ /(?:exec|eval|system)\s*\(/i,
37
+ /__import__\s*\(/i,
38
+ /os\.(?:system|popen|exec)/i,
39
+ /subprocess\.(?:run|call|Popen)/i,
40
+ ],
41
+ },
42
+ ];
43
+ /** Map PII types to regulatory categories. */
44
+ const PII_TO_REGULATORY = {
45
+ ssn: ["pci", "gdpr"],
46
+ credit_card: ["pci"],
47
+ email: ["gdpr", "coppa"],
48
+ phone: ["gdpr"],
49
+ date_of_birth: ["gdpr", "coppa", "hipaa"],
50
+ ip_address: ["gdpr"],
51
+ };
52
+ /**
53
+ * Classify content for safety risks and regulatory concerns.
54
+ */
55
+ export function classifyContent(text, piiMatches) {
56
+ const labels = [];
57
+ // Safety classification
58
+ for (const { category, patterns } of SAFETY_PATTERNS) {
59
+ for (const pattern of patterns) {
60
+ if (pattern.test(text)) {
61
+ labels.push({
62
+ category,
63
+ confidence: "medium",
64
+ detail: `Matched pattern: ${pattern.source.slice(0, 50)}`,
65
+ });
66
+ break; // One match per category is enough
67
+ }
68
+ }
69
+ }
70
+ // Regulatory classification based on PII found
71
+ const regulatoryCategories = new Set();
72
+ for (const match of piiMatches) {
73
+ const categories = PII_TO_REGULATORY[match.type];
74
+ if (categories) {
75
+ for (const cat of categories)
76
+ regulatoryCategories.add(cat);
77
+ }
78
+ }
79
+ for (const category of regulatoryCategories) {
80
+ const piiTypes = piiMatches
81
+ .filter((m) => PII_TO_REGULATORY[m.type]?.includes(category))
82
+ .map((m) => m.type);
83
+ labels.push({
84
+ category,
85
+ confidence: "high",
86
+ detail: `PII detected: ${[...new Set(piiTypes)].join(", ")}`,
87
+ });
88
+ }
89
+ // Compute risk score
90
+ const hasSafetyRisk = labels.some((l) => ["prompt_injection", "jailbreak_attempt", "code_injection"].includes(l.category));
91
+ const hasRegulatoryContent = regulatoryCategories.size > 0;
92
+ let riskScore = 0;
93
+ if (hasSafetyRisk)
94
+ riskScore += 50;
95
+ if (hasRegulatoryContent)
96
+ riskScore += 20;
97
+ riskScore += Math.min(piiMatches.length * 5, 30); // Up to 30 for PII density
98
+ riskScore = Math.min(riskScore, 100);
99
+ return { labels, riskScore, hasSafetyRisk, hasRegulatoryContent };
100
+ }
101
+ //# sourceMappingURL=classify.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classify.js","sourceRoot":"","sources":["../src/classify.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,uEAAuE;AACvE,EAAE;AACF,eAAe;AACf,gDAAgD;AAChD,0CAA0C;AAC1C,8DAA8D;AAC9D,sCAAsC;AACtC,2BAA2B;AAC3B,iDAAiD;AAUjD,oEAAoE;AACpE,MAAM,eAAe,GAA4D;IAC/E;QACE,QAAQ,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,SAAS,IAAI,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,2BAA2B;IAC7E,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IAErC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,oBAAoB,EAAE,CAAC;AACpE,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { PiiMatch } from "./types.js";
2
+ /**
3
+ * Detect PII in text content.
4
+ * Returns all matches with their positions.
5
+ */
6
+ export declare function detectPii(text: string, customPatterns?: Array<{
7
+ type: string;
8
+ pattern: RegExp;
9
+ }>): PiiMatch[];
10
+ //# sourceMappingURL=detect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAW,QAAQ,EAAE,MAAM,YAAY,CAAC;AA6CpD;;;GAGG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,cAAc,CAAC,EAAE,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,GACxD,QAAQ,EAAE,CAyBZ"}
package/dist/detect.js ADDED
@@ -0,0 +1,75 @@
1
+ // packages/transformabl-core/src/detect.ts
2
+ //
3
+ // Regex-based PII detection.
4
+ //
5
+ // FUTURE WORK:
6
+ // - ML-based NER detection (plug in spaCy, Presidio, or cloud NER APIs)
7
+ // - Address detection (street addresses, zip codes)
8
+ // - Name detection (requires NER - too many false positives with regex)
9
+ // - International phone number formats
10
+ // - Passport numbers, driver's license numbers
11
+ /**
12
+ * Built-in PII detection patterns.
13
+ * Each pattern uses the global flag for multi-match detection.
14
+ */
15
+ const BUILTIN_PATTERNS = [
16
+ {
17
+ type: "email",
18
+ pattern: /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}/g,
19
+ },
20
+ {
21
+ type: "phone",
22
+ // US phone numbers (10+ digits): (xxx) xxx-xxxx, xxx-xxx-xxxx, +1xxxxxxxxxx
23
+ // Requires area code (3 digits) + 7-digit number to avoid matching short numbers
24
+ pattern: /(?:\+1[-.\s]?)\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}\b|\b\(?\d{3}\)?[-.\s]\d{3}[-.\s]?\d{4}\b/g,
25
+ },
26
+ {
27
+ type: "ssn",
28
+ // US Social Security Numbers: xxx-xx-xxxx
29
+ pattern: /\b\d{3}-\d{2}-\d{4}\b/g,
30
+ },
31
+ {
32
+ type: "credit_card",
33
+ // Major card formats: Visa (13-19), MC (16), Amex (15), Discover (16), Diners (14)
34
+ // Matches 13-19 digit sequences with optional separators (space or dash)
35
+ pattern: /\b(?:4\d{3}|5[1-5]\d{2}|3[47]\d{2}|6(?:011|5\d{2})|3(?:0[0-5]|[68]\d)\d)[-\s]?\d{4,6}[-\s]?\d{4,5}(?:[-\s]?\d{1,4})?\b/g,
36
+ },
37
+ {
38
+ type: "ip_address",
39
+ // IPv4 addresses
40
+ pattern: /\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\b/g,
41
+ },
42
+ {
43
+ type: "date_of_birth",
44
+ // Common date formats that might be DOBs: MM/DD/YYYY, DD-MM-YYYY, YYYY-MM-DD
45
+ pattern: /\b(?:\d{1,2}[/-]\d{1,2}[/-]\d{4}|\d{4}-\d{2}-\d{2})\b/g,
46
+ },
47
+ ];
48
+ /**
49
+ * Detect PII in text content.
50
+ * Returns all matches with their positions.
51
+ */
52
+ export function detectPii(text, customPatterns) {
53
+ const matches = [];
54
+ const allPatterns = [
55
+ ...BUILTIN_PATTERNS,
56
+ ...(customPatterns ?? []),
57
+ ];
58
+ for (const { type, pattern } of allPatterns) {
59
+ // Reset lastIndex for global regex reuse
60
+ const regex = new RegExp(pattern.source, pattern.flags);
61
+ let match;
62
+ while ((match = regex.exec(text)) !== null) {
63
+ matches.push({
64
+ type: type,
65
+ value: match[0],
66
+ start: match.index,
67
+ end: match.index + match[0].length,
68
+ });
69
+ }
70
+ }
71
+ // Sort by position
72
+ matches.sort((a, b) => a.start - b.start);
73
+ return matches;
74
+ }
75
+ //# sourceMappingURL=detect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detect.js","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,EAAE;AACF,6BAA6B;AAC7B,EAAE;AACF,eAAe;AACf,wEAAwE;AACxE,oDAAoD;AACpD,wEAAwE;AACxE,uCAAuC;AACvC,+CAA+C;AAS/C;;;GAGG;AACH,MAAM,gBAAgB,GAAiB;IACrC;QACE,IAAI,EAAE,OAAO;QACb,OAAO,EAAE,iDAAiD;KAC3D;IACD;QACE,IAAI,EAAE,OAAO;QACb,4EAA4E;QAC5E,iFAAiF;QACjF,OAAO,EAAE,6FAA6F;KACvG;IACD;QACE,IAAI,EAAE,KAAK;QACX,0CAA0C;QAC1C,OAAO,EAAE,wBAAwB;KAClC;IACD;QACE,IAAI,EAAE,aAAa;QACnB,mFAAmF;QACnF,yEAAyE;QACzE,OAAO,EAAE,yHAAyH;KACnI;IACD;QACE,IAAI,EAAE,YAAY;QAClB,iBAAiB;QACjB,OAAO,EAAE,8EAA8E;KACxF;IACD;QACE,IAAI,EAAE,eAAe;QACrB,6EAA6E;QAC7E,OAAO,EAAE,wDAAwD;KAClE;CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,SAAS,CACvB,IAAY,EACZ,cAAyD;IAEzD,MAAM,OAAO,GAAe,EAAE,CAAC;IAC/B,MAAM,WAAW,GAA6C;QAC5D,GAAG,gBAAgB;QACnB,GAAG,CAAC,cAAc,IAAI,EAAE,CAAC;KAC1B,CAAC;IAEF,KAAK,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,WAAW,EAAE,CAAC;QAC5C,yCAAyC;QACzC,MAAM,KAAK,GAAG,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QACxD,IAAI,KAA6B,CAAC;QAElC,OAAO,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YAC3C,OAAO,CAAC,IAAI,CAAC;gBACX,IAAI,EAAE,IAAe;gBACrB,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;gBACf,KAAK,EAAE,KAAK,CAAC,KAAK;gBAClB,GAAG,EAAE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM;aACnC,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,mBAAmB;IACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAC1C,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from "./detect.js";
2
+ export * from "./redact.js";
3
+ export * from "./classify.js";
4
+ export * from "./metadata.js";
5
+ export * from "./transform.js";
6
+ export type * from "./types.js";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmBA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,mBAAmB,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,24 @@
1
+ // packages/transformabl-core/src/index.ts
2
+ //
3
+ // Content transformation and safety preprocessing.
4
+ // No Express, no HTTP. Pure functions.
5
+ //
6
+ // FUTURE WORK:
7
+ // - Reversible pseudonymization with token mapping + rehydration
8
+ // (replace PII with tokens like [EMAIL_1], restore in responses)
9
+ // - ML-based PII detection (plug in NER models for higher accuracy)
10
+ // - Advanced content classification:
11
+ // - Hate speech detection
12
+ // - Competitor mention detection
13
+ // - Proprietary information detection
14
+ // - Input segmentation (split content into safe/unsafe/neutral zones)
15
+ // - Content normalization (standardize formatting, encoding)
16
+ // - Routing analysis (recommend provider/model based on content type)
17
+ // - Configurable per-tenant transformation pipelines
18
+ // - Bidirectional response filtering (detect hallucinated PII in responses)
19
+ export * from "./detect.js";
20
+ export * from "./redact.js";
21
+ export * from "./classify.js";
22
+ export * from "./metadata.js";
23
+ export * from "./transform.js";
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,EAAE;AACF,mDAAmD;AACnD,uCAAuC;AACvC,EAAE;AACF,eAAe;AACf,iEAAiE;AACjE,mEAAmE;AACnE,oEAAoE;AACpE,qCAAqC;AACrC,4BAA4B;AAC5B,mCAAmC;AACnC,wCAAwC;AACxC,sEAAsE;AACtE,6DAA6D;AAC7D,sEAAsE;AACtE,qDAAqD;AACrD,4EAA4E;AAE5E,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { PiiMatch, ClassificationResult, ContentMetadata } from "./types.js";
2
+ /**
3
+ * Extract metadata from content analysis results.
4
+ */
5
+ export declare function extractMetadata(content: string, piiMatches: PiiMatch[], classification: ClassificationResult): ContentMetadata;
6
+ //# sourceMappingURL=metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../src/metadata.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElF;;GAEG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,UAAU,EAAE,QAAQ,EAAE,EACtB,cAAc,EAAE,oBAAoB,GACnC,eAAe,CAUjB"}
@@ -0,0 +1,17 @@
1
+ // packages/transformabl-core/src/metadata.ts
2
+ //
3
+ // Metadata extraction from content.
4
+ /**
5
+ * Extract metadata from content analysis results.
6
+ */
7
+ export function extractMetadata(content, piiMatches, classification) {
8
+ const piiTypes = [...new Set(piiMatches.map((m) => m.type))];
9
+ return {
10
+ contentLength: content.length,
11
+ piiTypesDetected: piiTypes,
12
+ piiMatchCount: piiMatches.length,
13
+ riskScore: classification.riskScore,
14
+ labels: classification.labels,
15
+ };
16
+ }
17
+ //# sourceMappingURL=metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.js","sourceRoot":"","sources":["../src/metadata.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,EAAE;AACF,oCAAoC;AAIpC;;GAEG;AACH,MAAM,UAAU,eAAe,CAC7B,OAAe,EACf,UAAsB,EACtB,cAAoC;IAEpC,MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAE7D,OAAO;QACL,aAAa,EAAE,OAAO,CAAC,MAAM;QAC7B,gBAAgB,EAAE,QAAQ;QAC1B,aAAa,EAAE,UAAU,CAAC,MAAM;QAChC,SAAS,EAAE,cAAc,CAAC,SAAS;QACnC,MAAM,EAAE,cAAc,CAAC,MAAM;KAC9B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { PiiMatch, RedactionConfig } from "./types.js";
2
+ /**
3
+ * Redact PII matches from text.
4
+ *
5
+ * Modes:
6
+ * - "mask": Replace middle characters with mask char (e.g., "jo**@example.com")
7
+ * - "remove": Remove the PII entirely
8
+ * - "placeholder": Replace with type label (e.g., "[EMAIL]")
9
+ */
10
+ export declare function redactPii(text: string, matches: PiiMatch[], config?: RedactionConfig): string;
11
+ //# sourceMappingURL=redact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../src/redact.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAiB,MAAM,YAAY,CAAC;AAE3E;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,QAAQ,EAAE,EACnB,MAAM,CAAC,EAAE,eAAe,GACvB,MAAM,CAqCR"}
package/dist/redact.js ADDED
@@ -0,0 +1,54 @@
1
+ // packages/transformabl-core/src/redact.ts
2
+ //
3
+ // PII redaction: mask, remove, or replace detected PII.
4
+ /**
5
+ * Redact PII matches from text.
6
+ *
7
+ * Modes:
8
+ * - "mask": Replace middle characters with mask char (e.g., "jo**@example.com")
9
+ * - "remove": Remove the PII entirely
10
+ * - "placeholder": Replace with type label (e.g., "[EMAIL]")
11
+ */
12
+ export function redactPii(text, matches, config) {
13
+ if (matches.length === 0)
14
+ return text;
15
+ const mode = config?.mode ?? "mask";
16
+ const maskChar = config?.maskChar ?? "*";
17
+ const maskKeep = config?.maskKeep ?? 2;
18
+ const typesToRedact = config?.types
19
+ ? new Set(config.types)
20
+ : null; // null = redact all
21
+ // Process matches in reverse order to preserve positions
22
+ const sorted = [...matches].sort((a, b) => b.start - a.start);
23
+ let result = text;
24
+ for (const match of sorted) {
25
+ if (typesToRedact && !typesToRedact.has(match.type))
26
+ continue;
27
+ let replacement;
28
+ switch (mode) {
29
+ case "mask":
30
+ replacement = maskValue(match.value, maskChar, maskKeep);
31
+ break;
32
+ case "remove":
33
+ replacement = "";
34
+ break;
35
+ case "placeholder":
36
+ replacement = config?.placeholder
37
+ ? config.placeholder.replace("{TYPE}", match.type.toUpperCase())
38
+ : `[${match.type.toUpperCase()}]`;
39
+ break;
40
+ }
41
+ result = result.slice(0, match.start) + replacement + result.slice(match.end);
42
+ }
43
+ return result;
44
+ }
45
+ function maskValue(value, maskChar, keep) {
46
+ if (value.length <= keep * 2) {
47
+ return maskChar.repeat(value.length);
48
+ }
49
+ const start = value.slice(0, keep);
50
+ const end = value.slice(-keep);
51
+ const middle = maskChar.repeat(value.length - keep * 2);
52
+ return start + middle + end;
53
+ }
54
+ //# sourceMappingURL=redact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redact.js","sourceRoot":"","sources":["../src/redact.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,EAAE;AACF,wDAAwD;AAIxD;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CACvB,IAAY,EACZ,OAAmB,EACnB,MAAwB;IAExB,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAEtC,MAAM,IAAI,GAAkB,MAAM,EAAE,IAAI,IAAI,MAAM,CAAC;IACnD,MAAM,QAAQ,GAAG,MAAM,EAAE,QAAQ,IAAI,GAAG,CAAC;IACzC,MAAM,QAAQ,GAAG,MAAM,EAAE,QAAQ,IAAI,CAAC,CAAC;IACvC,MAAM,aAAa,GAAG,MAAM,EAAE,KAAK;QACjC,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC;QACvB,CAAC,CAAC,IAAI,CAAC,CAAC,oBAAoB;IAE9B,yDAAyD;IACzD,MAAM,MAAM,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;IAC9D,IAAI,MAAM,GAAG,IAAI,CAAC;IAElB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,aAAa,IAAI,CAAC,aAAa,CAAC,GAAG,CA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,CAAC;AAC9B,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { TransformConfig, TransformResult } from "./types.js";
2
+ /**
3
+ * Run the full transformation pipeline on content.
4
+ *
5
+ * 1. Detect PII
6
+ * 2. Classify content (safety + regulatory)
7
+ * 3. Redact PII
8
+ * 4. Extract metadata
9
+ *
10
+ * Returns both the transformed content and all analysis results.
11
+ */
12
+ export declare function transformContent(content: string, config?: TransformConfig): TransformResult;
13
+ //# sourceMappingURL=transform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform.d.ts","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAMnE;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,MAAM,CAAC,EAAE,eAAe,GACvB,eAAe,CAkCjB"}
@@ -0,0 +1,47 @@
1
+ // packages/transformabl-core/src/transform.ts
2
+ //
3
+ // Full transformation pipeline: detect → classify → redact → extract metadata.
4
+ import { detectPii } from "./detect.js";
5
+ import { redactPii } from "./redact.js";
6
+ import { classifyContent } from "./classify.js";
7
+ import { extractMetadata } from "./metadata.js";
8
+ /**
9
+ * Run the full transformation pipeline on content.
10
+ *
11
+ * 1. Detect PII
12
+ * 2. Classify content (safety + regulatory)
13
+ * 3. Redact PII
14
+ * 4. Extract metadata
15
+ *
16
+ * Returns both the transformed content and all analysis results.
17
+ */
18
+ export function transformContent(content, config) {
19
+ // 1. Detect PII
20
+ const piiMatches = detectPii(content, config?.customPatterns);
21
+ // 2. Classify
22
+ const classification = config?.classify !== false
23
+ ? classifyContent(content, piiMatches)
24
+ : { labels: [], riskScore: 0, hasSafetyRisk: false, hasRegulatoryContent: false };
25
+ // 3. Redact
26
+ const redacted = piiMatches.length > 0
27
+ ? redactPii(content, piiMatches, config?.redaction)
28
+ : content;
29
+ // 4. Metadata
30
+ const metadata = config?.extractMetadata !== false
31
+ ? extractMetadata(content, piiMatches, classification)
32
+ : {
33
+ contentLength: content.length,
34
+ piiTypesDetected: [],
35
+ piiMatchCount: 0,
36
+ riskScore: 0,
37
+ labels: [],
38
+ };
39
+ return {
40
+ content: redacted,
41
+ piiMatches,
42
+ classification,
43
+ metadata,
44
+ transformed: redacted !== content,
45
+ };
46
+ }
47
+ //# sourceMappingURL=transform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform.js","sourceRoot":"","sources":["../src/transform.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,EAAE;AACF,+EAA+E;AAG/E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAAe,EACf,MAAwB;IAExB,gBAAgB;IAChB,MAAM,UAAU,GAAG,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC;IAE9D,cAAc;IACd,MAAM,cAAc,GAClB,MAAM,EAAE,QAAQ,KAAK,KAAK;QACxB,CAAC,CAAC,eAAe,CAAC,OAAO,EAAE,UAAU,CAAC;QACtC,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAAC;IAEtF,YAAY;IACZ,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC;QACpC,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC;QACnD,CAAC,CAAC,OAAO,CAAC;IAEZ,cAAc;IACd,MAAM,QAAQ,GACZ,MAAM,EAAE,eAAe,KAAK,KAAK;QAC/B,CAAC,CAAC,eAAe,CAAC,OAAO,EAAE,UAAU,EAAE,cAAc,CAAC;QACtD,CAAC,CAAC;YACE,aAAa,EAAE,OAAO,CAAC,MAAM;YAC7B,gBAAgB,EAAE,EAAE;YACpB,aAAa,EAAE,CAAC;YAChB,SAAS,EAAE,CAAC;YACZ,MAAM,EAAE,EAAE;SACX,CAAC;IAER,OAAO;QACL,OAAO,EAAE,QAAQ;QACjB,UAAU;QACV,cAAc;QACd,QAAQ;QACR,WAAW,EAAE,QAAQ,KAAK,OAAO;KAClC,CAAC;AACJ,CAAC"}
@@ -0,0 +1 @@
1
+ {"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../node_modules/@types/react/global.d.ts","../../../node_modules/csstype/index.d.ts","../../../node_modules/@types/react/index.d.ts","../../../node_modules/@types/react/jsx-runtime.d.ts","../src/types.ts","../src/classify.ts","../src/detect.ts","../src/redact.ts","../src/metadata.ts","../src/transform.ts","../src/index.ts","../../../node_modules/@types/node/compatibility/disposable.d.ts","../../../node_modules/@types/node/compatibility/indexable.d.ts","../../../node_modules/@types/node/compatibility/iterators.d.ts","../../../node_modules/@types/node/compatibility/index.d.ts","../../../node_modules/@types/node/globals.typedarray.d.ts","../../../node_modules/@types/node/buffer.buffer.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/web-globals/abortcontroller.d.ts","../../../node_modules/@types/node/web-globals/domexception.d.ts","../../../node_modules/@types/node/web-globals/events.d.ts","../../../node_modules/undici-types/header.d.ts","../../../node_modules/undici-types/readable.d.ts","../../../node_modules/undici-types/file.d.ts","../../../node_modules/undici-types/fetch.d.ts","../../../node_modules/undici-types/formdata.d.ts","../../../node_modules/undici-types/connector.d.ts","../../../node_modules/undici-types/client.d.ts","../../../node_modules/undici-types/errors.d.ts","../../../node_modules/undici-types/dispatcher.d.ts","../../../node_modules/undici-types/global-dispatcher.d.ts","../../../node_modules/undici-types/global-origin.d.ts","../../../node_modules/undici-types/pool-stats.d.ts","../../../node_modules/undici-types/pool.d.ts","../../../node_modules/undici-types/handlers.d.ts","../../../node_modules/undici-types/balanced-pool.d.ts","../../../node_modules/undici-types/agent.d.ts","../../../node_modules/undici-types/mock-interceptor.d.ts","../../../node_modules/undici-types/mock-agent.d.ts","../../../node_modules/undici-types/mock-client.d.ts","../../../node_modules/undici-types/mock-pool.d.ts","../../../node_modules/undici-types/mock-errors.d.ts","../../../node_modules/undici-types/proxy-agent.d.ts","../../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../../node_modules/undici-types/retry-handler.d.ts","../../../node_modules/undici-types/retry-agent.d.ts","../../../node_modules/undici-types/api.d.ts","../../../node_modules/undici-types/interceptors.d.ts","../../../node_modules/undici-types/util.d.ts","../../../node_modules/undici-types/cookies.d.ts","../../../node_modules/undici-types/patch.d.ts","../../../node_modules/undici-types/websocket.d.ts","../../../node_modules/undici-types/eventsource.d.ts","../../../node_modules/undici-types/filereader.d.ts","../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../node_modules/undici-types/content-type.d.ts","../../../node_modules/undici-types/cache.d.ts","../../../node_modules/undici-types/index.d.ts","../../../node_modules/@types/node/web-globals/fetch.d.ts","../../../node_modules/@types/node/web-globals/navigator.d.ts","../../../node_modules/@types/node/web-globals/storage.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/inspector.generated.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/readline/promises.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/sea.d.ts","../../../node_modules/@types/node/sqlite.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/test.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/index.d.ts"],"fileIdsList":[[76,121,122,124,141,142],[76,123,124,141,142],[124,141,142],[76,124,129,141,142,159],[76,124,125,130,135,141,142,144,156,167],[76,124,125,126,135,141,142,144],[76,124,141,142],[71,72,73,76,124,141,142],[76,124,127,141,142,168],[76,124,128,129,136,141,142,145],[76,124,129,141,142,156,164],[76,124,130,132,135,141,142,144],[76,123,124,131,141,142],[76,124,132,133,141,142],[76,124,134,135,141,142],[76,123,124,135,141,142],[76,124,135,136,137,141,142,156,167],[76,124,135,136,137,141,142,151,156,159],[76,117,124,132,135,138,141,142,144,156,167],[76,124,135,136,138,139,141,142,144,156,164,167],[76,124,138,140,141,142,156,164,167],[74,75,76,77,78,79,80,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173],[76,124,135,141,142],[76,124,141,142,143,167],[76,124,132,135,141,142,144,156],[76,124,141,142,145],[76,124,141,142,146],[76,123,124,141,142,147],[76,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173],[76,124,141,142,149],[76,124,141,142,150],[76,124,135,141,142,151,152],[76,124,141,142,151,153,168,170],[76,124,136,141,142],[76,124,135,141,142,156,157,159],[76,124,141,142,158,159],[76,124,141,142,156,157],[76,124,141,142,159],[76,124,141,142,160],[76,121,124,141,142,156,161],[76,124,135,141,142,162,163],[76,124,141,142,162,163],[76,124,129,141,142,144,156,164],[76,124,141,142,165],[76,124,141,142,144,166],[76,124,138,141,142,150,167],[76,124,129,141,142,168],[76,124,141,142,156,169],[76,124,141,142,143,170],[76,124,141,142,171],[76,117,124,141,142],[76,117,124,135,137,141,142,147,156,159,167,169,170,172],[76,124,141,142,156,173],[60,61,76,124,141,142],[62,76,124,141,142],[76,89,93,124,141,142,167],[76,89,124,141,142,156,167],[76,84,124,141,142],[76,86,89,124,141,142,164,167],[76,124,141,142,144,164],[76,124,141,142,174],[76,84,124,141,142,174],[76,86,89,124,141,142,144,167],[76,81,82,85,88,124,135,141,142,156,167],[76,89,96,124,141,142],[76,81,87,124,141,142],[76,89,110,111,124,141,142],[76,85,89,124,141,142,159,167,174],[76,110,124,141,142,174],[76,83,84,124,141,142,174],[76,89,124,141,142],[76,83,84,85,86,87,88,89,90,91,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,124,141,142],[76,89,104,124,141,142],[76,89,96,97,124,141,142],[76,87,89,97,98,124,141,142],[76,88,124,141,142],[76,81,84,89,124,141,142],[76,89,93,97,98,124,141,142],[76,93,124,141,142],[76,87,89,92,124,141,142,167],[76,81,86,89,96,124,141,142],[76,124,141,142,156],[76,84,89,110,124,141,142,172,174],[63,64,76,124,141,142],[63,64,65,66,67,68,69,76,124,141,142],[63,64,65,66,67,68,76,124,141,142],[63,76,124,141,142]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2e80ee7a49e8ac312cc11b77f1475804bee36b3b2bc896bead8b6e1266befb43","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"8cdf8847677ac7d20486e54dd3fcf09eda95812ac8ace44b4418da1bbbab6eb8","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"170d4db14678c68178ee8a3d5a990d5afb759ecb6ec44dbd885c50f6da6204f6","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac51dd7d31333793807a6abaa5ae168512b6131bd41d9c5b98477fc3b7800f9f","impliedFormat":1},{"version":"5e76305d58bcdc924ff2bf14f6a9dc2aa5441ed06464b7e7bd039e611d66a89b","impliedFormat":1},{"version":"42c169fb8c2d42f4f668c624a9a11e719d5d07dacbebb63cbcf7ef365b0a75b3","impliedFormat":1},{"version":"d91435df24b3cd464d8b22ce121243bbfb0896a619474b212caf2806a49a3b67","signature":"6580e79f27e85d5663f8141c5a73ca9a8c4d390814fcc5a8a6a68016bff412fa"},{"version":"53c38bfc676efbdd616fa9254668dfdd66e71e405ba8e169dd04e82c8d75d6d5","signature":"744ebd72d4c5db10d950f6099a05479b52a402d1357864512d2aa8390ccd5c5b"},{"version":"148e69e002d029c083503d48aa1a43b52049147435a9844cb6786f7d6421ab9b","signature":"f7b884eefd3fcc72d7cee7f0e23ef5cfdaca6ea221ecfd1f6d3e1882f54da038"},{"version":"108d1b378f8330a1b68e25845ca014fa312fddffa32e30c6f46b71241fb3b987","signature":"d935218e8c96873b23c90ad43837361dbf526404fc578006970d24a244469e7a"},{"version":"0b56e50573025e7d0ecd62ef57178d1b07a66ff30c9a0f3f0b218b2491f3851e","signature":"aefb346f9986d7abbe20e44c94f4783295e1e6d5ef51dd1ff8c0e6a2de17f55d"},{"version":"884e6ca04d5381f11f4401576c0a26748ef14e3f7ac232fe932b46d5415cbe43","signature":"5faf3c1fcaaa331a1bd393038accc984463ddc77286340ca8cb55728843cc760"},{"version":"47ff6c2e52b05e0a272feb6ad1f22e70c385e2f23b3c46247b35ab48fa0fce83","signature":"25e7ace7993429f17ed14d547ad101771aa4ef59b18f3beb39e3f7688df838ef"},{"version":"6c7176368037af28cb72f2392010fa1cef295d6d6744bca8cfb54985f3a18c3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"437e20f2ba32abaeb7985e0afe0002de1917bc74e949ba585e49feba65da6ca1","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"98cffbf06d6bab333473c70a893770dbe990783904002c4f1a960447b4b53dca","affectsGlobalScope":true,"impliedFormat":1},{"version":"3af97acf03cc97de58a3a4bc91f8f616408099bc4233f6d0852e72a8ffb91ac9","affectsGlobalScope":true,"impliedFormat":1},{"version":"808069bba06b6768b62fd22429b53362e7af342da4a236ed2d2e1c89fcca3b4a","affectsGlobalScope":true,"impliedFormat":1},{"version":"1db0b7dca579049ca4193d034d835f6bfe73096c73663e5ef9a0b5779939f3d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"9798340ffb0d067d69b1ae5b32faa17ab31b82466a3fc00d8f2f2df0c8554aaa","affectsGlobalScope":true,"impliedFormat":1},{"version":"f26b11d8d8e4b8028f1c7d618b22274c892e4b0ef5b3678a8ccbad85419aef43","affectsGlobalScope":true,"impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"763fe0f42b3d79b440a9b6e51e9ba3f3f91352469c1e4b3b67bfa4ff6352f3f4","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"7f182617db458e98fc18dfb272d40aa2fff3a353c44a89b2c0ccb3937709bfb5","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"e61be3f894b41b7baa1fbd6a66893f2579bfad01d208b4ff61daef21493ef0a8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"615ba88d0128ed16bf83ef8ccbb6aff05c3ee2db1cc0f89ab50a4939bfc1943f","impliedFormat":1},{"version":"a4d551dbf8746780194d550c88f26cf937caf8d56f102969a110cfaed4b06656","impliedFormat":1},{"version":"8bd86b8e8f6a6aa6c49b71e14c4ffe1211a0e97c80f08d2c8cc98838006e4b88","impliedFormat":1},{"version":"317e63deeb21ac07f3992f5b50cdca8338f10acd4fbb7257ebf56735bf52ab00","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"2cbe0621042e2a68c7cbce5dfed3906a1862a16a7d496010636cdbdb91341c0f","affectsGlobalScope":true,"impliedFormat":1},{"version":"f9501cc13ce624c72b61f12b3963e84fad210fbdf0ffbc4590e08460a3f04eba","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7721c4f69f93c91360c26a0a84ee885997d748237ef78ef665b153e622b36c1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fa06ada475b910e2106c98c68b10483dc8811d0c14a8a8dd36efb2672485b29","impliedFormat":1},{"version":"33e5e9aba62c3193d10d1d33ae1fa75c46a1171cf76fef750777377d53b0303f","impliedFormat":1},{"version":"2b06b93fd01bcd49d1a6bd1f9b65ddcae6480b9a86e9061634d6f8e354c1468f","impliedFormat":1},{"version":"6a0cd27e5dc2cfbe039e731cf879d12b0e2dded06d1b1dedad07f7712de0d7f4","affectsGlobalScope":true,"impliedFormat":1},{"version":"13f5c844119c43e51ce777c509267f14d6aaf31eafb2c2b002ca35584cd13b29","impliedFormat":1},{"version":"e60477649d6ad21542bd2dc7e3d9ff6853d0797ba9f689ba2f6653818999c264","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"5524481e56c48ff486f42926778c0a3cce1cc85dc46683b92b1271865bcf015a","impliedFormat":1},{"version":"4c829ab315f57c5442c6667b53769975acbf92003a66aef19bce151987675bd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"b2ade7657e2db96d18315694789eff2ddd3d8aea7215b181f8a0b303277cc579","impliedFormat":1},{"version":"9855e02d837744303391e5623a531734443a5f8e6e8755e018c41d63ad797db2","impliedFormat":1},{"version":"4d631b81fa2f07a0e63a9a143d6a82c25c5f051298651a9b69176ba28930756d","impliedFormat":1},{"version":"836a356aae992ff3c28a0212e3eabcb76dd4b0cc06bcb9607aeef560661b860d","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"41670ee38943d9cbb4924e436f56fc19ee94232bc96108562de1a734af20dc2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c906fb15bd2aabc9ed1e3f44eb6a8661199d6c320b3aa196b826121552cb3695","impliedFormat":1},{"version":"22295e8103f1d6d8ea4b5d6211e43421fe4564e34d0dd8e09e520e452d89e659","impliedFormat":1},{"version":"bb45cd435da536500f1d9692a9b49d0c570b763ccbf00473248b777f5c1f353b","impliedFormat":1},{"version":"6b4e081d55ac24fc8a4631d5dd77fe249fa25900abd7d046abb87d90e3b45645","impliedFormat":1},{"version":"a10f0e1854f3316d7ee437b79649e5a6ae3ae14ffe6322b02d4987071a95362e","impliedFormat":1},{"version":"e208f73ef6a980104304b0d2ca5f6bf1b85de6009d2c7e404028b875020fa8f2","impliedFormat":1},{"version":"d163b6bc2372b4f07260747cbc6c0a6405ab3fbcea3852305e98ac43ca59f5bc","impliedFormat":1},{"version":"e6fa9ad47c5f71ff733744a029d1dc472c618de53804eae08ffc243b936f87ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"83e63d6ccf8ec004a3bb6d58b9bb0104f60e002754b1e968024b320730cc5311","impliedFormat":1},{"version":"24826ed94a78d5c64bd857570fdbd96229ad41b5cb654c08d75a9845e3ab7dde","impliedFormat":1},{"version":"8b479a130ccb62e98f11f136d3ac80f2984fdc07616516d29881f3061f2dd472","impliedFormat":1},{"version":"928af3d90454bf656a52a48679f199f64c1435247d6189d1caf4c68f2eaf921f","affectsGlobalScope":true,"impliedFormat":1},{"version":"21145ce1c54e05ef9e52092b98a4ebfb326b92f52e76e47211c50cfcd2a2b4ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"933921f0bb0ec12ef45d1062a1fc0f27635318f4d294e4d99de9a5493e618ca2","impliedFormat":1},{"version":"71a0f3ad612c123b57239a7749770017ecfe6b66411488000aba83e4546fde25","impliedFormat":1},{"version":"77fbe5eecb6fac4b6242bbf6eebfc43e98ce5ccba8fa44e0ef6a95c945ff4d98","impliedFormat":1},{"version":"4f9d8ca0c417b67b69eeb54c7ca1bedd7b56034bb9bfd27c5d4f3bc4692daca7","impliedFormat":1},{"version":"814118df420c4e38fe5ae1b9a3bafb6e9c2aa40838e528cde908381867be6466","impliedFormat":1},{"version":"a3fc63c0d7b031693f665f5494412ba4b551fe644ededccc0ab5922401079c95","impliedFormat":1},{"version":"f27524f4bef4b6519c604bdb23bf4465bddcccbf3f003abb901acbd0d7404d99","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"45650f47bfb376c8a8ed39d4bcda5902ab899a3150029684ee4c10676d9fbaee","impliedFormat":1},{"version":"dba28a419aec76ed864ef43e5f577a5c99a010c32e5949fe4e17a4d57c58dd11","affectsGlobalScope":true,"impliedFormat":1},{"version":"18fd40412d102c5564136f29735e5d1c3b455b8a37f920da79561f1fde068208","impliedFormat":1},{"version":"c959a391a75be9789b43c8468f71e3fa06488b4d691d5729dde1416dcd38225b","impliedFormat":1},{"version":"f0be1b8078cd549d91f37c30c222c2a187ac1cf981d994fb476a1adc61387b14","affectsGlobalScope":true,"impliedFormat":1},{"version":"0aaed1d72199b01234152f7a60046bc947f1f37d78d182e9ae09c4289e06a592","impliedFormat":1},{"version":"5ebe6f4cc3b803cbfc962bae0d954f9c80e5078ca41eb3f1de41d92e7193ef37","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"5b7aa3c4c1a5d81b411e8cb302b45507fea9358d3569196b27eb1a27ae3a90ef","affectsGlobalScope":true,"impliedFormat":1},{"version":"5987a903da92c7462e0b35704ce7da94d7fdc4b89a984871c0e2b87a8aae9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea08a0345023ade2b47fbff5a76d0d0ed8bff10bc9d22b83f40858a8e941501c","impliedFormat":1},{"version":"47613031a5a31510831304405af561b0ffaedb734437c595256bb61a90f9311b","impliedFormat":1},{"version":"ae062ce7d9510060c5d7e7952ae379224fb3f8f2dd74e88959878af2057c143b","impliedFormat":1},{"version":"8a1a0d0a4a06a8d278947fcb66bf684f117bf147f89b06e50662d79a53be3e9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"9f663c2f91127ef7024e8ca4b3b4383ff2770e5f826696005de382282794b127","impliedFormat":1},{"version":"9f55299850d4f0921e79b6bf344b47c420ce0f507b9dcf593e532b09ea7eeea1","impliedFormat":1}],"root":[[64,70]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"jsx":4,"jsxImportSource":"react","module":99,"outDir":"./","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":9,"tsBuildInfoFile":"./tsconfig.tsbuildinfo"},"referencedMap":[[121,1],[122,1],[123,2],[76,3],[124,4],[125,5],[126,6],[71,7],[74,8],[72,7],[73,7],[127,9],[128,10],[129,11],[130,12],[131,13],[132,14],[133,14],[134,15],[135,16],[136,17],[137,18],[77,7],[75,7],[138,19],[139,20],[140,21],[174,22],[141,23],[142,7],[143,24],[144,25],[145,26],[146,27],[147,28],[148,29],[149,30],[150,31],[151,32],[152,32],[153,33],[154,7],[155,34],[156,35],[158,36],[157,37],[159,38],[160,39],[161,40],[162,41],[163,42],[164,43],[165,44],[166,45],[167,46],[168,47],[169,48],[170,49],[171,50],[78,7],[79,7],[80,7],[118,51],[119,7],[120,7],[172,52],[173,53],[60,7],[62,54],[63,55],[61,7],[58,7],[59,7],[10,7],[11,7],[13,7],[12,7],[2,7],[14,7],[15,7],[16,7],[17,7],[18,7],[19,7],[20,7],[21,7],[3,7],[22,7],[23,7],[4,7],[24,7],[28,7],[25,7],[26,7],[27,7],[29,7],[30,7],[31,7],[5,7],[32,7],[33,7],[34,7],[35,7],[6,7],[39,7],[36,7],[37,7],[38,7],[40,7],[7,7],[41,7],[46,7],[47,7],[42,7],[43,7],[44,7],[45,7],[8,7],[51,7],[48,7],[49,7],[50,7],[52,7],[9,7],[53,7],[54,7],[55,7],[57,7],[56,7],[1,7],[96,56],[106,57],[95,56],[116,58],[87,59],[86,60],[115,61],[109,62],[114,63],[89,64],[103,65],[88,66],[112,67],[84,68],[83,61],[113,69],[85,70],[90,71],[91,7],[94,71],[81,7],[117,72],[107,73],[98,74],[99,75],[101,76],[97,77],[100,78],[110,61],[92,79],[93,80],[102,81],[82,82],[105,73],[104,71],[108,7],[111,83],[65,84],[66,84],[70,85],[68,84],[67,84],[69,86],[64,87]],"latestChangedDtsFile":"./index.d.ts","version":"5.9.3"}
@@ -0,0 +1,82 @@
1
+ /** Categories of PII that can be detected. */
2
+ export type PiiType = "email" | "phone" | "ssn" | "credit_card" | "ip_address" | "date_of_birth";
3
+ /** A single PII detection match. */
4
+ export interface PiiMatch {
5
+ type: PiiType;
6
+ value: string;
7
+ start: number;
8
+ end: number;
9
+ }
10
+ /** How to handle detected PII. */
11
+ export type RedactionMode = "mask" | "remove" | "placeholder";
12
+ /** Configuration for PII redaction. */
13
+ export interface RedactionConfig {
14
+ /** Which PII types to redact. Default: all detected types. */
15
+ types?: PiiType[];
16
+ /** How to redact. Default: "mask". */
17
+ mode?: RedactionMode;
18
+ /** Custom placeholder format. Default: "[{TYPE}]" (e.g., "[EMAIL]"). */
19
+ placeholder?: string;
20
+ /** Mask character. Default: "*". */
21
+ maskChar?: string;
22
+ /** Number of characters to keep visible at start/end when masking. Default: 2. */
23
+ maskKeep?: number;
24
+ }
25
+ /** Safety risk categories. */
26
+ export type SafetyCategory = "prompt_injection" | "jailbreak_attempt" | "code_injection";
27
+ /** Regulatory compliance categories. */
28
+ export type RegulatoryCategory = "hipaa" | "pci" | "gdpr" | "coppa";
29
+ /** A content classification label. */
30
+ export interface ClassificationLabel {
31
+ category: SafetyCategory | RegulatoryCategory | string;
32
+ confidence: "high" | "medium" | "low";
33
+ detail?: string;
34
+ }
35
+ /** Result of content classification. */
36
+ export interface ClassificationResult {
37
+ labels: ClassificationLabel[];
38
+ riskScore: number;
39
+ hasSafetyRisk: boolean;
40
+ hasRegulatoryContent: boolean;
41
+ }
42
+ /** Metadata extracted from content. */
43
+ export interface ContentMetadata {
44
+ /** Length of the original content. */
45
+ contentLength: number;
46
+ /** PII types detected (if any). */
47
+ piiTypesDetected: PiiType[];
48
+ /** Number of PII matches found. */
49
+ piiMatchCount: number;
50
+ /** Risk score (0-100). */
51
+ riskScore: number;
52
+ /** Classification labels. */
53
+ labels: ClassificationLabel[];
54
+ }
55
+ /** Full transformation result. */
56
+ export interface TransformResult {
57
+ /** The transformed content (with PII redacted). */
58
+ content: string;
59
+ /** PII matches found in the original content. */
60
+ piiMatches: PiiMatch[];
61
+ /** Classification result. */
62
+ classification: ClassificationResult;
63
+ /** Extracted metadata. */
64
+ metadata: ContentMetadata;
65
+ /** Whether any transformation was applied. */
66
+ transformed: boolean;
67
+ }
68
+ /** Configuration for the full transformation pipeline. */
69
+ export interface TransformConfig {
70
+ /** PII detection and redaction settings. */
71
+ redaction?: RedactionConfig;
72
+ /** Enable content classification. Default: true. */
73
+ classify?: boolean;
74
+ /** Enable metadata extraction. Default: true. */
75
+ extractMetadata?: boolean;
76
+ /** Custom PII patterns to add to the built-in set. */
77
+ customPatterns?: Array<{
78
+ type: string;
79
+ pattern: RegExp;
80
+ }>;
81
+ }
82
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA,8CAA8C;AAC9C,MAAM,MAAM,OAAO,GACf,OAAO,GACP,OAAO,GACP,KAAK,GACL,aAAa,GACb,YAAY,GACZ,eAAe,CAAC;AAEpB,oCAAoC;AACpC,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,kCAAkC;AAClC,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,CAAC;AAE9D,uCAAuC;AACvC,MAAM,WAAW,eAAe;IAC9B,8DAA8D;IAC9D,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;IAClB,sCAAsC;IACtC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,kFAAkF;IAClF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,8BAA8B;AAC9B,MAAM,MAAM,cAAc,GACtB,kBAA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AAiD;IACjD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,sDAAsD;IACtD,cAAc,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC3D"}
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+ // packages/transformabl-core/src/types.ts
2
+ export {};
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,0CAA0C"}
package/package.json ADDED
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "@gatewaystack/transformabl-core",
3
+ "version": "0.1.0",
4
+ "private": false,
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": "./dist/index.js"
11
+ },
12
+ "files": [
13
+ "dist",
14
+ "README.md",
15
+ "LICENSE"
16
+ ],
17
+ "scripts": {
18
+ "build": "tsc -p tsconfig.json",
19
+ "prepublishOnly": "npm run build"
20
+ },
21
+ "devDependencies": {
22
+ "typescript": "^5.6.3"
23
+ }
24
+ }