@moyodb/sdk 1.0.0 → 1.0.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../src/codec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAarC,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,UAAU,CAAC;AAC5E,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAChD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAEpD;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEpD;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAErD;AACD,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,GAAG,CAAC,CAElD;AACD,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CASzD;AAMD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC,GAAG,UAAU,CAK5F;AACD,wBAAgB,WAAW,CAAC,GAAG,KAAK,EAAE,eAAe,EAAE,GAAG,UAAU,CAEnE;AACD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,GAAG,UAAU,CAEtE;AACD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,UAAU,CAEnF;AACD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,EAAE,CA2B9D;AACD,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,CASrE;AACD,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,KAAK,CAGrD;AACD,wBAAgB,gBAAgB,CAAC,GAAG,KAAK,EAAE,eAAe,EAAE,GAAG,KAAK,CAEnE"}
1
+ {"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../src/codec.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAcrC,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,UAAU,CAAC;AAC5E,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAChD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAEpD;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAEpD;AACD,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAMrD;AACD,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,GAAG,CAAC,CAElD;AACD,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAezD;AAMD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,eAAe,GAAG,aAAa,CAAC,eAAe,CAAC,GAAG,UAAU,CAK5F;AACD,wBAAgB,WAAW,CAAC,GAAG,KAAK,EAAE,eAAe,EAAE,GAAG,UAAU,CAEnE;AACD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,GAAG,UAAU,CAEtE;AACD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,UAAU,CAEnF;AACD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,EAAE,CA2B9D;AACD,wBAAgB,eAAe,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,CASrE;AACD,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,GAAG,KAAK,CAGrD;AACD,wBAAgB,gBAAgB,CAAC,GAAG,KAAK,EAAE,eAAe,EAAE,GAAG,KAAK,CAEnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"compression.d.ts","sourceRoot":"","sources":["../src/compression.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAAG,KAAK,CAAC;AAUxD,eAAO,MAAM,iCAAiC,OAAO,CAAC;AAuKtD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAY1E;AACD,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAYnH;AACD,wBAAsB,sBAAsB,CACxC,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE;IACL,MAAM,EAAE,OAAO,CAAC;CACnB,GACF,OAAO,CAAC,UAAU,CAAC,CAqDrB;AACD,wBAAsB,2BAA2B,CAC7C,QAAQ,EAAE,UAAU,EACpB,WAAW,EAAE,iBAAiB,GAC/B,OAAO,CAAC,UAAU,CAAC,CAMrB;AACD,wBAAsB,yBAAyB,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAmCzF"}
1
+ {"version":3,"file":"compression.d.ts","sourceRoot":"","sources":["../src/compression.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAAG,KAAK,CAAC;AAUxD,eAAO,MAAM,iCAAiC,OAAO,CAAC;AAoMtD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,CAY1E;AACD,wBAAsB,sBAAsB,CAAC,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,GAAG,OAAO,CAAC,UAAU,CAAC,CAmBnH;AACD,wBAAsB,sBAAsB,CACxC,KAAK,EAAE,UAAU,EACjB,OAAO,EAAE;IACL,MAAM,EAAE,OAAO,CAAC;CACnB,GACF,OAAO,CAAC,UAAU,CAAC,CAqDrB;AACD,wBAAsB,2BAA2B,CAC7C,QAAQ,EAAE,UAAU,EACpB,WAAW,EAAE,iBAAiB,GAC/B,OAAO,CAAC,UAAU,CAAC,CAOrB;AACD,wBAAsB,yBAAyB,CAAC,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAmCzF"}
@@ -24,7 +24,7 @@ It provides ordered byte keys, range scans, snapshots, TTL, recovery checks, and
24
24
  ## Quick start
25
25
 
26
26
  ```bash
27
- npm install @moyodb/sdk@1.0.0
27
+ npm install @moyodb/sdk@1.0.1
28
28
  ```
29
29
 
30
30
  ```ts
@@ -42,18 +42,19 @@ await db.close();
42
42
 
43
43
  ## Verification
44
44
 
45
- - `proofs/moyodb_proofs` is a Lean 4 executable specification, not a proof of the storage engine. It models the store as a sorted association list, the WAL as a list of page-image and commit records, and transactions as write batches over that list. Its theorems (lookup after insert, idempotent delete, scan bounds, an incomplete WAL tail is ignored, snapshot stability) hold for that model only; they say nothing about the Rust B-tree, page and checksum layout, OPFS I/O, flush ordering, or power loss.
46
- - The traces exported to `proofs/artifacts` are replayed against the Rust engine by `crates/engine/tests/proof_artifacts.rs` as conformance scenarios.
47
- - Crash behavior is covered by tests: `crates/engine/tests/crash_matrix.rs`, `crates/engine/tests/fault_injection.rs` (failed and short writes plus torn flushes at every WAL, main-file, and superblock operation during commit, checkpoint, and recovery), and `crates/engine/js/opfs_shim.test.mjs` for control-file publication.
45
+ \- Lean checks run with all built-in/extra linters, Heron, JunkLinter and the full Batteries set; every finding fails CI. See [strict Lean linting](docs/LEAN_LINTING.md) and run `npm run lint:lean` locally.\
46
+ \- `proofs/moyodb_proofs` models abstract KV/WAL/transaction semantics and independently checks real inline B-tree pages. The [B-tree checker](docs/LEAN_BTREE_CHECKER.md) has kernel-checked certificates for structure, contents and routing for every byte-string key; CI compares real Rust mutations, lookup/scan and retained COW roots with Lean-computed states and rejects two production mutation witnesses. This proves properties of the Lean checker and checks concrete Rust executions; the Rust engine, checksums, overflow, OPFS I/O, flush ordering and power loss remain outside those proofs.\
47
+ \- The traces exported to `proofs/artifacts` are replayed against the Rust engine by `crates/engine/tests/proof_artifacts.rs` as conformance scenarios.\
48
+ \- Crash behavior is covered by tests: `crates/engine/tests/crash_matrix.rs`, `crates/engine/tests/fault_injection.rs` (failed and short writes plus torn flushes at every WAL, main-file, and superblock operation during commit, checkpoint, and recovery), and `crates/engine/js/opfs_shim.test.mjs` for control-file publication.
48
49
 
49
50
  ## Limitations
50
51
 
51
- - Experimental software; storage format and SDK API may still change.
52
- - Browser-only runtime; there is no Node.js persistence API.
53
- - Requires OPFS and Worker-side sync access handles.
54
- - One active owner per database and one write transaction at a time.
55
- - Raw byte keys and values; no SQL/query planner.
56
- - No cloud sync, multi-tab concurrent writers, SharedWorker runtime, or IndexedDB fallback.
52
+ \- Experimental software; storage format and SDK API may still change.\
53
+ \- Browser-only runtime; there is no Node.js persistence API.\
54
+ \- Requires OPFS and Worker-side sync access handles.\
55
+ \- One active owner per database and one write transaction at a time.\
56
+ \- Raw byte keys and values; no SQL/query planner.\
57
+ \- No cloud sync, multi-tab concurrent writers, SharedWorker runtime, or IndexedDB fallback.
57
58
 
58
59
  ## License
59
60
 
@@ -11,8 +11,8 @@ export class WasmEngine {
11
11
  abandon(): void;
12
12
  apply_batch(tx_id: bigint, store: string, ops: any): any;
13
13
  /**
14
- * Returns one byte per op: for puts whether the key existed before,
15
- * for deletes whether a key was deleted. The op kinds are the caller's.
14
+ * Returns one byte per operation in input order. For puts, 1 means
15
+ * the key existed before the write. For deletes, 1 means it was deleted.
16
16
  */
17
17
  apply_batch_packed(tx_id: bigint, store: string, ops: Uint8Array): Uint8Array;
18
18
  begin_tx(mode: string): bigint;
@@ -21,16 +21,21 @@ export class WasmEngine {
21
21
  checkpoint(): void;
22
22
  clear_store(tx_id: bigint, name: string): void;
23
23
  /**
24
- * Checkpoints (when healthy) and closes. The handle is released even
25
- * when closing fails, so a retry never reuses a half-closed engine.
24
+ * Checkpoints a healthy engine and closes it. Releases the binding
25
+ * handle even on error so a retry cannot reuse a partially closed engine.
26
26
  */
27
27
  close(): void;
28
28
  commit_tx(tx_id: bigint): bigint;
29
29
  /**
30
- * Streams this database into `target`, a freshly opened empty
31
- * generation. Returns the txid the target was published at.
30
+ * Streams this database into a new, empty target generation.
31
+ * Returns the target txid. The caller must activate the generation.
32
32
  */
33
33
  compact_into(target: WasmEngine): bigint;
34
+ /**
35
+ * Omits the named internal stores during a rebuild. Compaction
36
+ * also omits the change log and retains the other stores.
37
+ */
38
+ compact_into_skipping_stores(target: WasmEngine, skip_stores: any): bigint;
34
39
  create_store(tx_id: bigint, name: string, options: any): void;
35
40
  delete(tx_id: bigint, store: string, key: Uint8Array): boolean;
36
41
  delete_many(tx_id: bigint, store: string, keys: any): any;
@@ -43,13 +48,17 @@ export class WasmEngine {
43
48
  get(tx_id: bigint, store: string, key: Uint8Array): any;
44
49
  get_many(tx_id: bigint, store: string, keys: any): any;
45
50
  /**
46
- * Keys arrive packed; values leave packed as
47
- * `u32 count | count x u32 length (u32::MAX = missing) | bytes`,
48
- * one buffer instead of one JS array per value.
51
+ * Returns packed values as
52
+ * `u32 count | count x u32 length (u32::MAX = missing) | bytes`.
53
+ * All integers are little-endian.
49
54
  */
50
55
  get_many_packed(tx_id: bigint, store: string, keys: Uint8Array): Uint8Array;
51
56
  get_schema_version(): bigint;
52
57
  has(tx_id: bigint, store: string, key: Uint8Array): boolean;
58
+ /**
59
+ * Checks existence using one TTL timestamp without loading value bodies.
60
+ */
61
+ has_many(tx_id: bigint, store: string, keys: any): any;
53
62
  health(): any;
54
63
  import_snapshot(data: Uint8Array): bigint;
55
64
  list_store_configs(): any;
@@ -75,8 +84,7 @@ export class WasmEngine {
75
84
  }
76
85
 
77
86
  /**
78
- * `"debug"` or `"release"`; benchmark reports record which build they
79
- * measured instead of trusting the build script that was supposed to run.
87
+ * Returns `"debug"` or `"release"` for the loaded WASM build.
80
88
  */
81
89
  export function buildProfile(): string;
82
90
 
@@ -89,16 +97,16 @@ export function deleteDB(name: string): Promise<void>;
89
97
  export function prepareRebuildTarget(name: string): Promise<any>;
90
98
 
91
99
  /**
92
- * Active generation from the control file, or `null` for the legacy
93
- * layout. A corrupt control file is an error, never `null`.
100
+ * Returns the active generation, or `null` for the legacy layout.
101
+ * A corrupt control file permits legacy fallback only while legacy data
102
+ * files remain. Otherwise it is an error.
94
103
  */
95
104
  export function readActiveGeneration(name: string): Promise<any>;
96
105
 
97
106
  /**
98
- * Publishes `generation_name` as the active generation. With
99
- * `expected_current` set, the swap fails unless the control file still
100
- * names that generation (or is absent, for `null`), and the written
101
- * control file is read back and verified before this resolves.
107
+ * Publishes `generation_name` only if the active generation matches
108
+ * `expected_current`. `None` requires no active generation.
109
+ * Verifies the written control file before returning.
102
110
  */
103
111
  export function swapActiveGeneration(name: string, generation_name: string, expected_current?: string | null): Promise<void>;
104
112
 
@@ -125,6 +133,7 @@ export interface InitOutput {
125
133
  readonly wasmengine_close: (a: number, b: number) => void;
126
134
  readonly wasmengine_commit_tx: (a: number, b: number, c: bigint) => void;
127
135
  readonly wasmengine_compact_into: (a: number, b: number, c: number) => void;
136
+ readonly wasmengine_compact_into_skipping_stores: (a: number, b: number, c: number, d: number) => void;
128
137
  readonly wasmengine_create_store: (a: number, b: number, c: bigint, d: number, e: number, f: number) => void;
129
138
  readonly wasmengine_delete: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
130
139
  readonly wasmengine_delete_many: (a: number, b: number, c: bigint, d: number, e: number, f: number) => void;
@@ -136,6 +145,7 @@ export interface InitOutput {
136
145
  readonly wasmengine_get_many_packed: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
137
146
  readonly wasmengine_get_schema_version: (a: number, b: number) => void;
138
147
  readonly wasmengine_has: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
148
+ readonly wasmengine_has_many: (a: number, b: number, c: bigint, d: number, e: number, f: number) => void;
139
149
  readonly wasmengine_health: (a: number, b: number) => void;
140
150
  readonly wasmengine_import_snapshot: (a: number, b: number, c: number, d: number) => void;
141
151
  readonly wasmengine_list_store_configs: (a: number, b: number) => void;
@@ -155,8 +165,8 @@ export interface InitOutput {
155
165
  readonly wasmengine_set_failpoint: (a: number, b: number, c: number) => void;
156
166
  readonly wasmengine_set_schema_version: (a: number, b: number, c: bigint, d: bigint) => void;
157
167
  readonly wasmengine_stats: (a: number, b: number) => void;
158
- readonly __wasm_bindgen_func_elem_665: (a: number, b: number, c: number, d: number) => void;
159
- readonly __wasm_bindgen_func_elem_680: (a: number, b: number, c: number, d: number) => void;
168
+ readonly __wasm_bindgen_func_elem_721: (a: number, b: number, c: number, d: number) => void;
169
+ readonly __wasm_bindgen_func_elem_736: (a: number, b: number, c: number, d: number) => void;
160
170
  readonly __wbindgen_export: (a: number, b: number) => number;
161
171
  readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
162
172
  readonly __wbindgen_export3: (a: number) => void;
@@ -1,5 +1,5 @@
1
1
  /* @ts-self-types="./moyodb_engine.d.ts" */
2
- import { opfsCleanupInactiveEntries, opfsCloseSession, opfsDbDirectorySize, opfsFlush, opfsLen, opfsOpenActiveDb, opfsOpenGenerationDb, opfsPrepareRebuildTarget, opfsReadActiveGeneration, opfsReadAt, opfsRemoveDb, opfsSwapActiveGeneration, opfsTruncate, opfsWriteAt } from './snippets/moyodb-engine-8ebe6af0cc2e81b7/js/opfs_shim.js';
2
+ import { opfsAppendOffset, opfsCleanupInactiveEntries, opfsCloseSession, opfsDbDirectorySize, opfsFlush, opfsLen, opfsOpenActiveDb, opfsOpenGenerationDb, opfsPrepareRebuildTarget, opfsReadActiveGeneration, opfsReadAtInto, opfsRemoveDb, opfsSwapActiveGeneration, opfsTruncate, opfsWriteAt } from './snippets/moyodb-engine-8ebe6af0cc2e81b7/js/opfs_shim.js';
3
3
 
4
4
 
5
5
  export class WasmEngine {
@@ -54,8 +54,8 @@ export class WasmEngine {
54
54
  }
55
55
  }
56
56
  /**
57
- * Returns one byte per op: for puts whether the key existed before,
58
- * for deletes whether a key was deleted. The op kinds are the caller's.
57
+ * Returns one byte per operation in input order. For puts, 1 means
58
+ * the key existed before the write. For deletes, 1 means it was deleted.
59
59
  * @param {bigint} tx_id
60
60
  * @param {string} store
61
61
  * @param {Uint8Array} ops
@@ -175,8 +175,8 @@ export class WasmEngine {
175
175
  }
176
176
  }
177
177
  /**
178
- * Checkpoints (when healthy) and closes. The handle is released even
179
- * when closing fails, so a retry never reuses a half-closed engine.
178
+ * Checkpoints a healthy engine and closes it. Releases the binding
179
+ * handle even on error so a retry cannot reuse a partially closed engine.
180
180
  */
181
181
  close() {
182
182
  try {
@@ -211,8 +211,8 @@ export class WasmEngine {
211
211
  }
212
212
  }
213
213
  /**
214
- * Streams this database into `target`, a freshly opened empty
215
- * generation. Returns the txid the target was published at.
214
+ * Streams this database into a new, empty target generation.
215
+ * Returns the target txid. The caller must activate the generation.
216
216
  * @param {WasmEngine} target
217
217
  * @returns {bigint}
218
218
  */
@@ -232,6 +232,29 @@ export class WasmEngine {
232
232
  wasm.__wbindgen_add_to_stack_pointer(16);
233
233
  }
234
234
  }
235
+ /**
236
+ * Omits the named internal stores during a rebuild. Compaction
237
+ * also omits the change log and retains the other stores.
238
+ * @param {WasmEngine} target
239
+ * @param {any} skip_stores
240
+ * @returns {bigint}
241
+ */
242
+ compact_into_skipping_stores(target, skip_stores) {
243
+ try {
244
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
245
+ _assertClass(target, WasmEngine);
246
+ wasm.wasmengine_compact_into_skipping_stores(retptr, this.__wbg_ptr, target.__wbg_ptr, addHeapObject(skip_stores));
247
+ var r0 = getDataViewMemory0().getBigInt64(retptr + 8 * 0, true);
248
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
249
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
250
+ if (r3) {
251
+ throw takeObject(r2);
252
+ }
253
+ return BigInt.asUintN(64, r0);
254
+ } finally {
255
+ wasm.__wbindgen_add_to_stack_pointer(16);
256
+ }
257
+ }
235
258
  /**
236
259
  * @param {bigint} tx_id
237
260
  * @param {string} name
@@ -418,9 +441,9 @@ export class WasmEngine {
418
441
  }
419
442
  }
420
443
  /**
421
- * Keys arrive packed; values leave packed as
422
- * `u32 count | count x u32 length (u32::MAX = missing) | bytes`,
423
- * one buffer instead of one JS array per value.
444
+ * Returns packed values as
445
+ * `u32 count | count x u32 length (u32::MAX = missing) | bytes`.
446
+ * All integers are little-endian.
424
447
  * @param {bigint} tx_id
425
448
  * @param {string} store
426
449
  * @param {Uint8Array} keys
@@ -491,6 +514,30 @@ export class WasmEngine {
491
514
  wasm.__wbindgen_add_to_stack_pointer(16);
492
515
  }
493
516
  }
517
+ /**
518
+ * Checks existence using one TTL timestamp without loading value bodies.
519
+ * @param {bigint} tx_id
520
+ * @param {string} store
521
+ * @param {any} keys
522
+ * @returns {any}
523
+ */
524
+ has_many(tx_id, store, keys) {
525
+ try {
526
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
527
+ const ptr0 = passStringToWasm0(store, wasm.__wbindgen_export, wasm.__wbindgen_export2);
528
+ const len0 = WASM_VECTOR_LEN;
529
+ wasm.wasmengine_has_many(retptr, this.__wbg_ptr, tx_id, ptr0, len0, addHeapObject(keys));
530
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
531
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
532
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
533
+ if (r2) {
534
+ throw takeObject(r1);
535
+ }
536
+ return takeObject(r0);
537
+ } finally {
538
+ wasm.__wbindgen_add_to_stack_pointer(16);
539
+ }
540
+ }
494
541
  /**
495
542
  * @returns {any}
496
543
  */
@@ -845,8 +892,7 @@ export class WasmEngine {
845
892
  if (Symbol.dispose) WasmEngine.prototype[Symbol.dispose] = WasmEngine.prototype.free;
846
893
 
847
894
  /**
848
- * `"debug"` or `"release"`; benchmark reports record which build they
849
- * measured instead of trusting the build script that was supposed to run.
895
+ * Returns `"debug"` or `"release"` for the loaded WASM build.
850
896
  * @returns {string}
851
897
  */
852
898
  export function buildProfile() {
@@ -911,8 +957,9 @@ export function prepareRebuildTarget(name) {
911
957
  }
912
958
 
913
959
  /**
914
- * Active generation from the control file, or `null` for the legacy
915
- * layout. A corrupt control file is an error, never `null`.
960
+ * Returns the active generation, or `null` for the legacy layout.
961
+ * A corrupt control file permits legacy fallback only while legacy data
962
+ * files remain. Otherwise it is an error.
916
963
  * @param {string} name
917
964
  * @returns {Promise<any>}
918
965
  */
@@ -924,10 +971,9 @@ export function readActiveGeneration(name) {
924
971
  }
925
972
 
926
973
  /**
927
- * Publishes `generation_name` as the active generation. With
928
- * `expected_current` set, the swap fails unless the control file still
929
- * names that generation (or is absent, for `null`), and the written
930
- * control file is read back and verified before this resolves.
974
+ * Publishes `generation_name` only if the active generation matches
975
+ * `expected_current`. `None` requires no active generation.
976
+ * Verifies the written control file before returning.
931
977
  * @param {string} name
932
978
  * @param {string} generation_name
933
979
  * @param {string | null} [expected_current]
@@ -1145,7 +1191,7 @@ function __wbg_get_imports() {
1145
1191
  const a = state0.a;
1146
1192
  state0.a = 0;
1147
1193
  try {
1148
- return __wasm_bindgen_func_elem_680(a, state0.b, arg0, arg1);
1194
+ return __wasm_bindgen_func_elem_736(a, state0.b, arg0, arg1);
1149
1195
  } finally {
1150
1196
  state0.a = a;
1151
1197
  }
@@ -1172,6 +1218,10 @@ function __wbg_get_imports() {
1172
1218
  const ret = Date.now();
1173
1219
  return ret;
1174
1220
  },
1221
+ __wbg_opfsAppendOffset_8c38ddb12af5281b: function() { return handleError(function (arg0, arg1) {
1222
+ const ret = opfsAppendOffset(arg0 >>> 0, arg1 >>> 0);
1223
+ return ret;
1224
+ }, arguments) ?? 0n; },
1175
1225
  __wbg_opfsCleanupInactiveEntries_e761ad3f373325fd: function() { return handleError(function (arg0, arg1) {
1176
1226
  const ret = opfsCleanupInactiveEntries(getStringFromWasm0(arg0, arg1));
1177
1227
  return addHeapObject(ret);
@@ -1206,9 +1256,9 @@ function __wbg_get_imports() {
1206
1256
  const ret = opfsReadActiveGeneration(getStringFromWasm0(arg0, arg1));
1207
1257
  return addHeapObject(ret);
1208
1258
  }, arguments); },
1209
- __wbg_opfsReadAt_e446074c3bbf69d1: function() { return handleError(function (arg0, arg1, arg2, arg3) {
1210
- const ret = opfsReadAt(arg0 >>> 0, arg1 >>> 0, BigInt.asUintN(64, arg2), arg3 >>> 0);
1211
- return addHeapObject(ret);
1259
+ __wbg_opfsReadAtInto_11f57c26cf06d807: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
1260
+ const ret = opfsReadAtInto(arg0 >>> 0, arg1 >>> 0, BigInt.asUintN(64, arg2), getArrayU8FromWasm0(arg3, arg4));
1261
+ return ret;
1212
1262
  }, arguments); },
1213
1263
  __wbg_opfsRemoveDb_7e05aef0688d4c5a: function() { return handleError(function (arg0, arg1) {
1214
1264
  const ret = opfsRemoveDb(getStringFromWasm0(arg0, arg1));
@@ -1283,8 +1333,8 @@ function __wbg_get_imports() {
1283
1333
  return addHeapObject(ret);
1284
1334
  },
1285
1335
  __wbindgen_generic_0000000000000001: function(arg0, arg1) {
1286
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 106, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1287
- const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_665);
1336
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 108, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
1337
+ const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_721);
1288
1338
  return addHeapObject(ret);
1289
1339
  },
1290
1340
  __wbindgen_generic_0000000000000002: function(arg0) {
@@ -1326,14 +1376,14 @@ function __wbg_get_imports() {
1326
1376
  };
1327
1377
  }
1328
1378
 
1329
- function __wasm_bindgen_func_elem_680(arg0, arg1, arg2, arg3) {
1330
- wasm.__wasm_bindgen_func_elem_680(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
1379
+ function __wasm_bindgen_func_elem_736(arg0, arg1, arg2, arg3) {
1380
+ wasm.__wasm_bindgen_func_elem_736(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
1331
1381
  }
1332
1382
 
1333
- function __wasm_bindgen_func_elem_665(arg0, arg1, arg2) {
1383
+ function __wasm_bindgen_func_elem_721(arg0, arg1, arg2) {
1334
1384
  try {
1335
1385
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
1336
- wasm.__wasm_bindgen_func_elem_665(retptr, arg0, arg1, addHeapObject(arg2));
1386
+ wasm.__wasm_bindgen_func_elem_721(retptr, arg0, arg1, addHeapObject(arg2));
1337
1387
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
1338
1388
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
1339
1389
  if (r1) {
Binary file
@@ -20,6 +20,7 @@ export const wasmengine_clear_store: (a: number, b: number, c: bigint, d: number
20
20
  export const wasmengine_close: (a: number, b: number) => void;
21
21
  export const wasmengine_commit_tx: (a: number, b: number, c: bigint) => void;
22
22
  export const wasmengine_compact_into: (a: number, b: number, c: number) => void;
23
+ export const wasmengine_compact_into_skipping_stores: (a: number, b: number, c: number, d: number) => void;
23
24
  export const wasmengine_create_store: (a: number, b: number, c: bigint, d: number, e: number, f: number) => void;
24
25
  export const wasmengine_delete: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
25
26
  export const wasmengine_delete_many: (a: number, b: number, c: bigint, d: number, e: number, f: number) => void;
@@ -31,6 +32,7 @@ export const wasmengine_get_many: (a: number, b: number, c: bigint, d: number, e
31
32
  export const wasmengine_get_many_packed: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
32
33
  export const wasmengine_get_schema_version: (a: number, b: number) => void;
33
34
  export const wasmengine_has: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
35
+ export const wasmengine_has_many: (a: number, b: number, c: bigint, d: number, e: number, f: number) => void;
34
36
  export const wasmengine_health: (a: number, b: number) => void;
35
37
  export const wasmengine_import_snapshot: (a: number, b: number, c: number, d: number) => void;
36
38
  export const wasmengine_list_store_configs: (a: number, b: number) => void;
@@ -50,8 +52,8 @@ export const wasmengine_set_change_feed_policy: (a: number, b: number, c: bigint
50
52
  export const wasmengine_set_failpoint: (a: number, b: number, c: number) => void;
51
53
  export const wasmengine_set_schema_version: (a: number, b: number, c: bigint, d: bigint) => void;
52
54
  export const wasmengine_stats: (a: number, b: number) => void;
53
- export const __wasm_bindgen_func_elem_665: (a: number, b: number, c: number, d: number) => void;
54
- export const __wasm_bindgen_func_elem_680: (a: number, b: number, c: number, d: number) => void;
55
+ export const __wasm_bindgen_func_elem_721: (a: number, b: number, c: number, d: number) => void;
56
+ export const __wasm_bindgen_func_elem_736: (a: number, b: number, c: number, d: number) => void;
55
57
  export const __wbindgen_export: (a: number, b: number) => number;
56
58
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
57
59
  export const __wbindgen_export3: (a: number) => void;