@conarium-ai/core 0.2.54 → 0.3.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.
Files changed (124) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/LIMITATIONS.md +94 -1
  3. package/LIMITATIONS.tr.md +96 -1
  4. package/dist/custom_patterns.d.ts +13 -12
  5. package/dist/custom_patterns.d.ts.map +1 -1
  6. package/dist/custom_patterns.js +576 -14
  7. package/dist/custom_patterns.js.map +1 -1
  8. package/dist/governance.d.ts.map +1 -1
  9. package/dist/governance.js +37 -139
  10. package/dist/governance.js.map +1 -1
  11. package/dist/mask/belt.d.ts +36 -0
  12. package/dist/mask/belt.d.ts.map +1 -0
  13. package/dist/mask/belt.js +771 -0
  14. package/dist/mask/belt.js.map +1 -0
  15. package/dist/mask/core.d.ts +36 -0
  16. package/dist/mask/core.d.ts.map +1 -0
  17. package/dist/mask/core.js +119 -0
  18. package/dist/mask/core.js.map +1 -0
  19. package/dist/mask/detectors/bearer.d.ts +6 -0
  20. package/dist/mask/detectors/bearer.d.ts.map +1 -0
  21. package/dist/mask/detectors/bearer.js +30 -0
  22. package/dist/mask/detectors/bearer.js.map +1 -0
  23. package/dist/mask/detectors/connection.d.ts +7 -0
  24. package/dist/mask/detectors/connection.d.ts.map +1 -0
  25. package/dist/mask/detectors/connection.js +20 -0
  26. package/dist/mask/detectors/connection.js.map +1 -0
  27. package/dist/mask/detectors/custom.d.ts +12 -0
  28. package/dist/mask/detectors/custom.d.ts.map +1 -0
  29. package/dist/mask/detectors/custom.js +44 -0
  30. package/dist/mask/detectors/custom.js.map +1 -0
  31. package/dist/mask/detectors/email.d.ts +3 -0
  32. package/dist/mask/detectors/email.d.ts.map +1 -0
  33. package/dist/mask/detectors/email.js +41 -0
  34. package/dist/mask/detectors/email.js.map +1 -0
  35. package/dist/mask/detectors/embedded.d.ts +3 -0
  36. package/dist/mask/detectors/embedded.d.ts.map +1 -0
  37. package/dist/mask/detectors/embedded.js +73 -0
  38. package/dist/mask/detectors/embedded.js.map +1 -0
  39. package/dist/mask/detectors/iban.d.ts +3 -0
  40. package/dist/mask/detectors/iban.d.ts.map +1 -0
  41. package/dist/mask/detectors/iban.js +92 -0
  42. package/dist/mask/detectors/iban.js.map +1 -0
  43. package/dist/mask/detectors/ip.d.ts +3 -0
  44. package/dist/mask/detectors/ip.d.ts.map +1 -0
  45. package/dist/mask/detectors/ip.js +42 -0
  46. package/dist/mask/detectors/ip.js.map +1 -0
  47. package/dist/mask/detectors/labelled_secret.d.ts +6 -0
  48. package/dist/mask/detectors/labelled_secret.d.ts.map +1 -0
  49. package/dist/mask/detectors/labelled_secret.js +31 -0
  50. package/dist/mask/detectors/labelled_secret.js.map +1 -0
  51. package/dist/mask/detectors/mrz.d.ts +3 -0
  52. package/dist/mask/detectors/mrz.d.ts.map +1 -0
  53. package/dist/mask/detectors/mrz.js +42 -0
  54. package/dist/mask/detectors/mrz.js.map +1 -0
  55. package/dist/mask/detectors/name.d.ts +6 -0
  56. package/dist/mask/detectors/name.d.ts.map +1 -0
  57. package/dist/mask/detectors/name.js +41 -0
  58. package/dist/mask/detectors/name.js.map +1 -0
  59. package/dist/mask/detectors/numeric.d.ts +3 -0
  60. package/dist/mask/detectors/numeric.d.ts.map +1 -0
  61. package/dist/mask/detectors/numeric.js +240 -0
  62. package/dist/mask/detectors/numeric.js.map +1 -0
  63. package/dist/mask/detectors/secret.d.ts +6 -0
  64. package/dist/mask/detectors/secret.d.ts.map +1 -0
  65. package/dist/mask/detectors/secret.js +31 -0
  66. package/dist/mask/detectors/secret.js.map +1 -0
  67. package/dist/mask/detectors/whole_base64.d.ts +3 -0
  68. package/dist/mask/detectors/whole_base64.d.ts.map +1 -0
  69. package/dist/mask/detectors/whole_base64.js +28 -0
  70. package/dist/mask/detectors/whole_base64.js.map +1 -0
  71. package/dist/mask/legacy_0254/conn_linear.d.ts +26 -0
  72. package/dist/mask/legacy_0254/conn_linear.d.ts.map +1 -0
  73. package/dist/mask/legacy_0254/conn_linear.js +97 -0
  74. package/dist/mask/legacy_0254/conn_linear.js.map +1 -0
  75. package/dist/mask/legacy_0254/custom_patterns.d.ts +42 -0
  76. package/dist/mask/legacy_0254/custom_patterns.d.ts.map +1 -0
  77. package/dist/mask/legacy_0254/custom_patterns.js +164 -0
  78. package/dist/mask/legacy_0254/custom_patterns.js.map +1 -0
  79. package/dist/mask/legacy_0254/digit_pii.d.ts +46 -0
  80. package/dist/mask/legacy_0254/digit_pii.d.ts.map +1 -0
  81. package/dist/mask/legacy_0254/digit_pii.js +230 -0
  82. package/dist/mask/legacy_0254/digit_pii.js.map +1 -0
  83. package/dist/mask/legacy_0254/iban.d.ts +56 -0
  84. package/dist/mask/legacy_0254/iban.d.ts.map +1 -0
  85. package/dist/mask/legacy_0254/iban.js +171 -0
  86. package/dist/mask/legacy_0254/iban.js.map +1 -0
  87. package/dist/mask/legacy_0254/ip_detect.d.ts +28 -0
  88. package/dist/mask/legacy_0254/ip_detect.d.ts.map +1 -0
  89. package/dist/mask/legacy_0254/ip_detect.js +92 -0
  90. package/dist/mask/legacy_0254/ip_detect.js.map +1 -0
  91. package/dist/mask/legacy_0254/legacy_governance_mask.d.ts +20 -0
  92. package/dist/mask/legacy_0254/legacy_governance_mask.d.ts.map +1 -0
  93. package/dist/mask/legacy_0254/legacy_governance_mask.js +171 -0
  94. package/dist/mask/legacy_0254/legacy_governance_mask.js.map +1 -0
  95. package/dist/mask/legacy_0254/legacy_mask_text.d.ts +11 -0
  96. package/dist/mask/legacy_0254/legacy_mask_text.d.ts.map +1 -0
  97. package/dist/mask/legacy_0254/legacy_mask_text.js +46 -0
  98. package/dist/mask/legacy_0254/legacy_mask_text.js.map +1 -0
  99. package/dist/mask/legacy_0254/mrz.d.ts +7 -0
  100. package/dist/mask/legacy_0254/mrz.d.ts.map +1 -0
  101. package/dist/mask/legacy_0254/mrz.js +74 -0
  102. package/dist/mask/legacy_0254/mrz.js.map +1 -0
  103. package/dist/mask/legacy_0254/pii_normalize.d.ts +38 -0
  104. package/dist/mask/legacy_0254/pii_normalize.d.ts.map +1 -0
  105. package/dist/mask/legacy_0254/pii_normalize.js +96 -0
  106. package/dist/mask/legacy_0254/pii_normalize.js.map +1 -0
  107. package/dist/mask/legacy_0254/safe-object.d.ts +14 -0
  108. package/dist/mask/legacy_0254/safe-object.d.ts.map +1 -0
  109. package/dist/mask/legacy_0254/safe-object.js +27 -0
  110. package/dist/mask/legacy_0254/safe-object.js.map +1 -0
  111. package/dist/mask/legacy_0254/tckn.d.ts +10 -0
  112. package/dist/mask/legacy_0254/tckn.d.ts.map +1 -0
  113. package/dist/mask/legacy_0254/tckn.js +70 -0
  114. package/dist/mask/legacy_0254/tckn.js.map +1 -0
  115. package/dist/mask/legacy_0254/types.d.ts +207 -0
  116. package/dist/mask/legacy_0254/types.d.ts.map +1 -0
  117. package/dist/mask/legacy_0254/types.js +2 -0
  118. package/dist/mask/legacy_0254/types.js.map +1 -0
  119. package/dist/mask-text.d.ts +11 -1
  120. package/dist/mask-text.d.ts.map +1 -1
  121. package/dist/mask-text.js +189 -30
  122. package/dist/mask-text.js.map +1 -1
  123. package/docs/claims/reviews/0.3.0.md +72 -0
  124. package/package.json +3 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tckn.js","sourceRoot":"","sources":["../../../src/mask/legacy_0254/tckn.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C;;;;;;;;;;GAUG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAEjD,MAAM,UAAU,cAAc,CAAC,MAAc;IAC3C,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAA;IAC/C,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAA;IACz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AAA;YAC9D,IAAI,CAAC,GAAG;gBAAE,SAAQ;YAClB,MAAM,CAAC,GAAG,EAAE,CAAC,EAAE,cAAc,CAAC,CAAA;YAC9B,MAAM,CAAC,GAAG,EAAE,CAAC,EAAE,cAAc,CAAC,CAAA;YAC9B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;YACX,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;YACX,UAAU,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QACvB,CAAC;IACH,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,CAAA;AACjD,CAAC"}
