@stll/anonymize-wasm 0.1.4 → 0.1.6

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/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Stella
4
+
5
+ Permission is hereby granted, free of charge, to any
6
+ person obtaining a copy of this software and associated
7
+ documentation files (the "Software"), to deal in the
8
+ Software without restriction, including without
9
+ limitation the rights to use, copy, modify, merge,
10
+ publish, distribute, sublicense, and/or sell copies of
11
+ the Software, and to permit persons to whom the
12
+ Software is furnished to do so, subject to the following
13
+ conditions:
14
+
15
+ The above copyright notice and this permission notice
16
+ shall be included in all copies or substantial portions
17
+ of the Software.
18
+
19
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
20
+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
21
+ TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
22
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
23
+ SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
26
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27
+ DEALINGS IN THE SOFTWARE.
28
+
package/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # @stll/anonymize-wasm
2
+
3
+ Browser-friendly build of `@stll/anonymize`.
4
+
5
+ Use this package when you need the runtime API in a browser or bundler environment. It ships the WebAssembly build and the Vite helper that keeps the wasm assets out of dependency pre-bundling.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ bun add @stll/anonymize-wasm
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```ts
16
+ import { runPipeline } from "@stll/anonymize-wasm";
17
+ import stllWasm from "@stll/anonymize-wasm/vite";
18
+ ```
19
+
20
+ ## Notes
21
+
22
+ - This package depends on the same core runtime behavior as `@stll/anonymize`.
23
+ - If you use Vite, include the helper plugin so wasm asset resolution stays intact.
@@ -0,0 +1,7 @@
1
+ import { Plugin } from "vite";
2
+
3
+ //#region src/vite.d.ts
4
+ declare function stllAnonymizeWasmVite(): Plugin;
5
+ //#endregion
6
+ export { stllAnonymizeWasmVite as default };
7
+ //# sourceMappingURL=vite.d.mts.map
package/dist/vite.mjs ADDED
@@ -0,0 +1,21 @@
1
+ //#region src/vite.ts
2
+ const PACKAGES = [
3
+ "@stll/anonymize-wasm",
4
+ "@stll/text-search-wasm",
5
+ "@stll/aho-corasick-wasm",
6
+ "@stll/fuzzy-search-wasm",
7
+ "@stll/regex-set-wasm"
8
+ ];
9
+ function stllAnonymizeWasmVite() {
10
+ return {
11
+ name: "stll-anonymize-wasm",
12
+ apply: "serve",
13
+ config() {
14
+ return { optimizeDeps: { exclude: PACKAGES } };
15
+ }
16
+ };
17
+ }
18
+ //#endregion
19
+ export { stllAnonymizeWasmVite as default };
20
+
21
+ //# sourceMappingURL=vite.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vite.mjs","names":[],"sources":["../../src/vite.ts"],"sourcesContent":["/* Vite plugin that wires up @stll/anonymize-wasm so its transitive\n * napi-rs-generated wasm loaders survive Vite's dep pre-bundler. Adds\n * this package plus its @stll/*-wasm dependencies to optimizeDeps.exclude\n * so the loader modules are served with their original paths, keeping\n * `new URL(\"./foo.wasm\", import.meta.url)` correct. */\nimport type { Plugin } from \"vite\";\n\nconst PACKAGES = [\n \"@stll/anonymize-wasm\",\n \"@stll/text-search-wasm\",\n \"@stll/aho-corasick-wasm\",\n \"@stll/fuzzy-search-wasm\",\n \"@stll/regex-set-wasm\",\n];\n\nexport default function stllAnonymizeWasmVite(): Plugin {\n return {\n name: \"stll-anonymize-wasm\",\n apply: \"serve\",\n config() {\n return {\n optimizeDeps: { exclude: PACKAGES },\n };\n },\n };\n}\n"],"mappings":";AAOA,MAAM,WAAW;CACf;CACA;CACA;CACA;CACA;CACD;AAED,SAAwB,wBAAgC;AACtD,QAAO;EACL,MAAM;EACN,OAAO;EACP,SAAS;AACP,UAAO,EACL,cAAc,EAAE,SAAS,UAAU,EACpC;;EAEJ"}
package/dist/wasm.d.mts CHANGED
@@ -178,6 +178,19 @@ type PipelineConfig = {
178
178
  threshold: number;
179
179
  enableTriggerPhrases: boolean;
180
180
  enableRegex: boolean;
181
+ /**
182
+ * Enables legal-form organization detection.
183
+ * Required for typed callers; legacy untyped
184
+ * callers that omit this field are treated as
185
+ * enabled at runtime for backward compatibility.
186
+ */
187
+ enableLegalForms: boolean;
188
+ /**
189
+ * Enables first-name/surname/title corpus matching.
190
+ * When deny-list mode is enabled, this also controls
191
+ * whether name-corpus entries are injected into the
192
+ * deny-list search automaton.
193
+ */
181
194
  enableNameCorpus: boolean;
182
195
  enableDenyList: boolean;
183
196
  denyListCountries?: string[];
@@ -189,6 +202,11 @@ type PipelineConfig = {
189
202
  enableCoreference: boolean;
190
203
  enableZoneClassification?: boolean;
191
204
  enableHotwordRules?: boolean;
205
+ /**
206
+ * Requested output labels. An empty array means
207
+ * "do not filter by label" for deterministic
208
+ * detectors; NER falls back to DEFAULT_ENTITY_LABELS.
209
+ */
192
210
  labels: string[];
193
211
  workspaceId: string;
194
212
  };
@@ -243,7 +261,7 @@ declare const CURRENCY_PATTERN_META: Readonly<RegexMeta>;
243
261
  declare const processRegexMatches: (allMatches: Match[], sliceStart: number, sliceEnd: number, meta_: readonly RegexMeta[]) => Entity[];
244
262
  //#endregion
245
263
  //#region src/detectors/deny-list.d.ts
246
- type DenyListConfig = Pick<PipelineConfig, "enableDenyList" | "denyListCountries" | "denyListRegions" | "denyListExcludeCategories">;
264
+ type DenyListConfig = Pick<PipelineConfig, "enableDenyList" | "enableNameCorpus" | "denyListCountries" | "denyListRegions" | "denyListExcludeCategories">;
247
265
  /**
248
266
  * Source tag for each pattern in the automaton.
249
267
  * "deny-list" = standard deny list entry
@@ -707,7 +725,7 @@ declare const resolveCountries: (regions?: string[], countries?: string[]) => Se
707
725
  * Runs as a post-processing step after all detection
708
726
  * layers have merged.
709
727
  */
710
- declare const filterFalsePositives: (entities: Entity[], ctx?: PipelineContext) => Entity[];
728
+ declare const filterFalsePositives: (entities: Entity[], ctx?: PipelineContext, fullText?: string) => Entity[];
711
729
  //#endregion
712
730
  //#region src/filters/confidence-boost.d.ts
713
731
  /**