@dreamlake/dreamdb 0.5.2 → 0.5.3
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 +6 -0
- package/browser/dreamdb.d.ts +96 -2
- package/browser/dreamdb.js +1 -1
- package/browser/dreamdb_bg.js +332 -4
- package/browser/dreamdb_bg.wasm +0 -0
- package/browser/dreamdb_bg.wasm.d.ts +22 -0
- package/index.d.ts +116 -6
- package/node/dreamdb.cjs +355 -6
- package/node/dreamdb.d.cts +116 -6
- 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 +118 -2
- package/web/dreamdb.js +332 -4
- package/web/dreamdb_bg.wasm +0 -0
- package/web/dreamdb_bg.wasm.d.ts +22 -0
package/node/dreamdb.d.cts
CHANGED
|
@@ -31,7 +31,7 @@ export class Authoring {
|
|
|
31
31
|
* off, reads decode 1-bit reconstructions and relevance degrades in a way
|
|
32
32
|
* no API-level check can see.
|
|
33
33
|
*/
|
|
34
|
-
addEmbeddingLayer(name: string, parent_field: string, dim: number, algorithm: string, spatial_index: string, compressor: string, rerank: boolean, version: number | null | undefined, samples: Array<any
|
|
34
|
+
addEmbeddingLayer(name: string, parent_field: string, dim: number, algorithm: string, spatial_index: string, compressor: string, rerank: boolean, version: number | null | undefined, samples: Array<any>, bucket_max_bytes?: number | null, embed_spec?: Uint8Array | null): Promise<void>;
|
|
35
35
|
/**
|
|
36
36
|
* Add a field to the schema of an existing dataset.
|
|
37
37
|
*/
|
|
@@ -49,10 +49,20 @@ export class Authoring {
|
|
|
49
49
|
* `int|float|bool|string|categorical|timestamp`.
|
|
50
50
|
*/
|
|
51
51
|
addScalarLayer(name: string, parent_field: string, value_type: string, samples: Array<any>): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Append `[anchor, vector]` pairs, adopting a raw graph as Fresh Vamana.
|
|
54
|
+
*/
|
|
55
|
+
appendGraphNodes(field: string, samples: Array<any>): Promise<any>;
|
|
52
56
|
/**
|
|
53
57
|
* Fork the current manifest to a new ref name.
|
|
54
58
|
*/
|
|
55
59
|
branch(new_name: string): Promise<Authoring>;
|
|
60
|
+
/**
|
|
61
|
+
* Merge one or more branches into this ref. Returns the new manifest hash.
|
|
62
|
+
* Build a raw Vamana field. Samples are `[anchor, vector]` pairs; anchors
|
|
63
|
+
* use the same lossless representation as addEmbeddingLayer.
|
|
64
|
+
*/
|
|
65
|
+
buildGraphIndex(name: string, parent_field: string, dim: number, samples: Array<any>, r: number, seed: Uint8Array, embed_spec?: Uint8Array | null): Promise<void>;
|
|
56
66
|
/**
|
|
57
67
|
* Collapse per-cell fragments. Returns
|
|
58
68
|
* `{cellsExamined, cellsCompacted, fragmentsCollapsed, manifest?}`.
|
|
@@ -63,6 +73,15 @@ export class Authoring {
|
|
|
63
73
|
* nothing needed compacting — a no-op, not a failure.
|
|
64
74
|
*/
|
|
65
75
|
compact(modality: string | null | undefined, threshold: number, max_cells: number): Promise<any>;
|
|
76
|
+
/**
|
|
77
|
+
* Compress a raw graph with canonical VectorCompressor CBOR. The raw
|
|
78
|
+
* lineage is retained; rerank selects exact scoring of the candidate pool.
|
|
79
|
+
*/
|
|
80
|
+
compressGraphIndex(field: string, compressor: Uint8Array, rerank: boolean): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Caller-driven region consolidation; does not erase tombstones or ids.
|
|
83
|
+
*/
|
|
84
|
+
consolidateGraph(field: string): Promise<any>;
|
|
66
85
|
/**
|
|
67
86
|
* Create a new dataset and publish `refs/<name>`.
|
|
68
87
|
*
|
|
@@ -86,9 +105,6 @@ export class Authoring {
|
|
|
86
105
|
* Ref names under `refs/`. Requires a backend implementing `list`.
|
|
87
106
|
*/
|
|
88
107
|
listRefs(): Promise<string[]>;
|
|
89
|
-
/**
|
|
90
|
-
* Merge one or more branches into this ref. Returns the new manifest hash.
|
|
91
|
-
*/
|
|
92
108
|
mergeMany(branches: string[]): Promise<string>;
|
|
93
109
|
/**
|
|
94
110
|
* Open an existing ref for authoring.
|
|
@@ -108,6 +124,22 @@ export class Authoring {
|
|
|
108
124
|
readonly refName: string;
|
|
109
125
|
}
|
|
110
126
|
|
|
127
|
+
export class GeometryReader {
|
|
128
|
+
private constructor();
|
|
129
|
+
free(): void;
|
|
130
|
+
[Symbol.dispose](): void;
|
|
131
|
+
/**
|
|
132
|
+
* Returns only the new suffix at this total logical byte budget.
|
|
133
|
+
*/
|
|
134
|
+
extendCellPrefix(key: any, budget: any): Promise<Uint8Array>;
|
|
135
|
+
/**
|
|
136
|
+
* Declaration plus cells/LODs; no payload transfer. u64 values are BigInt.
|
|
137
|
+
*/
|
|
138
|
+
metadata(): any;
|
|
139
|
+
readMeshLod(level: any): Promise<Uint8Array>;
|
|
140
|
+
selectCells(min: any, max: any): Array<any>;
|
|
141
|
+
}
|
|
142
|
+
|
|
111
143
|
/**
|
|
112
144
|
* A `fetch`-backed backend rooted at a base URL.
|
|
113
145
|
*/
|
|
@@ -144,6 +176,15 @@ export class Space {
|
|
|
144
176
|
private constructor();
|
|
145
177
|
free(): void;
|
|
146
178
|
[Symbol.dispose](): void;
|
|
179
|
+
/**
|
|
180
|
+
* Validate all referenced Items, including tombstoned payloads.
|
|
181
|
+
*/
|
|
182
|
+
auditArrayField(field: string): Promise<bigint>;
|
|
183
|
+
/**
|
|
184
|
+
* Validate all graph pages and, when declared, exact-source correspondence.
|
|
185
|
+
* The returned count is exactly representable (GraphIndex node_count is u32).
|
|
186
|
+
*/
|
|
187
|
+
auditGraphIndex(field: string): Promise<number>;
|
|
147
188
|
/**
|
|
148
189
|
* The Space's human-readable description, or `undefined` when none is set.
|
|
149
190
|
*
|
|
@@ -178,11 +219,21 @@ export class Space {
|
|
|
178
219
|
* no-backend path).
|
|
179
220
|
*/
|
|
180
221
|
static fromUri(uri: string, backend: any): Promise<Space>;
|
|
222
|
+
/**
|
|
223
|
+
* Read at this pinned Manifest. Returns null for never-created keys;
|
|
224
|
+
* deleted keys retain metadata with sample=null. Integer keys and anchors
|
|
225
|
+
* are BigInt; sample values use the Writer's tagged field shapes.
|
|
226
|
+
*/
|
|
227
|
+
getEntity(key: any): Promise<any>;
|
|
181
228
|
/**
|
|
182
229
|
* Walk the manifest DAG from HEAD, up to `max_depth` entries. Each entry:
|
|
183
230
|
* `{ manifestHash, ts, writer, tracks: [{modality, address}] }`.
|
|
184
231
|
*/
|
|
185
232
|
history(max_depth?: number | null): Promise<Array<any>>;
|
|
233
|
+
/**
|
|
234
|
+
* Open one pinned geometry Item. Missing/deleted anchors return undefined.
|
|
235
|
+
*/
|
|
236
|
+
openGeometryItem(field: string, anchor: any): Promise<GeometryReader | undefined>;
|
|
186
237
|
/**
|
|
187
238
|
* Hybrid search fusing a lexical (BM25) sub-query and a dense (vector)
|
|
188
239
|
* sub-query per spec/0015 §5/§6. Returns the fused `[{ anchor, score }]`
|
|
@@ -205,10 +256,17 @@ export class Space {
|
|
|
205
256
|
* ```
|
|
206
257
|
*
|
|
207
258
|
* Delegates to the real (tested) `dreamdb-dataset::Dataset::query_hybrid`.
|
|
208
|
-
*
|
|
209
|
-
* scalar
|
|
259
|
+
* Optional `scalarField` / `scalarOp` / `scalarValue` properties select
|
|
260
|
+
* the same scalar pre/post-filter planner used by the native API.
|
|
210
261
|
*/
|
|
211
262
|
queryHybrid(vector: Float32Array, opts: any): Promise<Array<any>>;
|
|
263
|
+
/**
|
|
264
|
+
* Hybrid query with an observable `{hits, trace}` result. `opts` accepts
|
|
265
|
+
* `maxLatencyMs`, `costModel`, and the optional scalar triple
|
|
266
|
+
* `scalarField`/`scalarOp`/`scalarValue` in addition to `queryHybrid`'s
|
|
267
|
+
* existing properties.
|
|
268
|
+
*/
|
|
269
|
+
queryHybridPlanned(vector: Float32Array, opts: any): Promise<any>;
|
|
212
270
|
/**
|
|
213
271
|
* Scalar-index lookup: every anchor whose `field` satisfies `op value`
|
|
214
272
|
* (spec/0011). Returns a `BigUint64Array`-style `Array` of anchors,
|
|
@@ -259,6 +317,11 @@ export class Space {
|
|
|
259
317
|
* authoritative shape and semantic metadata.
|
|
260
318
|
*/
|
|
261
319
|
readArrayConstant(field: string): Promise<any>;
|
|
320
|
+
/**
|
|
321
|
+
* Point read; full-u64 BigInt anchors are supported. Returned components
|
|
322
|
+
* are owned typed arrays (one Item's bytes), never unaligned aliases.
|
|
323
|
+
*/
|
|
324
|
+
readArrayItem(field: string, anchor: any): Promise<any>;
|
|
262
325
|
/**
|
|
263
326
|
* Read a scalar track as a `Map<anchorString, value>`. Single-anchor
|
|
264
327
|
* entries resolve from the track index; multi-anchor entries fetch (and
|
|
@@ -338,6 +401,11 @@ export class Writer {
|
|
|
338
401
|
private constructor();
|
|
339
402
|
free(): void;
|
|
340
403
|
[Symbol.dispose](): void;
|
|
404
|
+
/**
|
|
405
|
+
* Atomically hot-append a complete Sample batch. Embeddings retain v1;
|
|
406
|
+
* scalar/text values use v2. Identified embeddings require embeddingSpecs.
|
|
407
|
+
*/
|
|
408
|
+
appendHot(samples: Array<any>, embedding_specs?: object | null): Promise<number>;
|
|
341
409
|
/**
|
|
342
410
|
* Append records and commit in one call.
|
|
343
411
|
*
|
|
@@ -351,6 +419,11 @@ export class Writer {
|
|
|
351
419
|
* lifetime is under the caller's control.
|
|
352
420
|
*/
|
|
353
421
|
appendMany(samples: Array<any>): Promise<number>;
|
|
422
|
+
/**
|
|
423
|
+
* Append records with a field-to-`spec_id` map for identified embeddings.
|
|
424
|
+
* Values are full canonical base32 multihashes.
|
|
425
|
+
*/
|
|
426
|
+
appendManyWithSpecs(samples: Array<any>, embedding_specs: object): Promise<number>;
|
|
354
427
|
/**
|
|
355
428
|
* Flush staged entries and publish a new manifest.
|
|
356
429
|
*
|
|
@@ -360,10 +433,30 @@ export class Writer {
|
|
|
360
433
|
* its records on top of the new head is correct.
|
|
361
434
|
*/
|
|
362
435
|
commit(): Promise<string>;
|
|
436
|
+
/**
|
|
437
|
+
* Producer policy only: TTL is evaluated on append, not by a timer.
|
|
438
|
+
*/
|
|
439
|
+
configureHotShard(flush_threshold: number, ttl_seconds: number): void;
|
|
440
|
+
/**
|
|
441
|
+
* Create a never-used key. Sample uses appendMany's tagged fields, no anchor.
|
|
442
|
+
*/
|
|
443
|
+
createEntity(key: any, sample: object, embedding_specs?: object | null): Promise<object>;
|
|
444
|
+
/**
|
|
445
|
+
* Delete exactly a live revision, retaining its key and stable identity.
|
|
446
|
+
*/
|
|
447
|
+
deleteEntity(key: any, expected: Uint8Array): Promise<object>;
|
|
363
448
|
/**
|
|
364
449
|
* Tombstone records by anchor. Returns the new manifest hash.
|
|
365
450
|
*/
|
|
366
451
|
deleteRecords(anchors: BigUint64Array, reason?: string | null): Promise<string>;
|
|
452
|
+
/**
|
|
453
|
+
* Enable one exact typed entity namespace: string, bytes or int.
|
|
454
|
+
*/
|
|
455
|
+
enableEntityKeys(key_kind: string): Promise<void>;
|
|
456
|
+
/**
|
|
457
|
+
* Explicitly fold every pending hot field into cold Tracks in one publish.
|
|
458
|
+
*/
|
|
459
|
+
flushHot(): Promise<void>;
|
|
367
460
|
/**
|
|
368
461
|
* Ingest a pre-fragmented CMAF (fragmented-MP4) video into a Video field
|
|
369
462
|
* as a `spec/0007` §5 media Track — the thing that makes a video Track
|
|
@@ -415,10 +508,27 @@ export class Writer {
|
|
|
415
508
|
* until it calls it.
|
|
416
509
|
*/
|
|
417
510
|
static open(uri: string, backend: any): Promise<Writer>;
|
|
511
|
+
/**
|
|
512
|
+
* Publish prequantized fixed-stride records. Coordinates is
|
|
513
|
+
* {origin:[x,y,z],step:[x,y,z],units:string}; depth is 0..16.
|
|
514
|
+
*/
|
|
515
|
+
publishGeometryCells(field: string, anchor: any, coordinates: any, depth: any, records: Uint8Array): Promise<string>;
|
|
516
|
+
/**
|
|
517
|
+
* Each level is {errorGrid,vertices,triangles,bytes:Uint8Array}.
|
|
518
|
+
*/
|
|
519
|
+
publishGeometryMesh(field: string, anchor: any, coordinates: any, levels: Array<any>): Promise<string>;
|
|
418
520
|
/**
|
|
419
521
|
* Tag the current manifest with an immutable label (`refs/<ref>@<label>`).
|
|
420
522
|
*/
|
|
421
523
|
snapshot(label: string): Promise<string>;
|
|
524
|
+
/**
|
|
525
|
+
* Replace only a live revision, atomically hiding its old physical row.
|
|
526
|
+
*/
|
|
527
|
+
supersedeEntity(key: any, sample: object, expected: Uint8Array, embedding_specs?: object | null): Promise<object>;
|
|
528
|
+
/**
|
|
529
|
+
* Create with no expected token, or replace/restore exactly that revision.
|
|
530
|
+
*/
|
|
531
|
+
upsertEntity(key: any, sample: object, expected?: Uint8Array | null, embedding_specs?: object | null): Promise<object>;
|
|
422
532
|
/**
|
|
423
533
|
* Current manifest hash, base32.
|
|
424
534
|
*/
|
package/node/dreamdb_bg.wasm
CHANGED
|
Binary file
|
|
@@ -2,17 +2,22 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const __wbg_authoring_free: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_geometryreader_free: (a: number, b: number) => void;
|
|
5
6
|
export const __wbg_s3backend_free: (a: number, b: number) => void;
|
|
6
7
|
export const __wbg_space_free: (a: number, b: number) => void;
|
|
7
8
|
export const addressRoundTrip: (a: number, b: number) => [number, number, number, number];
|
|
8
9
|
export const addressVariant: (a: number, b: number) => [number, number, number, number];
|
|
9
10
|
export const authoring_addArrayConstant: (a: number, b: any, c: any) => any;
|
|
10
|
-
export const authoring_addEmbeddingLayer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: any) => any;
|
|
11
|
+
export const authoring_addEmbeddingLayer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: any, p: number, q: number, r: number) => any;
|
|
11
12
|
export const authoring_addField: (a: number, b: any) => any;
|
|
12
13
|
export const authoring_addImageLayer: (a: number, b: number, c: number, d: number, e: number, f: any, g: number, h: number) => any;
|
|
13
14
|
export const authoring_addScalarLayer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: any) => any;
|
|
15
|
+
export const authoring_appendGraphNodes: (a: number, b: number, c: number, d: any) => any;
|
|
14
16
|
export const authoring_branch: (a: number, b: number, c: number) => any;
|
|
17
|
+
export const authoring_buildGraphIndex: (a: number, b: number, c: number, d: number, e: number, f: number, g: any, h: number, i: number, j: number, k: number, l: number) => any;
|
|
15
18
|
export const authoring_compact: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
19
|
+
export const authoring_compressGraphIndex: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
20
|
+
export const authoring_consolidateGraph: (a: number, b: number, c: number) => any;
|
|
16
21
|
export const authoring_create: (a: number, b: number, c: any, d: number, e: number, f: any) => any;
|
|
17
22
|
export const authoring_deleteRef: (a: number, b: number, c: number) => any;
|
|
18
23
|
export const authoring_listRefs: (a: number) => any;
|
|
@@ -24,6 +29,10 @@ export const authoring_writer: (a: number) => number;
|
|
|
24
29
|
export const bytesToBase32: (a: number, b: number) => [number, number];
|
|
25
30
|
export const decodeCbor: (a: number, b: number) => [number, number, number];
|
|
26
31
|
export const encodeCbor: (a: any) => [number, number, number, number];
|
|
32
|
+
export const geometryreader_extendCellPrefix: (a: number, b: any, c: any) => any;
|
|
33
|
+
export const geometryreader_metadata: (a: number) => [number, number, number];
|
|
34
|
+
export const geometryreader_readMeshLod: (a: number, b: any) => any;
|
|
35
|
+
export const geometryreader_selectCells: (a: number, b: any, c: any) => [number, number, number];
|
|
27
36
|
export const modalityParse: (a: number, b: number) => [number, number, number];
|
|
28
37
|
export const multihashBase32: (a: number, b: number) => [number, number];
|
|
29
38
|
export const multihashHex: (a: number, b: number) => [number, number];
|
|
@@ -32,17 +41,23 @@ export const s3backend_get: (a: number, b: number, c: number, d: any) => any;
|
|
|
32
41
|
export const s3backend_getStream: (a: number, b: number, c: number) => any;
|
|
33
42
|
export const s3backend_list: (a: number, b: number, c: number) => any;
|
|
34
43
|
export const s3backend_new: (a: number, b: number) => number;
|
|
44
|
+
export const space_auditArrayField: (a: number, b: number, c: number) => any;
|
|
45
|
+
export const space_auditGraphIndex: (a: number, b: number, c: number) => any;
|
|
35
46
|
export const space_connectorBase: (a: number) => [number, number];
|
|
36
47
|
export const space_description: (a: number) => any;
|
|
37
48
|
export const space_fromUri: (a: number, b: number, c: any) => any;
|
|
49
|
+
export const space_getEntity: (a: number, b: any) => any;
|
|
38
50
|
export const space_history: (a: number, b: number) => any;
|
|
39
51
|
export const space_manifestHash: (a: number) => [number, number];
|
|
52
|
+
export const space_openGeometryItem: (a: number, b: number, c: number, d: any) => any;
|
|
40
53
|
export const space_queryHybrid: (a: number, b: number, c: number, d: any) => any;
|
|
54
|
+
export const space_queryHybridPlanned: (a: number, b: number, c: number, d: any) => any;
|
|
41
55
|
export const space_queryScalar: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
|
|
42
56
|
export const space_queryText: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
43
57
|
export const space_queryVector: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
|
|
44
58
|
export const space_readArrayColumn: (a: number, b: number, c: number) => any;
|
|
45
59
|
export const space_readArrayConstant: (a: number, b: number, c: number) => any;
|
|
60
|
+
export const space_readArrayItem: (a: number, b: number, c: number, d: any) => any;
|
|
46
61
|
export const space_readScalarColumn: (a: number, b: any, c: any) => any;
|
|
47
62
|
export const space_readVideoItemRange: (a: number, b: number, c: number, d: any, e: any, f: any) => any;
|
|
48
63
|
export const space_resolveObjectIndex: (a: number, b: any) => any;
|
|
@@ -60,13 +75,24 @@ export const timeAnchorHex: (a: bigint) => [number, number];
|
|
|
60
75
|
export const timeBucket: (a: bigint, b: number, c: number) => [bigint, number, number];
|
|
61
76
|
export const typedArrayDecode: (a: any, b: number, c: number) => [number, number, number];
|
|
62
77
|
export const version: () => [number, number];
|
|
78
|
+
export const writer_appendHot: (a: number, b: any, c: number) => any;
|
|
63
79
|
export const writer_appendMany: (a: number, b: any) => any;
|
|
80
|
+
export const writer_appendManyWithSpecs: (a: number, b: any, c: any) => any;
|
|
64
81
|
export const writer_commit: (a: number) => any;
|
|
82
|
+
export const writer_configureHotShard: (a: number, b: number, c: number) => [number, number];
|
|
83
|
+
export const writer_createEntity: (a: number, b: any, c: any, d: number) => any;
|
|
84
|
+
export const writer_deleteEntity: (a: number, b: any, c: any) => any;
|
|
65
85
|
export const writer_deleteRecords: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
86
|
+
export const writer_enableEntityKeys: (a: number, b: number, c: number) => any;
|
|
87
|
+
export const writer_flushHot: (a: number) => any;
|
|
66
88
|
export const writer_ingestCmaf: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
|
|
67
89
|
export const writer_manifestHash: (a: number) => [number, number, number, number];
|
|
68
90
|
export const writer_open: (a: number, b: number, c: any) => any;
|
|
91
|
+
export const writer_publishGeometryCells: (a: number, b: number, c: number, d: any, e: any, f: any, g: any) => any;
|
|
92
|
+
export const writer_publishGeometryMesh: (a: number, b: number, c: number, d: any, e: any, f: any) => any;
|
|
69
93
|
export const writer_snapshot: (a: number, b: number, c: number) => any;
|
|
94
|
+
export const writer_supersedeEntity: (a: number, b: any, c: any, d: any, e: number) => any;
|
|
95
|
+
export const writer_upsertEntity: (a: number, b: any, c: any, d: number, e: number) => any;
|
|
70
96
|
export const zeroSpatialKey: () => [number, number];
|
|
71
97
|
export const __wasm_init: () => void;
|
|
72
98
|
export const __wbg_writer_free: (a: number, b: number) => void;
|
package/node.mjs
CHANGED
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
import mod from './node/dreamdb.cjs'
|
|
9
9
|
|
|
10
10
|
export const {
|
|
11
|
-
Authoring, S3Backend, Space, Writer,
|
|
12
|
-
addressVariant, bytesToBase32, decodeCbor, encodeCbor,
|
|
13
|
-
multihashBase32, multihashHex, rangeHeader, spatialKeyRoundTrip,
|
|
14
|
-
timeAnchorHex, timeBucket, typedArrayDecode, version,
|
|
11
|
+
Authoring, GeometryReader, S3Backend, Space, Writer,
|
|
12
|
+
addressRoundTrip, addressVariant, bytesToBase32, decodeCbor, encodeCbor,
|
|
13
|
+
modalityParse, multihashBase32, multihashHex, rangeHeader, spatialKeyRoundTrip,
|
|
14
|
+
timeAnchorFromHex, timeAnchorHex, timeBucket, typedArrayDecode, version,
|
|
15
|
+
zeroSpatialKey,
|
|
15
16
|
} = mod
|
|
16
17
|
|
|
17
18
|
/** Zero spatial-key path segment for non-spatial (fragment) object addresses. */
|
package/package.json
CHANGED
package/web/dreamdb.d.ts
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
+
export class GeometryReader {
|
|
5
|
+
private constructor();
|
|
6
|
+
free(): void;
|
|
7
|
+
[Symbol.dispose](): void;
|
|
8
|
+
/**
|
|
9
|
+
* Returns only the new suffix at this total logical byte budget.
|
|
10
|
+
*/
|
|
11
|
+
extendCellPrefix(key: any, budget: any): Promise<Uint8Array>;
|
|
12
|
+
/**
|
|
13
|
+
* Declaration plus cells/LODs; no payload transfer. u64 values are BigInt.
|
|
14
|
+
*/
|
|
15
|
+
metadata(): any;
|
|
16
|
+
readMeshLod(level: any): Promise<Uint8Array>;
|
|
17
|
+
selectCells(min: any, max: any): Array<any>;
|
|
18
|
+
}
|
|
19
|
+
|
|
4
20
|
/**
|
|
5
21
|
* A `fetch`-backed backend rooted at a base URL.
|
|
6
22
|
*/
|
|
@@ -37,6 +53,15 @@ export class Space {
|
|
|
37
53
|
private constructor();
|
|
38
54
|
free(): void;
|
|
39
55
|
[Symbol.dispose](): void;
|
|
56
|
+
/**
|
|
57
|
+
* Validate all referenced Items, including tombstoned payloads.
|
|
58
|
+
*/
|
|
59
|
+
auditArrayField(field: string): Promise<bigint>;
|
|
60
|
+
/**
|
|
61
|
+
* Validate all graph pages and, when declared, exact-source correspondence.
|
|
62
|
+
* The returned count is exactly representable (GraphIndex node_count is u32).
|
|
63
|
+
*/
|
|
64
|
+
auditGraphIndex(field: string): Promise<number>;
|
|
40
65
|
/**
|
|
41
66
|
* The Space's human-readable description, or `undefined` when none is set.
|
|
42
67
|
*
|
|
@@ -71,11 +96,21 @@ export class Space {
|
|
|
71
96
|
* no-backend path).
|
|
72
97
|
*/
|
|
73
98
|
static fromUri(uri: string, backend: any): Promise<Space>;
|
|
99
|
+
/**
|
|
100
|
+
* Read at this pinned Manifest. Returns null for never-created keys;
|
|
101
|
+
* deleted keys retain metadata with sample=null. Integer keys and anchors
|
|
102
|
+
* are BigInt; sample values use the Writer's tagged field shapes.
|
|
103
|
+
*/
|
|
104
|
+
getEntity(key: any): Promise<any>;
|
|
74
105
|
/**
|
|
75
106
|
* Walk the manifest DAG from HEAD, up to `max_depth` entries. Each entry:
|
|
76
107
|
* `{ manifestHash, ts, writer, tracks: [{modality, address}] }`.
|
|
77
108
|
*/
|
|
78
109
|
history(max_depth?: number | null): Promise<Array<any>>;
|
|
110
|
+
/**
|
|
111
|
+
* Open one pinned geometry Item. Missing/deleted anchors return undefined.
|
|
112
|
+
*/
|
|
113
|
+
openGeometryItem(field: string, anchor: any): Promise<GeometryReader | undefined>;
|
|
79
114
|
/**
|
|
80
115
|
* Hybrid search fusing a lexical (BM25) sub-query and a dense (vector)
|
|
81
116
|
* sub-query per spec/0015 §5/§6. Returns the fused `[{ anchor, score }]`
|
|
@@ -98,10 +133,17 @@ export class Space {
|
|
|
98
133
|
* ```
|
|
99
134
|
*
|
|
100
135
|
* Delegates to the real (tested) `dreamdb-dataset::Dataset::query_hybrid`.
|
|
101
|
-
*
|
|
102
|
-
* scalar
|
|
136
|
+
* Optional `scalarField` / `scalarOp` / `scalarValue` properties select
|
|
137
|
+
* the same scalar pre/post-filter planner used by the native API.
|
|
103
138
|
*/
|
|
104
139
|
queryHybrid(vector: Float32Array, opts: any): Promise<Array<any>>;
|
|
140
|
+
/**
|
|
141
|
+
* Hybrid query with an observable `{hits, trace}` result. `opts` accepts
|
|
142
|
+
* `maxLatencyMs`, `costModel`, and the optional scalar triple
|
|
143
|
+
* `scalarField`/`scalarOp`/`scalarValue` in addition to `queryHybrid`'s
|
|
144
|
+
* existing properties.
|
|
145
|
+
*/
|
|
146
|
+
queryHybridPlanned(vector: Float32Array, opts: any): Promise<any>;
|
|
105
147
|
/**
|
|
106
148
|
* Scalar-index lookup: every anchor whose `field` satisfies `op value`
|
|
107
149
|
* (spec/0011). Returns a `BigUint64Array`-style `Array` of anchors,
|
|
@@ -152,6 +194,11 @@ export class Space {
|
|
|
152
194
|
* authoritative shape and semantic metadata.
|
|
153
195
|
*/
|
|
154
196
|
readArrayConstant(field: string): Promise<any>;
|
|
197
|
+
/**
|
|
198
|
+
* Point read; full-u64 BigInt anchors are supported. Returned components
|
|
199
|
+
* are owned typed arrays (one Item's bytes), never unaligned aliases.
|
|
200
|
+
*/
|
|
201
|
+
readArrayItem(field: string, anchor: any): Promise<any>;
|
|
155
202
|
/**
|
|
156
203
|
* Read a scalar track as a `Map<anchorString, value>`. Single-anchor
|
|
157
204
|
* entries resolve from the track index; multi-anchor entries fetch (and
|
|
@@ -231,6 +278,11 @@ export class Writer {
|
|
|
231
278
|
private constructor();
|
|
232
279
|
free(): void;
|
|
233
280
|
[Symbol.dispose](): void;
|
|
281
|
+
/**
|
|
282
|
+
* Atomically hot-append a complete Sample batch. Embeddings retain v1;
|
|
283
|
+
* scalar/text values use v2. Identified embeddings require embeddingSpecs.
|
|
284
|
+
*/
|
|
285
|
+
appendHot(samples: Array<any>, embedding_specs?: object | null): Promise<number>;
|
|
234
286
|
/**
|
|
235
287
|
* Append records and commit in one call.
|
|
236
288
|
*
|
|
@@ -244,6 +296,11 @@ export class Writer {
|
|
|
244
296
|
* lifetime is under the caller's control.
|
|
245
297
|
*/
|
|
246
298
|
appendMany(samples: Array<any>): Promise<number>;
|
|
299
|
+
/**
|
|
300
|
+
* Append records with a field-to-`spec_id` map for identified embeddings.
|
|
301
|
+
* Values are full canonical base32 multihashes.
|
|
302
|
+
*/
|
|
303
|
+
appendManyWithSpecs(samples: Array<any>, embedding_specs: object): Promise<number>;
|
|
247
304
|
/**
|
|
248
305
|
* Flush staged entries and publish a new manifest.
|
|
249
306
|
*
|
|
@@ -253,10 +310,30 @@ export class Writer {
|
|
|
253
310
|
* its records on top of the new head is correct.
|
|
254
311
|
*/
|
|
255
312
|
commit(): Promise<string>;
|
|
313
|
+
/**
|
|
314
|
+
* Producer policy only: TTL is evaluated on append, not by a timer.
|
|
315
|
+
*/
|
|
316
|
+
configureHotShard(flush_threshold: number, ttl_seconds: number): void;
|
|
317
|
+
/**
|
|
318
|
+
* Create a never-used key. Sample uses appendMany's tagged fields, no anchor.
|
|
319
|
+
*/
|
|
320
|
+
createEntity(key: any, sample: object, embedding_specs?: object | null): Promise<object>;
|
|
321
|
+
/**
|
|
322
|
+
* Delete exactly a live revision, retaining its key and stable identity.
|
|
323
|
+
*/
|
|
324
|
+
deleteEntity(key: any, expected: Uint8Array): Promise<object>;
|
|
256
325
|
/**
|
|
257
326
|
* Tombstone records by anchor. Returns the new manifest hash.
|
|
258
327
|
*/
|
|
259
328
|
deleteRecords(anchors: BigUint64Array, reason?: string | null): Promise<string>;
|
|
329
|
+
/**
|
|
330
|
+
* Enable one exact typed entity namespace: string, bytes or int.
|
|
331
|
+
*/
|
|
332
|
+
enableEntityKeys(key_kind: string): Promise<void>;
|
|
333
|
+
/**
|
|
334
|
+
* Explicitly fold every pending hot field into cold Tracks in one publish.
|
|
335
|
+
*/
|
|
336
|
+
flushHot(): Promise<void>;
|
|
260
337
|
/**
|
|
261
338
|
* Open a ref for writing.
|
|
262
339
|
*
|
|
@@ -271,10 +348,27 @@ export class Writer {
|
|
|
271
348
|
* until it calls it.
|
|
272
349
|
*/
|
|
273
350
|
static open(uri: string, backend: any): Promise<Writer>;
|
|
351
|
+
/**
|
|
352
|
+
* Publish prequantized fixed-stride records. Coordinates is
|
|
353
|
+
* {origin:[x,y,z],step:[x,y,z],units:string}; depth is 0..16.
|
|
354
|
+
*/
|
|
355
|
+
publishGeometryCells(field: string, anchor: any, coordinates: any, depth: any, records: Uint8Array): Promise<string>;
|
|
356
|
+
/**
|
|
357
|
+
* Each level is {errorGrid,vertices,triangles,bytes:Uint8Array}.
|
|
358
|
+
*/
|
|
359
|
+
publishGeometryMesh(field: string, anchor: any, coordinates: any, levels: Array<any>): Promise<string>;
|
|
274
360
|
/**
|
|
275
361
|
* Tag the current manifest with an immutable label (`refs/<ref>@<label>`).
|
|
276
362
|
*/
|
|
277
363
|
snapshot(label: string): Promise<string>;
|
|
364
|
+
/**
|
|
365
|
+
* Replace only a live revision, atomically hiding its old physical row.
|
|
366
|
+
*/
|
|
367
|
+
supersedeEntity(key: any, sample: object, expected: Uint8Array, embedding_specs?: object | null): Promise<object>;
|
|
368
|
+
/**
|
|
369
|
+
* Create with no expected token, or replace/restore exactly that revision.
|
|
370
|
+
*/
|
|
371
|
+
upsertEntity(key: any, sample: object, expected?: Uint8Array | null, embedding_specs?: object | null): Promise<object>;
|
|
278
372
|
/**
|
|
279
373
|
* Current manifest hash, base32.
|
|
280
374
|
*/
|
|
@@ -418,6 +512,7 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
418
512
|
|
|
419
513
|
export interface InitOutput {
|
|
420
514
|
readonly memory: WebAssembly.Memory;
|
|
515
|
+
readonly __wbg_geometryreader_free: (a: number, b: number) => void;
|
|
421
516
|
readonly __wbg_s3backend_free: (a: number, b: number) => void;
|
|
422
517
|
readonly __wbg_space_free: (a: number, b: number) => void;
|
|
423
518
|
readonly __wbg_writer_free: (a: number, b: number) => void;
|
|
@@ -426,6 +521,10 @@ export interface InitOutput {
|
|
|
426
521
|
readonly bytesToBase32: (a: number, b: number) => [number, number];
|
|
427
522
|
readonly decodeCbor: (a: number, b: number) => [number, number, number];
|
|
428
523
|
readonly encodeCbor: (a: any) => [number, number, number, number];
|
|
524
|
+
readonly geometryreader_extendCellPrefix: (a: number, b: any, c: any) => any;
|
|
525
|
+
readonly geometryreader_metadata: (a: number) => [number, number, number];
|
|
526
|
+
readonly geometryreader_readMeshLod: (a: number, b: any) => any;
|
|
527
|
+
readonly geometryreader_selectCells: (a: number, b: any, c: any) => [number, number, number];
|
|
429
528
|
readonly modalityParse: (a: number, b: number) => [number, number, number];
|
|
430
529
|
readonly multihashBase32: (a: number, b: number) => [number, number];
|
|
431
530
|
readonly multihashHex: (a: number, b: number) => [number, number];
|
|
@@ -434,17 +533,23 @@ export interface InitOutput {
|
|
|
434
533
|
readonly s3backend_getStream: (a: number, b: number, c: number) => any;
|
|
435
534
|
readonly s3backend_list: (a: number, b: number, c: number) => any;
|
|
436
535
|
readonly s3backend_new: (a: number, b: number) => number;
|
|
536
|
+
readonly space_auditArrayField: (a: number, b: number, c: number) => any;
|
|
537
|
+
readonly space_auditGraphIndex: (a: number, b: number, c: number) => any;
|
|
437
538
|
readonly space_connectorBase: (a: number) => [number, number];
|
|
438
539
|
readonly space_description: (a: number) => any;
|
|
439
540
|
readonly space_fromUri: (a: number, b: number, c: any) => any;
|
|
541
|
+
readonly space_getEntity: (a: number, b: any) => any;
|
|
440
542
|
readonly space_history: (a: number, b: number) => any;
|
|
441
543
|
readonly space_manifestHash: (a: number) => [number, number];
|
|
544
|
+
readonly space_openGeometryItem: (a: number, b: number, c: number, d: any) => any;
|
|
442
545
|
readonly space_queryHybrid: (a: number, b: number, c: number, d: any) => any;
|
|
546
|
+
readonly space_queryHybridPlanned: (a: number, b: number, c: number, d: any) => any;
|
|
443
547
|
readonly space_queryScalar: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
|
|
444
548
|
readonly space_queryText: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
445
549
|
readonly space_queryVector: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
|
|
446
550
|
readonly space_readArrayColumn: (a: number, b: number, c: number) => any;
|
|
447
551
|
readonly space_readArrayConstant: (a: number, b: number, c: number) => any;
|
|
552
|
+
readonly space_readArrayItem: (a: number, b: number, c: number, d: any) => any;
|
|
448
553
|
readonly space_readScalarColumn: (a: number, b: any, c: any) => any;
|
|
449
554
|
readonly space_readVideoItemRange: (a: number, b: number, c: number, d: any, e: any, f: any) => any;
|
|
450
555
|
readonly space_resolveObjectIndex: (a: number, b: any) => any;
|
|
@@ -462,13 +567,24 @@ export interface InitOutput {
|
|
|
462
567
|
readonly timeBucket: (a: bigint, b: number, c: number) => [bigint, number, number];
|
|
463
568
|
readonly typedArrayDecode: (a: any, b: number, c: number) => [number, number, number];
|
|
464
569
|
readonly version: () => [number, number];
|
|
570
|
+
readonly writer_appendHot: (a: number, b: any, c: number) => any;
|
|
465
571
|
readonly writer_appendMany: (a: number, b: any) => any;
|
|
572
|
+
readonly writer_appendManyWithSpecs: (a: number, b: any, c: any) => any;
|
|
466
573
|
readonly writer_commit: (a: number) => any;
|
|
574
|
+
readonly writer_configureHotShard: (a: number, b: number, c: number) => [number, number];
|
|
575
|
+
readonly writer_createEntity: (a: number, b: any, c: any, d: number) => any;
|
|
576
|
+
readonly writer_deleteEntity: (a: number, b: any, c: any) => any;
|
|
467
577
|
readonly writer_deleteRecords: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
578
|
+
readonly writer_enableEntityKeys: (a: number, b: number, c: number) => any;
|
|
579
|
+
readonly writer_flushHot: (a: number) => any;
|
|
468
580
|
readonly writer_manifestHash: (a: number) => [number, number, number, number];
|
|
469
581
|
readonly writer_open: (a: number, b: number, c: any) => any;
|
|
582
|
+
readonly writer_publishGeometryCells: (a: number, b: number, c: number, d: any, e: any, f: any, g: any) => any;
|
|
583
|
+
readonly writer_publishGeometryMesh: (a: number, b: number, c: number, d: any, e: any, f: any) => any;
|
|
470
584
|
readonly writer_refName: (a: number) => [number, number];
|
|
471
585
|
readonly writer_snapshot: (a: number, b: number, c: number) => any;
|
|
586
|
+
readonly writer_supersedeEntity: (a: number, b: any, c: any, d: any, e: number) => any;
|
|
587
|
+
readonly writer_upsertEntity: (a: number, b: any, c: any, d: number, e: number) => any;
|
|
472
588
|
readonly zeroSpatialKey: () => [number, number];
|
|
473
589
|
readonly __wasm_init: () => void;
|
|
474
590
|
readonly wasm_bindgen_f7c54996eb9137d9___convert__closures_____invoke___wasm_bindgen_f7c54996eb9137d9___JsValue__core_7d5f0a2ba6a62c33___result__Result_____wasm_bindgen_f7c54996eb9137d9___JsError___true_: (a: number, b: number, c: any) => [number, number];
|