@dreamlake/dreamdb 0.5.2 → 0.5.4
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 +7 -0
- package/browser/dreamdb.d.ts +101 -3
- package/browser/dreamdb.js +1 -1
- package/browser/dreamdb_bg.js +337 -5
- package/browser/dreamdb_bg.wasm +0 -0
- package/browser/dreamdb_bg.wasm.d.ts +22 -0
- package/index.d.ts +121 -7
- package/node/dreamdb.cjs +360 -7
- package/node/dreamdb.d.cts +121 -7
- package/node/dreamdb_bg.wasm +0 -0
- package/node/dreamdb_bg.wasm.d.ts +27 -1
- package/node.mjs +5 -4
- package/package.json +1 -1
- package/web/dreamdb.d.ts +123 -3
- package/web/dreamdb.js +337 -5
- package/web/dreamdb_bg.wasm +0 -0
- package/web/dreamdb_bg.wasm.d.ts +22 -0
package/node/dreamdb.cjs
CHANGED
|
@@ -57,9 +57,11 @@ class Authoring {
|
|
|
57
57
|
* @param {boolean} rerank
|
|
58
58
|
* @param {number | null | undefined} version
|
|
59
59
|
* @param {Array<any>} samples
|
|
60
|
+
* @param {number | null} [bucket_max_bytes]
|
|
61
|
+
* @param {Uint8Array | null} [embed_spec]
|
|
60
62
|
* @returns {Promise<void>}
|
|
61
63
|
*/
|
|
62
|
-
addEmbeddingLayer(name, parent_field, dim, algorithm, spatial_index, compressor, rerank, version, samples) {
|
|
64
|
+
addEmbeddingLayer(name, parent_field, dim, algorithm, spatial_index, compressor, rerank, version, samples, bucket_max_bytes, embed_spec) {
|
|
63
65
|
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
64
66
|
const len0 = WASM_VECTOR_LEN;
|
|
65
67
|
const ptr1 = passStringToWasm0(parent_field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -70,7 +72,9 @@ class Authoring {
|
|
|
70
72
|
const len3 = WASM_VECTOR_LEN;
|
|
71
73
|
const ptr4 = passStringToWasm0(compressor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
72
74
|
const len4 = WASM_VECTOR_LEN;
|
|
73
|
-
|
|
75
|
+
var ptr5 = isLikeNone(embed_spec) ? 0 : passArray8ToWasm0(embed_spec, wasm.__wbindgen_malloc);
|
|
76
|
+
var len5 = WASM_VECTOR_LEN;
|
|
77
|
+
const ret = wasm.authoring_addEmbeddingLayer(this.__wbg_ptr, ptr0, len0, ptr1, len1, dim, ptr2, len2, ptr3, len3, ptr4, len4, rerank, isLikeNone(version) ? Number.MAX_SAFE_INTEGER : (version) >>> 0, samples, isLikeNone(bucket_max_bytes) ? Number.MAX_SAFE_INTEGER : (bucket_max_bytes) >>> 0, ptr5, len5);
|
|
74
78
|
return ret;
|
|
75
79
|
}
|
|
76
80
|
/**
|
|
@@ -123,6 +127,18 @@ class Authoring {
|
|
|
123
127
|
const ret = wasm.authoring_addScalarLayer(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, samples);
|
|
124
128
|
return ret;
|
|
125
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Append `[anchor, vector]` pairs, adopting a raw graph as Fresh Vamana.
|
|
132
|
+
* @param {string} field
|
|
133
|
+
* @param {Array<any>} samples
|
|
134
|
+
* @returns {Promise<any>}
|
|
135
|
+
*/
|
|
136
|
+
appendGraphNodes(field, samples) {
|
|
137
|
+
const ptr0 = passStringToWasm0(field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
138
|
+
const len0 = WASM_VECTOR_LEN;
|
|
139
|
+
const ret = wasm.authoring_appendGraphNodes(this.__wbg_ptr, ptr0, len0, samples);
|
|
140
|
+
return ret;
|
|
141
|
+
}
|
|
126
142
|
/**
|
|
127
143
|
* Fork the current manifest to a new ref name.
|
|
128
144
|
* @param {string} new_name
|
|
@@ -134,6 +150,31 @@ class Authoring {
|
|
|
134
150
|
const ret = wasm.authoring_branch(this.__wbg_ptr, ptr0, len0);
|
|
135
151
|
return ret;
|
|
136
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* Merge one or more branches into this ref. Returns the new manifest hash.
|
|
155
|
+
* Build a raw Vamana field. Samples are `[anchor, vector]` pairs; anchors
|
|
156
|
+
* use the same lossless representation as addEmbeddingLayer.
|
|
157
|
+
* @param {string} name
|
|
158
|
+
* @param {string} parent_field
|
|
159
|
+
* @param {number} dim
|
|
160
|
+
* @param {Array<any>} samples
|
|
161
|
+
* @param {number} r
|
|
162
|
+
* @param {Uint8Array} seed
|
|
163
|
+
* @param {Uint8Array | null} [embed_spec]
|
|
164
|
+
* @returns {Promise<void>}
|
|
165
|
+
*/
|
|
166
|
+
buildGraphIndex(name, parent_field, dim, samples, r, seed, embed_spec) {
|
|
167
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
168
|
+
const len0 = WASM_VECTOR_LEN;
|
|
169
|
+
const ptr1 = passStringToWasm0(parent_field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
170
|
+
const len1 = WASM_VECTOR_LEN;
|
|
171
|
+
const ptr2 = passArray8ToWasm0(seed, wasm.__wbindgen_malloc);
|
|
172
|
+
const len2 = WASM_VECTOR_LEN;
|
|
173
|
+
var ptr3 = isLikeNone(embed_spec) ? 0 : passArray8ToWasm0(embed_spec, wasm.__wbindgen_malloc);
|
|
174
|
+
var len3 = WASM_VECTOR_LEN;
|
|
175
|
+
const ret = wasm.authoring_buildGraphIndex(this.__wbg_ptr, ptr0, len0, ptr1, len1, dim, samples, r, ptr2, len2, ptr3, len3);
|
|
176
|
+
return ret;
|
|
177
|
+
}
|
|
137
178
|
/**
|
|
138
179
|
* Collapse per-cell fragments. Returns
|
|
139
180
|
* `{cellsExamined, cellsCompacted, fragmentsCollapsed, manifest?}`.
|
|
@@ -153,6 +194,33 @@ class Authoring {
|
|
|
153
194
|
const ret = wasm.authoring_compact(this.__wbg_ptr, ptr0, len0, threshold, max_cells);
|
|
154
195
|
return ret;
|
|
155
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* Compress a raw graph with canonical VectorCompressor CBOR. The raw
|
|
199
|
+
* lineage is retained; rerank selects exact scoring of the candidate pool.
|
|
200
|
+
* @param {string} field
|
|
201
|
+
* @param {Uint8Array} compressor
|
|
202
|
+
* @param {boolean} rerank
|
|
203
|
+
* @returns {Promise<void>}
|
|
204
|
+
*/
|
|
205
|
+
compressGraphIndex(field, compressor, rerank) {
|
|
206
|
+
const ptr0 = passStringToWasm0(field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
207
|
+
const len0 = WASM_VECTOR_LEN;
|
|
208
|
+
const ptr1 = passArray8ToWasm0(compressor, wasm.__wbindgen_malloc);
|
|
209
|
+
const len1 = WASM_VECTOR_LEN;
|
|
210
|
+
const ret = wasm.authoring_compressGraphIndex(this.__wbg_ptr, ptr0, len0, ptr1, len1, rerank);
|
|
211
|
+
return ret;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Caller-driven region consolidation; does not erase tombstones or ids.
|
|
215
|
+
* @param {string} field
|
|
216
|
+
* @returns {Promise<any>}
|
|
217
|
+
*/
|
|
218
|
+
consolidateGraph(field) {
|
|
219
|
+
const ptr0 = passStringToWasm0(field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
220
|
+
const len0 = WASM_VECTOR_LEN;
|
|
221
|
+
const ret = wasm.authoring_consolidateGraph(this.__wbg_ptr, ptr0, len0);
|
|
222
|
+
return ret;
|
|
223
|
+
}
|
|
156
224
|
/**
|
|
157
225
|
* Create a new dataset and publish `refs/<name>`.
|
|
158
226
|
*
|
|
@@ -200,7 +268,6 @@ class Authoring {
|
|
|
200
268
|
return ret;
|
|
201
269
|
}
|
|
202
270
|
/**
|
|
203
|
-
* Merge one or more branches into this ref. Returns the new manifest hash.
|
|
204
271
|
* @param {string[]} branches
|
|
205
272
|
* @returns {Promise<string>}
|
|
206
273
|
*/
|
|
@@ -261,6 +328,68 @@ class Authoring {
|
|
|
261
328
|
if (Symbol.dispose) Authoring.prototype[Symbol.dispose] = Authoring.prototype.free;
|
|
262
329
|
exports.Authoring = Authoring;
|
|
263
330
|
|
|
331
|
+
class GeometryReader {
|
|
332
|
+
static __wrap(ptr) {
|
|
333
|
+
const obj = Object.create(GeometryReader.prototype);
|
|
334
|
+
obj.__wbg_ptr = ptr;
|
|
335
|
+
GeometryReaderFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
336
|
+
return obj;
|
|
337
|
+
}
|
|
338
|
+
__destroy_into_raw() {
|
|
339
|
+
const ptr = this.__wbg_ptr;
|
|
340
|
+
this.__wbg_ptr = 0;
|
|
341
|
+
GeometryReaderFinalization.unregister(this);
|
|
342
|
+
return ptr;
|
|
343
|
+
}
|
|
344
|
+
free() {
|
|
345
|
+
const ptr = this.__destroy_into_raw();
|
|
346
|
+
wasm.__wbg_geometryreader_free(ptr, 0);
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Returns only the new suffix at this total logical byte budget.
|
|
350
|
+
* @param {any} key
|
|
351
|
+
* @param {any} budget
|
|
352
|
+
* @returns {Promise<Uint8Array>}
|
|
353
|
+
*/
|
|
354
|
+
extendCellPrefix(key, budget) {
|
|
355
|
+
const ret = wasm.geometryreader_extendCellPrefix(this.__wbg_ptr, key, budget);
|
|
356
|
+
return ret;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Declaration plus cells/LODs; no payload transfer. u64 values are BigInt.
|
|
360
|
+
* @returns {any}
|
|
361
|
+
*/
|
|
362
|
+
metadata() {
|
|
363
|
+
const ret = wasm.geometryreader_metadata(this.__wbg_ptr);
|
|
364
|
+
if (ret[2]) {
|
|
365
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
366
|
+
}
|
|
367
|
+
return takeFromExternrefTable0(ret[0]);
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* @param {any} level
|
|
371
|
+
* @returns {Promise<Uint8Array>}
|
|
372
|
+
*/
|
|
373
|
+
readMeshLod(level) {
|
|
374
|
+
const ret = wasm.geometryreader_readMeshLod(this.__wbg_ptr, level);
|
|
375
|
+
return ret;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* @param {any} min
|
|
379
|
+
* @param {any} max
|
|
380
|
+
* @returns {Array<any>}
|
|
381
|
+
*/
|
|
382
|
+
selectCells(min, max) {
|
|
383
|
+
const ret = wasm.geometryreader_selectCells(this.__wbg_ptr, min, max);
|
|
384
|
+
if (ret[2]) {
|
|
385
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
386
|
+
}
|
|
387
|
+
return takeFromExternrefTable0(ret[0]);
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
if (Symbol.dispose) GeometryReader.prototype[Symbol.dispose] = GeometryReader.prototype.free;
|
|
391
|
+
exports.GeometryReader = GeometryReader;
|
|
392
|
+
|
|
264
393
|
/**
|
|
265
394
|
* A `fetch`-backed backend rooted at a base URL.
|
|
266
395
|
*/
|
|
@@ -350,6 +479,29 @@ class Space {
|
|
|
350
479
|
const ptr = this.__destroy_into_raw();
|
|
351
480
|
wasm.__wbg_space_free(ptr, 0);
|
|
352
481
|
}
|
|
482
|
+
/**
|
|
483
|
+
* Validate all referenced Items, including tombstoned payloads.
|
|
484
|
+
* @param {string} field
|
|
485
|
+
* @returns {Promise<bigint>}
|
|
486
|
+
*/
|
|
487
|
+
auditArrayField(field) {
|
|
488
|
+
const ptr0 = passStringToWasm0(field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
489
|
+
const len0 = WASM_VECTOR_LEN;
|
|
490
|
+
const ret = wasm.space_auditArrayField(this.__wbg_ptr, ptr0, len0);
|
|
491
|
+
return ret;
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* Validate all graph pages and, when declared, exact-source correspondence.
|
|
495
|
+
* The returned count is exactly representable (GraphIndex node_count is u32).
|
|
496
|
+
* @param {string} field
|
|
497
|
+
* @returns {Promise<number>}
|
|
498
|
+
*/
|
|
499
|
+
auditGraphIndex(field) {
|
|
500
|
+
const ptr0 = passStringToWasm0(field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
501
|
+
const len0 = WASM_VECTOR_LEN;
|
|
502
|
+
const ret = wasm.space_auditGraphIndex(this.__wbg_ptr, ptr0, len0);
|
|
503
|
+
return ret;
|
|
504
|
+
}
|
|
353
505
|
/**
|
|
354
506
|
* The base URL objects are fetched relative to (consumers build their own
|
|
355
507
|
* object URLs from this — e.g. `dreamdb-demo`'s track readers).
|
|
@@ -413,6 +565,17 @@ class Space {
|
|
|
413
565
|
const ret = wasm.space_fromUri(ptr0, len0, backend);
|
|
414
566
|
return ret;
|
|
415
567
|
}
|
|
568
|
+
/**
|
|
569
|
+
* Read at this pinned Manifest. Returns null for never-created keys;
|
|
570
|
+
* deleted keys retain metadata with sample=null. Integer keys and anchors
|
|
571
|
+
* are BigInt; sample values use the Writer's tagged field shapes.
|
|
572
|
+
* @param {any} key
|
|
573
|
+
* @returns {Promise<any>}
|
|
574
|
+
*/
|
|
575
|
+
getEntity(key) {
|
|
576
|
+
const ret = wasm.space_getEntity(this.__wbg_ptr, key);
|
|
577
|
+
return ret;
|
|
578
|
+
}
|
|
416
579
|
/**
|
|
417
580
|
* Walk the manifest DAG from HEAD, up to `max_depth` entries. Each entry:
|
|
418
581
|
* `{ manifestHash, ts, writer, tracks: [{modality, address}] }`.
|
|
@@ -439,6 +602,18 @@ class Space {
|
|
|
439
602
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
440
603
|
}
|
|
441
604
|
}
|
|
605
|
+
/**
|
|
606
|
+
* Open one pinned geometry Item. Missing/deleted anchors return undefined.
|
|
607
|
+
* @param {string} field
|
|
608
|
+
* @param {any} anchor
|
|
609
|
+
* @returns {Promise<GeometryReader | undefined>}
|
|
610
|
+
*/
|
|
611
|
+
openGeometryItem(field, anchor) {
|
|
612
|
+
const ptr0 = passStringToWasm0(field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
613
|
+
const len0 = WASM_VECTOR_LEN;
|
|
614
|
+
const ret = wasm.space_openGeometryItem(this.__wbg_ptr, ptr0, len0, anchor);
|
|
615
|
+
return ret;
|
|
616
|
+
}
|
|
442
617
|
/**
|
|
443
618
|
* Hybrid search fusing a lexical (BM25) sub-query and a dense (vector)
|
|
444
619
|
* sub-query per spec/0015 §5/§6. Returns the fused `[{ anchor, score }]`
|
|
@@ -461,8 +636,8 @@ class Space {
|
|
|
461
636
|
* ```
|
|
462
637
|
*
|
|
463
638
|
* Delegates to the real (tested) `dreamdb-dataset::Dataset::query_hybrid`.
|
|
464
|
-
*
|
|
465
|
-
* scalar
|
|
639
|
+
* Optional `scalarField` / `scalarOp` / `scalarValue` properties select
|
|
640
|
+
* the same scalar pre/post-filter planner used by the native API.
|
|
466
641
|
* @param {Float32Array} vector
|
|
467
642
|
* @param {any} opts
|
|
468
643
|
* @returns {Promise<Array<any>>}
|
|
@@ -473,6 +648,21 @@ class Space {
|
|
|
473
648
|
const ret = wasm.space_queryHybrid(this.__wbg_ptr, ptr0, len0, opts);
|
|
474
649
|
return ret;
|
|
475
650
|
}
|
|
651
|
+
/**
|
|
652
|
+
* Hybrid query with an observable `{hits, trace}` result. `opts` accepts
|
|
653
|
+
* `maxLatencyMs`, `costModel`, and the optional scalar triple
|
|
654
|
+
* `scalarField`/`scalarOp`/`scalarValue` in addition to `queryHybrid`'s
|
|
655
|
+
* existing properties.
|
|
656
|
+
* @param {Float32Array} vector
|
|
657
|
+
* @param {any} opts
|
|
658
|
+
* @returns {Promise<any>}
|
|
659
|
+
*/
|
|
660
|
+
queryHybridPlanned(vector, opts) {
|
|
661
|
+
const ptr0 = passArrayF32ToWasm0(vector, wasm.__wbindgen_malloc);
|
|
662
|
+
const len0 = WASM_VECTOR_LEN;
|
|
663
|
+
const ret = wasm.space_queryHybridPlanned(this.__wbg_ptr, ptr0, len0, opts);
|
|
664
|
+
return ret;
|
|
665
|
+
}
|
|
476
666
|
/**
|
|
477
667
|
* Scalar-index lookup: every anchor whose `field` satisfies `op value`
|
|
478
668
|
* (spec/0011). Returns a `BigUint64Array`-style `Array` of anchors,
|
|
@@ -528,7 +718,11 @@ class Space {
|
|
|
528
718
|
}
|
|
529
719
|
/**
|
|
530
720
|
* Top-K cosine vector search over an embedding `field`. `opts` may be a
|
|
531
|
-
* number (topK) or `{ topK?, probeCount
|
|
721
|
+
* number (topK) or `{ topK?, probeCount?, specId?, rerankPoolSize?, rerankMode? }`.
|
|
722
|
+
* The optional pool must be a positive integer at least topK; it changes
|
|
723
|
+
* neither probe coverage nor Schema exactness. rerankMode explicitly selects
|
|
724
|
+
* inherit (default), approximate or exact. Graphs reject explicit overrides.
|
|
725
|
+
* Returns `[{ anchor, score }]`
|
|
532
726
|
* sorted by score descending — the shape dreamdb-ts's `queryVector` yields.
|
|
533
727
|
*
|
|
534
728
|
* Delegates to the real (tested) `dreamdb-dataset` query path: ADC cull +
|
|
@@ -570,6 +764,19 @@ class Space {
|
|
|
570
764
|
const ret = wasm.space_readArrayConstant(this.__wbg_ptr, ptr0, len0);
|
|
571
765
|
return ret;
|
|
572
766
|
}
|
|
767
|
+
/**
|
|
768
|
+
* Point read; full-u64 BigInt anchors are supported. Returned components
|
|
769
|
+
* are owned typed arrays (one Item's bytes), never unaligned aliases.
|
|
770
|
+
* @param {string} field
|
|
771
|
+
* @param {any} anchor
|
|
772
|
+
* @returns {Promise<any>}
|
|
773
|
+
*/
|
|
774
|
+
readArrayItem(field, anchor) {
|
|
775
|
+
const ptr0 = passStringToWasm0(field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
776
|
+
const len0 = WASM_VECTOR_LEN;
|
|
777
|
+
const ret = wasm.space_readArrayItem(this.__wbg_ptr, ptr0, len0, anchor);
|
|
778
|
+
return ret;
|
|
779
|
+
}
|
|
573
780
|
/**
|
|
574
781
|
* Read a scalar track as a `Map<anchorString, value>`. Single-anchor
|
|
575
782
|
* entries resolve from the track index; multi-anchor entries fetch (and
|
|
@@ -740,6 +947,17 @@ class Writer {
|
|
|
740
947
|
const ptr = this.__destroy_into_raw();
|
|
741
948
|
wasm.__wbg_writer_free(ptr, 0);
|
|
742
949
|
}
|
|
950
|
+
/**
|
|
951
|
+
* Atomically hot-append a complete Sample batch. Embeddings retain v1;
|
|
952
|
+
* scalar/text values use v2. Identified embeddings require embeddingSpecs.
|
|
953
|
+
* @param {Array<any>} samples
|
|
954
|
+
* @param {object | null} [embedding_specs]
|
|
955
|
+
* @returns {Promise<number>}
|
|
956
|
+
*/
|
|
957
|
+
appendHot(samples, embedding_specs) {
|
|
958
|
+
const ret = wasm.writer_appendHot(this.__wbg_ptr, samples, isLikeNone(embedding_specs) ? 0 : addToExternrefTable0(embedding_specs));
|
|
959
|
+
return ret;
|
|
960
|
+
}
|
|
743
961
|
/**
|
|
744
962
|
* Append records and commit in one call.
|
|
745
963
|
*
|
|
@@ -758,6 +976,17 @@ class Writer {
|
|
|
758
976
|
const ret = wasm.writer_appendMany(this.__wbg_ptr, samples);
|
|
759
977
|
return ret;
|
|
760
978
|
}
|
|
979
|
+
/**
|
|
980
|
+
* Append records with a field-to-`spec_id` map for identified embeddings.
|
|
981
|
+
* Values are full canonical base32 multihashes.
|
|
982
|
+
* @param {Array<any>} samples
|
|
983
|
+
* @param {object} embedding_specs
|
|
984
|
+
* @returns {Promise<number>}
|
|
985
|
+
*/
|
|
986
|
+
appendManyWithSpecs(samples, embedding_specs) {
|
|
987
|
+
const ret = wasm.writer_appendManyWithSpecs(this.__wbg_ptr, samples, embedding_specs);
|
|
988
|
+
return ret;
|
|
989
|
+
}
|
|
761
990
|
/**
|
|
762
991
|
* Flush staged entries and publish a new manifest.
|
|
763
992
|
*
|
|
@@ -771,6 +1000,38 @@ class Writer {
|
|
|
771
1000
|
const ret = wasm.writer_commit(this.__wbg_ptr);
|
|
772
1001
|
return ret;
|
|
773
1002
|
}
|
|
1003
|
+
/**
|
|
1004
|
+
* Producer policy only: TTL is evaluated on append, not by a timer.
|
|
1005
|
+
* @param {number} flush_threshold
|
|
1006
|
+
* @param {number} ttl_seconds
|
|
1007
|
+
*/
|
|
1008
|
+
configureHotShard(flush_threshold, ttl_seconds) {
|
|
1009
|
+
const ret = wasm.writer_configureHotShard(this.__wbg_ptr, flush_threshold, ttl_seconds);
|
|
1010
|
+
if (ret[1]) {
|
|
1011
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
/**
|
|
1015
|
+
* Create a never-used key. Sample uses appendMany's tagged fields, no anchor.
|
|
1016
|
+
* @param {any} key
|
|
1017
|
+
* @param {object} sample
|
|
1018
|
+
* @param {object | null} [embedding_specs]
|
|
1019
|
+
* @returns {Promise<object>}
|
|
1020
|
+
*/
|
|
1021
|
+
createEntity(key, sample, embedding_specs) {
|
|
1022
|
+
const ret = wasm.writer_createEntity(this.__wbg_ptr, key, sample, isLikeNone(embedding_specs) ? 0 : addToExternrefTable0(embedding_specs));
|
|
1023
|
+
return ret;
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* Delete exactly a live revision, retaining its key and stable identity.
|
|
1027
|
+
* @param {any} key
|
|
1028
|
+
* @param {Uint8Array} expected
|
|
1029
|
+
* @returns {Promise<object>}
|
|
1030
|
+
*/
|
|
1031
|
+
deleteEntity(key, expected) {
|
|
1032
|
+
const ret = wasm.writer_deleteEntity(this.__wbg_ptr, key, expected);
|
|
1033
|
+
return ret;
|
|
1034
|
+
}
|
|
774
1035
|
/**
|
|
775
1036
|
* Tombstone records by anchor. Returns the new manifest hash.
|
|
776
1037
|
* @param {BigUint64Array} anchors
|
|
@@ -785,6 +1046,25 @@ class Writer {
|
|
|
785
1046
|
const ret = wasm.writer_deleteRecords(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
786
1047
|
return ret;
|
|
787
1048
|
}
|
|
1049
|
+
/**
|
|
1050
|
+
* Enable one exact typed entity namespace: string, bytes or int.
|
|
1051
|
+
* @param {string} key_kind
|
|
1052
|
+
* @returns {Promise<void>}
|
|
1053
|
+
*/
|
|
1054
|
+
enableEntityKeys(key_kind) {
|
|
1055
|
+
const ptr0 = passStringToWasm0(key_kind, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1056
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1057
|
+
const ret = wasm.writer_enableEntityKeys(this.__wbg_ptr, ptr0, len0);
|
|
1058
|
+
return ret;
|
|
1059
|
+
}
|
|
1060
|
+
/**
|
|
1061
|
+
* Explicitly fold every pending hot field into cold Tracks in one publish.
|
|
1062
|
+
* @returns {Promise<void>}
|
|
1063
|
+
*/
|
|
1064
|
+
flushHot() {
|
|
1065
|
+
const ret = wasm.writer_flushHot(this.__wbg_ptr);
|
|
1066
|
+
return ret;
|
|
1067
|
+
}
|
|
788
1068
|
/**
|
|
789
1069
|
* Ingest a pre-fragmented CMAF (fragmented-MP4) video into a Video field
|
|
790
1070
|
* as a `spec/0007` §5 media Track — the thing that makes a video Track
|
|
@@ -877,6 +1157,36 @@ class Writer {
|
|
|
877
1157
|
const ret = wasm.writer_open(ptr0, len0, backend);
|
|
878
1158
|
return ret;
|
|
879
1159
|
}
|
|
1160
|
+
/**
|
|
1161
|
+
* Publish prequantized fixed-stride records. Coordinates is
|
|
1162
|
+
* {origin:[x,y,z],step:[x,y,z],units:string}; depth is 0..16.
|
|
1163
|
+
* @param {string} field
|
|
1164
|
+
* @param {any} anchor
|
|
1165
|
+
* @param {any} coordinates
|
|
1166
|
+
* @param {any} depth
|
|
1167
|
+
* @param {Uint8Array} records
|
|
1168
|
+
* @returns {Promise<string>}
|
|
1169
|
+
*/
|
|
1170
|
+
publishGeometryCells(field, anchor, coordinates, depth, records) {
|
|
1171
|
+
const ptr0 = passStringToWasm0(field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1172
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1173
|
+
const ret = wasm.writer_publishGeometryCells(this.__wbg_ptr, ptr0, len0, anchor, coordinates, depth, records);
|
|
1174
|
+
return ret;
|
|
1175
|
+
}
|
|
1176
|
+
/**
|
|
1177
|
+
* Each level is {errorGrid,vertices,triangles,bytes:Uint8Array}.
|
|
1178
|
+
* @param {string} field
|
|
1179
|
+
* @param {any} anchor
|
|
1180
|
+
* @param {any} coordinates
|
|
1181
|
+
* @param {Array<any>} levels
|
|
1182
|
+
* @returns {Promise<string>}
|
|
1183
|
+
*/
|
|
1184
|
+
publishGeometryMesh(field, anchor, coordinates, levels) {
|
|
1185
|
+
const ptr0 = passStringToWasm0(field, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1186
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1187
|
+
const ret = wasm.writer_publishGeometryMesh(this.__wbg_ptr, ptr0, len0, anchor, coordinates, levels);
|
|
1188
|
+
return ret;
|
|
1189
|
+
}
|
|
880
1190
|
/**
|
|
881
1191
|
* The ref this writer advances.
|
|
882
1192
|
* @returns {string}
|
|
@@ -904,6 +1214,30 @@ class Writer {
|
|
|
904
1214
|
const ret = wasm.writer_snapshot(this.__wbg_ptr, ptr0, len0);
|
|
905
1215
|
return ret;
|
|
906
1216
|
}
|
|
1217
|
+
/**
|
|
1218
|
+
* Replace only a live revision, atomically hiding its old physical row.
|
|
1219
|
+
* @param {any} key
|
|
1220
|
+
* @param {object} sample
|
|
1221
|
+
* @param {Uint8Array} expected
|
|
1222
|
+
* @param {object | null} [embedding_specs]
|
|
1223
|
+
* @returns {Promise<object>}
|
|
1224
|
+
*/
|
|
1225
|
+
supersedeEntity(key, sample, expected, embedding_specs) {
|
|
1226
|
+
const ret = wasm.writer_supersedeEntity(this.__wbg_ptr, key, sample, expected, isLikeNone(embedding_specs) ? 0 : addToExternrefTable0(embedding_specs));
|
|
1227
|
+
return ret;
|
|
1228
|
+
}
|
|
1229
|
+
/**
|
|
1230
|
+
* Create with no expected token, or replace/restore exactly that revision.
|
|
1231
|
+
* @param {any} key
|
|
1232
|
+
* @param {object} sample
|
|
1233
|
+
* @param {Uint8Array | null} [expected]
|
|
1234
|
+
* @param {object | null} [embedding_specs]
|
|
1235
|
+
* @returns {Promise<object>}
|
|
1236
|
+
*/
|
|
1237
|
+
upsertEntity(key, sample, expected, embedding_specs) {
|
|
1238
|
+
const ret = wasm.writer_upsertEntity(this.__wbg_ptr, key, sample, isLikeNone(expected) ? 0 : addToExternrefTable0(expected), isLikeNone(embedding_specs) ? 0 : addToExternrefTable0(embedding_specs));
|
|
1239
|
+
return ret;
|
|
1240
|
+
}
|
|
907
1241
|
}
|
|
908
1242
|
if (Symbol.dispose) Writer.prototype[Symbol.dispose] = Writer.prototype.free;
|
|
909
1243
|
exports.Writer = Writer;
|
|
@@ -1414,6 +1748,14 @@ function __wbg_get_imports() {
|
|
|
1414
1748
|
__wbg_error_f085d7e62279b703: function(arg0) {
|
|
1415
1749
|
console.error(arg0);
|
|
1416
1750
|
},
|
|
1751
|
+
__wbg_from_fa561fa561dc8031: function(arg0) {
|
|
1752
|
+
const ret = Array.from(arg0);
|
|
1753
|
+
return ret;
|
|
1754
|
+
},
|
|
1755
|
+
__wbg_geometryreader_new: function(arg0) {
|
|
1756
|
+
const ret = GeometryReader.__wrap(arg0);
|
|
1757
|
+
return ret;
|
|
1758
|
+
},
|
|
1417
1759
|
__wbg_getRandomValues_c44a50d8cfdaebeb: function() { return handleError(function (arg0, arg1) {
|
|
1418
1760
|
arg0.getRandomValues(arg1);
|
|
1419
1761
|
}, arguments); },
|
|
@@ -1544,6 +1886,10 @@ function __wbg_get_imports() {
|
|
|
1544
1886
|
const ret = Symbol.iterator;
|
|
1545
1887
|
return ret;
|
|
1546
1888
|
},
|
|
1889
|
+
__wbg_keys_682010b680c9b1f8: function(arg0) {
|
|
1890
|
+
const ret = Object.keys(arg0);
|
|
1891
|
+
return ret;
|
|
1892
|
+
},
|
|
1547
1893
|
__wbg_length_0adf2f3c5da33087: function(arg0) {
|
|
1548
1894
|
const ret = arg0.length;
|
|
1549
1895
|
return ret;
|
|
@@ -1612,6 +1958,10 @@ function __wbg_get_imports() {
|
|
|
1612
1958
|
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
1613
1959
|
return ret;
|
|
1614
1960
|
},
|
|
1961
|
+
__wbg_new_from_slice_7a419f18ea6472bf: function(arg0, arg1) {
|
|
1962
|
+
const ret = new Float32Array(getArrayF32FromWasm0(arg0, arg1));
|
|
1963
|
+
return ret;
|
|
1964
|
+
},
|
|
1615
1965
|
__wbg_new_typed_c072c4ce9a2a0cdf: function(arg0, arg1) {
|
|
1616
1966
|
try {
|
|
1617
1967
|
var state0 = {a: arg0, b: arg1};
|
|
@@ -1813,7 +2163,7 @@ function __wbg_get_imports() {
|
|
|
1813
2163
|
return ret;
|
|
1814
2164
|
},
|
|
1815
2165
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
1816
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
2166
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 948, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1817
2167
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_f7c54996eb9137d9___convert__closures_____invoke___wasm_bindgen_f7c54996eb9137d9___JsValue__core_7d5f0a2ba6a62c33___result__Result_____wasm_bindgen_f7c54996eb9137d9___JsError___true_);
|
|
1818
2168
|
return ret;
|
|
1819
2169
|
},
|
|
@@ -1884,6 +2234,9 @@ function wasm_bindgen_f7c54996eb9137d9___convert__closures_____invoke___js_sys_a
|
|
|
1884
2234
|
const AuthoringFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1885
2235
|
? { register: () => {}, unregister: () => {} }
|
|
1886
2236
|
: new FinalizationRegistry(ptr => wasm.__wbg_authoring_free(ptr, 1));
|
|
2237
|
+
const GeometryReaderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2238
|
+
? { register: () => {}, unregister: () => {} }
|
|
2239
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_geometryreader_free(ptr, 1));
|
|
1887
2240
|
const S3BackendFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1888
2241
|
? { register: () => {}, unregister: () => {} }
|
|
1889
2242
|
: new FinalizationRegistry(ptr => wasm.__wbg_s3backend_free(ptr, 1));
|