albex 0.6.0 → 0.7.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 (58) hide show
  1. package/CHANGELOG.md +223 -0
  2. package/README.md +84 -30
  3. package/dist/_generated/inline-wasm.d.ts +2 -0
  4. package/dist/_generated/inline-wasm.d.ts.map +1 -0
  5. package/dist/_generated/inline-wasm.js +9 -0
  6. package/dist/_generated/inline-wasm.js.map +1 -0
  7. package/dist/albex-worker.d.ts +65 -2
  8. package/dist/albex-worker.d.ts.map +1 -1
  9. package/dist/albex-worker.js +98 -21
  10. package/dist/albex-worker.js.map +1 -1
  11. package/dist/albex.d.ts +250 -42
  12. package/dist/albex.d.ts.map +1 -1
  13. package/dist/albex.js +492 -120
  14. package/dist/albex.js.map +1 -1
  15. package/dist/errors.d.ts +35 -4
  16. package/dist/errors.d.ts.map +1 -1
  17. package/dist/errors.js +38 -3
  18. package/dist/errors.js.map +1 -1
  19. package/dist/index.d.ts +47 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +82 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/inline.d.ts +10 -0
  24. package/dist/inline.d.ts.map +1 -0
  25. package/dist/inline.js +17 -0
  26. package/dist/inline.js.map +1 -0
  27. package/dist/persistence.js +2 -2
  28. package/dist/pool/coordinator.d.ts +14 -6
  29. package/dist/pool/coordinator.d.ts.map +1 -1
  30. package/dist/pool/coordinator.js +65 -28
  31. package/dist/pool/coordinator.js.map +1 -1
  32. package/dist/profile.js +2 -2
  33. package/dist/resource-manager.js +2 -2
  34. package/dist/tiered-store.js +2 -2
  35. package/dist/wasm-bindings.d.ts +50 -1
  36. package/dist/wasm-bindings.d.ts.map +1 -1
  37. package/dist/wasm-bindings.js +20 -12
  38. package/dist/wasm-bindings.js.map +1 -1
  39. package/dist/worker-protocol.d.ts +23 -2
  40. package/dist/worker-protocol.d.ts.map +1 -1
  41. package/dist/worker-protocol.js +2 -2
  42. package/dist/worker-runtime.js +17 -2
  43. package/dist/worker-runtime.js.map +1 -1
  44. package/package.json +14 -9
  45. package/src/_generated/inline-wasm.ts +9 -0
  46. package/src/albex-worker.ts +103 -18
  47. package/src/albex.ts +3053 -2524
  48. package/src/errors.ts +49 -4
  49. package/src/index.ts +81 -0
  50. package/src/inline.ts +9 -0
  51. package/src/pool/coordinator.ts +61 -34
  52. package/src/wasm-bindings.ts +78 -12
  53. package/src/worker-protocol.ts +12 -2
  54. package/src/worker-runtime.ts +16 -1
  55. package/wasm/pkg/albex_pdf.wasm +0 -0
  56. package/wasm/pkg/albex_wasm.wasm +0 -0
  57. package/wasm/pkg/albex_wasm_bg.wasm +0 -0
  58. package/wasm/pkg/albex_wasm_simd.wasm +0 -0
package/dist/albex.d.ts CHANGED
@@ -13,7 +13,6 @@
13
13
  * const results = engine.search('contrato marco');
