@xberg-io/xberg-wasm 1.2.5 → 1.2.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xberg-io/xberg-wasm",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "private": false,
5
5
  "description": "High-performance document intelligence library",
6
6
  "license": "MIT",
@@ -2,7 +2,7 @@
2
2
  "name": "xberg-wasm",
3
3
  "type": "module",
4
4
  "description": "High-performance document intelligence library",
5
- "version": "1.2.5",
5
+ "version": "1.2.7",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
@@ -10,6 +10,8 @@ export interface WasmPdfMetadataCamelWire {
10
10
  pageCount: number | undefined;
11
11
  scannedConfidence: number | undefined;
12
12
  scannedPages: number[] | undefined;
13
+ fabricatedTextPages: number[] | undefined;
14
+ implausibleTextPages: number[] | undefined;
13
15
  layoutGatedPages: number[] | undefined;
14
16
  layoutGateReasons: string[] | undefined;
15
17
  }
@@ -1041,7 +1043,12 @@ export enum WasmCodeBlockStyle {
1041
1043
  * Controls thread usage for constrained environments.
1042
1044
  *
1043
1045
  * Set `max_threads` to cap all internal thread pools (Rayon, ONNX Runtime
1044
- * intra-op) and batch concurrency to a single limit.
1046
+ * intra-op), batch concurrency and Tesseract recognition to a single limit.
1047
+ * Set `max_concurrent_ocr` to give recognition a limit of its own, which is
1048
+ * the knob to reach for when the host has cores to spare but not the memory
1049
+ * to run a recognition session on each of them. It is applied as given and
1050
+ * is not capped by `max_threads`. The first extraction in a process fixes
1051
+ * it for that process — see the field's own documentation.
1045
1052
  *
1046
1053
  * # Default budget when `max_threads` is unset
1047
1054
  *
@@ -1069,7 +1076,9 @@ export class WasmConcurrencyConfig {
1069
1076
  free(): void;
1070
1077
  [Symbol.dispose](): void;
1071
1078
  static default(): WasmConcurrencyConfig;
1072
- constructor(maxThreads?: number | null);
1079
+ constructor(maxThreads?: number | null, maxConcurrentOcr?: number | null);
1080
+ get maxConcurrentOcr(): number | undefined;
1081
+ set maxConcurrentOcr(value: number | null | undefined);
1073
1082
  get maxThreads(): number | undefined;
1074
1083
  set maxThreads(value: number | null | undefined);
1075
1084
  }