@@ -0,0 +1,207 @@
1
+ export interface ConariumConfig {
2
+ connectors: ConnectorConfig[];
3
+ serverName?: string;
4
+ serverVersion?: string;
5
+ /** Identity of the consumer (team / editor / user) for audit attribution. */
6
+ consumer?: string;
7
+ /** Access policy enforced on every connector call. */
8
+ policy?: GovernancePolicy;
9
+ /** Audit configuration. */
10
+ audit?: AuditConfig;
11
+ /**
12
+ * Proof profile. `production` requires Ed25519 AND HMAC, turns G3 strict
13
+ * signatures and anchoring on, and defaults HTTP rate-limit to 60/min
14
+ * unless CONARIUM_MCP_RATE_PER_MIN is explicitly 0.
15
+ */
16
+ profile?: 'production';
17
+ }
18
+ export interface GovernancePolicy {
19
+ /** Allow-list of schema-qualified tables (glob: "billing.*", "*"). Missing or empty = deny all (default-deny). */
20
+ allowTables?: string[];
21
+ /** Deny-list of schema-qualified tables; takes precedence over allow. */
22
+ denyTables?: string[];
23
+ /** Columns to mask before data leaves the boundary ("customers.email", "*.tckn"). */
24
+ maskColumns?: string[];
25
+ /**
26
+ * Columns whose values must not be learnable through predicates.
27
+ * Same glob syntax as `maskColumns` (`"customers.email"`, `"*.tckn"`).
28
+ *
29
+ * Every pattern here is also treated as a `maskColumns` pattern: the value
30
+ * is redacted in the result set. A column that cannot be queried but is
31
+ * returned in the clear would be meaningless. You do not need to repeat
32
+ * the pattern in `maskColumns`.
33
+ *
34
+ * A profile cannot set, clear, or replace this field. Protection is global.
35
+ */
36
+ protectedColumns?: string[];
37
+ /** Hard cap on rows returned to the AI assistant (default 100). */
38
+ maxRows?: number;
39
+ /**
40
+ * Which SQL gate the shipped `query` tool uses. Operator declaration —
41
+ * never inferred from the statement. Omitted = `postgres` (today's path)
42
+ * except when a `custom-sql` connector is present: that path requires an
43
+ * explicit dialect. Unknown values reject the config; they do not fall back.
44
+ */
45
+ dialect?: 'postgres' | 'mssql' | 'oracle';
46
+ /**
47
+ * Mask names that the text itself marks as names — a title ("Sn. Ahmet
48
+ * Yılmaz") or a field label ("Yetkili: Ayşe Demir"). Default true.
49
+ *
50
+ * Names are the one identifier with no shape of their own, so column policy
51
+ * was the only thing catching them and free text went through untouched.
52
+ * This is NOT name recognition: a bare name in running prose is not detected,
53
+ * because guessing would trade this gateway's deterministic decisions for a
54
+ * confidence score. Set false where the labelled form is legitimate output —
55
+ * typically via a profile, so it stays off for one identified person rather
56
+ * than for everyone.
57
+ */
58
+ maskLabelledNames?: boolean;
59
+ /** Allowed API tools (e.g. "addPet", "getUser*"). */
60
+ allowTools?: string[];
61
+ /** Denied API tools. */
62
+ denyTools?: string[];
63
+ /** Allowed connector names (glob). Missing or empty = deny all (fail-closed). */
64
+ allowConnectors?: string[];
65
+ /** Denied connector names (glob); takes precedence over allow. */
66
+ denyConnectors?: string[];
67
+ /**
68
+ * Named masking overlays, applied per person.
69
+ *
70
+ * The problem this solves: masking that is right for an AI agent is wrong for
71
+ * the data controller. A shop owner asking "which customer owes the most" needs
72
+ * the name; the assistant summarising revenue does not. A global on/off switch
73
+ * would answer that by disabling the product's only real guarantee.
74
+ *
75
+ * Deliberately narrow: a profile may override `maskColumns`, `maxRows` and
76
+ * `maskLabelledNames` — and NOTHING else. Table, tool and connector permissions
77
+ * stay global, so a profile can never widen what is reachable — only what is
78
+ * legible within it. `protectedColumns` is not overlayable: a per-person
79
+ * profile that could drop a protection rule would be a back door.
80
+ */
81
+ profiles?: Record<string, MaskingProfile>;
82
+ /**
83
+ * Actor id → profile name. Honoured ONLY for actors authenticated with a
84
+ * per-user token (`assurance: 'per-user-token'`). A shared token never receives
85
+ * a profile: "whoever holds this token sees unmasked PII" is exactly the
86
+ * property this product exists to prevent.
87
+ */
88
+ actorProfiles?: Record<string, string>;
89
+ /**
90
+ * Fail-closed scan length. A field longer than this is replaced whole with
91
+ * `[MASKED_PII]` — it is never skipped. Default 16 384. Env
92
+ * `CONARIUM_SCAN_CHAR_CAP` overrides. This is a usability knob: raising it
93
+ * grows scan cost quadratically on the remaining detectors.
94
+ */
95
+ scanCharCap?: number;
96
+ /**
97
+ * Optional content detectors. Identity detectors (TCKN, card, IBAN, email)
98
+ * are not keys here and cannot be turned off — a config that tries is
99
+ * rejected at load. `ip` defaults off (server IPs are not always personal
100
+ * data). `mrz` defaults on (a passport MRZ is identity and checksummed).
101
+ */
102
+ detectors?: DetectorToggles;
103
+ /**
104
+ * Extra content detectors the operator writes. Same scanner as the built-in
105
+ * ones — not a second masking path. Each rule has a name (what the receipt
106
+ * records), a pattern, optional column globs, and a mask label.
107
+ *
108
+ * A broken or ReDoS-shaped pattern rejects the config. The pattern text is
109
+ * never written to logs or receipts.
110
+ */
111
+ customPatterns?: CustomPiiPattern[];
112
+ }
113
+ /** Operator-defined content detector. See `GovernancePolicy.customPatterns`. */
114
+ export interface CustomPiiPattern {
115
+ /** Receipt `masking.byClass` key. Not the pattern. */
116
+ name: string;
117
+ /** JS regex source. Compiled at load; never logged. */
118
+ pattern: string;
119
+ /** Optional column globs (`*.hesap_no`). Empty / omitted = every scanned field. */
120
+ columns?: string[];
121
+ /** Replacement. Default `[MASKED_PII]`. Must be `[MASKED_…]`. */
122
+ label?: string;
123
+ /**
124
+ * Optional example the doctor tries against the compiled pattern.
125
+ * Same sensitivity as `pattern` — never logged or printed.
126
+ */
127
+ sample?: string;
128
+ }
129
+ /** See `GovernancePolicy.detectors`. */
130
+ export interface DetectorToggles {
131
+ /** Opt-in. Default false. */
132
+ ip?: boolean;
133
+ /** Passport TD3 MRZ. Default true. */
134
+ mrz?: boolean;
135
+ }
136
+ /** Per-person overlay. See `GovernancePolicy.profiles`. */
137
+ export interface MaskingProfile {
138
+ maskColumns?: string[];
139
+ maxRows?: number;
140
+ maskLabelledNames?: boolean;
141
+ }
142
+ export interface AuditConfig {
143
+ /** Append-only JSONL file path. If unset, audit goes to stderr only. */
144
+ sink?: string;
145
+ failClosed?: boolean;
146
+ /** Optional: append-only JSONL file for verifiable access receipts. If unset, no receipts are produced. */
147
+ receiptSink?: string;
148
+ /** Model identification for receipts (provider/name/version). */
149
+ receiptModel?: {
150
+ provider: string;
151
+ name: string;
152
+ version: string;
153
+ };
154
+ /** Client identification for receipts (name/version). */
155
+ receiptClient?: {
156
+ name: string;
157
+ version: string;
158
+ };
159
+ /** Operator-declared destination. Not verified. Not a policy input. */
160
+ receiptDestination?: string;
161
+ }
162
+ export interface ConnectorConfig {
163
+ type: 'postgres' | 'supabase' | 'supabase-rest' | 'openapi' | 'files' | 'docs' | 'slack' | 'jira' | 'custom-sql' | 'demo';
164
+ name: string;
165
+ description: string;
166
+ config: Record<string, string>;
167
+ }
168
+ export interface SchemaTable {
169
+ name: string;
170
+ schema: string;
171
+ columns: SchemaColumn[];
172
+ rowCount?: number;
173
+ description?: string;
174
+ }
175
+ export interface SchemaColumn {
176
+ name: string;
177
+ type: string;
178
+ nullable: boolean;
179
+ isPrimary: boolean;
180
+ isForeign: boolean;
181
+ references?: string;
182
+ description?: string;
183
+ }
184
+ export interface QueryResult {
185
+ rows: Record<string, unknown>[];
186
+ rowCount: number;
187
+ fields: string[];
188
+ sql?: string;
189
+ }
190
+ export interface ConnectorCapabilities {
191
+ canQuery: boolean;
192
+ canListSchema: boolean;
193
+ canDescribeTable: boolean;
194
+ canSearch: boolean;
195
+ }
196
+ export interface Connector {
197
+ name: string;
198
+ description: string;
199
+ capabilities: ConnectorCapabilities;
200
+ connect(): Promise<void>;
201
+ disconnect(): Promise<void>;
202
+ listTables(): Promise<SchemaTable[]>;
203
+ describeTable(table: string): Promise<SchemaTable>;
204
+ query(sql: string, params?: unknown[]): Promise<QueryResult>;
205
+ search(query: string, tables?: string[]): Promise<QueryResult>;
206
+ }
207
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/mask/legacy_0254/types.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,eAAe,EAAE,CAAA;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,6EAA6E;IAC7E,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,sDAAsD;IACtD,MAAM,CAAC,EAAE,gBAAgB,CAAA;IACzB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB;;;;OAIG;IACH,OAAO,CAAC,EAAE,YAAY,CAAA;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,kHAAkH;IAClH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB,yEAAyE;IACzE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;IACtB;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC3B,mEAAmE;IACnE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAA;IACzC;;;;;;;;;;;OAWG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,wBAAwB;IACxB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,iFAAiF;I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ED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,OAAO,CAAA;IACjB,aAAa,EAAE,OAAO,CAAA;IACtB,gBAAgB,EAAE,OAAO,CAAA;IACzB,SAAS,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,qBAAqB,CAAA;IACnC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACxB,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3B,UAAU,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAAA;IACpC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;IAClD,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;IAC5D,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;CAC/D"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/mask/legacy_0254/types.ts"],"names":[],"mappings":""}
@@ -1,4 +1,4 @@
1
- import { type CompiledCustomPattern } from './custom_patterns.js';
1
+ import type { CompiledCustomPattern } from './custom_patterns.js';
2
2
  import type { DetectorToggles } from './types.js';