14
14
  * ```
15
15
  */
16
- import { type Tier } from './profile.js';
17
16
  export { AlbexError, AlbexInitError, AlbexUnsupportedFormatError, AlbexParseError, AlbexCapacityError, } from './errors.js';
18
17
  export { listPersisted, deletePersisted } from './persistence.js';
19
18
  export { detectProfile, pickTier, pickWorkerCount, shouldUseGpu } from './profile.js';
@@ -25,29 +24,80 @@ export type { AlbexPoolOptions } from './pool/coordinator.js';
25
24
  export { BloomGpu, packBloomsFromChunks } from './gpu/bloom-runtime.js';
26
25
  export { TieredStore } from './tiered-store.js';
27
26
  export type { TieredStoreOptions } from './tiered-store.js';
27
+ /**
28
+ * Explicit engine capacity configuration. All fields optional — anything
29
+ * missing is completed from the std defaults, scaled to keep the std
30
+ * ratios when a related field IS provided (documented per field).
31
+ *
32
+ * Estimated WASM memory ≈ `maxChunks × 64 B` (32 B descriptor + 32 B
33
+ * trigram signature) `+ textPoolBytes + namePoolBytes + maxDocs × 28 B`,
34
+ * on top of the engine's fixed ~80 KB of scratch buffers. The std preset
35
+ * is ~22 MB; `'large'` is ~180 MB. WASM linear memory never shrinks: the
36
+ * high-water mark of the largest capacity ever initialised in a given
37
+ * engine stays committed until the engine is disposed.
38
+ */
39
+ export interface AlbexCapacityConfig {
40
+ /** Maximum number of live documents. Default 128. Range 1–65 536. */
41
+ maxDocs?: number;
42
+ /** Maximum number of indexed chunks (≈ paragraphs; long paragraphs split
43
+ * every 512 bytes). Default `max(maxDocs × 782, 1024)` — the std ratio
44
+ * (100 000 chunks / 128 docs). Range maxDocs–4 194 304. */
45
+ maxChunks?: number;
46
+ /** Text pool size in bytes (total UTF-8 text the index can hold).
47
+ * Default `max(maxChunks × 168, 64 KiB)` — the std ratio (16 MiB /
48
+ * 100 000 chunks). Range 4 KiB–1 GiB. */
49
+ textPoolBytes?: number;
50
+ /** Filename pool size in bytes. Default `max(maxDocs × 256, 4 KiB)` —
51
+ * the std ratio (32 KiB / 128 docs). Range 256 B–16 MiB. */
52
+ namePoolBytes?: number;
53
+ }
54
+ /**
55
+ * Engine capacity (decision A16 — runtime capacity, single binary):
56
+ * `'std'` — 128 docs · 100k chunks · 16 MB text · 32 KB names (~22 MB).
57
+ * The default, identical to every previous release.
58
+ * `'large'` — 1 024 docs · 800k chunks · 128 MB text · 256 KB names
59
+ * (~180 MB) — the old compile-time "pro" tier.
60
+ * object — explicit {@link AlbexCapacityConfig}.
61
+ */
62
+ export type AlbexCapacity = 'std' | 'large' | AlbexCapacityConfig;
28
63
  export interface AlbexOptions {
29
64
  /**
30
- * Explicit URL to the main WASM binary.
31
- *
32
- * If you want automatic tier selection (mini/std/pro chosen from
33
- * `deviceMemory`), pass `wasmBaseUrl` instead — the engine will fetch
34
- * `albex_wasm_<tier>.wasm` from that directory.
65
+ * Explicit URL to the main WASM binary. If omitted, the baseline (or
66
+ * SIMD, when supported) binary packaged with albex is used.
35
67
  */
36
68
  wasmUrl?: string;
37
69
  /**
38
- * Base directory containing tiered binaries (`albex_wasm_mini.wasm`,
39
- * `_std.wasm`, `_pro.wasm`). Used when `wasmUrl` is omitted.
70
+ * Base directory containing the two binaries (`albex_wasm.wasm`,
71
+ * `albex_wasm_simd.wasm`). Used when `wasmUrl` is omitted.
40
72
  */
41
73
  wasmBaseUrl?: string;
42
74
  /** URL to albex_pdf.wasm. Required only if you call indexFile() with PDFs. */
43
75
  pdfWasmUrl?: string;
44
76
  /**
45
- * Override the tier auto-detection. Pass `'auto'` (default), or an
46
- * explicit tier when you know the constraints of your target environment.
77
+ * Raw bytes of the main core WASM. When present, Albex instantiates from
78
+ * these directly and does NO network fetch `wasmUrl`, `wasmBaseUrl` and
79
+ * SIMD auto-selection are all ignored. This is the escape hatch for
80
+ * bundlers that don't rewrite `new URL('…wasm', import.meta.url)` (esbuild,
81
+ * many Angular and Webpack setups): import the `.wasm` as an asset through
82
+ * your own bundler and hand the bytes here. The `albex/inline` entry point
83
+ * sets this automatically with an embedded baseline core — true zero-config.
84
+ */
85
+ wasmBytes?: BufferSource;
86
+ /**
87
+ * Raw bytes of `albex_pdf.wasm`. Same rationale as {@link wasmBytes}; only
88
+ * needed if you index PDFs AND your bundler can't serve the binary. When
89
+ * present, the PDF module is compiled from these instead of fetched.
47
90
  */
48
- /** @deprecated Removed in 0.5.0. Albex no longer has capacity tiers;
49
- * pass `'auto'` or omit. Other values are accepted and ignored. */
50
- tier?: 'auto' | 'mini' | 'std' | 'pro';
91
+ pdfWasmBytes?: BufferSource;
92
+ /**
93
+ * Engine capacity. `'std'` (default) keeps the historical limits;
94
+ * `'large'` raises them to 1 024 docs / 800k chunks / 128 MB text; an
95
+ * object configures each pool explicitly (see {@link AlbexCapacityConfig}
96
+ * for defaults, ranges and the memory cost model). Replaces the removed
97
+ * compile-time `tier` option — capacity is now a runtime parameter of a
98
+ * single binary (`initWithCapacity`, ABI 7).
99
+ */
100
+ capacity?: AlbexCapacity;
51
101
  /**
52
102
  * SIMD selection. When `'auto'` (default), Albex probes for v128 support
53
103
  * and fetches the `_simd.wasm` variant when available. Pass `'off'` to
@@ -68,6 +118,16 @@ export interface AlbexOptions {
68
118
  * the upload + dispatch overhead is bigger than the speedup. Default: 20_000.
69
119
  */
70
120
  gpuThreshold?: number;
121
+ /**
122
+ * Maximum size (in bytes) of a file accepted by `indexFile`. Checked
123
+ * against `File.size` BEFORE the file is read, so an oversized input is
124
+ * rejected with a typed `AlbexCapacityError` (`limit: 'file'`) without
125
+ * ever being buffered or hashed. Default: 256 MiB — above any default
126
+ * text pool (16 MB std / 128 MB large), so this only stops pathological
127
+ * inputs (e.g. a 2 GB log file) from exhausting tab memory. Raise it if
128
+ * you configure a custom `capacity` with a text pool beyond 256 MiB.
129
+ */
130
+ maxFileBytes?: number;
71
131
  }
72
132
  export interface IndexedDocument {
73
133
  name: string;
@@ -80,27 +140,77 @@ export interface IndexedDocument {
80
140
  /** 64-bit FNV-1a hex of the source file bytes. Stable across runs. */
81
141
  contentHash: string;
82
142
  }
143
+ /**
144
+ * One authoritative chunk of an indexed document — the exact unit Albex
145
+ * indexed and searches over. Returned by {@link AlbexEngine.listChunks} so a
146
+ * host can mirror Albex's chunking (e.g. to build a parallel vector index over
147
+ * the same units). A long paragraph is split into several ≤512-byte chunks that
148
+ * share a `location` but differ in `sub`.
149
+ */
150
+ export interface AuthoritativeChunk {
151
+ /** WASM-side stable document id (survives compact()). */
152
+ docId: number;
153
+ /** Paragraph index (DOCX/TXT) or page number (PDF, 1-based). */
154
+ location: number;
155
+ /** Ordinal of this chunk within its document (0-based, compact()-stable). */
156
+ ord: number;
157
+ /** Ordinal of this chunk within its `location` group (0-based, informational). */
158
+ sub: number;
159
+ /** The exact UTF-8 text Albex indexed for this chunk. */
160
+ text: string;
161
+ /** Byte length of `text`. */
162
+ byteLen: number;
163
+ /**
164
+ * Canonical shared id `"<docId>::<ord>"`. Identical to the matching
165
+ * {@link SearchResult.chunkId}, and stable across compact() and snapshot
166
+ * save/load — so it is safe to persist alongside parallel structures
167
+ * (unlike the absolute chunk index, which compact() renumbers).
168
+ */
169
+ id: string;
170
+ }
83
171
  export interface MatchSpan {
84
- /** Byte offset within `snippet` where this matched token begins. */
172
+ /** UTF-8 **byte** offset within `snippet` where this matched token begins.
173
+ * NOT a JS string index — for `snippet.slice()` use the UTF-16
174
+ * {@link SearchResult.snippetStart}/{@link SearchResult.snippetEnd} of the
175
+ * primary span instead. */
85
176
  start: number;
86
- /** Byte offset within `snippet` where this matched token ends (exclusive). */
177
+ /** UTF-8 **byte** offset within `snippet` where this matched token ends
178
+ * (exclusive). See the note on `start`. */
87
179
  end: number;
88
180
  }
89
181
  export interface SearchResult {
90
182
  documentName: string;
183
+ /** WASM-side stable document id (survives compact()). Matches
184
+ * `AuthoritativeChunk.docId` from {@link AlbexEngine.listChunks}. */
185
+ docId: number;
91
186
  /** Paragraph index (DOCX/TXT) or page number (PDF, 1-based). */
92
187
  location: number;
188
+ /** Canonical chunk id `"<docId>::<ord>"` — identical to the matching
189
+ * {@link AuthoritativeChunk.id}, so a host can fuse search hits with a
190
+ * parallel index (e.g. embeddings) on this key. Stable across compact(). */
191
+ chunkId: string;
93
192
  /** Relevance score 0–1000. */
94
193
  score: number;
95
194
  /** Snippet text. With `windowed` search options this is a substring with
96
195
  * ASCII ellipsis sentinels (`"... "` / `" ..."`) the UI should render
97
196
  * as `…`. Without windowing, the full chunk text. */
98
197
  snippet: string;
99
- /** Primary token match (kept for backwards compatibility). Equal to `matches[0]`. */
198
+ /** Primary token match as UTF-8 **byte** offsets within the encoded
199
+ * snippet (kept for backwards compatibility; equal to `matches[0]`).
200
+ * Byte offsets drift from JS string indices as soon as the snippet
201
+ * contains accents/ñ/emoji — use {@link snippetStart}/{@link snippetEnd}
202
+ * for `snippet.slice()` / UI highlighting. */
100
203
  matchStart: number;
101
204
  matchEnd: number;
102
- /** All matched token spans within `snippet`, in query order. Length 1–4. */
205
+ /** All matched token spans within `snippet` as UTF-8 **byte** offsets,
206
+ * in query order. Length 1–4. */
103
207
  matches: MatchSpan[];
208
+ /** Primary token match start as a UTF-16 code-unit index into `snippet` —
209
+ * safe to pass directly to `snippet.slice(snippetStart, snippetEnd)`. */
210
+ snippetStart: number;
211
+ /** Primary token match end (exclusive) as a UTF-16 code-unit index into
212
+ * `snippet`. */
213
+ snippetEnd: number;
104
214
  }
105
215
  /**
106
216
  * Options that change how snippets are produced. Both fields are optional.
@@ -127,15 +237,17 @@ export interface SearchOptions {
127
237
  export interface EngineStats {
128
238
  documents: number;
129
239
  chunks: number;
240
+ /** Bytes of indexed text currently in the text pool. */
130
241
  textUsed: number;
242
+ /** RUNTIME text pool capacity in bytes (= resolved `textPoolBytes`). */
131
243
  textCapacity: number;
132
244
  wasmMemoryBytes: number;
133
- /** Tier loaded at init time (mini/std/pro). */
134
- tier: Tier | null;
135
- /** Compile-time chunk capacity for the loaded tier. */
245
+ /** RUNTIME chunk capacity the engine was initialised with. */
136
246
  maxChunks: number;
137
- /** Compile-time document capacity for the loaded tier. */
247
+ /** RUNTIME document capacity the engine was initialised with. */
138
248
  maxDocs: number;
249
+ /** RUNTIME filename pool capacity in bytes. */
250
+ namePoolBytes: number;
139
251
  }
140
252
  export interface SearchStats {
141
253
  query: string;
@@ -144,6 +256,14 @@ export interface SearchStats {
144
256
  bloomTested: number;
145
257
  bloomPassed: number;
146
258
  bitapMatched: number;
259
+ /** True if the query had more than 8 OR branches — the extras were
260
+ * discarded and did not contribute results. */
261
+ truncatedBranches?: boolean;
262
+ /** True if tokens were dropped (more than 4 per branch) or clipped
263
+ * (longer than 64 bytes). */
264
+ truncatedTokens?: boolean;
265
+ /** True if the raw query exceeded 1024 bytes and was cut. */
266
+ truncatedQuery?: boolean;
147
267
  }
148
268
  /**
149
269
  * One structured warning recorded by the engine during indexFile or
@@ -232,22 +352,34 @@ export declare class AlbexEngine {
232
352
  private _pdfMem;
233
353
  private _docs;
234
354
  private _lastSearch;
355
+ /** Raw truncation bitflags from the most recent prepareQuery (ABI 5):
356
+ * 1 = branches dropped, 2 = tokens dropped/clipped, 4 = query bytes cut.
357
+ * Captured right after prepareQuery so every _lastSearch built for that
358
+ * query (including per-branch OR runs) reports the same flags. */
359
+ private _lastTruncFlags;
235
360
  /** Structured diagnostics collected during the most recent operation.
236
361
  * Drained by `takeDiagnostics()`. Capped at 256 entries to avoid
237
362
  * unbounded memory growth in pathological cases (very corrupted
238
363
  * corpora producing thousands of recovery warnings). */
239
364
  private _diagnostics;
240
- private _tier;
365
+ /** Resolved runtime capacity (set in init(); reused by reset()). */
366
+ private _capacity;
241
367
  private _simd;
242
368
  private _profile;
243
369
  private _resources;
244
370
  private _gpu;
245
- private _gpuChunkCountUploaded;
371
+ /** True when the GPU-resident Bloom array no longer mirrors the WASM
372
+ * chunk array. Set by EVERY index mutation (indexFile, removeDocument,
373
+ * compact, reset, load) and cleared after a successful upload. A plain
374
+ * chunk-count comparison is NOT enough: compact() can reorder blooms
375
+ * while keeping the count identical, which would silently filter the
376
+ * wrong chunks (audit 1.5). */
377
+ private _gpuUploadDirty;
246
378
  private _unsubscribeResources;
247
379
  private readonly _opts;
248
380
  private _opChain;
249
381
  private _busy;
250
- constructor(opts: AlbexOptions);
382
+ constructor(opts?: AlbexOptions);
251
383
  /** Serialize an async engine operation behind any in-flight one. */
252
384
  private _exclusive;
253
385
  /** Guard a synchronous mutator/search: refuse to run mid-async-operation
@@ -256,30 +388,55 @@ export declare class AlbexEngine {
256
388
  /** Compact opportunistically when tombstones pile up under text pressure,
257
389
  * so repeated removeDocument/replaceDocument don't exhaust the pool. */
258
390
  private _autoCompactIfNeeded;
259
- /** Load and initialise the main WASM module. Must be called before any other method. */
391
+ /**
392
+ * Load and initialise the main WASM module. Must be called before any
393
+ * other method.
394
+ *
395
+ * Resolves `opts.capacity` ('std' default · 'large' · explicit object)
396
+ * and sizes the WASM pools accordingly via `initWithCapacity` (ABI 7).
397
+ * Memory cost ≈ `maxChunks × 64 B + textPoolBytes + namePoolBytes` —
398
+ * ~22 MB for 'std', ~180 MB for 'large'. Throws `AlbexInitError` if the
399
+ * requested capacity is out of range or the allocation fails.
400
+ */
260
401
  init(): Promise<void>;
261
402
  /**
262
- * Decide which `.wasm` binary to fetch. Order of precedence:
263
- * 1. `opts.wasmUrl` if provided used verbatim.
264
- * 2. `opts.tier` if explicit joined with `wasmBaseUrl`.
265
- * 3. `opts.wasmBaseUrl` + tier picked from the device profile.
403
+ * Instantiate the main core WASM. Two sources, in order of precedence:
404
+ * 1. `opts.wasmBytes` caller-provided bytes; NO network access. The
405
+ * `albex/inline` entry uses this with the embedded baseline core, and
406
+ * integrators on bundlers that don't rewrite `new URL(…, import.meta.
407
+ * url)` (esbuild / Angular / some Webpack) can import the `.wasm` as an
408
+ * asset and pass the bytes here.
409
+ * 2. a URL from `_resolveWasmUrl` (`wasmUrl` / `wasmBaseUrl` / the
410
+ * bundler-friendly default).
266
411
  *
267
- * Order of precedence:
412
+ * The URL path prefers `instantiateStreaming` and falls back to
413
+ * `instantiate(arrayBuffer)` when the host serves the `.wasm` with the
414
+ * wrong MIME type — a common esbuild / static-server pitfall that
415
+ * otherwise rejects with an opaque "Incorrect response MIME type". A 404
416
+ * or a network error is rethrown as an `AlbexInitError` whose message
417
+ * points at the concrete fixes (inline entry / `wasmBytes` / `wasmUrl`).
418
+ */
419
+ private _instantiateMainWasm;
420
+ /** Build the actionable "couldn't load the core" message shared by every
421
+ * main-WASM load failure. The default `albex` entry embeds the core, so a
422
+ * fetch only runs when the caller explicitly set `wasmUrl`/`wasmBaseUrl` —
423
+ * the message leads with the one-line exit (drop the option). */
424
+ private _wasmLoadHelp;
425
+ /**
426
+ * Decide which `.wasm` binary to fetch. Order of precedence:
268
427
  * 1. `opts.wasmUrl` literal → use verbatim
269
- * 2. `opts.wasmBaseUrl` + tier suffix → fetched from that directory
428
+ * 2. `opts.wasmBaseUrl` + simd suffix → fetched from that directory
270
429
  * 3. zero-config default → `albex_wasm_bg.wasm` packaged
271
430
  * next to this file, resolved
272
431
  * via `import.meta.url`
273
432
  *
274
- * The zero-config default loads the std-baseline binary. Tier auto-detection
275
- * is only active when `wasmBaseUrl` is given, because picking a tier in
276
- * runtime would defeat any bundler's static asset rewriting. Users who want
277
- * tier optimisation must serve the six variants themselves and pass the
278
- * directory through `wasmBaseUrl`.
433
+ * There are exactly two main binaries (baseline + SIMD); capacity is a
434
+ * RUNTIME parameter since ABI 7, so it never affects which file is
435
+ * fetched. SIMD auto-detection is only active when `wasmBaseUrl` is
436
+ * given, because picking a URL at runtime would defeat any bundler's
437
+ * static asset rewriting.
279
438
  */
280
439
  private _resolveWasmUrl;
281
- /** The tier that was actually loaded. `null` until `init()` resolves. */
282
- get tier(): Tier | null;
283
440
  /** True if the SIMD-accelerated binary was loaded. */
284
441
  get simdEnabled(): boolean;
285
442
  /** True if a WebGPU device is acquired and the next search will use it. */
@@ -302,12 +459,23 @@ export declare class AlbexEngine {
302
459
  * No-op if the GPU device hasn't been acquired yet — first call attempts
303
460
  * `init()` lazily; if that fails, the candidate path is permanently
304
461
  * disabled for this engine instance.
462
+ *
463
+ * IMPORTANT: this method CLOBBERS the scratchpad (the candidate bitset
464
+ * is pushed through it via `setCandidateMask`). Any pattern previously
465
+ * staged by `selectQueryBranch` is destroyed — the caller MUST re-select
466
+ * the active branch before calling `searchBegin`, which snapshots the
467
+ * pattern from the scratchpad (audit 1.2).
305
468
  */
306
469
  private _gpuPreFilter;
307
470
  private _u8;
308
471
  private _writePad;
309
472
  private _writeStr;
310
473
  private _readPad;
474
+ /** Copy `n` scratchpad bytes out of WASM memory. The copy is private to
475
+ * JS, so it survives later WASM calls (and memory growth) — used when the
476
+ * caller needs both the raw bytes (UTF-16 span mapping) and the decoded
477
+ * string of the same payload. */
478
+ private _readPadBytes;
311
479
  private _feedText;
312
480
  /**
313
481
  * Compute the FNV-1a 64-bit content hash of `bytes` via the WASM
@@ -320,6 +488,11 @@ export declare class AlbexEngine {
320
488
  private _contentHash;
321
489
  private _feedXmlBytes;
322
490
  private _ensurePdfWasm;
491
+ /** Fetch + compile the PDF module from a URL. Split out of
492
+ * `_ensurePdfWasm` so the `pdfWasmBytes` (no-network) path stays trivial.
493
+ * Falls back to a buffered compile when the host serves the binary with
494
+ * the wrong MIME type (same pitfall as the core loader). */
495
+ private _fetchPdfModule;
323
496
  private _indexDocx;
324
497
  private _indexXlsx;
325
498
  private _indexPdf;
@@ -404,7 +577,9 @@ export declare class AlbexEngine {
404
577
  private _indexRtf;
405
578
  private static readonly _INDEXERS;
406
579
  /**
407
- * Index a file. Supported formats: DOCX, XLSX, PDF, TXT, XML.
580
+ * Index a file. Supported formats (11, with varying depth): DOCX, XLSX, PDF,
581
+ * HTML, MD, JSON, CSV, EML, RTF, TXT, XML. Several are deliberately "lite"
582
+ * (CSV is RFC-4180-lite, EML is MIME-lite, RTF is regex-stripped).
408
583
  * Throws for unsupported formats or parse errors.
409
584
  */
410
585
  indexFile(file: File): Promise<IndexedDocument>;
@@ -432,6 +607,21 @@ export declare class AlbexEngine {
432
607
  * references (e.g. in a UI) remain valid.
433
608
  */
434
609
  compact(): void;
610
+ /**
611
+ * Enumerate the authoritative chunks Albex indexed for a document, in order.
612
+ * Lets a host mirror Albex's exact chunking — e.g. embed the same units for a
613
+ * parallel semantic index keyed on the same {@link AuthoritativeChunk.id}
614
+ * (`"<docId>::<ord>"`, identical to {@link SearchResult.chunkId}). `docId` is
615
+ * `IndexedDocument.docId` from {@link indexFile}; returns `[]` if no live
616
+ * document has that id.
617
+ *
618
+ * The returned `id`/`ord`/`sub` are stable across {@link compact} and
619
+ * snapshot save/load. Never key persistent structures on a search result's
620
+ * absolute `chunkIdx`, which {@link compact} renumbers.
621
+ */
622
+ listChunks(docId: number): AuthoritativeChunk[];
623
+ /** Doc-table slot (0..getDocCount) whose stable id is `docId`, or -1. */
624
+ private _docSlotOf;
435
625
  /**
436
626
  * Search the index. Supports:
437
627
  * - Simple queries: `contrato` (AND of tokens, accent-insensitive)
@@ -440,6 +630,11 @@ export declare class AlbexEngine {
440
630
  *
441
631
  * Pass `{ windowed: true }` to receive cropped snippets with ASCII ellipsis
442
632
  * markers instead of full chunk text. Defaults: 60 bytes before, 120 after.
633
+ *
634
+ * Note: this synchronous path never uses the GPU pre-filter — the WebGPU
635
+ * scan is asynchronous by nature. Only `searchCooperative` (the budgeted
636
+ * path) engages the GPU; `search()` always runs the CPU Bloom pre-filter,
637
+ * regardless of the `gpu` option.
443
638
  */
444
639
  search(query: string, opts?: SearchOptions): SearchResult[];
445
640
  /** Read the WASM-compiled tokens of branch `i` for phrase post-filter.
@@ -481,12 +676,24 @@ export declare class AlbexEngine {
481
676
  * may eat the entire budget, which is also fine.
482
677
  */
483
678
  private _runSearchBudgeted;
679
+ /** Truncation booleans for SearchStats, decoded from the flags the WASM
680
+ * reported for the most recent prepareQuery (audit 1.6 — the engine used
681
+ * to drop OR branches past 8 and tokens past 4 in silence). */
682
+ private _truncStats;
484
683
  /** Materialise results [0..count) into the public SearchResult shape.
485
684
  * When `phraseTokens` is given, each result is kept only if those tokens
486
685
  * appear adjacently in the FULL chunk text — independent of any display
487
- * windowing — so phrase queries stay correct under `{ windowed: true }`. */
686
+ * windowing — so phrase queries stay correct under `{ windowed: true }`.
687
+ *
688
+ * Frontier discipline (audit 2.1): all numeric fields of every result are
689
+ * read in ONE DataView pass over the `#[repr(C)]` RESULTS array
690
+ * (`getResultsPtr`/`getResultStride`, ABI 6) — the old path made 12-15
691
+ * frontier calls per result. Strings still need calls, minimised to one
692
+ * snippet read per result plus one doc-name read per DISTINCT document
693
+ * (the old `getResultDocName` was additionally O(doc_count) inside WASM
694
+ * for every single result). */
488
695
  private _collectResults;