@@ -2491,11 +2500,21 @@ export class WasmExtractionConfig {
2491
2500
  * For text-only extractions (no OCR, no image extraction), skipping image
2492
2501
  * decompression can improve CPU utilization by 5-10% by avoiding wasteful
2493
2502
  * image I/O and processing when results won't be used.
2494
- * Returns `true` when image binary data should be extracted.
2503
+ * Returns `true` when a CONTAINER document (DOCX, PPT, PPTX, HTML, ...) needs
2504
+ * to read an embedded image's binary data out of its archive or source.
2495
2505
  *
2496
- * True when `config.images.extract_images` is set, captioning is configured, or QR-code
2497
- * detection is enabled. Captioning and QR-code detection both require image bytes
2498
- * regardless of whether the caller also requested image extraction.
2506
+ * True when `config.images.extract_images` is set, captioning is configured, QR-code
2507
+ * detection is enabled, or embedded images get OCR'd. All four consume the bytes:
2508
+ * captioning and QR-code detection regardless of whether the caller also requested
2509
+ * image extraction, and embedded-image OCR because the OCR path reads the same bytes
2510
+ * the container would otherwise skip (GH#1662): before the OCR disjunct existed, a
2511
+ * container asked this question, was told no, and attached an image with an empty
2512
+ * buffer, which OCR then ran on and reported `Could not determine image format`.
2513
+ *
2514
+ * This governs whether a CONTAINER reads bytes it does not otherwise have. A
2515
+ * standalone image extractor already holds the whole file's bytes regardless of this
2516
+ * answer, so it must not use this method to decide whether to put its OWN bytes in the
2517
+ * result's `images` array; that is `wants_own_bytes_in_result`.
2499
2518
  */
2500
2519
  needsImageData(): boolean;
2501
2520
  /**
@@ -2509,6 +2528,18 @@ export class WasmExtractionConfig {
2509
2528
  */
2510
2529
  needsImageProcessing(): boolean;
2511
2530
  constructor(mimeDetectionPolicy?: WasmMimeDetectionPolicy | null, useCache?: boolean | null, enableQualityProcessing?: boolean | null, forceOcr?: boolean | null, ocrStrategy?: any | null, disableOcr?: boolean | null, resultFormat?: WasmResultFormat | null, outputFormat?: any | null, escapeMarkdown?: boolean | null, tableAnchors?: boolean | null, jupyterCellRendering?: WasmJupyterCellRendering | null, applyNotebookCellTags?: boolean | null, useLayoutForMarkdown?: boolean | null, includeDocumentStructure?: boolean | null, url?: WasmUrlExtractionConfig | null, maxArchiveDepth?: number | null, ocr?: WasmOcrConfig | null, forceOcrPages?: Uint32Array | null, chunking?: WasmChunkingConfig | null, contentFilter?: WasmContentFilterConfig | null, images?: WasmImageExtractionConfig | null, pdfOptions?: WasmPdfConfig | null, tokenReduction?: WasmTokenReductionOptions | null, languageDetection?: WasmLanguageDetectionConfig | null, pages?: WasmPageConfig | null, keywords?: WasmKeywordConfig | null, postprocessor?: WasmPostProcessorConfig | null, htmlOptions?: WasmConversionOptions | null, htmlOutput?: WasmHtmlOutputConfig | null, extractionTimeoutSecs?: bigint | null, maxConcurrentExtractions?: number | null, securityLimits?: WasmSecurityLimits | null, maxEmbeddedFileBytes?: bigint | null, layout?: WasmLayoutDetectionConfig | null, transcription?: WasmTranscriptionConfig | null, acceleration?: WasmAccelerationConfig | null, cacheNamespace?: string | null, cacheTtlSecs?: bigint | null, email?: WasmEmailConfig | null, csv?: WasmCsvConfig | null, geojson?: WasmGeoJsonExtractionConfig | null, concurrency?: WasmConcurrencyConfig | null, structuredExtraction?: WasmStructuredExtractionConfig | null, ner?: WasmNerConfig | null, redaction?: WasmRedactionConfig | null, summarization?: WasmSummarizationConfig | null, translation?: WasmTranslationConfig | null, pageClassification?: WasmPageClassificationConfig | null, chunkClassification?: WasmChunkClassificationConfig | null, captioning?: WasmCaptioningConfig | null, qrCodes?: boolean | null);
2531
+ /**
2532
+ * Whether embedded images get OCR'd.
2533
+ *
2534
+ * This mirrors the condition the pipeline itself uses before it calls
2535
+ * `image_ocr.process_images_with_ocr` (`core/pipeline/mod.rs`), and it is
2536
+ * deliberately the same predicate rather than an equivalent one: when the
2537
+ * two drifted apart, a container extractor asked `needs_image_data` and was
2538
+ * told no, so it attached an image with an empty buffer, and the OCR path
2539
+ * then ran on those zero bytes and reported `Could not determine image
2540
+ * format` (GH#1662).
2541
+ */
2542
+ runsOcrOnEmbeddedImages(): boolean;
2512
2543
  /**
2513
2544
  * Validate the configuration, returning an error if any settings are invalid.
2514
2545
  *
@@ -2538,6 +2569,21 @@ export class WasmExtractionConfig {
2538
2569
  * Returns `XbergError.Validation` describing the first invalid setting found.
2539
2570
  */
2540
2571
  validate(): void;
2572
+ /**
2573
+ * Returns `true` when a standalone image extraction (the whole input document IS
2574
+ * the image, not a container's embedded picture) should attach its own already-read
2575
+ * bytes to the result's `images` array.
2576
+ *
2577
+ * Deliberately narrower than `needs_image_data`: a standalone
2578
+ * image's content is read in full before this question is ever asked, whether or not OCR
2579
+ * runs, so OCR being configured is not by itself a reason to echo those bytes back in the
2580
+ * public output. Using `needs_image_data` here (as `needs_image_data`'s own OCR disjunct
2581
+ * briefly did) would silently start returning every OCR'd standalone image's raw bytes in
2582
+ * `images`, a public output contract change with nothing asking for it. Same three
2583
+ * conditions as before that disjunct existed: explicit image extraction, captioning, or
2584
+ * QR-code detection.
2585
+ */
2586
+ wantsOwnBytesInResult(): boolean;
2541
2587
  get acceleration(): WasmAccelerationConfig | undefined;
2542
2588
  set acceleration(value: WasmAccelerationConfig | null | undefined);
2543
2589
  applyNotebookCellTags: boolean;
@@ -4595,10 +4641,11 @@ export class WasmOcrQualityThresholds {
4595
4641
  free(): void;
4596
4642
  [Symbol.dispose](): void;
4597
4643
  static default(): WasmOcrQualityThresholds;
4598
- constructor(minTotalNonWhitespace?: number | null, minNonWhitespacePerPage?: number | null, minMeaningfulWordLen?: number | null, minMeaningfulWords?: number | null, minAlnumRatio?: number | null, minGarbageChars?: number | null, maxFragmentedWordRatio?: number | null, criticalFragmentedWordRatio?: number | null, maxOcrOutputFragmentedWordRatio?: number | null, minOcrMeanConfidence?: number | null, minWordsForOcrOutputCheck?: number | null, maxOcrOutputDictInvalidWordRatio?: number | null, discardSuspectedOcrNoise?: boolean | null, minAvgWordLength?: number | null, minWordsForAvgLengthCheck?: number | null, minConsecutiveRepeatRatio?: number | null, minWordsForRepeatCheck?: number | null, substantiveMinChars?: number | null, nonTextMinChars?: number | null, alnumWsRatioThreshold?: number | null, pipelineMinQuality?: number | null, minUndecodableRatio?: number | null, enableProvenanceOcrRouting?: boolean | null, minProvenanceFallbackRatio?: number | null);
4644
+ constructor(minTotalNonWhitespace?: number | null, minNonWhitespacePerPage?: number | null, minMeaningfulWordLen?: number | null, minMeaningfulWords?: number | null, minAlnumRatio?: number | null, minGarbageChars?: number | null, maxFragmentedWordRatio?: number | null, criticalFragmentedWordRatio?: number | null, maxOcrOutputFragmentedWordRatio?: number | null, minOcrMeanConfidence?: number | null, minWordsForOcrOutputCheck?: number | null, maxOcrOutputDictInvalidWordRatio?: number | null, discardSuspectedOcrNoise?: boolean | null, minAvgWordLength?: number | null, minWordsForAvgLengthCheck?: number | null, minConsecutiveRepeatRatio?: number | null, minWordsForRepeatCheck?: number | null, substantiveMinChars?: number | null, nonTextMinChars?: number | null, alnumWsRatioThreshold?: number | null, pipelineMinQuality?: number | null, minUndecodableRatio?: number | null, enableProvenanceOcrRouting?: boolean | null, minProvenanceFallbackRatio?: number | null, enablePlausibilityOcrRouting?: boolean | null, minReliableLanguageChunkRatio?: number | null);
4599
4645
  alnumWsRatioThreshold: number;
4600
4646
  criticalFragmentedWordRatio: number;
4601
4647
  discardSuspectedOcrNoise: boolean;
4648
+ enablePlausibilityOcrRouting: boolean;
4602
4649
  enableProvenanceOcrRouting: boolean;
4603
4650
  maxFragmentedWordRatio: number;
4604
4651
  maxOcrOutputDictInvalidWordRatio: number;
@@ -4612,6 +4659,7 @@ export class WasmOcrQualityThresholds {
4612
4659
  minNonWhitespacePerPage: number;
4613
4660
  minOcrMeanConfidence: number;
4614
4661
  minProvenanceFallbackRatio: number;
4662
+ minReliableLanguageChunkRatio: number;
4615
4663
  minTotalNonWhitespace: number;
4616
4664
  minUndecodableRatio: number;
4617
4665
  minWordsForAvgLengthCheck: number;
@@ -5377,9 +5425,13 @@ export class WasmPdfMetadata {
5377
5425
  free(): void;
5378
5426
  [Symbol.dispose](): void;
5379
5427
  static default(): WasmPdfMetadata;
5380
- constructor(pdfVersion?: string | null, producer?: string | null, isEncrypted?: boolean | null, width?: bigint | null, height?: bigint | null, pageCount?: number | null, scannedConfidence?: number | null, scannedPages?: Uint32Array | null, layoutGatedPages?: Uint32Array | null, layoutGateReasons?: string[] | null);
5428
+ constructor(pdfVersion?: string | null, producer?: string | null, isEncrypted?: boolean | null, width?: bigint | null, height?: bigint | null, pageCount?: number | null, scannedConfidence?: number | null, scannedPages?: Uint32Array | null, fabricatedTextPages?: Uint32Array | null, implausibleTextPages?: Uint32Array | null, layoutGatedPages?: Uint32Array | null, layoutGateReasons?: string[] | null);
5429
+ get fabricatedTextPages(): Uint32Array | undefined;
5430
+ set fabricatedTextPages(value: Uint32Array | null | undefined);
5381
5431
  get height(): bigint | undefined;
5382
5432
  set height(value: bigint | null | undefined);
5433
+ get implausibleTextPages(): Uint32Array | undefined;
5434
+ set implausibleTextPages(value: Uint32Array | null | undefined);
5383
5435
  get isEncrypted(): boolean | undefined;
5384
5436
  set isEncrypted(value: boolean | null | undefined);
5385
5437
  get layoutGateReasons(): string[] | undefined;
@@ -7248,9 +7300,10 @@ export function listEmbeddingBackends(): string[];
7248
7300
  * # Cost
7249
7301
  *
7250
7302
  * Calling this is not free for every backend. In particular, `TesseractBackend`'s
7251
- * `supported_languages()` allocates a Tesseract API and initializes it (`init("", "eng")`) the
7252
- * first time it is called, to enumerate installed tessdata languages; subsequent calls are
7253
- * served from a cache.
7303
+ * `supported_languages()` allocates a Tesseract API and initializes it against the same
7304
+ * tessdata directory a real OCR job resolves (`resolve_tessdata_path`), the first time it
7305
+ * is called, to enumerate installed tessdata languages; subsequent calls are served from a
7306
+ * cache.
7254
7307
  *
7255
7308
  * # Errors
7256
7309
  *
@@ -8060,8 +8113,10 @@ export interface InitOutput {
8060
8113
  readonly wasmclassificationlabel_set_confidence: (a: number, b: number) => void;
8061
8114
  readonly wasmclassificationlabel_set_label: (a: number, b: number, c: number) => void;
8062
8115
  readonly wasmconcurrencyconfig_default: () => number;
8116
+ readonly wasmconcurrencyconfig_maxConcurrentOcr: (a: number) => number;
8063
8117
  readonly wasmconcurrencyconfig_maxThreads: (a: number) => number;
8064
- readonly wasmconcurrencyconfig_new: (a: number) => number;
8118
+ readonly wasmconcurrencyconfig_new: (a: number, b: number) => number;
8119
+ readonly wasmconcurrencyconfig_set_maxConcurrentOcr: (a: number, b: number) => void;
8065
8120
  readonly wasmconcurrencyconfig_set_maxThreads: (a: number, b: number) => void;
8066
8121
  readonly wasmconfidencesemantics_default: () => number;
8067
8122
  readonly wasmconfidencesemantics_new: () => number;
@@ -8974,6 +9029,7 @@ export interface InitOutput {
8974
9029
  readonly wasmextractionconfig_qrCodes: (a: number) => number;
8975
9030
  readonly wasmextractionconfig_redaction: (a: number) => number;
8976
9031
  readonly wasmextractionconfig_resultFormat: (a: number) => [number, number];
9032
+ readonly wasmextractionconfig_runsOcrOnEmbeddedImages: (a: number) => number;
8977
9033
  readonly wasmextractionconfig_securityLimits: (a: number) => number;
8978
9034
  readonly wasmextractionconfig_set_acceleration: (a: number, b: number) => void;
8979
9035
  readonly wasmextractionconfig_set_applyNotebookCellTags: (a: number, b: number) => void;
@@ -9036,6 +9092,7 @@ export interface InitOutput {
9036
9092
  readonly wasmextractionconfig_useCache: (a: number) => number;
9037
9093
  readonly wasmextractionconfig_useLayoutForMarkdown: (a: number) => number;
9038
9094
  readonly wasmextractionconfig_validate: (a: number) => [number, number];
9095
+ readonly wasmextractionconfig_wantsOwnBytesInResult: (a: number) => number;
9039
9096
  readonly wasmextractionerroritem_code: (a: number) => number;
9040
9097
  readonly wasmextractionerroritem_default: () => number;
9041
9098
  readonly wasmextractionerroritem_errorType: (a: number) => [number, number];
@@ -10086,6 +10143,7 @@ export interface InitOutput {
10086
10143
  readonly wasmocrqualitythresholds_criticalFragmentedWordRatio: (a: number) => number;
10087
10144
  readonly wasmocrqualitythresholds_default: () => number;
10088
10145
  readonly wasmocrqualitythresholds_discardSuspectedOcrNoise: (a: number) => number;
10146
+ readonly wasmocrqualitythresholds_enablePlausibilityOcrRouting: (a: number) => number;
10089
10147
  readonly wasmocrqualitythresholds_enableProvenanceOcrRouting: (a: number) => number;
10090
10148
  readonly wasmocrqualitythresholds_maxFragmentedWordRatio: (a: number) => number;
10091
10149
  readonly wasmocrqualitythresholds_maxOcrOutputDictInvalidWordRatio: (a: number) => number;
@@ -10099,17 +10157,19 @@ export interface InitOutput {
10099
10157
  readonly wasmocrqualitythresholds_minNonWhitespacePerPage: (a: number) => number;
10100
10158
  readonly wasmocrqualitythresholds_minOcrMeanConfidence: (a: number) => number;
10101
10159
  readonly wasmocrqualitythresholds_minProvenanceFallbackRatio: (a: number) => number;
10160
+ readonly wasmocrqualitythresholds_minReliableLanguageChunkRatio: (a: number) => number;
10102
10161
  readonly wasmocrqualitythresholds_minTotalNonWhitespace: (a: number) => number;
10103
10162
  readonly wasmocrqualitythresholds_minUndecodableRatio: (a: number) => number;
10104
10163
  readonly wasmocrqualitythresholds_minWordsForAvgLengthCheck: (a: number) => number;
10105
10164
  readonly wasmocrqualitythresholds_minWordsForOcrOutputCheck: (a: number) => number;
10106
10165
  readonly wasmocrqualitythresholds_minWordsForRepeatCheck: (a: number) => number;
10107
- readonly wasmocrqualitythresholds_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number, k1: number) => number;
10166
+ readonly wasmocrqualitythresholds_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number, k1: number, l1: number, m1: number, n1: number) => number;
10108
10167
  readonly wasmocrqualitythresholds_nonTextMinChars: (a: number) => number;
10109
10168
  readonly wasmocrqualitythresholds_pipelineMinQuality: (a: number) => number;
10110
10169
  readonly wasmocrqualitythresholds_set_alnumWsRatioThreshold: (a: number, b: number) => void;
10111
10170
  readonly wasmocrqualitythresholds_set_criticalFragmentedWordRatio: (a: number, b: number) => void;
10112
10171
  readonly wasmocrqualitythresholds_set_discardSuspectedOcrNoise: (a: number, b: number) => void;
10172
+ readonly wasmocrqualitythresholds_set_enablePlausibilityOcrRouting: (a: number, b: number) => void;
10113
10173
  readonly wasmocrqualitythresholds_set_enableProvenanceOcrRouting: (a: number, b: number) => void;
10114
10174
  readonly wasmocrqualitythresholds_set_maxFragmentedWordRatio: (a: number, b: number) => void;
10115
10175
  readonly wasmocrqualitythresholds_set_maxOcrOutputDictInvalidWordRatio: (a: number, b: number) => void;
@@ -10123,6 +10183,7 @@ export interface InitOutput {
10123
10183
  readonly wasmocrqualitythresholds_set_minNonWhitespacePerPage: (a: number, b: number) => void;
10124
10184
  readonly wasmocrqualitythresholds_set_minOcrMeanConfidence: (a: number, b: number) => void;
10125
10185
  readonly wasmocrqualitythresholds_set_minProvenanceFallbackRatio: (a: number, b: number) => void;
10186
+ readonly wasmocrqualitythresholds_set_minReliableLanguageChunkRatio: (a: number, b: number) => void;
10126
10187
  readonly wasmocrqualitythresholds_set_minTotalNonWhitespace: (a: number, b: number) => void;
10127
10188
  readonly wasmocrqualitythresholds_set_minUndecodableRatio: (a: number, b: number) => void;
10128
10189
  readonly wasmocrqualitythresholds_set_minWordsForAvgLengthCheck: (a: number, b: number) => void;
@@ -10430,17 +10491,21 @@ export interface InitOutput {
10430
10491
  readonly wasmpdfformfield_tooltip: (a: number) => [number, number];
10431
10492
  readonly wasmpdfformfield_value: (a: number) => [number, number];
10432
10493
  readonly wasmpdfmetadata_default: () => number;
10494
+ readonly wasmpdfmetadata_fabricatedTextPages: (a: number) => [number, number];
10433
10495
  readonly wasmpdfmetadata_height: (a: number) => [number, bigint];
10496
+ readonly wasmpdfmetadata_implausibleTextPages: (a: number) => [number, number];
10434
10497
  readonly wasmpdfmetadata_isEncrypted: (a: number) => number;
10435
10498
  readonly wasmpdfmetadata_layoutGateReasons: (a: number) => [number, number];
10436
10499
  readonly wasmpdfmetadata_layoutGatedPages: (a: number) => [number, number];
10437
- readonly wasmpdfmetadata_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: bigint, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number) => number;
10500
+ readonly wasmpdfmetadata_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: bigint, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number) => number;
10438
10501
  readonly wasmpdfmetadata_pageCount: (a: number) => number;
10439
10502
  readonly wasmpdfmetadata_pdfVersion: (a: number) => [number, number];
10440
10503
  readonly wasmpdfmetadata_producer: (a: number) => [number, number];
10441
10504
  readonly wasmpdfmetadata_scannedConfidence: (a: number) => number;
10442
10505
  readonly wasmpdfmetadata_scannedPages: (a: number) => [number, number];
10506
+ readonly wasmpdfmetadata_set_fabricatedTextPages: (a: number, b: number, c: number) => void;
10443
10507
  readonly wasmpdfmetadata_set_height: (a: number, b: number, c: bigint) => void;
10508
+ readonly wasmpdfmetadata_set_implausibleTextPages: (a: number, b: number, c: number) => void;
10444
10509
  readonly wasmpdfmetadata_set_isEncrypted: (a: number, b: number) => void;
10445
10510
  readonly wasmpdfmetadata_set_layoutGateReasons: (a: number, b: number, c: number) => void;
10446
10511
  readonly wasmpdfmetadata_set_layoutGatedPages: (a: number, b: number, c: number) => void;
@@ -10892,6 +10957,10 @@ export interface InitOutput {
10892
10957
  readonly wasmsparseembeddingpreset_modelFile: (a: number) => [number, number];
10893
10958
  readonly wasmsparseembeddingpreset_modelRepo: (a: number) => [number, number];
10894
10959
  readonly wasmsparseembeddingpreset_name: (a: number) => [number, number];
10960
+ readonly wasmsparseembeddingpreset_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => number;
10961
+ readonly wasmsparseembeddingpreset_set_additionalFiles: (a: number, b: number, c: number) => void;
10962
+ readonly wasmsparseembeddingpreset_set_description: (a: number, b: number, c: number) => void;
10963
+ readonly wasmsparseembeddingpreset_set_maxLength: (a: number, b: number) => void;
10895
10964
  readonly qcms_profile_precache_output_transform: (a: number) => void;
10896
10965
  readonly lut_inverse_interp16: (a: number, b: number, c: number) => number;
10897
10966
  readonly lut_interp_linear16: (a: number, b: number, c: number) => number;
@@ -10904,13 +10973,9 @@ export interface InitOutput {
10904
10973
  readonly qcms_transform_data_bgra_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
10905
10974
  readonly qcms_profile_is_bogus: (a: number) => number;
10906
10975
  readonly qcms_transform_release: (a: number) => void;
10907
- readonly wasmsparseembeddingpreset_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => number;
10908
- readonly wasmsparseembeddingpreset_set_additionalFiles: (a: number, b: number, c: number) => void;
10909
- readonly __cxa_atexit: (a: number, b: number, c: number) => number;
10910
- readonly wasmsparseembeddingpreset_set_description: (a: number, b: number, c: number) => void;
10911
- readonly wasmsparseembeddingpreset_set_maxLength: (a: number, b: number) => void;
10912
10976
  readonly wasmsparseembeddingpreset_set_modelFile: (a: number, b: number, c: number) => void;
10913
10977
  readonly wasmsparseembeddingpreset_set_modelRepo: (a: number, b: number, c: number) => void;
10978
+ readonly __cxa_atexit: (a: number, b: number, c: number) => number;
10914
10979
  readonly wasmsparseembeddingpreset_set_name: (a: number, b: number, c: number) => void;
10915
10980
  readonly wasmssrfpolicy_allowlist: (a: number) => any;
10916
10981
  readonly wasmssrfpolicy_default: () => number;
@@ -3894,7 +3894,12 @@ export const WasmCodeBlockStyle = Object.freeze({
3894
3894
  * Controls thread usage for constrained environments.
3895
3895
  *
3896
3896
  * Set `max_threads` to cap all internal thread pools (Rayon, ONNX Runtime
3897
- * intra-op) and batch concurrency to a single limit.
3897
+ * intra-op), batch concurrency and Tesseract recognition to a single limit.
3898
+ * Set `max_concurrent_ocr` to give recognition a limit of its own, which is
3899
+ * the knob to reach for when the host has cores to spare but not the memory
3900
+ * to run a recognition session on each of them. It is applied as given and
3901
+ * is not capped by `max_threads`. The first extraction in a process fixes
3902
+ * it for that process — see the field's own documentation.
3898
3903
  *
3899
3904
  * # Default budget when `max_threads` is unset
3900
3905
  *
@@ -3942,6 +3947,13 @@ export class WasmConcurrencyConfig {
3942
3947
  const ret = wasm.wasmconcurrencyconfig_default();
3943
3948
  return WasmConcurrencyConfig.__wrap(ret);
3944
3949
  }
3950
+ /**
3951
+ * @returns {number | undefined}
3952
+ */
3953
+ get maxConcurrentOcr() {
3954
+ const ret = wasm.wasmconcurrencyconfig_maxConcurrentOcr(this.__wbg_ptr);
3955
+ return ret === Number.MAX_SAFE_INTEGER ? undefined : ret;
3956
+ }
3945
3957
  /**
3946
3958
  * @returns {number | undefined}
3947
3959
  */
@@ -3951,13 +3963,20 @@ export class WasmConcurrencyConfig {
3951
3963
  }
3952
3964
  /**
3953
3965
  * @param {number | null} [maxThreads]
3966
+ * @param {number | null} [maxConcurrentOcr]
3954
3967
  */
3955
- constructor(maxThreads) {
3956
- const ret = wasm.wasmconcurrencyconfig_new(isLikeNone(maxThreads) ? Number.MAX_SAFE_INTEGER : (maxThreads) >>> 0);
3968
+ constructor(maxThreads, maxConcurrentOcr) {
3969
+ const ret = wasm.wasmconcurrencyconfig_new(isLikeNone(maxThreads) ? Number.MAX_SAFE_INTEGER : (maxThreads) >>> 0, isLikeNone(maxConcurrentOcr) ? Number.MAX_SAFE_INTEGER : (maxConcurrentOcr) >>> 0);
3957
3970
  this.__wbg_ptr = ret;
3958
3971
  WasmConcurrencyConfigFinalization.register(this, this.__wbg_ptr, this);
3959
3972
  return this;
3960
3973
  }
3974
+ /**
3975
+ * @param {number | null} [value]
3976
+ */
3977
+ set maxConcurrentOcr(value) {
3978
+ wasm.wasmconcurrencyconfig_set_maxConcurrentOcr(this.__wbg_ptr, isLikeNone(value) ? Number.MAX_SAFE_INTEGER : (value) >>> 0);
3979
+ }
3961
3980
  /**
3962
3981
  * @param {number | null} [value]
3963
3982
  */
@@ -13866,11 +13885,21 @@ export class WasmExtractionConfig {
13866
13885
  * For text-only extractions (no OCR, no image extraction), skipping image
13867
13886
  * decompression can improve CPU utilization by 5-10% by avoiding wasteful
13868
13887
  * image I/O and processing when results won't be used.
13869
- * Returns `true` when image binary data should be extracted.
13888
+ * Returns `true` when a CONTAINER document (DOCX, PPT, PPTX, HTML, ...) needs
13889
+ * to read an embedded image's binary data out of its archive or source.
13890
+ *
13891
+ * True when `config.images.extract_images` is set, captioning is configured, QR-code
13892
+ * detection is enabled, or embedded images get OCR'd. All four consume the bytes:
13893
+ * captioning and QR-code detection regardless of whether the caller also requested
13894
+ * image extraction, and embedded-image OCR because the OCR path reads the same bytes
13895
+ * the container would otherwise skip (GH#1662): before the OCR disjunct existed, a
13896
+ * container asked this question, was told no, and attached an image with an empty
13897
+ * buffer, which OCR then ran on and reported `Could not determine image format`.
13870
13898
  *
13871
- * True when `config.images.extract_images` is set, captioning is configured, or QR-code
13872
- * detection is enabled. Captioning and QR-code detection both require image bytes
13873
- * regardless of whether the caller also requested image extraction.
13899
+ * This governs whether a CONTAINER reads bytes it does not otherwise have. A
13900
+ * standalone image extractor already holds the whole file's bytes regardless of this
13901
+ * answer, so it must not use this method to decide whether to put its OWN bytes in the
13902
+ * result's `images` array; that is `wants_own_bytes_in_result`.
13874
13903
  * @returns {boolean}
13875
13904
  */
13876
13905
  needsImageData() {
@@ -14184,6 +14213,22 @@ export class WasmExtractionConfig {
14184
14213
  wasm.__wbindgen_free_command_export(deferred1_0, deferred1_1, 1);
14185
14214
  }
14186
14215
  }
14216
+ /**
14217
+ * Whether embedded images get OCR'd.
14218
+ *
14219
+ * This mirrors the condition the pipeline itself uses before it calls
14220
+ * `image_ocr.process_images_with_ocr` (`core/pipeline/mod.rs`), and it is
14221
+ * deliberately the same predicate rather than an equivalent one: when the
14222
+ * two drifted apart, a container extractor asked `needs_image_data` and was
14223
+ * told no, so it attached an image with an empty buffer, and the OCR path
14224
+ * then ran on those zero bytes and reported `Could not determine image
14225
+ * format` (GH#1662).
14226
+ * @returns {boolean}
14227
+ */
14228
+ runsOcrOnEmbeddedImages() {
14229
+ const ret = wasm.wasmextractionconfig_runsOcrOnEmbeddedImages(this.__wbg_ptr);
14230
+ return ret !== 0;
14231
+ }
14187
14232
  /**
14188
14233
  * @returns {WasmSecurityLimits | undefined}
14189
14234
  */
@@ -14740,6 +14785,25 @@ export class WasmExtractionConfig {
14740
14785
  throw takeFromExternrefTable0(ret[0]);
14741
14786
  }
14742
14787
  }
14788
+ /**
14789
+ * Returns `true` when a standalone image extraction (the whole input document IS
14790
+ * the image, not a container's embedded picture) should attach its own already-read
14791
+ * bytes to the result's `images` array.
14792
+ *
14793
+ * Deliberately narrower than `needs_image_data`: a standalone
14794
+ * image's content is read in full before this question is ever asked, whether or not OCR
14795
+ * runs, so OCR being configured is not by itself a reason to echo those bytes back in the
14796
+ * public output. Using `needs_image_data` here (as `needs_image_data`'s own OCR disjunct
14797
+ * briefly did) would silently start returning every OCR'd standalone image's raw bytes in
14798
+ * `images`, a public output contract change with nothing asking for it. Same three
14799
+ * conditions as before that disjunct existed: explicit image extraction, captioning, or
14800
+ * QR-code detection.
14801
+ * @returns {boolean}
14802
+ */
14803
+ wantsOwnBytesInResult() {
14804
+ const ret = wasm.wasmextractionconfig_wantsOwnBytesInResult(this.__wbg_ptr);
14805
+ return ret !== 0;
14806
+ }
14743
14807
  }
14744
14808
  if (Symbol.dispose) WasmExtractionConfig.prototype[Symbol.dispose] = WasmExtractionConfig.prototype.free;
14745
14809
 
@@ -26746,6 +26810,13 @@ export class WasmOcrQualityThresholds {
26746
26810
  const ret = wasm.wasmocrqualitythresholds_discardSuspectedOcrNoise(this.__wbg_ptr);
26747
26811
  return ret !== 0;
26748
26812
  }
26813
+ /**
26814
+ * @returns {boolean}
26815
+ */
26816
+ get enablePlausibilityOcrRouting() {
26817
+ const ret = wasm.wasmocrqualitythresholds_enablePlausibilityOcrRouting(this.__wbg_ptr);
26818
+ return ret !== 0;
26819
+ }
26749
26820
  /**
26750
26821
  * @returns {boolean}
26751
26822
  */
@@ -26837,6 +26908,13 @@ export class WasmOcrQualityThresholds {
26837
26908
  const ret = wasm.wasmocrqualitythresholds_minProvenanceFallbackRatio(this.__wbg_ptr);
26838
26909
  return ret;
26839
26910
  }
26911
+ /**
26912
+ * @returns {number}
26913
+ */
26914
+ get minReliableLanguageChunkRatio() {
26915
+ const ret = wasm.wasmocrqualitythresholds_minReliableLanguageChunkRatio(this.__wbg_ptr);
26916
+ return ret;
26917
+ }
26840
26918
  /**
26841
26919
  * @returns {number}
26842
26920
  */
@@ -26897,9 +26975,11 @@ export class WasmOcrQualityThresholds {
26897
26975
  * @param {number | null} [minUndecodableRatio]
26898
26976
  * @param {boolean | null} [enableProvenanceOcrRouting]
26899
26977
  * @param {number | null} [minProvenanceFallbackRatio]
26978
+ * @param {boolean | null} [enablePlausibilityOcrRouting]
26979
+ * @param {number | null} [minReliableLanguageChunkRatio]
26900
26980
  */
26901
- constructor(minTotalNonWhitespace, minNonWhitespacePerPage, minMeaningfulWordLen, minMeaningfulWords, minAlnumRatio, minGarbageChars, maxFragmentedWordRatio, criticalFragmentedWordRatio, maxOcrOutputFragmentedWordRatio, minOcrMeanConfidence, minWordsForOcrOutputCheck, maxOcrOutputDictInvalidWordRatio, discardSuspectedOcrNoise, minAvgWordLength, minWordsForAvgLengthCheck, minConsecutiveRepeatRatio, minWordsForRepeatCheck, substantiveMinChars, nonTextMinChars, alnumWsRatioThreshold, pipelineMinQuality, minUndecodableRatio, enableProvenanceOcrRouting, minProvenanceFallbackRatio) {
26902
- const ret = wasm.wasmocrqualitythresholds_new(isLikeNone(minTotalNonWhitespace) ? Number.MAX_SAFE_INTEGER : (minTotalNonWhitespace) >>> 0, !isLikeNone(minNonWhitespacePerPage), isLikeNone(minNonWhitespacePerPage) ? 0 : minNonWhitespacePerPage, isLikeNone(minMeaningfulWordLen) ? Number.MAX_SAFE_INTEGER : (minMeaningfulWordLen) >>> 0, isLikeNone(minMeaningfulWords) ? Number.MAX_SAFE_INTEGER : (minMeaningfulWords) >>> 0, !isLikeNone(minAlnumRatio), isLikeNone(minAlnumRatio) ? 0 : minAlnumRatio, isLikeNone(minGarbageChars) ? Number.MAX_SAFE_INTEGER : (minGarbageChars) >>> 0, !isLikeNone(maxFragmentedWordRatio), isLikeNone(maxFragmentedWordRatio) ? 0 : maxFragmentedWordRatio, !isLikeNone(criticalFragmentedWordRatio), isLikeNone(criticalFragmentedWordRatio) ? 0 : criticalFragmentedWordRatio, !isLikeNone(maxOcrOutputFragmentedWordRatio), isLikeNone(maxOcrOutputFragmentedWordRatio) ? 0 : maxOcrOutputFragmentedWordRatio, !isLikeNone(minOcrMeanConfidence), isLikeNone(minOcrMeanConfidence) ? 0 : minOcrMeanConfidence, isLikeNone(minWordsForOcrOutputCheck) ? Number.MAX_SAFE_INTEGER : (minWordsForOcrOutputCheck) >>> 0, !isLikeNone(maxOcrOutputDictInvalidWordRatio), isLikeNone(maxOcrOutputDictInvalidWordRatio) ? 0 : maxOcrOutputDictInvalidWordRatio, isLikeNone(discardSuspectedOcrNoise) ? 0xFFFFFF : discardSuspectedOcrNoise ? 1 : 0, !isLikeNone(minAvgWordLength), isLikeNone(minAvgWordLength) ? 0 : minAvgWordLength, isLikeNone(minWordsForAvgLengthCheck) ? Number.MAX_SAFE_INTEGER : (minWordsForAvgLengthCheck) >>> 0, !isLikeNone(minConsecutiveRepeatRatio), isLikeNone(minConsecutiveRepeatRatio) ? 0 : minConsecutiveRepeatRatio, isLikeNone(minWordsForRepeatCheck) ? Number.MAX_SAFE_INTEGER : (minWordsForRepeatCheck) >>> 0, isLikeNone(substantiveMinChars) ? Number.MAX_SAFE_INTEGER : (substantiveMinChars) >>> 0, isLikeNone(nonTextMinChars) ? Number.MAX_SAFE_INTEGER : (nonTextMinChars) >>> 0, !isLikeNone(alnumWsRatioThreshold), isLikeNone(alnumWsRatioThreshold) ? 0 : alnumWsRatioThreshold, !isLikeNone(pipelineMinQuality), isLikeNone(pipelineMinQuality) ? 0 : pipelineMinQuality, !isLikeNone(minUndecodableRatio), isLikeNone(minUndecodableRatio) ? 0 : minUndecodableRatio, isLikeNone(enableProvenanceOcrRouting) ? 0xFFFFFF : enableProvenanceOcrRouting ? 1 : 0, !isLikeNone(minProvenanceFallbackRatio), isLikeNone(minProvenanceFallbackRatio) ? 0 : minProvenanceFallbackRatio);
26981
+ constructor(minTotalNonWhitespace, minNonWhitespacePerPage, minMeaningfulWordLen, minMeaningfulWords, minAlnumRatio, minGarbageChars, maxFragmentedWordRatio, criticalFragmentedWordRatio, maxOcrOutputFragmentedWordRatio, minOcrMeanConfidence, minWordsForOcrOutputCheck, maxOcrOutputDictInvalidWordRatio, discardSuspectedOcrNoise, minAvgWordLength, minWordsForAvgLengthCheck, minConsecutiveRepeatRatio, minWordsForRepeatCheck, substantiveMinChars, nonTextMinChars, alnumWsRatioThreshold, pipelineMinQuality, minUndecodableRatio, enableProvenanceOcrRouting, minProvenanceFallbackRatio, enablePlausibilityOcrRouting, minReliableLanguageChunkRatio) {
26982
+ const ret = wasm.wasmocrqualitythresholds_new(isLikeNone(minTotalNonWhitespace) ? Number.MAX_SAFE_INTEGER : (minTotalNonWhitespace) >>> 0, !isLikeNone(minNonWhitespacePerPage), isLikeNone(minNonWhitespacePerPage) ? 0 : minNonWhitespacePerPage, isLikeNone(minMeaningfulWordLen) ? Number.MAX_SAFE_INTEGER : (minMeaningfulWordLen) >>> 0, isLikeNone(minMeaningfulWords) ? Number.MAX_SAFE_INTEGER : (minMeaningfulWords) >>> 0, !isLikeNone(minAlnumRatio), isLikeNone(minAlnumRatio) ? 0 : minAlnumRatio, isLikeNone(minGarbageChars) ? Number.MAX_SAFE_INTEGER : (minGarbageChars) >>> 0, !isLikeNone(maxFragmentedWordRatio), isLikeNone(maxFragmentedWordRatio) ? 0 : maxFragmentedWordRatio, !isLikeNone(criticalFragmentedWordRatio), isLikeNone(criticalFragmentedWordRatio) ? 0 : criticalFragmentedWordRatio, !isLikeNone(maxOcrOutputFragmentedWordRatio), isLikeNone(maxOcrOutputFragmentedWordRatio) ? 0 : maxOcrOutputFragmentedWordRatio, !isLikeNone(minOcrMeanConfidence), isLikeNone(minOcrMeanConfidence) ? 0 : minOcrMeanConfidence, isLikeNone(minWordsForOcrOutputCheck) ? Number.MAX_SAFE_INTEGER : (minWordsForOcrOutputCheck) >>> 0, !isLikeNone(maxOcrOutputDictInvalidWordRatio), isLikeNone(maxOcrOutputDictInvalidWordRatio) ? 0 : maxOcrOutputDictInvalidWordRatio, isLikeNone(discardSuspectedOcrNoise) ? 0xFFFFFF : discardSuspectedOcrNoise ? 1 : 0, !isLikeNone(minAvgWordLength), isLikeNone(minAvgWordLength) ? 0 : minAvgWordLength, isLikeNone(minWordsForAvgLengthCheck) ? Number.MAX_SAFE_INTEGER : (minWordsForAvgLengthCheck) >>> 0, !isLikeNone(minConsecutiveRepeatRatio), isLikeNone(minConsecutiveRepeatRatio) ? 0 : minConsecutiveRepeatRatio, isLikeNone(minWordsForRepeatCheck) ? Number.MAX_SAFE_INTEGER : (minWordsForRepeatCheck) >>> 0, isLikeNone(substantiveMinChars) ? Number.MAX_SAFE_INTEGER : (substantiveMinChars) >>> 0, isLikeNone(nonTextMinChars) ? Number.MAX_SAFE_INTEGER : (nonTextMinChars) >>> 0, !isLikeNone(alnumWsRatioThreshold), isLikeNone(alnumWsRatioThreshold) ? 0 : alnumWsRatioThreshold, !isLikeNone(pipelineMinQuality), isLikeNone(pipelineMinQuality) ? 0 : pipelineMinQuality, !isLikeNone(minUndecodableRatio), isLikeNone(minUndecodableRatio) ? 0 : minUndecodableRatio, isLikeNone(enableProvenanceOcrRouting) ? 0xFFFFFF : enableProvenanceOcrRouting ? 1 : 0, !isLikeNone(minProvenanceFallbackRatio), isLikeNone(minProvenanceFallbackRatio) ? 0 : minProvenanceFallbackRatio, isLikeNone(enablePlausibilityOcrRouting) ? 0xFFFFFF : enablePlausibilityOcrRouting ? 1 : 0, !isLikeNone(minReliableLanguageChunkRatio), isLikeNone(minReliableLanguageChunkRatio) ? 0 : minReliableLanguageChunkRatio);
26903
26983
  this.__wbg_ptr = ret;
26904
26984
  WasmOcrQualityThresholdsFinalization.register(this, this.__wbg_ptr, this);
26905
26985
  return this;
@@ -26936,6 +27016,12 @@ export class WasmOcrQualityThresholds {
26936
27016
  set discardSuspectedOcrNoise(value) {
26937
27017
  wasm.wasmocrqualitythresholds_set_discardSuspectedOcrNoise(this.__wbg_ptr, value);
26938
27018
  }
27019
+ /**
27020
+ * @param {boolean} value
27021
+ */
27022
+ set enablePlausibilityOcrRouting(value) {
27023
+ wasm.wasmocrqualitythresholds_set_enablePlausibilityOcrRouting(this.__wbg_ptr, value);
27024
+ }
26939
27025
  /**
26940
27026
  * @param {boolean} value
26941
27027
  */
@@ -27014,6 +27100,12 @@ export class WasmOcrQualityThresholds {
27014
27100
  set minProvenanceFallbackRatio(value) {
27015
27101
  wasm.wasmocrqualitythresholds_set_minProvenanceFallbackRatio(this.__wbg_ptr, value);
27016
27102
  }
27103
+ /**
27104
+ * @param {number} value
27105
+ */
27106
+ set minReliableLanguageChunkRatio(value) {
27107
+ wasm.wasmocrqualitythresholds_set_minReliableLanguageChunkRatio(this.__wbg_ptr, value);
27108
+ }
27017
27109
  /**
27018
27110
  * @param {number} value
27019
27111
  */
@@ -30587,6 +30679,18 @@ export class WasmPdfMetadata {
30587
30679
  const ret = wasm.wasmpdfmetadata_default();
30588
30680
  return WasmPdfMetadata.__wrap(ret);
30589
30681
  }
30682
+ /**
30683
+ * @returns {Uint32Array | undefined}
30684
+ */
30685
+ get fabricatedTextPages() {
30686
+ const ret = wasm.wasmpdfmetadata_fabricatedTextPages(this.__wbg_ptr);
30687
+ let v1;
30688
+ if (ret[0] !== 0) {
30689
+ v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
30690
+ wasm.__wbindgen_free_command_export(ret[0], ret[1] * 4, 4);
30691
+ }
30692
+ return v1;
30693
+ }
30590
30694
  /**
30591
30695
  * @returns {bigint | undefined}
30592
30696
  */
@@ -30594,6 +30698,18 @@ export class WasmPdfMetadata {
30594
30698
  const ret = wasm.wasmpdfmetadata_height(this.__wbg_ptr);
30595
30699
  return ret[0] === 0 ? undefined : ret[1];
30596
30700
  }
30701
+ /**
30702
+ * @returns {Uint32Array | undefined}
30703
+ */
30704
+ get implausibleTextPages() {
30705
+ const ret = wasm.wasmpdfmetadata_implausibleTextPages(this.__wbg_ptr);
30706
+ let v1;
30707
+ if (ret[0] !== 0) {
30708
+ v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
30709
+ wasm.__wbindgen_free_command_export(ret[0], ret[1] * 4, 4);
30710
+ }
30711
+ return v1;
30712
+ }
30597
30713
  /**
30598
30714
  * @returns {boolean | undefined}
30599
30715
  */
@@ -30634,21 +30750,27 @@ export class WasmPdfMetadata {
30634
30750
  * @param {number | null} [pageCount]
30635
30751
  * @param {number | null} [scannedConfidence]
30636
30752
  * @param {Uint32Array | null} [scannedPages]
30753
+ * @param {Uint32Array | null} [fabricatedTextPages]
30754
+ * @param {Uint32Array | null} [implausibleTextPages]
30637
30755
  * @param {Uint32Array | null} [layoutGatedPages]
30638
30756
  * @param {string[] | null} [layoutGateReasons]
30639
30757
  */
30640
- constructor(pdfVersion, producer, isEncrypted, width, height, pageCount, scannedConfidence, scannedPages, layoutGatedPages, layoutGateReasons) {
30758
+ constructor(pdfVersion, producer, isEncrypted, width, height, pageCount, scannedConfidence, scannedPages, fabricatedTextPages, implausibleTextPages, layoutGatedPages, layoutGateReasons) {
30641
30759
  var ptr0 = isLikeNone(pdfVersion) ? 0 : passStringToWasm0(pdfVersion, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
30642
30760
  var len0 = WASM_VECTOR_LEN;
30643
30761
  var ptr1 = isLikeNone(producer) ? 0 : passStringToWasm0(producer, wasm.__wbindgen_malloc_command_export, wasm.__wbindgen_realloc_command_export);
30644
30762
  var len1 = WASM_VECTOR_LEN;
30645
30763
  var ptr2 = isLikeNone(scannedPages) ? 0 : passArray32ToWasm0(scannedPages, wasm.__wbindgen_malloc_command_export);
30646
30764
  var len2 = WASM_VECTOR_LEN;
30647
- var ptr3 = isLikeNone(layoutGatedPages) ? 0 : passArray32ToWasm0(layoutGatedPages, wasm.__wbindgen_malloc_command_export);
30765
+ var ptr3 = isLikeNone(fabricatedTextPages) ? 0 : passArray32ToWasm0(fabricatedTextPages, wasm.__wbindgen_malloc_command_export);
30648
30766
  var len3 = WASM_VECTOR_LEN;
30649
- var ptr4 = isLikeNone(layoutGateReasons) ? 0 : passArrayJsValueToWasm0(layoutGateReasons, wasm.__wbindgen_malloc_command_export);
30767
+ var ptr4 = isLikeNone(implausibleTextPages) ? 0 : passArray32ToWasm0(implausibleTextPages, wasm.__wbindgen_malloc_command_export);
30650
30768
  var len4 = WASM_VECTOR_LEN;
30651
- const ret = wasm.wasmpdfmetadata_new(ptr0, len0, ptr1, len1, isLikeNone(isEncrypted) ? 0xFFFFFF : isEncrypted ? 1 : 0, !isLikeNone(width), isLikeNone(width) ? BigInt(0) : width, !isLikeNone(height), isLikeNone(height) ? BigInt(0) : height, isLikeNone(pageCount) ? Number.MAX_SAFE_INTEGER : (pageCount) >>> 0, isLikeNone(scannedConfidence) ? Number.MAX_SAFE_INTEGER : Math.fround(scannedConfidence), ptr2, len2, ptr3, len3, ptr4, len4);
30769
+ var ptr5 = isLikeNone(layoutGatedPages) ? 0 : passArray32ToWasm0(layoutGatedPages, wasm.__wbindgen_malloc_command_export);
30770
+ var len5 = WASM_VECTOR_LEN;
30771
+ var ptr6 = isLikeNone(layoutGateReasons) ? 0 : passArrayJsValueToWasm0(layoutGateReasons, wasm.__wbindgen_malloc_command_export);
30772
+ var len6 = WASM_VECTOR_LEN;
30773
+ const ret = wasm.wasmpdfmetadata_new(ptr0, len0, ptr1, len1, isLikeNone(isEncrypted) ? 0xFFFFFF : isEncrypted ? 1 : 0, !isLikeNone(width), isLikeNone(width) ? BigInt(0) : width, !isLikeNone(height), isLikeNone(height) ? BigInt(0) : height, isLikeNone(pageCount) ? Number.MAX_SAFE_INTEGER : (pageCount) >>> 0, isLikeNone(scannedConfidence) ? Number.MAX_SAFE_INTEGER : Math.fround(scannedConfidence), ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6);
30652
30774
  this.__wbg_ptr = ret;
30653
30775
  WasmPdfMetadataFinalization.register(this, this.__wbg_ptr, this);
30654
30776
  return this;
@@ -30703,12 +30825,28 @@ export class WasmPdfMetadata {
30703
30825
  }
30704
30826
  return v1;
30705
30827
  }
30828
+ /**
30829
+ * @param {Uint32Array | null} [value]
30830
+ */
30831
+ set fabricatedTextPages(value) {
30832
+ var ptr0 = isLikeNone(value) ? 0 : passArray32ToWasm0(value, wasm.__wbindgen_malloc_command_export);
30833
+ var len0 = WASM_VECTOR_LEN;
30834
+ wasm.wasmpdfmetadata_set_fabricatedTextPages(this.__wbg_ptr, ptr0, len0);
30835
+ }
30706
30836
  /**
30707
30837
  * @param {bigint | null} [value]
30708
30838
  */
30709
30839
  set height(value) {
30710
30840
  wasm.wasmpdfmetadata_set_height(this.__wbg_ptr, !isLikeNone(value), isLikeNone(value) ? BigInt(0) : value);
30711
30841
  }
30842
+ /**
30843
+ * @param {Uint32Array | null} [value]
30844
+ */
30845
+ set implausibleTextPages(value) {
30846
+ var ptr0 = isLikeNone(value) ? 0 : passArray32ToWasm0(value, wasm.__wbindgen_malloc_command_export);
30847
+ var len0 = WASM_VECTOR_LEN;
30848
+ wasm.wasmpdfmetadata_set_implausibleTextPages(this.__wbg_ptr, ptr0, len0);
30849
+ }
30712
30850
  /**
30713
30851
  * @param {boolean | null} [value]
30714
30852
  */
@@ -40449,9 +40587,10 @@ export function listEmbeddingBackends() {
40449
40587
  * # Cost
40450
40588
  *
40451
40589
  * Calling this is not free for every backend. In particular, `TesseractBackend`'s
40452
- * `supported_languages()` allocates a Tesseract API and initializes it (`init("", "eng")`) the
40453
- * first time it is called, to enumerate installed tessdata languages; subsequent calls are
40454
- * served from a cache.
40590
+ * `supported_languages()` allocates a Tesseract API and initializes it against the same
40591
+ * tessdata directory a real OCR job resolves (`resolve_tessdata_path`), the first time it
40592
+ * is called, to enumerate installed tessdata languages; subsequent calls are served from a
40593
+ * cache.
40455
40594
  *
40456
40595
  * # Errors
40457
40596
  *
@@ -41451,7 +41590,7 @@ function __wbg_get_imports() {
41451
41590
  const ret = arg0.value;
41452
41591
  return ret;
41453
41592
  },
41454
- __wbg_warn_396d6a968bb12dcf: function(arg0, arg1) {
41593
+ __wbg_warn_e0cfe89b1377d054: function(arg0, arg1) {
41455
41594
  console.warn(getStringFromWasm0(arg0, arg1));
41456
41595
  },
41457
41596
  __wbg_wasmarchiveentry_new: function(arg0) {
@@ -42015,7 +42154,7 @@ function __wbg_get_imports() {
42015
42154
  return ret;
42016
42155
  },
42017
42156
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
42018
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 678, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
42157
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 677, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
42019
42158
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h58dcb4b03347de73);
42020
42159
  return ret;
42021
42160
  },
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/pkg/web/xberg_wasm_bg.wasm
3
- size: 36487609 bytes
4
- sha256: 673faaa93ece262fba5786d6a2df8f7651e237b165409f2edb8dd69246cca4a9
3
+ size: 36543946 bytes
4
+ sha256: 03604594b98524d3ab8d2350c8335cc2bf410269bfe560e67d7f96c1fa99aa93
@@ -619,8 +619,10 @@ export const wasmclassificationlabel_new: (a: number, b: number, c: number) => n
619
619
  export const wasmclassificationlabel_set_confidence: (a: number, b: number) => void;
620
620
  export const wasmclassificationlabel_set_label: (a: number, b: number, c: number) => void;
621
621
  export const wasmconcurrencyconfig_default: () => number;
622
+ export const wasmconcurrencyconfig_maxConcurrentOcr: (a: number) => number;
622
623
  export const wasmconcurrencyconfig_maxThreads: (a: number) => number;
623
- export const wasmconcurrencyconfig_new: (a: number) => number;
624
+ export const wasmconcurrencyconfig_new: (a: number, b: number) => number;
625
+ export const wasmconcurrencyconfig_set_maxConcurrentOcr: (a: number, b: number) => void;
624
626
  export const wasmconcurrencyconfig_set_maxThreads: (a: number, b: number) => void;
625
627
  export const wasmconfidencesemantics_default: () => number;
626
628
  export const wasmconfidencesemantics_new: () => number;
@@ -1533,6 +1535,7 @@ export const wasmextractionconfig_postprocessor: (a: number) => number;
1533
1535
  export const wasmextractionconfig_qrCodes: (a: number) => number;
1534
1536
  export const wasmextractionconfig_redaction: (a: number) => number;
1535
1537
  export const wasmextractionconfig_resultFormat: (a: number) => [number, number];
1538
+ export const wasmextractionconfig_runsOcrOnEmbeddedImages: (a: number) => number;
1536
1539
  export const wasmextractionconfig_securityLimits: (a: number) => number;
1537
1540
  export const wasmextractionconfig_set_acceleration: (a: number, b: number) => void;
1538
1541
  export const wasmextractionconfig_set_applyNotebookCellTags: (a: number, b: number) => void;
@@ -1595,6 +1598,7 @@ export const wasmextractionconfig_url: (a: number) => number;
1595
1598
  export const wasmextractionconfig_useCache: (a: number) => number;
1596
1599
  export const wasmextractionconfig_useLayoutForMarkdown: (a: number) => number;
1597
1600
  export const wasmextractionconfig_validate: (a: number) => [number, number];
1601
+ export const wasmextractionconfig_wantsOwnBytesInResult: (a: number) => number;
1598
1602
  export const wasmextractionerroritem_code: (a: number) => number;
1599
1603
  export const wasmextractionerroritem_default: () => number;
1600
1604
  export const wasmextractionerroritem_errorType: (a: number) => [number, number];
@@ -2645,6 +2649,7 @@ export const wasmocrqualitythresholds_alnumWsRatioThreshold: (a: number) => numb
2645
2649
  export const wasmocrqualitythresholds_criticalFragmentedWordRatio: (a: number) => number;
2646
2650
  export const wasmocrqualitythresholds_default: () => number;
2647
2651
  export const wasmocrqualitythresholds_discardSuspectedOcrNoise: (a: number) => number;
2652
+ export const wasmocrqualitythresholds_enablePlausibilityOcrRouting: (a: number) => number;
2648
2653
  export const wasmocrqualitythresholds_enableProvenanceOcrRouting: (a: number) => number;
2649
2654
  export const wasmocrqualitythresholds_maxFragmentedWordRatio: (a: number) => number;
2650
2655
  export const wasmocrqualitythresholds_maxOcrOutputDictInvalidWordRatio: (a: number) => number;
@@ -2658,17 +2663,19 @@ export const wasmocrqualitythresholds_minMeaningfulWords: (a: number) => number;
2658
2663
  export const wasmocrqualitythresholds_minNonWhitespacePerPage: (a: number) => number;
2659
2664
  export const wasmocrqualitythresholds_minOcrMeanConfidence: (a: number) => number;
2660
2665
  export const wasmocrqualitythresholds_minProvenanceFallbackRatio: (a: number) => number;
2666
+ export const wasmocrqualitythresholds_minReliableLanguageChunkRatio: (a: number) => number;
2661
2667
  export const wasmocrqualitythresholds_minTotalNonWhitespace: (a: number) => number;
2662
2668
  export const wasmocrqualitythresholds_minUndecodableRatio: (a: number) => number;
2663
2669
  export const wasmocrqualitythresholds_minWordsForAvgLengthCheck: (a: number) => number;
2664
2670
  export const wasmocrqualitythresholds_minWordsForOcrOutputCheck: (a: number) => number;
2665
2671
  export const wasmocrqualitythresholds_minWordsForRepeatCheck: (a: number) => number;
2666
- export const wasmocrqualitythresholds_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number, k1: number) => number;
2672
+ export const wasmocrqualitythresholds_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number, k1: number, l1: number, m1: number, n1: number) => number;
2667
2673
  export const wasmocrqualitythresholds_nonTextMinChars: (a: number) => number;
2668
2674
  export const wasmocrqualitythresholds_pipelineMinQuality: (a: number) => number;
2669
2675
  export const wasmocrqualitythresholds_set_alnumWsRatioThreshold: (a: number, b: number) => void;
2670
2676
  export const wasmocrqualitythresholds_set_criticalFragmentedWordRatio: (a: number, b: number) => void;
2671
2677
  export const wasmocrqualitythresholds_set_discardSuspectedOcrNoise: (a: number, b: number) => void;
2678
+ export const wasmocrqualitythresholds_set_enablePlausibilityOcrRouting: (a: number, b: number) => void;
2672
2679
  export const wasmocrqualitythresholds_set_enableProvenanceOcrRouting: (a: number, b: number) => void;
2673
2680
  export const wasmocrqualitythresholds_set_maxFragmentedWordRatio: (a: number, b: number) => void;
2674
2681
  export const wasmocrqualitythresholds_set_maxOcrOutputDictInvalidWordRatio: (a: number, b: number) => void;
@@ -2682,6 +2689,7 @@ export const wasmocrqualitythresholds_set_minMeaningfulWords: (a: number, b: num
2682
2689
  export const wasmocrqualitythresholds_set_minNonWhitespacePerPage: (a: number, b: number) => void;
2683
2690
  export const wasmocrqualitythresholds_set_minOcrMeanConfidence: (a: number, b: number) => void;
2684
2691
  export const wasmocrqualitythresholds_set_minProvenanceFallbackRatio: (a: number, b: number) => void;
2692
+ export const wasmocrqualitythresholds_set_minReliableLanguageChunkRatio: (a: number, b: number) => void;
2685
2693
  export const wasmocrqualitythresholds_set_minTotalNonWhitespace: (a: number, b: number) => void;
2686
2694
  export const wasmocrqualitythresholds_set_minUndecodableRatio: (a: number, b: number) => void;
2687
2695
  export const wasmocrqualitythresholds_set_minWordsForAvgLengthCheck: (a: number, b: number) => void;
@@ -2989,17 +2997,21 @@ export const wasmpdfformfield_set_value: (a: number, b: number, c: number) => vo
2989
2997
  export const wasmpdfformfield_tooltip: (a: number) => [number, number];
2990
2998
  export const wasmpdfformfield_value: (a: number) => [number, number];
2991
2999
  export const wasmpdfmetadata_default: () => number;
3000
+ export const wasmpdfmetadata_fabricatedTextPages: (a: number) => [number, number];
2992
3001
  export const wasmpdfmetadata_height: (a: number) => [number, bigint];
3002
+ export const wasmpdfmetadata_implausibleTextPages: (a: number) => [number, number];
2993
3003
  export const wasmpdfmetadata_isEncrypted: (a: number) => number;
2994
3004
  export const wasmpdfmetadata_layoutGateReasons: (a: number) => [number, number];
2995
3005
  export const wasmpdfmetadata_layoutGatedPages: (a: number) => [number, number];
2996
- export const wasmpdfmetadata_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: bigint, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number) => number;
3006
+ export const wasmpdfmetadata_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: bigint, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number) => number;
2997
3007
  export const wasmpdfmetadata_pageCount: (a: number) => number;
2998
3008
  export const wasmpdfmetadata_pdfVersion: (a: number) => [number, number];
2999
3009
  export const wasmpdfmetadata_producer: (a: number) => [number, number];
3000
3010
  export const wasmpdfmetadata_scannedConfidence: (a: number) => number;
3001
3011
  export const wasmpdfmetadata_scannedPages: (a: number) => [number, number];
3012
+ export const wasmpdfmetadata_set_fabricatedTextPages: (a: number, b: number, c: number) => void;
3002
3013
  export const wasmpdfmetadata_set_height: (a: number, b: number, c: bigint) => void;
3014
+ export const wasmpdfmetadata_set_implausibleTextPages: (a: number, b: number, c: number) => void;
3003
3015
  export const wasmpdfmetadata_set_isEncrypted: (a: number, b: number) => void;
3004
3016
  export const wasmpdfmetadata_set_layoutGateReasons: (a: number, b: number, c: number) => void;
3005
3017
  export const wasmpdfmetadata_set_layoutGatedPages: (a: number, b: number, c: number) => void;
@@ -3451,6 +3463,10 @@ export const wasmsparseembeddingpreset_maxLength: (a: number) => number;
3451
3463
  export const wasmsparseembeddingpreset_modelFile: (a: number) => [number, number];
3452
3464
  export const wasmsparseembeddingpreset_modelRepo: (a: number) => [number, number];
3453
3465
  export const wasmsparseembeddingpreset_name: (a: number) => [number, number];
3466
+ export const wasmsparseembeddingpreset_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => number;
3467
+ export const wasmsparseembeddingpreset_set_additionalFiles: (a: number, b: number, c: number) => void;
3468
+ export const wasmsparseembeddingpreset_set_description: (a: number, b: number, c: number) => void;
3469
+ export const wasmsparseembeddingpreset_set_maxLength: (a: number, b: number) => void;
3454
3470
  export const qcms_profile_precache_output_transform: (a: number) => void;
3455
3471
  export const lut_inverse_interp16: (a: number, b: number, c: number) => number;
3456
3472
  export const lut_interp_linear16: (a: number, b: number, c: number) => number;
@@ -3463,13 +3479,9 @@ export const qcms_transform_data_rgba_out_lut_precache: (a: number, b: number, c
3463
3479
  export const qcms_transform_data_bgra_out_lut_precache: (a: number, b: number, c: number, d: number) => void;
3464
3480
  export const qcms_profile_is_bogus: (a: number) => number;
3465
3481
  export const qcms_transform_release: (a: number) => void;
3466
- export const wasmsparseembeddingpreset_new: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => number;
3467
- export const wasmsparseembeddingpreset_set_additionalFiles: (a: number, b: number, c: number) => void;
3468
- export const __cxa_atexit: (a: number, b: number, c: number) => number;
3469
- export const wasmsparseembeddingpreset_set_description: (a: number, b: number, c: number) => void;
3470
- export const wasmsparseembeddingpreset_set_maxLength: (a: number, b: number) => void;
3471
3482
  export const wasmsparseembeddingpreset_set_modelFile: (a: number, b: number, c: number) => void;
3472
3483
  export const wasmsparseembeddingpreset_set_modelRepo: (a: number, b: number, c: number) => void;
3484
+ export const __cxa_atexit: (a: number, b: number, c: number) => number;
3473
3485
  export const wasmsparseembeddingpreset_set_name: (a: number, b: number, c: number) => void;
3474
3486
  export const wasmssrfpolicy_allowlist: (a: number) => any;
3475
3487
  export const wasmssrfpolicy_default: () => number;