hermes-wasm 1.8.27 → 1.8.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,236 @@
1
+ # hermes-wasm
2
+
3
+ WebAssembly bindings for the [Hermes](https://github.com/SpaceFrontiers/hermes) search engine. Run a full-text search engine entirely in the browser — including indexing, BM25 ranking, and document storage.
4
+
5
+ ## Features
6
+
7
+ - **Local indexing** — create indexes, add documents, commit, and search entirely in WASM
8
+ - **IndexedDB persistence** — indexes survive page refreshes via per-file IDB records
9
+ - **Remote search** — load pre-built indexes over HTTP with slice caching
10
+ - **IPFS support** — load indexes from IPFS via JavaScript fetch callbacks
11
+ - **15+ language stemmers** — English, German, French, Spanish, Russian, Arabic, and more
12
+ - **Query language** — `field:term`, `AND`, `OR`, `NOT`, grouping with parentheses
13
+ - **~3 MB** WASM binary (gzipped ~1.2 MB)
14
+
15
+ ## Quick Start
16
+
17
+ ```bash
18
+ npm install hermes-wasm
19
+ ```
20
+
21
+ ### In-Memory Index
22
+
23
+ ```js
24
+ import init, { LocalIndex } from "hermes-wasm";
25
+
26
+ await init();
27
+
28
+ // Define schema using SDL
29
+ const index = await LocalIndex.create(`
30
+ index articles {
31
+ field title: text<en_stem> [indexed, stored]
32
+ field body: text<en_stem> [indexed, stored]
33
+ field views: u64 [indexed, stored]
34
+ }
35
+ `);
36
+
37
+ // Add documents
38
+ await index.addDocuments([
39
+ {
40
+ title: "Rust Programming",
41
+ body: "Rust is a systems language.",
42
+ views: 1500,
43
+ },
44
+ { title: "Search Engines", body: "BM25 is a ranking function.", views: 800 },
45
+ ]);
46
+
47
+ // Commit (builds the segment)
48
+ await index.commit();
49
+
50
+ // Search
51
+ const results = await index.search("rust", 10);
52
+ // { hits: [{ address: { segment_id, doc_id }, score }], total_hits: 1 }
53
+
54
+ // Get document
55
+ const doc = await index.getDocument(
56
+ results.hits[0].address.segment_id,
57
+ results.hits[0].address.doc_id,
58
+ );
59
+ // { title: "Rust Programming", body: "Rust is a systems language.", views: 1500 }
60
+ ```
61
+
62
+ ### Persistent Index (IndexedDB)
63
+
64
+ ```js
65
+ // Create — auto-saves changed files to IDB on each commit
66
+ const index = await LocalIndex.createPersistent("my-index", schema);
67
+ await index.addDocuments(docs);
68
+ await index.commit(); // only new segment files written to IDB
69
+
70
+ // Later, on page reload:
71
+ const index = await LocalIndex.open("my-index");
72
+ const results = await index.search("rust", 10); // works immediately
73
+
74
+ // Management
75
+ await LocalIndex.exists("my-index"); // true
76
+ await LocalIndex.deleteIndex("my-index");
77
+ ```
78
+
79
+ ### Remote Index (HTTP)
80
+
81
+ ```js
82
+ import init, { RemoteIndex } from "hermes-wasm";
83
+
84
+ await init();
85
+
86
+ const index = new RemoteIndex("https://example.com/my-index/");
87
+ await index.load_with_idb_cache(); // loads with IndexedDB cache for fast reload
88
+
89
+ const results = await index.search("query", 10);
90
+
91
+ // Fetch a document
92
+ const doc = await index.get_document(
93
+ results.hits[0].address.segment_id,
94
+ results.hits[0].address.doc_id,
95
+ );
96
+ ```
97
+
98
+ ## API Reference
99
+
100
+ ### `LocalIndex`
101
+
102
+ | Method | Description |
103
+ | ------------------------------------------ | --------------------------------------- |
104
+ | `LocalIndex.create(sdl)` | Create in-memory index from SDL schema |
105
+ | `LocalIndex.createPersistent(name, sdl)` | Create IndexedDB-backed index |
106
+ | `LocalIndex.open(name)` | Open existing persistent index from IDB |
107
+ | `LocalIndex.deleteIndex(name)` | Delete persistent index from IDB |
108
+ | `LocalIndex.exists(name)` | Check if persistent index exists in IDB |
109
+ | `index.addDocument(json)` | Add a single document |
110
+ | `index.addDocuments(jsonArray)` | Add multiple documents, returns count |
111
+ | `index.commit()` | Commit pending docs (builds segments) |
112
+ | `index.search(query, limit)` | Search with BM25 ranking |
113
+ | `index.searchOffset(query, limit, offset)` | Search with pagination |
114
+ | `index.getDocument(segmentId, docId)` | Retrieve stored document |
115
+ | `index.numDocs()` | Count of committed documents |
116
+ | `index.pendingDocs()` | Count of uncommitted documents |
117
+ | `index.fieldNames()` | List of field names |
118
+
119
+ ### `RemoteIndex`
120
+
121
+ | Method | Description |
122
+ | ------------------------------------------- | ----------------------------------- |
123
+ | `new RemoteIndex(url)` | Create remote index pointing to URL |
124
+ | `RemoteIndex.with_cache_size(url, bytes)` | Create with custom cache size |
125
+ | `index.load()` | Load index metadata and segments |
126
+ | `index.load_with_idb_cache()` | Load with IndexedDB cache pre-fill |
127
+ | `index.search(query, limit)` | Search |
128
+ | `index.search_offset(query, limit, offset)` | Search with pagination |
129
+ | `index.get_document(segmentId, docId)` | Retrieve document |
130
+ | `index.num_docs()` | Document count |
131
+ | `index.num_segments()` | Segment count |
132
+ | `index.field_names()` | Field names |
133
+ | `index.default_fields()` | Default search fields |
134
+ | `index.export_cache()` | Export slice cache as `Uint8Array` |
135
+ | `index.import_cache(data)` | Import previously exported cache |
136
+ | `index.save_cache_to_idb()` | Persist slice cache to IndexedDB |
137
+ | `index.load_cache_from_idb()` | Restore cache from IndexedDB |
138
+ | `index.clear_idb_cache()` | Remove persisted cache |
139
+ | `index.cache_stats()` | Cache utilization info |
140
+ | `index.network_stats()` | HTTP request statistics |
141
+ | `index.reset_network_stats()` | Clear network statistics |
142
+
143
+ ### `IpfsIndex`
144
+
145
+ Same API as `RemoteIndex` but loaded via JavaScript callbacks instead of HTTP:
146
+
147
+ | Method | Description |
148
+ | -------------------------------------------- | ---------------------------------------- |
149
+ | `new IpfsIndex(basePath)` | Create with IPFS path (e.g. `/ipfs/Qm…`) |
150
+ | `IpfsIndex.with_cache_size(path, bytes)` | Create with custom cache size |
151
+ | `index.load(fetchFn, sizeFn)` | Load using JS callbacks |
152
+ | `index.load_with_idb_cache(fetchFn, sizeFn)` | Load with IDB cache + JS callbacks |
153
+
154
+ `fetchFn`: `(path: string, rangeStart?: number, rangeEnd?: number) => Promise<Uint8Array>`
155
+ `sizeFn`: `(path: string) => Promise<number>`
156
+
157
+ All other methods (`search`, `get_document`, `cache_stats`, etc.) are identical to `RemoteIndex`.
158
+
159
+ ### `IndexRegistry`
160
+
161
+ Manages multiple named remote indexes:
162
+
163
+ | Method | Description |
164
+ | ------------------------------------- | ------------------------------ |
165
+ | `new IndexRegistry()` | Create empty registry |
166
+ | `registry.add_remote(name, url)` | Load and register remote index |
167
+ | `registry.remove(name)` | Remove index |
168
+ | `registry.list()` | List index names |
169
+ | `registry.search(name, query, limit)` | Search a specific index |
170
+
171
+ ### Schema Definition Language (SDL)
172
+
173
+ ```
174
+ index <name> {
175
+ field <name>: <type> [attributes]
176
+ }
177
+ ```
178
+
179
+ **Types:** `text`, `u64`, `i64`, `f64`, `bytes`
180
+
181
+ **Tokenizers:** `text<en_stem>`, `text<de_stem>`, `text<fr_stem>`, `text<es_stem>`, `text<it_stem>`, `text<pt_stem>`, `text<ru_stem>`, `text<ar_stem>`, `text<simple>`, etc.
182
+
183
+ **Attributes:** `indexed` (searchable), `stored` (retrievable), `fast` (columnar access)
184
+
185
+ ### Query Language
186
+
187
+ | Syntax | Example | Description |
188
+ | ------ | ---------------------- | --------------------------- |
189
+ | Term | `rust` | Match across default fields |
190
+ | Field | `title:rust` | Match in specific field |
191
+ | AND | `rust AND web` | Both terms required |
192
+ | OR | `rust OR python` | Either term |
193
+ | NOT | `rust NOT unsafe` | Exclude term |
194
+ | Group | `(rust OR go) AND web` | Grouping |
195
+ | Phrase | `"search engine"` | Exact phrase |
196
+
197
+ ## Building
198
+
199
+ ```bash
200
+ cd hermes-wasm
201
+ bash build.sh # requires Homebrew LLVM on macOS
202
+ ```
203
+
204
+ The build script sets `CC` and `AR` to Homebrew LLVM binaries for zstd cross-compilation to `wasm32-unknown-unknown`.
205
+
206
+ ## Example
207
+
208
+ Open `examples/index.html` in a browser (needs to be served, not opened as file):
209
+
210
+ ```bash
211
+ cd hermes-wasm
212
+ bash build.sh
213
+ cp pkg/hermes_wasm.js pkg/hermes_wasm_bg.wasm examples/
214
+ cd examples && python3 -m http.server 8080
215
+ # Open http://localhost:8080
216
+ ```
217
+
218
+ ## Architecture
219
+
220
+ ```
221
+ Browser JS
222
+
223
+ ├── LocalIndex (create/index/search in WASM)
224
+ │ └── WasmIndexWriter → SegmentBuilder → RamDirectory
225
+ │ │
226
+ │ [per-file IndexedDB records]
227
+
228
+ ├── RemoteIndex (HTTP range requests)
229
+ │ └── Searcher → SliceCachingDirectory → HttpDirectory
230
+
231
+ ├── IpfsIndex (JS fetch callbacks)
232
+ │ └── Searcher → SliceCachingDirectory → JsFetchDirectory
233
+
234
+ └── IndexRegistry (multi-index management)
235
+ └── Map<name, RemoteIndex>
236
+ ```
package/hermes_wasm.d.ts CHANGED
@@ -113,6 +113,9 @@ export class IpfsIndex {
113
113
  save_cache_to_idb(): Promise<void>;
114
114
  /**
115
115
  * Search the index
116
+ *
117
+ * Returns `{ hits: [{ address: { segment_id: string, doc_id: number }, score: number }], total_hits: number }`.
118
+ * Use `get_document(hit.address.segment_id, hit.address.doc_id)` to fetch document content.
116
119
  */
117
120
  search(query_str: string, limit: number): Promise<any>;
118
121
  /**
@@ -125,6 +128,93 @@ export class IpfsIndex {
125
128
  static with_cache_size(base_path: string, cache_size: number): IpfsIndex;
126
129
  }
127
130
 
131
+ /**
132
+ * In-browser local index — create, index documents, search, all in WASM.
133
+ *
134
+ * ```js
135
+ * // In-memory (ephemeral)
136
+ * const index = await LocalIndex.create("index articles { field title: text<en_stem> [indexed, stored] }");
137
+ *
138
+ * // Persistent (IndexedDB-backed)
139
+ * const index = await LocalIndex.createPersistent("my-index", "index articles { ... }");
140
+ * // ... later, on page reload:
141
+ * const index = await LocalIndex.open("my-index");
142
+ * ```
143
+ */
144
+ export class LocalIndex {
145
+ private constructor();
146
+ free(): void;
147
+ [Symbol.dispose](): void;
148
+ /**
149
+ * Add a single document (JSON object with field names matching the schema).
150
+ */
151
+ addDocument(doc_json: any): Promise<void>;
152
+ /**
153
+ * Add multiple documents at once (array of JSON objects).
154
+ */
155
+ addDocuments(docs_json: any): Promise<number>;
156
+ /**
157
+ * Commit pending documents — builds segments and updates metadata.
158
+ *
159
+ * For persistent indexes, only writes new/changed files to IndexedDB.
160
+ */
161
+ commit(): Promise<boolean>;
162
+ /**
163
+ * Create a new in-memory index from an SDL schema string.
164
+ *
165
+ * Data is lost on page refresh. Use `createPersistent()` for IndexedDB-backed storage.
166
+ */
167
+ static create(schema_sdl: string): Promise<LocalIndex>;
168
+ /**
169
+ * Create a new persistent index backed by IndexedDB.
170
+ *
171
+ * Each file in the index gets its own IDB record — commits only write
172
+ * new/changed files, not the entire index.
173
+ * Use `LocalIndex.open(name)` to reopen it after page refresh.
174
+ */
175
+ static createPersistent(name: string, schema_sdl: string): Promise<LocalIndex>;
176
+ /**
177
+ * Delete a persistent index from IndexedDB.
178
+ */
179
+ static deleteIndex(name: string): Promise<void>;
180
+ /**
181
+ * Check if a persistent index exists in IndexedDB.
182
+ */
183
+ static exists(name: string): Promise<boolean>;
184
+ /**
185
+ * Get field names from the schema.
186
+ */
187
+ fieldNames(): any;
188
+ /**
189
+ * Get a document by its address.
190
+ */
191
+ getDocument(segment_id: string, doc_id: number): Promise<any>;
192
+ /**
193
+ * Number of indexed documents (across all committed segments).
194
+ */
195
+ numDocs(): number;
196
+ /**
197
+ * Open an existing persistent index from IndexedDB.
198
+ *
199
+ * Loads the file manifest and all index files into a RamDirectory.
200
+ */
201
+ static open(name: string): Promise<LocalIndex>;
202
+ /**
203
+ * Number of documents pending (not yet committed).
204
+ */
205
+ pendingDocs(): number;
206
+ /**
207
+ * Search the index.
208
+ *
209
+ * Returns `{ hits: [{ address: { segment_id, doc_id }, score }], total_hits }`.
210
+ */
211
+ search(query_str: string, limit: number): Promise<any>;
212
+ /**
213
+ * Search with offset for pagination.
214
+ */
215
+ searchOffset(query_str: string, limit: number, offset: number): Promise<any>;
216
+ }
217
+
128
218
  /**
129
219
  * Remote index that loads data via HTTP with slice caching
130
220
  */
@@ -219,7 +309,9 @@ export class RemoteIndex {
219
309
  *
220
310
  * Accepts both query language syntax (field:term, AND, OR, NOT, grouping)
221
311
  * and simple text (tokenized and searched across default fields).
222
- * Returns document addresses (segment_id + doc_id) without document content.
312
+ *
313
+ * Returns `{ hits: [{ address: { segment_id: string, doc_id: number }, score: number }], total_hits: number }`.
314
+ * Use `get_document(hit.address.segment_id, hit.address.doc_id)` to fetch document content.
223
315
  */
224
316
  search(query_str: string, limit: number): Promise<any>;
225
317
  /**
@@ -246,30 +338,9 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
246
338
 
247
339
  export interface InitOutput {
248
340
  readonly memory: WebAssembly.Memory;
249
- readonly __wbg_remoteindex_free: (a: number, b: number) => void;
250
- readonly remoteindex_cache_stats: (a: number) => any;
251
- readonly remoteindex_clear_idb_cache: (a: number) => any;
252
- readonly remoteindex_default_fields: (a: number) => any;
253
- readonly remoteindex_export_cache: (a: number) => [number, number];
254
- readonly remoteindex_field_names: (a: number) => any;
255
- readonly remoteindex_get_document: (a: number, b: number, c: number, d: number) => any;
256
- readonly remoteindex_import_cache: (a: number, b: number, c: number) => [number, number];
257
- readonly remoteindex_load: (a: number) => any;
258
- readonly remoteindex_load_cache_from_idb: (a: number) => any;
259
- readonly remoteindex_load_with_idb_cache: (a: number) => any;
260
- readonly remoteindex_network_stats: (a: number) => any;
261
- readonly remoteindex_new: (a: number, b: number) => number;
262
- readonly remoteindex_num_docs: (a: number) => number;
263
- readonly remoteindex_num_segments: (a: number) => number;
264
- readonly remoteindex_reset_network_stats: (a: number) => void;
265
- readonly remoteindex_save_cache_to_idb: (a: number) => any;
266
- readonly remoteindex_search: (a: number, b: number, c: number, d: number) => any;
267
- readonly remoteindex_search_offset: (a: number, b: number, c: number, d: number, e: number) => any;
268
- readonly remoteindex_with_cache_size: (a: number, b: number, c: number) => number;
269
- readonly init: () => void;
270
- readonly setup_logging: () => void;
271
341
  readonly __wbg_indexregistry_free: (a: number, b: number) => void;
272
342
  readonly __wbg_ipfsindex_free: (a: number, b: number) => void;
343
+ readonly __wbg_remoteindex_free: (a: number, b: number) => void;
273
344
  readonly indexregistry_add_remote: (a: number, b: number, c: number, d: number, e: number) => any;
274
345
  readonly indexregistry_list: (a: number) => any;
275
346
  readonly indexregistry_new: () => number;
@@ -294,6 +365,42 @@ export interface InitOutput {
294
365
  readonly ipfsindex_search: (a: number, b: number, c: number, d: number) => any;
295
366
  readonly ipfsindex_search_offset: (a: number, b: number, c: number, d: number, e: number) => any;
296
367
  readonly ipfsindex_with_cache_size: (a: number, b: number, c: number) => number;
368
+ readonly remoteindex_cache_stats: (a: number) => any;
369
+ readonly remoteindex_clear_idb_cache: (a: number) => any;
370
+ readonly remoteindex_default_fields: (a: number) => any;
371
+ readonly remoteindex_export_cache: (a: number) => [number, number];
372
+ readonly remoteindex_field_names: (a: number) => any;
373
+ readonly remoteindex_get_document: (a: number, b: number, c: number, d: number) => any;
374
+ readonly remoteindex_import_cache: (a: number, b: number, c: number) => [number, number];
375
+ readonly remoteindex_load: (a: number) => any;
376
+ readonly remoteindex_load_cache_from_idb: (a: number) => any;
377
+ readonly remoteindex_load_with_idb_cache: (a: number) => any;
378
+ readonly remoteindex_network_stats: (a: number) => any;
379
+ readonly remoteindex_new: (a: number, b: number) => number;
380
+ readonly remoteindex_reset_network_stats: (a: number) => void;
381
+ readonly remoteindex_save_cache_to_idb: (a: number) => any;
382
+ readonly remoteindex_search: (a: number, b: number, c: number, d: number) => any;
383
+ readonly remoteindex_search_offset: (a: number, b: number, c: number, d: number, e: number) => any;
384
+ readonly remoteindex_with_cache_size: (a: number, b: number, c: number) => number;
385
+ readonly init: () => void;
386
+ readonly setup_logging: () => void;
387
+ readonly remoteindex_num_docs: (a: number) => number;
388
+ readonly remoteindex_num_segments: (a: number) => number;
389
+ readonly __wbg_localindex_free: (a: number, b: number) => void;
390
+ readonly localindex_addDocument: (a: number, b: any) => any;
391
+ readonly localindex_addDocuments: (a: number, b: any) => any;
392
+ readonly localindex_commit: (a: number) => any;
393
+ readonly localindex_create: (a: number, b: number) => any;
394
+ readonly localindex_createPersistent: (a: number, b: number, c: number, d: number) => any;
395
+ readonly localindex_deleteIndex: (a: number, b: number) => any;
396
+ readonly localindex_exists: (a: number, b: number) => any;
397
+ readonly localindex_fieldNames: (a: number) => any;
398
+ readonly localindex_getDocument: (a: number, b: number, c: number, d: number) => any;
399
+ readonly localindex_numDocs: (a: number) => number;
400
+ readonly localindex_open: (a: number, b: number) => any;
401
+ readonly localindex_pendingDocs: (a: number) => number;
402
+ readonly localindex_search: (a: number, b: number, c: number, d: number) => any;
403
+ readonly localindex_searchOffset: (a: number, b: number, c: number, d: number, e: number) => any;
297
404
  readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
298
405
  readonly rust_zstd_wasm_shim_free: (a: number) => void;
299
406
  readonly rust_zstd_wasm_shim_malloc: (a: number) => number;
@@ -302,14 +409,14 @@ export interface InitOutput {
302
409
  readonly rust_zstd_wasm_shim_memmove: (a: number, b: number, c: number) => number;
303
410
  readonly rust_zstd_wasm_shim_memset: (a: number, b: number, c: number) => number;
304
411
  readonly rust_zstd_wasm_shim_qsort: (a: number, b: number, c: number, d: number) => void;
305
- readonly wasm_bindgen_be9c423343b4eded___closure__destroy___dyn_core_5858575f5ab61d4b___ops__function__FnMut__web_sys_f79ef57e54248762___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent____Output_______: (a: number, b: number) => void;
306
- readonly wasm_bindgen_be9c423343b4eded___closure__destroy___dyn_core_5858575f5ab61d4b___ops__function__FnMut_____Output_______: (a: number, b: number) => void;
307
- readonly wasm_bindgen_be9c423343b4eded___closure__destroy___dyn_core_5858575f5ab61d4b___ops__function__FnMut__wasm_bindgen_be9c423343b4eded___JsValue____Output___core_5858575f5ab61d4b___result__Result_____wasm_bindgen_be9c423343b4eded___JsError___: (a: number, b: number) => void;
308
- readonly wasm_bindgen_be9c423343b4eded___convert__closures_____invoke___wasm_bindgen_be9c423343b4eded___JsValue__core_5858575f5ab61d4b___result__Result_____wasm_bindgen_be9c423343b4eded___JsError___true_: (a: number, b: number, c: any) => [number, number];
309
- readonly wasm_bindgen_be9c423343b4eded___convert__closures_____invoke___js_sys_c43126f5a1da0590___Function_fn_wasm_bindgen_be9c423343b4eded___JsValue_____wasm_bindgen_be9c423343b4eded___sys__Undefined___js_sys_c43126f5a1da0590___Function_fn_wasm_bindgen_be9c423343b4eded___JsValue_____wasm_bindgen_be9c423343b4eded___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
310
- readonly wasm_bindgen_be9c423343b4eded___convert__closures_____invoke___web_sys_f79ef57e54248762___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent______true_: (a: number, b: number, c: any) => void;
311
- readonly wasm_bindgen_be9c423343b4eded___convert__closures_____invoke___web_sys_f79ef57e54248762___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent______true__1: (a: number, b: number, c: any) => void;
312
- readonly wasm_bindgen_be9c423343b4eded___convert__closures_____invoke_______true_: (a: number, b: number) => void;
412
+ readonly wasm_bindgen_efede8c867e8014b___closure__destroy___dyn_core_5858575f5ab61d4b___ops__function__FnMut__web_sys_108d82c43c7519e2___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent____Output_______: (a: number, b: number) => void;
413
+ readonly wasm_bindgen_efede8c867e8014b___closure__destroy___dyn_core_5858575f5ab61d4b___ops__function__FnMut_____Output_______: (a: number, b: number) => void;
414
+ readonly wasm_bindgen_efede8c867e8014b___closure__destroy___dyn_core_5858575f5ab61d4b___ops__function__FnMut__wasm_bindgen_efede8c867e8014b___JsValue____Output___core_5858575f5ab61d4b___result__Result_____wasm_bindgen_efede8c867e8014b___JsError___: (a: number, b: number) => void;
415
+ readonly wasm_bindgen_efede8c867e8014b___convert__closures_____invoke___wasm_bindgen_efede8c867e8014b___JsValue__core_5858575f5ab61d4b___result__Result_____wasm_bindgen_efede8c867e8014b___JsError___true_: (a: number, b: number, c: any) => [number, number];
416
+ readonly wasm_bindgen_efede8c867e8014b___convert__closures_____invoke___js_sys_855885ac49497d5a___Function_fn_wasm_bindgen_efede8c867e8014b___JsValue_____wasm_bindgen_efede8c867e8014b___sys__Undefined___js_sys_855885ac49497d5a___Function_fn_wasm_bindgen_efede8c867e8014b___JsValue_____wasm_bindgen_efede8c867e8014b___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
417
+ readonly wasm_bindgen_efede8c867e8014b___convert__closures_____invoke___web_sys_108d82c43c7519e2___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent______true_: (a: number, b: number, c: any) => void;
418
+ readonly wasm_bindgen_efede8c867e8014b___convert__closures_____invoke___web_sys_108d82c43c7519e2___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent______true__1: (a: number, b: number, c: any) => void;
419
+ readonly wasm_bindgen_efede8c867e8014b___convert__closures_____invoke_______true_: (a: number, b: number) => void;
313
420
  readonly __wbindgen_malloc: (a: number, b: number) => number;
314
421
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
315
422
  readonly __wbindgen_exn_store: (a: number) => void;
package/hermes_wasm.js CHANGED
@@ -254,6 +254,9 @@ export class IpfsIndex {
254
254
  }
255
255
  /**
256
256
  * Search the index
257
+ *
258
+ * Returns `{ hits: [{ address: { segment_id: string, doc_id: number }, score: number }], total_hits: number }`.
259
+ * Use `get_document(hit.address.segment_id, hit.address.doc_id)` to fetch document content.
257
260
  * @param {string} query_str
258
261
  * @param {number} limit
259
262
  * @returns {Promise<any>}
@@ -292,6 +295,197 @@ export class IpfsIndex {
292
295
  }
293
296
  if (Symbol.dispose) IpfsIndex.prototype[Symbol.dispose] = IpfsIndex.prototype.free;
294
297
 
298
+ /**
299
+ * In-browser local index — create, index documents, search, all in WASM.
300
+ *
301
+ * ```js
302
+ * // In-memory (ephemeral)
303
+ * const index = await LocalIndex.create("index articles { field title: text<en_stem> [indexed, stored] }");
304
+ *
305
+ * // Persistent (IndexedDB-backed)
306
+ * const index = await LocalIndex.createPersistent("my-index", "index articles { ... }");
307
+ * // ... later, on page reload:
308
+ * const index = await LocalIndex.open("my-index");
309
+ * ```
310
+ */
311
+ export class LocalIndex {
312
+ static __wrap(ptr) {
313
+ ptr = ptr >>> 0;
314
+ const obj = Object.create(LocalIndex.prototype);
315
+ obj.__wbg_ptr = ptr;
316
+ LocalIndexFinalization.register(obj, obj.__wbg_ptr, obj);
317
+ return obj;
318
+ }
319
+ __destroy_into_raw() {
320
+ const ptr = this.__wbg_ptr;
321
+ this.__wbg_ptr = 0;
322
+ LocalIndexFinalization.unregister(this);
323
+ return ptr;
324
+ }
325
+ free() {
326
+ const ptr = this.__destroy_into_raw();
327
+ wasm.__wbg_localindex_free(ptr, 0);
328
+ }
329
+ /**
330
+ * Add a single document (JSON object with field names matching the schema).
331
+ * @param {any} doc_json
332
+ * @returns {Promise<void>}
333
+ */
334
+ addDocument(doc_json) {
335
+ const ret = wasm.localindex_addDocument(this.__wbg_ptr, doc_json);
336
+ return ret;
337
+ }
338
+ /**
339
+ * Add multiple documents at once (array of JSON objects).
340
+ * @param {any} docs_json
341
+ * @returns {Promise<number>}
342
+ */
343
+ addDocuments(docs_json) {
344
+ const ret = wasm.localindex_addDocuments(this.__wbg_ptr, docs_json);
345
+ return ret;
346
+ }
347
+ /**
348
+ * Commit pending documents — builds segments and updates metadata.
349
+ *
350
+ * For persistent indexes, only writes new/changed files to IndexedDB.
351
+ * @returns {Promise<boolean>}
352
+ */
353
+ commit() {
354
+ const ret = wasm.localindex_commit(this.__wbg_ptr);
355
+ return ret;
356
+ }
357
+ /**
358
+ * Create a new in-memory index from an SDL schema string.
359
+ *
360
+ * Data is lost on page refresh. Use `createPersistent()` for IndexedDB-backed storage.
361
+ * @param {string} schema_sdl
362
+ * @returns {Promise<LocalIndex>}
363
+ */
364
+ static create(schema_sdl) {
365
+ const ptr0 = passStringToWasm0(schema_sdl, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
366
+ const len0 = WASM_VECTOR_LEN;
367
+ const ret = wasm.localindex_create(ptr0, len0);
368
+ return ret;
369
+ }
370
+ /**
371
+ * Create a new persistent index backed by IndexedDB.
372
+ *
373
+ * Each file in the index gets its own IDB record — commits only write
374
+ * new/changed files, not the entire index.
375
+ * Use `LocalIndex.open(name)` to reopen it after page refresh.
376
+ * @param {string} name
377
+ * @param {string} schema_sdl
378
+ * @returns {Promise<LocalIndex>}
379
+ */
380
+ static createPersistent(name, schema_sdl) {
381
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
382
+ const len0 = WASM_VECTOR_LEN;
383
+ const ptr1 = passStringToWasm0(schema_sdl, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
384
+ const len1 = WASM_VECTOR_LEN;
385
+ const ret = wasm.localindex_createPersistent(ptr0, len0, ptr1, len1);
386
+ return ret;
387
+ }
388
+ /**
389
+ * Delete a persistent index from IndexedDB.
390
+ * @param {string} name
391
+ * @returns {Promise<void>}
392
+ */
393
+ static deleteIndex(name) {
394
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
395
+ const len0 = WASM_VECTOR_LEN;
396
+ const ret = wasm.localindex_deleteIndex(ptr0, len0);
397
+ return ret;
398
+ }
399
+ /**
400
+ * Check if a persistent index exists in IndexedDB.
401
+ * @param {string} name
402
+ * @returns {Promise<boolean>}
403
+ */
404
+ static exists(name) {
405
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
406
+ const len0 = WASM_VECTOR_LEN;
407
+ const ret = wasm.localindex_exists(ptr0, len0);
408
+ return ret;
409
+ }
410
+ /**
411
+ * Get field names from the schema.
412
+ * @returns {any}
413
+ */
414
+ fieldNames() {
415
+ const ret = wasm.localindex_fieldNames(this.__wbg_ptr);
416
+ return ret;
417
+ }
418
+ /**
419
+ * Get a document by its address.
420
+ * @param {string} segment_id
421
+ * @param {number} doc_id
422
+ * @returns {Promise<any>}
423
+ */
424
+ getDocument(segment_id, doc_id) {
425
+ const ptr0 = passStringToWasm0(segment_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
426
+ const len0 = WASM_VECTOR_LEN;
427
+ const ret = wasm.localindex_getDocument(this.__wbg_ptr, ptr0, len0, doc_id);
428
+ return ret;
429
+ }
430
+ /**
431
+ * Number of indexed documents (across all committed segments).
432
+ * @returns {number}
433
+ */
434
+ numDocs() {
435
+ const ret = wasm.localindex_numDocs(this.__wbg_ptr);
436
+ return ret >>> 0;
437
+ }
438
+ /**
439
+ * Open an existing persistent index from IndexedDB.
440
+ *
441
+ * Loads the file manifest and all index files into a RamDirectory.
442
+ * @param {string} name
443
+ * @returns {Promise<LocalIndex>}
444
+ */
445
+ static open(name) {
446
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
447
+ const len0 = WASM_VECTOR_LEN;
448
+ const ret = wasm.localindex_open(ptr0, len0);
449
+ return ret;
450
+ }
451
+ /**
452
+ * Number of documents pending (not yet committed).
453
+ * @returns {number}
454
+ */
455
+ pendingDocs() {
456
+ const ret = wasm.localindex_pendingDocs(this.__wbg_ptr);
457
+ return ret >>> 0;
458
+ }
459
+ /**
460
+ * Search the index.
461
+ *
462
+ * Returns `{ hits: [{ address: { segment_id, doc_id }, score }], total_hits }`.
463
+ * @param {string} query_str
464
+ * @param {number} limit
465
+ * @returns {Promise<any>}
466
+ */
467
+ search(query_str, limit) {
468
+ const ptr0 = passStringToWasm0(query_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
469
+ const len0 = WASM_VECTOR_LEN;
470
+ const ret = wasm.localindex_search(this.__wbg_ptr, ptr0, len0, limit);
471
+ return ret;
472
+ }
473
+ /**
474
+ * Search with offset for pagination.
475
+ * @param {string} query_str
476
+ * @param {number} limit
477
+ * @param {number} offset
478
+ * @returns {Promise<any>}
479
+ */
480
+ searchOffset(query_str, limit, offset) {
481
+ const ptr0 = passStringToWasm0(query_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
482
+ const len0 = WASM_VECTOR_LEN;
483
+ const ret = wasm.localindex_searchOffset(this.__wbg_ptr, ptr0, len0, limit, offset);
484
+ return ret;
485
+ }
486
+ }
487
+ if (Symbol.dispose) LocalIndex.prototype[Symbol.dispose] = LocalIndex.prototype.free;
488
+
295
489
  /**
296
490
  * Remote index that loads data via HTTP with slice caching
297
491
  */
@@ -480,7 +674,9 @@ export class RemoteIndex {
480
674
  *
481
675
  * Accepts both query language syntax (field:term, AND, OR, NOT, grouping)
482
676
  * and simple text (tokenized and searched across default fields).
483
- * Returns document addresses (segment_id + doc_id) without document content.
677
+ *
678
+ * Returns `{ hits: [{ address: { segment_id: string, doc_id: number }, score: number }], total_hits: number }`.
679
+ * Use `get_document(hit.address.segment_id, hit.address.doc_id)` to fetch document content.
484
680
  * @param {string} query_str
485
681
  * @param {number} limit
486
682
  * @returns {Promise<any>}
@@ -547,6 +743,17 @@ function __wbg_get_imports() {
547
743
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
548
744
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
549
745
  },
746
+ __wbg___wbindgen_bigint_get_as_i64_447a76b5c6ef7bda: function(arg0, arg1) {
747
+ const v = arg1;
748
+ const ret = typeof(v) === 'bigint' ? v : undefined;
749
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
750
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
751
+ },
752
+ __wbg___wbindgen_boolean_get_c0f3f60bac5a78d1: function(arg0) {
753
+ const v = arg0;
754
+ const ret = typeof(v) === 'boolean' ? v : undefined;
755
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
756
+ },
550
757
  __wbg___wbindgen_debug_string_5398f5bb970e0daa: function(arg0, arg1) {
551
758
  const ret = debugString(arg1);
552
759
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -554,6 +761,14 @@ function __wbg_get_imports() {
554
761
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
555
762
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
556
763
  },
764
+ __wbg___wbindgen_in_41dbb8413020e076: function(arg0, arg1) {
765
+ const ret = arg0 in arg1;
766
+ return ret;
767
+ },
768
+ __wbg___wbindgen_is_bigint_e2141d4f045b7eda: function(arg0) {
769
+ const ret = typeof(arg0) === 'bigint';
770
+ return ret;
771
+ },
557
772
  __wbg___wbindgen_is_function_3c846841762788c1: function(arg0) {
558
773
  const ret = typeof(arg0) === 'function';
559
774
  return ret;
@@ -562,6 +777,11 @@ function __wbg_get_imports() {
562
777
  const ret = arg0 === null;
563
778
  return ret;
564
779
  },
780
+ __wbg___wbindgen_is_object_781bc9f159099513: function(arg0) {
781
+ const val = arg0;
782
+ const ret = typeof(val) === 'object' && val !== null;
783
+ return ret;
784
+ },
565
785
  __wbg___wbindgen_is_string_7ef6b97b02428fae: function(arg0) {
566
786
  const ret = typeof(arg0) === 'string';
567
787
  return ret;
@@ -570,6 +790,14 @@ function __wbg_get_imports() {
570
790
  const ret = arg0 === undefined;
571
791
  return ret;
572
792
  },
793
+ __wbg___wbindgen_jsval_eq_ee31bfad3e536463: function(arg0, arg1) {
794
+ const ret = arg0 === arg1;
795
+ return ret;
796
+ },
797
+ __wbg___wbindgen_jsval_loose_eq_5bcc3bed3c69e72b: function(arg0, arg1) {
798
+ const ret = arg0 == arg1;
799
+ return ret;
800
+ },
573
801
  __wbg___wbindgen_number_get_34bb9d9dcfa21373: function(arg0, arg1) {
574
802
  const obj = arg1;
575
803
  const ret = typeof(obj) === 'number' ? obj : undefined;
@@ -607,6 +835,10 @@ function __wbg_get_imports() {
607
835
  const ret = arg0.call(arg1, arg2);
608
836
  return ret;
609
837
  }, arguments); },
838
+ __wbg_call_e133b57c9155d22c: function() { return handleError(function (arg0, arg1) {
839
+ const ret = arg0.call(arg1);
840
+ return ret;
841
+ }, arguments); },
610
842
  __wbg_call_f858478a02f9600f: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
611
843
  const ret = arg0.call(arg1, arg2, arg3, arg4);
612
844
  return ret;
@@ -638,6 +870,10 @@ function __wbg_get_imports() {
638
870
  const ret = arg0.entries();
639
871
  return ret;
640
872
  },
873
+ __wbg_entries_e8a20ff8c9757101: function(arg0) {
874
+ const ret = Object.entries(arg0);
875
+ return ret;
876
+ },
641
877
  __wbg_error_8d9a8e04cd1d3588: function(arg0) {
642
878
  console.error(arg0);
643
879
  },
@@ -664,6 +900,13 @@ function __wbg_get_imports() {
664
900
  const ret = arg0.fetch(arg1);
665
901
  return ret;
666
902
  },
903
+ __wbg_getRandomValues_3f44b700395062e5: function() { return handleError(function (arg0, arg1) {
904
+ globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
905
+ }, arguments); },
906
+ __wbg_get_326e41e095fb2575: function() { return handleError(function (arg0, arg1) {
907
+ const ret = Reflect.get(arg0, arg1);
908
+ return ret;
909
+ }, arguments); },
667
910
  __wbg_get_3ef1eba1850ade27: function() { return handleError(function (arg0, arg1) {
668
911
  const ret = Reflect.get(arg0, arg1);
669
912
  return ret;
@@ -676,6 +919,10 @@ function __wbg_get_imports() {
676
919
  const ret = arg0[arg1 >>> 0];
677
920
  return ret;
678
921
  },
922
+ __wbg_get_unchecked_329cfe50afab7352: function(arg0, arg1) {
923
+ const ret = arg0[arg1 >>> 0];
924
+ return ret;
925
+ },
679
926
  __wbg_has_926ef2ff40b308cf: function() { return handleError(function (arg0, arg1) {
680
927
  const ret = Reflect.has(arg0, arg1);
681
928
  return ret;
@@ -691,6 +938,16 @@ function __wbg_get_imports() {
691
938
  __wbg_info_7d4e223bb1a7e671: function(arg0) {
692
939
  console.info(arg0);
693
940
  },
941
+ __wbg_instanceof_ArrayBuffer_101e2bf31071a9f6: function(arg0) {
942
+ let result;
943
+ try {
944
+ result = arg0 instanceof ArrayBuffer;
945
+ } catch (_) {
946
+ result = false;
947
+ }
948
+ const ret = result;
949
+ return ret;
950
+ },
694
951
  __wbg_instanceof_IdbDatabase_5f436cc89cc07f14: function(arg0) {
695
952
  let result;
696
953
  try {
@@ -721,6 +978,16 @@ function __wbg_get_imports() {
721
978
  const ret = result;
722
979
  return ret;
723
980
  },
981
+ __wbg_instanceof_Map_f194b366846aca0c: function(arg0) {
982
+ let result;
983
+ try {
984
+ result = arg0 instanceof Map;
985
+ } catch (_) {
986
+ result = false;
987
+ }
988
+ const ret = result;
989
+ return ret;
990
+ },
724
991
  __wbg_instanceof_Response_9b4d9fd451e051b1: function(arg0) {
725
992
  let result;
726
993
  try {
@@ -755,10 +1022,26 @@ function __wbg_get_imports() {
755
1022
  const ret = Array.isArray(arg0);
756
1023
  return ret;
757
1024
  },
1025
+ __wbg_isSafeInteger_ecd6a7f9c3e053cd: function(arg0) {
1026
+ const ret = Number.isSafeInteger(arg0);
1027
+ return ret;
1028
+ },
1029
+ __wbg_iterator_d8f549ec8fb061b1: function() {
1030
+ const ret = Symbol.iterator;
1031
+ return ret;
1032
+ },
1033
+ __wbg_length_b3416cf66a5452c8: function(arg0) {
1034
+ const ret = arg0.length;
1035
+ return ret;
1036
+ },
758
1037
  __wbg_length_ea16607d7b61445b: function(arg0) {
759
1038
  const ret = arg0.length;
760
1039
  return ret;
761
1040
  },
1041
+ __wbg_localindex_new: function(arg0) {
1042
+ const ret = LocalIndex.__wrap(arg0);
1043
+ return ret;
1044
+ },
762
1045
  __wbg_log_524eedafa26daa59: function(arg0) {
763
1046
  console.log(arg0);
764
1047
  },
@@ -801,7 +1084,7 @@ function __wbg_get_imports() {
801
1084
  const a = state0.a;
802
1085
  state0.a = 0;
803
1086
  try {
804
- return wasm_bindgen_be9c423343b4eded___convert__closures_____invoke___js_sys_c43126f5a1da0590___Function_fn_wasm_bindgen_be9c423343b4eded___JsValue_____wasm_bindgen_be9c423343b4eded___sys__Undefined___js_sys_c43126f5a1da0590___Function_fn_wasm_bindgen_be9c423343b4eded___JsValue_____wasm_bindgen_be9c423343b4eded___sys__Undefined_______true_(a, state0.b, arg0, arg1);
1087
+ return wasm_bindgen_efede8c867e8014b___convert__closures_____invoke___js_sys_855885ac49497d5a___Function_fn_wasm_bindgen_efede8c867e8014b___JsValue_____wasm_bindgen_efede8c867e8014b___sys__Undefined___js_sys_855885ac49497d5a___Function_fn_wasm_bindgen_efede8c867e8014b___JsValue_____wasm_bindgen_efede8c867e8014b___sys__Undefined_______true_(a, state0.b, arg0, arg1);
805
1088
  } finally {
806
1089
  state0.a = a;
807
1090
  }
@@ -820,6 +1103,10 @@ function __wbg_get_imports() {
820
1103
  const ret = arg0.next();
821
1104
  return ret;
822
1105
  }, arguments); },
1106
+ __wbg_next_e01a967809d1aa68: function(arg0) {
1107
+ const ret = arg0.next;
1108
+ return ret;
1109
+ },
823
1110
  __wbg_now_c6d7a7d35f74f6f1: function(arg0) {
824
1111
  const ret = arg0.now();
825
1112
  return ret;
@@ -975,23 +1262,23 @@ function __wbg_get_imports() {
975
1262
  console.warn(arg0);
976
1263
  },
977
1264
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
978
- // Cast intrinsic for `Closure(Closure { dtor_idx: 205, function: Function { arguments: [NamedExternref("Event")], shim_idx: 206, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
979
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_be9c423343b4eded___closure__destroy___dyn_core_5858575f5ab61d4b___ops__function__FnMut__web_sys_f79ef57e54248762___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent____Output_______, wasm_bindgen_be9c423343b4eded___convert__closures_____invoke___web_sys_f79ef57e54248762___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent______true_);
1265
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 289, function: Function { arguments: [NamedExternref("Event")], shim_idx: 290, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1266
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_efede8c867e8014b___closure__destroy___dyn_core_5858575f5ab61d4b___ops__function__FnMut__web_sys_108d82c43c7519e2___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent____Output_______, wasm_bindgen_efede8c867e8014b___convert__closures_____invoke___web_sys_108d82c43c7519e2___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent______true_);
980
1267
  return ret;
981
1268
  },
982
1269
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
983
- // Cast intrinsic for `Closure(Closure { dtor_idx: 205, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 206, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
984
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_be9c423343b4eded___closure__destroy___dyn_core_5858575f5ab61d4b___ops__function__FnMut__web_sys_f79ef57e54248762___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent____Output_______, wasm_bindgen_be9c423343b4eded___convert__closures_____invoke___web_sys_f79ef57e54248762___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent______true__1);
1270
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 289, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 290, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1271
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_efede8c867e8014b___closure__destroy___dyn_core_5858575f5ab61d4b___ops__function__FnMut__web_sys_108d82c43c7519e2___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent____Output_______, wasm_bindgen_efede8c867e8014b___convert__closures_____invoke___web_sys_108d82c43c7519e2___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent______true__1);
985
1272
  return ret;
986
1273
  },
987
1274
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
988
- // Cast intrinsic for `Closure(Closure { dtor_idx: 602, function: Function { arguments: [], shim_idx: 603, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
989
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_be9c423343b4eded___closure__destroy___dyn_core_5858575f5ab61d4b___ops__function__FnMut_____Output_______, wasm_bindgen_be9c423343b4eded___convert__closures_____invoke_______true_);
1275
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 762, function: Function { arguments: [], shim_idx: 763, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
1276
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_efede8c867e8014b___closure__destroy___dyn_core_5858575f5ab61d4b___ops__function__FnMut_____Output_______, wasm_bindgen_efede8c867e8014b___convert__closures_____invoke_______true_);
990
1277
  return ret;
991
1278
  },
992
1279
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
993
- // Cast intrinsic for `Closure(Closure { dtor_idx: 632, function: Function { arguments: [Externref], shim_idx: 633, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
994
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_be9c423343b4eded___closure__destroy___dyn_core_5858575f5ab61d4b___ops__function__FnMut__wasm_bindgen_be9c423343b4eded___JsValue____Output___core_5858575f5ab61d4b___result__Result_____wasm_bindgen_be9c423343b4eded___JsError___, wasm_bindgen_be9c423343b4eded___convert__closures_____invoke___wasm_bindgen_be9c423343b4eded___JsValue__core_5858575f5ab61d4b___result__Result_____wasm_bindgen_be9c423343b4eded___JsError___true_);
1280
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 792, function: Function { arguments: [Externref], shim_idx: 793, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1281
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_efede8c867e8014b___closure__destroy___dyn_core_5858575f5ab61d4b___ops__function__FnMut__wasm_bindgen_efede8c867e8014b___JsValue____Output___core_5858575f5ab61d4b___result__Result_____wasm_bindgen_efede8c867e8014b___JsError___, wasm_bindgen_efede8c867e8014b___convert__closures_____invoke___wasm_bindgen_efede8c867e8014b___JsValue__core_5858575f5ab61d4b___result__Result_____wasm_bindgen_efede8c867e8014b___JsError___true_);
995
1282
  return ret;
996
1283
  },
997
1284
  __wbindgen_cast_0000000000000005: function(arg0) {
@@ -1030,27 +1317,27 @@ function __wbg_get_imports() {
1030
1317
  };
1031
1318
  }
1032
1319
 
1033
- function wasm_bindgen_be9c423343b4eded___convert__closures_____invoke_______true_(arg0, arg1) {
1034
- wasm.wasm_bindgen_be9c423343b4eded___convert__closures_____invoke_______true_(arg0, arg1);
1320
+ function wasm_bindgen_efede8c867e8014b___convert__closures_____invoke_______true_(arg0, arg1) {
1321
+ wasm.wasm_bindgen_efede8c867e8014b___convert__closures_____invoke_______true_(arg0, arg1);
1035
1322
  }
1036
1323
 
1037
- function wasm_bindgen_be9c423343b4eded___convert__closures_____invoke___web_sys_f79ef57e54248762___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent______true_(arg0, arg1, arg2) {
1038
- wasm.wasm_bindgen_be9c423343b4eded___convert__closures_____invoke___web_sys_f79ef57e54248762___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent______true_(arg0, arg1, arg2);
1324
+ function wasm_bindgen_efede8c867e8014b___convert__closures_____invoke___web_sys_108d82c43c7519e2___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent______true_(arg0, arg1, arg2) {
1325
+ wasm.wasm_bindgen_efede8c867e8014b___convert__closures_____invoke___web_sys_108d82c43c7519e2___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent______true_(arg0, arg1, arg2);
1039
1326
  }
1040
1327
 
1041
- function wasm_bindgen_be9c423343b4eded___convert__closures_____invoke___web_sys_f79ef57e54248762___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent______true__1(arg0, arg1, arg2) {
1042
- wasm.wasm_bindgen_be9c423343b4eded___convert__closures_____invoke___web_sys_f79ef57e54248762___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent______true__1(arg0, arg1, arg2);
1328
+ function wasm_bindgen_efede8c867e8014b___convert__closures_____invoke___web_sys_108d82c43c7519e2___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent______true__1(arg0, arg1, arg2) {
1329
+ wasm.wasm_bindgen_efede8c867e8014b___convert__closures_____invoke___web_sys_108d82c43c7519e2___features__gen_IdbVersionChangeEvent__IdbVersionChangeEvent______true__1(arg0, arg1, arg2);
1043
1330
  }
1044
1331
 
1045
- function wasm_bindgen_be9c423343b4eded___convert__closures_____invoke___wasm_bindgen_be9c423343b4eded___JsValue__core_5858575f5ab61d4b___result__Result_____wasm_bindgen_be9c423343b4eded___JsError___true_(arg0, arg1, arg2) {
1046
- const ret = wasm.wasm_bindgen_be9c423343b4eded___convert__closures_____invoke___wasm_bindgen_be9c423343b4eded___JsValue__core_5858575f5ab61d4b___result__Result_____wasm_bindgen_be9c423343b4eded___JsError___true_(arg0, arg1, arg2);
1332
+ function wasm_bindgen_efede8c867e8014b___convert__closures_____invoke___wasm_bindgen_efede8c867e8014b___JsValue__core_5858575f5ab61d4b___result__Result_____wasm_bindgen_efede8c867e8014b___JsError___true_(arg0, arg1, arg2) {
1333
+ const ret = wasm.wasm_bindgen_efede8c867e8014b___convert__closures_____invoke___wasm_bindgen_efede8c867e8014b___JsValue__core_5858575f5ab61d4b___result__Result_____wasm_bindgen_efede8c867e8014b___JsError___true_(arg0, arg1, arg2);
1047
1334
  if (ret[1]) {
1048
1335
  throw takeFromExternrefTable0(ret[0]);
1049
1336
  }
1050
1337
  }
1051
1338
 
1052
- function wasm_bindgen_be9c423343b4eded___convert__closures_____invoke___js_sys_c43126f5a1da0590___Function_fn_wasm_bindgen_be9c423343b4eded___JsValue_____wasm_bindgen_be9c423343b4eded___sys__Undefined___js_sys_c43126f5a1da0590___Function_fn_wasm_bindgen_be9c423343b4eded___JsValue_____wasm_bindgen_be9c423343b4eded___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
1053
- wasm.wasm_bindgen_be9c423343b4eded___convert__closures_____invoke___js_sys_c43126f5a1da0590___Function_fn_wasm_bindgen_be9c423343b4eded___JsValue_____wasm_bindgen_be9c423343b4eded___sys__Undefined___js_sys_c43126f5a1da0590___Function_fn_wasm_bindgen_be9c423343b4eded___JsValue_____wasm_bindgen_be9c423343b4eded___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
1339
+ function wasm_bindgen_efede8c867e8014b___convert__closures_____invoke___js_sys_855885ac49497d5a___Function_fn_wasm_bindgen_efede8c867e8014b___JsValue_____wasm_bindgen_efede8c867e8014b___sys__Undefined___js_sys_855885ac49497d5a___Function_fn_wasm_bindgen_efede8c867e8014b___JsValue_____wasm_bindgen_efede8c867e8014b___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
1340
+ wasm.wasm_bindgen_efede8c867e8014b___convert__closures_____invoke___js_sys_855885ac49497d5a___Function_fn_wasm_bindgen_efede8c867e8014b___JsValue_____wasm_bindgen_efede8c867e8014b___sys__Undefined___js_sys_855885ac49497d5a___Function_fn_wasm_bindgen_efede8c867e8014b___JsValue_____wasm_bindgen_efede8c867e8014b___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
1054
1341
  }
1055
1342
 
1056
1343
 
@@ -1070,6 +1357,9 @@ const IndexRegistryFinalization = (typeof FinalizationRegistry === 'undefined')
1070
1357
  const IpfsIndexFinalization = (typeof FinalizationRegistry === 'undefined')
1071
1358
  ? { register: () => {}, unregister: () => {} }
1072
1359
  : new FinalizationRegistry(ptr => wasm.__wbg_ipfsindex_free(ptr >>> 0, 1));
1360
+ const LocalIndexFinalization = (typeof FinalizationRegistry === 'undefined')
1361
+ ? { register: () => {}, unregister: () => {} }
1362
+ : new FinalizationRegistry(ptr => wasm.__wbg_localindex_free(ptr >>> 0, 1));
1073
1363
  const RemoteIndexFinalization = (typeof FinalizationRegistry === 'undefined')
1074
1364
  ? { register: () => {}, unregister: () => {} }
1075
1365
  : new FinalizationRegistry(ptr => wasm.__wbg_remoteindex_free(ptr >>> 0, 1));
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "izihawa"
6
6
  ],
7
7
  "description": "WASM bindings for Hermes search engine",
8
- "version": "1.8.27",
8
+ "version": "1.8.29",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",