3
3
  export interface MaskTextOptions {
4
4
  scanCharCap?: number;
@@ -7,5 +7,15 @@ export interface MaskTextOptions {
7
7
  }
8
8
  export declare const SECRET_VALUE_RE: RegExp;
9
9
  export declare function maskSecretShapedValues(text: string, token?: string): string;
10
+ export interface MaskFieldOptions extends MaskTextOptions {
11
+ pipeline: 'text' | 'governance';
12
+ column?: string;
13
+ maskLabelledNames?: boolean;
14
+ }
15
+ export declare function maskField(text: string, opts: MaskFieldOptions): {
16
+ text: string;
17
+ count: number;
18
+ byClass: Record<string, number>;
19
+ };
10
20
  export declare function maskSensitiveText(text: string, opts?: MaskTextOptions): string;
11
21
  //# sourceMappingURL=mask-text.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mask-text.d.ts","sourceRoot":"","sources":["../src/mask-text.ts"],"names":[],"mappings":"AAkBA,OAAO,EAEL,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B,cAAc,CAAC,EAAE,qBAAqB,EAAE,CAAA;CACzC;AAED,eAAO,MAAM,eAAe,QAC0I,CAAA;AAEtK,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAoB,GAAG,MAAM,CAGtF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,eAAoB,GAAG,MAAM,CAuBlF"}
1
+ {"version":3,"file":"mask-text.d.ts","sourceRoot":"","sources":["../src/mask-text.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAIjD,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,eAAe,CAAA;IAC3B,cAAc,CAAC,EAAE,qBAAqB,EAAE,CAAA;CACzC;AAED,eAAO,MAAM,eAAe,QAC0I,CAAA;AAEtK,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,SAAoB,GAAG,MAAM,CAGtF;AAKD,MAAM,WAAW,gBAAiB,SAAQ,eAAe;IACvD,QAAQ,EAAE,MAAM,GAAG,YAAY,CAAA;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAC5B;AAqID,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG;IAC/D,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC,CAmCA;AAID,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,eAAoB,GAAG,MAAM,CAOlF"}
package/dist/mask-text.js CHANGED
@@ -2,41 +2,200 @@
2
2
  * Shared PII/secret masking pipeline. Audit args, error text, and (later)
3
3
  * reason/target/governance all go through this — one copy, not three.
4
4
  */
5
- import { maskIbansInText, prepareIbanPass } from './iban.js';
6
- import { collapsePartialMask, maskEmbeddedEncodedPii, normalizePiiText, } from './pii_normalize.js';
7
- import { resolveScanCharCap, maskEmails, maskEntityEncodedEmails, maskNumericPii, } from './digit_pii.js';
8
- import { maskIps } from './ip_detect.js';
9
- import { maskMrz } from './mrz.js';
10
- import { applyCustomPatterns, } from './custom_patterns.js';
5
+ import { normalizePiiText } from './pii_normalize.js';
6
+ import { resolveScanCharCap } from './digit_pii.js';
7
+ import { apply, detect } from './mask/core.js';
8
+ import { beltCover } from './mask/belt.js';
11
9
  export const SECRET_VALUE_RE = /\b(?:sk-[A-Za-z0-9]{12,}|sk_live_[A-Za-z0-9]{6,}|AKIA[0-9A-Z]{16}|ghp_[A-Za-z0-9]{20,}|gsk_[A-Za-z0-9]{20,}|xox[baprs]-[A-Za-z0-9-]{8,}|eyJ[A-Za-z0-9._-]{20,})\b/g;
12
10
  export function maskSecretShapedValues(text, token = '[MASKED_SECRET]') {
13
11
  SECRET_VALUE_RE.lastIndex = 0;
14
12
  return text.replace(SECRET_VALUE_RE, token);
15
13
  }
16
- export function maskSensitiveText(text, opts = {}) {
14
+ const SECRET = '[MASKED_SECRET]';
15
+ const PII = '[MASKED_PII]';
16
+ function tokenTier(token) {
17
+ if (token === SECRET)
18
+ return 0;
19
+ if (token === PII)
20
+ return 1;
21
+ return 2;
22
+ }
23
+ function preferToken(left, right, rules) {
24
+ if (!left)
25
+ return right;
26
+ if (!right)
27
+ return left;
28
+ const a = tokenTier(left);
29
+ const b = tokenTier(right);
30
+ if (a !== b)
31
+ return a < b ? left : right;
32
+ if (a < 2)
33
+ return left;
34
+ const ia = rules.findIndex((rule) => rule.label === left);
35
+ const ib = rules.findIndex((rule) => rule.label === right);
36
+ if (ia < 0)
37
+ return ib < 0 ? left : right;
38
+ if (ib < 0)
39
+ return left;
40
+ return ia <= ib ? left : right;
41
+ }
42
+ function legacySpan(start, end) {
43
+ return {
44
+ start,
45
+ end,
46
+ cls: 'legacy',
47
+ token: PII,
48
+ source: 'belt',
49
+ };
50
+ }
51
+ /** Belt ranges carry no token. Only the part a core span does not already cover enters as PII. */
52
+ function beltOnlySpans(core, belt) {
53
+ const raw = [];
54
+ for (let i = 0; i < core.length; i++) {
55
+ const sp = core[i];
56
+ if (sp.end > sp.start)
57
+ raw.push({ start: sp.start, end: sp.end });
58
+ }
59
+ raw.sort((a, b) => a.start - b.start || a.end - b.end);
60
+ const merged = [];
61
+ for (let i = 0; i < raw.length; i++) {
62
+ const iv = raw[i];
63
+ const cur = merged[merged.length - 1];
64
+ if (!cur || iv.start > cur.end)
65
+ merged.push({ start: iv.start, end: iv.end });
66
+ else if (iv.end > cur.end)
67
+ cur.end = iv.end;
68
+ }
69
+ const ordered = unionBelt(beltByStart(belt));
70
+ const out = [];
71
+ // `head` only moves forward. Belt ranges are in start order, so an interval
72
+ // that ended before this range cannot meet a later one.
73
+ let head = 0;
74
+ for (let b = 0; b < ordered.length; b++) {
75
+ const sp = ordered[b];
76
+ if (sp.end <= sp.start)
77
+ continue;
78
+ while (head < merged.length && merged[head].end <= sp.start)
79
+ head++;
80
+ let cursor = sp.start;
81
+ for (let k = head; k < merged.length; k++) {
82
+ const iv = merged[k];
83
+ if (iv.start >= sp.end)
84
+ break;
85
+ if (iv.start > cursor)
86
+ out.push(legacySpan(cursor, Math.min(iv.start, sp.end)));
87
+ if (iv.end > cursor)
88
+ cursor = iv.end;
89
+ if (cursor >= sp.end)
90
+ break;
91
+ }
92
+ if (cursor < sp.end)
93
+ out.push(legacySpan(cursor, sp.end));
94
+ }
95
+ return out;
96
+ }
97
+ // Widest ranges of an ambiguous mask overlap. Cut the gaps once, on the
98
+ // union, or each range rebuilds the same gaps and the piece count squares.
99
+ function unionBelt(ordered) {
100
+ for (let i = 1; i < ordered.length; i++) {
101
+ if (ordered[i].start < ordered[i - 1].end)
102
+ return mergeBelt(ordered);
103
+ }
104
+ return ordered;
105
+ }
106
+ function mergeBelt(ordered) {
107
+ const merged = [];
108
+ for (let i = 0; i < ordered.length; i++) {
109
+ const sp = ordered[i];
110
+ if (sp.end <= sp.start)
111
+ continue;
112
+ const cur = merged[merged.length - 1];
113
+ if (cur && sp.start < cur.end) {
114
+ if (sp.end > cur.end)
115
+ cur.end = sp.end;
116
+ }
117
+ else {
118
+ merged.push({ start: sp.start, end: sp.end });
119
+ }
120
+ }
121
+ return merged;
122
+ }
123
+ function beltByStart(belt) {
124
+ for (let i = 1; i < belt.length; i++) {
125
+ if (belt[i].start < belt[i - 1].start) {
126
+ const copy = belt.slice();
127
+ copy.sort((a, b) => a.start - b.start);
128
+ return copy;
129
+ }
130
+ }
131
+ return belt;
132
+ }
133
+ function ownByClass(src) {
134
+ const bag = Object.create(null);
135
+ if (!src)
136
+ return bag;
137
+ for (const key of Object.keys(src)) {
138
+ const n = src[key];
139
+ if (typeof n !== 'number' || !(n > 0))
140
+ continue;
141
+ Object.defineProperty(bag, key, {
142
+ value: n,
143
+ writable: true,
144
+ enumerable: true,
145
+ configurable: true,
146
+ });
147
+ }
148
+ return bag;
149
+ }
150
+ // The core detects on its own. The belt keeps every span 0.2.54 masked.
151
+ // When the belt cannot decide, the whole field is masked.
152
+ export function maskField(text, opts) {
17
153
  if (text.length > resolveScanCharCap(opts.scanCharCap)) {
18
- return '[MASKED_PII]';
19
- }
20
- let masked = normalizePiiText(text);
21
- const ibanPass = prepareIbanPass(masked);
22
- masked = ibanPass.text;
23
- masked = maskEmails(masked).text;
24
- masked = maskEntityEncodedEmails(masked).text;
25
- masked = maskNumericPii(masked).text;
26
- if (opts.detectors?.ip === true)
27
- masked = maskIps(masked).text;
28
- if (opts.detectors?.mrz !== false)
29
- masked = maskMrz(masked).text;
30
- masked = maskSecretShapedValues(masked);
31
- masked = masked.replace(/([a-zA-Z][a-zA-Z0-9+.-]*:\/\/[^:@\s/"']+:)[^@\s/"']+(@)/g, '$1[MASKED_SECRET]$2');
32
- masked = masked.replace(/(Bearer\s+)[A-Za-z0-9._~+/=-]{6,}/gi, '$1[MASKED_SECRET]');
33
- masked = masked.replace(/((?:password|passwd|pwd|secret|token|api[_-]?key|access[_-]?key|authorization)["'\s]*[:=]["'\s]*)[^"'\s,;}]{4,}/gi, '$1[MASKED_SECRET]');
34
- masked = ibanPass.restore(masked);
35
- masked = collapsePartialMask(masked);
36
- masked = maskEmbeddedEncodedPii(masked, (s) => maskIbansInText(s).count > 0).text;
37
- if (opts.customPatterns && opts.customPatterns.length > 0) {
38
- masked = applyCustomPatterns(masked, opts.customPatterns).text;
39
- }
40
- return masked;
154
+ return { text: PII, count: 1, byClass: Object.create(null) };
155
+ }
156
+ try {
157
+ const normalized = normalizePiiText(text);
158
+ const rules = opts.customPatterns ?? [];
159
+ const detected = detect(normalized, {
160
+ detectors: opts.detectors,
161
+ customPatterns: rules,
162
+ column: opts.column,
163
+ maskLabelledNames: opts.maskLabelledNames,
164
+ });
165
+ const belt = beltCover({
166
+ raw: text,
167
+ normalized,
168
+ pipeline: opts.pipeline,
169
+ policy: {
170
+ detectors: opts.detectors,
171
+ scanCharCap: opts.scanCharCap,
172
+ maskLabelledNames: opts.maskLabelledNames,
173
+ },
174
+ customPatterns: rules,
175
+ column: opts.column,
176
+ scanCharCap: opts.scanCharCap,
177
+ });
178
+ const byClass = ownByClass(detected.byClass);
179
+ if (!belt.ok)
180
+ return { text: PII, count: 1, byClass };
181
+ const whole = preferToken(detected.wholeField?.token, belt.wholeField, rules);
182
+ if (whole)
183
+ return { text: whole, count: 1, byClass };
184
+ const applied = apply(normalized, detected.spans.concat(beltOnlySpans(detected.spans, belt.spans)));
185
+ return { text: applied.text, count: applied.regions, byClass };
186
+ }
187
+ catch {
188
+ return { text: PII, count: 1, byClass: Object.create(null) };
189
+ }
190
+ }
191
+ // The core detects on its own. The belt keeps every span 0.2.54 masked.
192
+ // When the belt cannot decide, the whole field is masked.
193
+ export function maskSensitiveText(text, opts = {}) {
194
+ return maskField(text, {
195
+ pipeline: 'text',
196
+ scanCharCap: opts.scanCharCap,
197
+ detectors: opts.detectors,
198
+ customPatterns: opts.customPatterns,
199
+ }).text;
41
200
  }
42
201
  //# sourceMappingURL=mask-text.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mask-text.js","sourceRoot":"","sources":["../src/mask-text.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAC5D,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,uBAAuB,EACvB,cAAc,GACf,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EACL,mBAAmB,GAEpB,MAAM,sBAAsB,CAAA;AAS7B,MAAM,CAAC,MAAM,eAAe,GAC1B,oKAAoK,CAAA;AAEtK,MAAM,UAAU,sBAAsB,CAAC,IAAY,EAAE,K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,CAAC,CAAC,CAAC,CAAA;QACnG,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,CAAA;IAChE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAA;IAC9D,CAAC;AACH,CAAC;AAED,wEAAwE;AACxE,0DAA0D;AAC1D,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,IAAI,GAAoB,EAAE;IACxE,OAAO,SAAS,CAAC,IAAI,EAAE;QACrB,QAAQ,EAAE,MAAM;QAChB,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,cAAc,EAAE,IAAI,CAAC,cAAc;KACpC,CAAC,CAAC,IAAI,CAAA;AACT,CAAC"}
@@ -0,0 +1,72 @@
1
+ # Claims review — 0.3.0
2
+
3
+ - base: v0.2.54
4
+ - head: baf3a9f
5
+ - surface: sha256:df5f83b4950b1c586d3a1a718fcfdb1cf6ae5ece4672cb07cb524901d44b241c
6
+ - verdict: pass
7
+ - reviewer: Claude. Across the claim surfaces the diff from v0.2.54 is
8
+ `LIMITATIONS.md` and `LIMITATIONS.tr.md`: the version line moves to 0.3.x and
9
+ four sections are added (a labelled secret is masked to its first delimiter;
10
+ a joined number is found only when it proves itself; each field also runs the
11
+ 0.2.54 steps; custom patterns, what is refused and the engine they run on).
12
+ Each example in them was run against the head: the first-delimiter case, the
13
+ joined landline, the number with no separator, the dotless title and the
14
+ literal custom label behave as written. The custom-pattern section's four
15
+ added refusals were each run at the head (`(?m:^.$)`, `(?i:a)\w`, `(?:|a)?`,
16
+ `\u{D83D}`: refused with a reason naming the form) and against Node 24's
17
+ RegExp, which matches each differently from the engine; the Node 24 claim
18
+ about `\w` outside a case-insensitive group was run (`(?i:a)\w` matches `a`
19
+ and the Kelvin sign). Acceptance was compared with 0.2.54 over every Unicode
20
+ property name JavaScript accepts on Node 24 and the syntax forms of
21
+ `compile_parity`; no other pattern 0.2.54 accepted is refused there. A
22
+ pre-merge read found one more: repeats nested so that their counts multiply
23
+ past 1000. The section now names it, and it was run at the head
24
+ (`(?:(?:a{32})){32}` and `(?:x(?:a{32})|b){32}` refused as nested
25
+ quantifiers, `(?:(?:a{25})){40}` accepted and matching JavaScript on 1000
26
+ letters) and at v0.2.54 (accepted). The
27
+ equivalence the section states is the scope of
28
+ `src/custom_patterns.engine.test.ts`, `src/custom_patterns.unicode.test.ts`,
29
+ `src/custom_patterns.unicode_all.test.ts` and
30
+ `src/custom_patterns.edges.test.ts`; the two remaining differences it names
31
+ were run: an empty match between the halves of a surrogate pair (`\B` on `a`
32
+ and an emoji), and the seven letters beyond Latin-1 inside `(?i:…)`, each
33
+ typed and escaped, against each Latin-1 case partner: the engine matched on
34
+ a Latin-1-only text, Node 24.16's RegExp did not, both matched once the text
35
+ held a wider character, and both matched with the letter inside a class. The
36
+ sentence that the empty-choice rule is structural was run with `(?:$|a)?`
37
+ (refused at the head; re2js and Node 24 give the same positions on `a`, the
38
+ empty text, `ba` and `aa`). A raw lone surrogate was run (refused). The braced escapes
39
+ the 0.2.54 cap reads as quantifiers (`\u{100}`, `\u{65}`, `\u{2028}`) were
40
+ run at the head and at v0.2.54 (refused as unbounded or nested in both), and
41
+ their four-digit forms were accepted in both. The timings are measurements
42
+ from comparison scripts outside the repository and are written as "about"
43
+ and "up to".
44
+
45
+ The rest of the release is the masking engine (`src/mask/`, `src/mask-text.ts`,
46
+ `src/governance.ts`, `src/custom_patterns.ts`), its tests, the new runtime
47
+ dependencies `re2js` and `@eslint-community/regexpp`, the version fields (`package.json`, `server.json`,
48
+ `package-lock.json`), the version assertion in `src/demo-mode.test.ts`, and the
49
+ changelog entry. None of those files is a claim surface.
50
+
51
+ ## Findings
52
+
53
+ ### 1. LIMITATIONS.md:63 — an eleven-digit number stays readable
54
+
55
+ - Claim: "A joined landline (`siparis 2024 02321234567`), an eleven-digit number that fails the ID checksum, and a number with no separator before it (`siparis 202410000000146`) stay readable."
56
+ - Mechanism: the joined-number windows accept only parts that pass a checksum or are a Turkish mobile number.
57
+ - Why it falls short: run at the head, `siparis 2024 12345678901` comes back as `siparis [MASKED_PII]` in both paths: the frozen 0.2.54 steps mask it, so the sentence said less was masked than is.
58
+ - Disposition: reworded in `c529a1d` (the eleven-digit clause removed, in both languages).
59
+
60
+ ### 2. LIMITATIONS.md:89 — custom patterns that can backtrack are refused
61
+
62
+ - Claim: "A custom pattern is refused when the policy loads if it can backtrack without bound: a quantified group that holds a quantifier or an alternation …, or two adjacent variable-width quantifiers over overlapping characters …"
63
+ - Mechanism: shape rules in `looksUnsafe`.
64
+ - Why it falls short: a third reading built `[0-9]{0,64}a?[0-9]{0,64}a?[0-9]{0,64}X`, which passed the rules and took 27 s on 16 000 digits; the same rules refused `(?:https?)?`, which 0.2.54 accepted. No list of shapes established "can backtrack without bound".
65
+ - Disposition: the mechanism changed (custom patterns run on a linear-time engine; the shape rules added in this release are gone, the 0.2.54 rules stay) and the section was rewritten in `b13a3e2`, in both languages.
66
+
67
+ ### 3. LIMITATIONS.md:85 — what the 0.2.54 copy can hide that is not personal
68
+
69
+ - Claim: "Some text next to a masked value can then be hidden although it is not personal: a title without a dot (`Bay`, `Bayan`) next to a masked number, or a custom rule's label written literally in the source text."
70
+ - Mechanism: the belt masks every span the frozen 0.2.54 output implies; where that output fits the text in more than one way, the implied spans are the widest ones.
71
+ - Why it falls short: a pre-merge read found that the same title without a dot starting line after line makes the widest spans overlap across the whole run. Run at the head on the model path, `Sayin Ahmet`, `Sayin Mehmet`, `Sayin Ali` on three lines comes back as one mask (`Sayin [MASKED_PII]` and a line break); v0.2.54 gives two. The list named only the adjacent title and the literal label.
72
+ - Disposition: a sentence added in `ed149ef` (the English title spelled `Sayin` in `d2c7bf3`), in both languages, and narrowed in `fd560e2` and `baf3a9f`: the copy's output can fit those lines in more than one way, and the masks over them can then merge into one. The first wording said the region runs from the first name to the last; a second read showed that does not hold for every name shape, so the sentence no longer says where the region ends. Run at the head: `Bay Ab` on 2 340 lines gives one mask in 16 ms on the model path; the audit path keeps one mask for every one or two of those lines; a title followed by other lines (`Sayin Ahmet Bey,` then a sentence) gives the same output as v0.2.54 on the model path. The quadratic time and memory the read also found were fixed in `45caed5` (overlapping spans merge); the "up to about four times" sentence still holds on the inputs of that read (one megabyte of `Bay Ab` lines: 337 ms against 78 ms; 40 custom rules over dense matches: about three times).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conarium-ai/core",
3
- "version": "0.2.54",
3
+ "version": "0.3.0",
4
4
  "mcpName": "io.github.dogrucanemek-alt/conarium",
5
5
  "//files-artefakt": "Generated files under examples/ (private key, receipt/audit JSONL) are EXCLUDED. .gitignore does not bind npm: because the allow-list contained 'examples', `npm publish` on a machine that had run the demo was shipping _keys/audit-ed25519.pem (PRIVATE KEY) and the receipts. test/pack_artefakt.mjs locks this. The exclusions are LIMITED to examples/: receipts.jsonl and .pub.pem under test-vectors/ MUST ship, or a third party cannot run the conformance vectors.",
6
6
  "//files": "Allow-list of what enters the package. Without it npm sent everything: 296 files / 1.5 MB — CI workflows, gitleaks config, a 137 KB marketing image, the site's api/chat.js. A bank security team opens the tarball and sees those. scripts/ is here ON PURPOSE: conarium-reconcile references scripts/pg-snapshot.sql at runtime; without it the user files a support mail.",
@@ -117,12 +117,14 @@
117
117
  "bench:overhead": "node scripts/benchmark-overhead.mjs"
118
118
  },
119
119
  "dependencies": {
120
+ "@eslint-community/regexpp": "4.12.2",
120
121
  "@guanmingchiu/sqlparser-ts": "^0.62.0",
121
122
  "@modelcontextprotocol/sdk": "^1.0.0",
122
123
  "express": "^5.2.1",
123
124
  "node-sql-parser": "^5.4.0",
124
125
  "pgsql-ast-parser": "^12.0.2",
125
126
  "postgres": "^3.4.4",
127
+ "re2js": "2.8.6",
126
128
  "zod": "4.5.4"
127
129
  },
128
130
  "devDependencies": {