489
- /** Run all OR branches and merge dedup-by-(doc, location, match). The
696
+ /** Run all OR branches and merge dedup-by-(chunkId, matchStart). The
490
697
  * branches are already compiled inside the WASM (by prepareQuery); we
491
698
  * iterate them with selectQueryBranch. The "rawQuery" param is kept
492
699
  * only for the lastSearch.query field. */
@@ -495,7 +702,8 @@ export declare class AlbexEngine {
495
702
  * active (set via selectQueryBranch). Returns the materialised
496
703
  * SearchResult[]. Caller is responsible for activating a branch first. */
497
704
  private _runSearch;
498
- /** Returns current engine statistics. */
705
+ /** Returns current engine statistics (capacities are the RUNTIME values
706
+ * the engine was initialised with via the `capacity` option). */
499
707
  getStats(): EngineStats;
500
708
  /** Returns stats from the most recent search, or null. */
501
709
  getLastSearchStats(): SearchStats | null;
@@ -1 +1 @@
1
- {"version":3,"file":"albex.d.ts","sourceRoot":"","sources":["../src/albex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAsBH,OAAO,EAA+B,KAAK,IAAI,EAAsB,MAAM,cAAc,CAAC;AAI1F,OAAO,EACL,UAAU,EACV,cAAc,EACd,2BAA2B,EAC3B,eAAe,EACf,kBAAkB,GACnB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACtF,YAAY,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAwB5D,MAAM,WAAW,YAAY;IAC3B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8EAA8E;IAC9E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH;uEACmE;IACnE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;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