@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.
@@ -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>): Promise<void>;
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
- * (v0 does not expose the optional scalar pre/post-filter; it runs with no
209
- * scalar gate.)
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,
@@ -242,7 +300,11 @@ export class Space {
242
300
  queryText(field: string, query: string, top_k: number): Promise<Array<any>>;
243
301
  /**
244
302
  * Top-K cosine vector search over an embedding `field`. `opts` may be a
245
- * number (topK) or `{ topK?, probeCount? }`. Returns `[{ anchor, score }]`
303
+ * number (topK) or `{ topK?, probeCount?, specId?, rerankPoolSize?, rerankMode? }`.
304
+ * The optional pool must be a positive integer at least topK; it changes
305
+ * neither probe coverage nor Schema exactness. rerankMode explicitly selects
306
+ * inherit (default), approximate or exact. Graphs reject explicit overrides.
307
+ * Returns `[{ anchor, score }]`
246
308
  * sorted by score descending — the shape dreamdb-ts's `queryVector` yields.
247
309
  *
248
310
  * Delegates to the real (tested) `dreamdb-dataset` query path: ADC cull +
@@ -259,6 +321,11 @@ export class Space {
259
321
  * authoritative shape and semantic metadata.
260
322
  */
261
323
  readArrayConstant(field: string): Promise<any>;
324
+ /**
325
+ * Point read; full-u64 BigInt anchors are supported. Returned components
326
+ * are owned typed arrays (one Item's bytes), never unaligned aliases.
327
+ */
328
+ readArrayItem(field: string, anchor: any): Promise<any>;
262
329
  /**
263
330
  * Read a scalar track as a `Map<anchorString, value>`. Single-anchor
264
331
  * entries resolve from the track index; multi-anchor entries fetch (and
@@ -338,6 +405,11 @@ export class Writer {
338
405
  private constructor();
339
406
  free(): void;
340
407
  [Symbol.dispose](): void;
408
+ /**
409
+ * Atomically hot-append a complete Sample batch. Embeddings retain v1;
410
+ * scalar/text values use v2. Identified embeddings require embeddingSpecs.
411
+ */
412
+ appendHot(samples: Array<any>, embedding_specs?: object | null): Promise<number>;
341
413
  /**
342
414
  * Append records and commit in one call.
343
415
  *
@@ -351,6 +423,11 @@ export class Writer {
351
423
  * lifetime is under the caller's control.
352
424
  */
353
425
  appendMany(samples: Array<any>): Promise<number>;
426
+ /**
427
+ * Append records with a field-to-`spec_id` map for identified embeddings.
428
+ * Values are full canonical base32 multihashes.
429
+ */
430
+ appendManyWithSpecs(samples: Array<any>, embedding_specs: object): Promise<number>;
354
431
  /**
355
432
  * Flush staged entries and publish a new manifest.
356
433
  *
@@ -360,10 +437,30 @@ export class Writer {
360
437
  * its records on top of the new head is correct.
361
438
  */
362
439
  commit(): Promise<string>;
440
+ /**
441
+ * Producer policy only: TTL is evaluated on append, not by a timer.
442
+ */
443
+ configureHotShard(flush_threshold: number, ttl_seconds: number): void;
444
+ /**
445
+ * Create a never-used key. Sample uses appendMany's tagged fields, no anchor.
446
+ */
447
+ createEntity(key: any, sample: object, embedding_specs?: object | null): Promise<object>;
448
+ /**
449
+ * Delete exactly a live revision, retaining its key and stable identity.
450
+ */
451
+ deleteEntity(key: any, expected: Uint8Array): Promise<object>;
363
452
  /**
364
453
  * Tombstone records by anchor. Returns the new manifest hash.
365
454
  */
366
455
  deleteRecords(anchors: BigUint64Array, reason?: string | null): Promise<string>;
456
+ /**
457
+ * Enable one exact typed entity namespace: string, bytes or int.
458
+ */
459
+ enableEntityKeys(key_kind: string): Promise<void>;
460
+ /**
461
+ * Explicitly fold every pending hot field into cold Tracks in one publish.
462
+ */
463
+ flushHot(): Promise<void>;
367
464
  /**
368
465
  * Ingest a pre-fragmented CMAF (fragmented-MP4) video into a Video field
369
466
  * as a `spec/0007` §5 media Track — the thing that makes a video Track
@@ -415,10 +512,27 @@ export class Writer {
415
512
  * until it calls it.
416
513
  */
417
514
  static open(uri: string, backend: any): Promise<Writer>;
515
+ /**
516
+ * Publish prequantized fixed-stride records. Coordinates is
517
+ * {origin:[x,y,z],step:[x,y,z],units:string}; depth is 0..16.
518
+ */
519
+ publishGeometryCells(field: string, anchor: any, coordinates: any, depth: any, records: Uint8Array): Promise<string>;
520
+ /**
521
+ * Each level is {errorGrid,vertices,triangles,bytes:Uint8Array}.
522
+ */
523
+ publishGeometryMesh(field: string, anchor: any, coordinates: any, levels: Array<any>): Promise<string>;
418
524
  /**
419
525
  * Tag the current manifest with an immutable label (`refs/<ref>@<label>`).
420
526
  */
421
527
  snapshot(label: string): Promise<string>;
528
+ /**
529
+ * Replace only a live revision, atomically hiding its old physical row.
530
+ */
531
+ supersedeEntity(key: any, sample: object, expected: Uint8Array, embedding_specs?: object | null): Promise<object>;
532
+ /**
533
+ * Create with no expected token, or replace/restore exactly that revision.
534
+ */
535
+ upsertEntity(key: any, sample: object, expected?: Uint8Array | null, embedding_specs?: object | null): Promise<object>;
422
536
  /**
423
537
  * Current manifest hash, base32.
424
538
  */
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, addressRoundTrip,
12
- addressVariant, bytesToBase32, decodeCbor, encodeCbor, modalityParse,
13
- multihashBase32, multihashHex, rangeHeader, spatialKeyRoundTrip, timeAnchorFromHex,
14
- timeAnchorHex, timeBucket, typedArrayDecode, version, zeroSpatialKey,
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreamlake/dreamdb",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "description": "DreamDB SDK — isomorphic (browser + Node) read and write, compiled from the Rust core",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "type": "module",
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
- * (v0 does not expose the optional scalar pre/post-filter; it runs with no
102
- * scalar gate.)
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,
@@ -135,7 +177,11 @@ export class Space {
135
177
  queryText(field: string, query: string, top_k: number): Promise<Array<any>>;
136
178
  /**
137
179
  * Top-K cosine vector search over an embedding `field`. `opts` may be a
138
- * number (topK) or `{ topK?, probeCount? }`. Returns `[{ anchor, score }]`
180
+ * number (topK) or `{ topK?, probeCount?, specId?, rerankPoolSize?, rerankMode? }`.
181
+ * The optional pool must be a positive integer at least topK; it changes
182
+ * neither probe coverage nor Schema exactness. rerankMode explicitly selects
183
+ * inherit (default), approximate or exact. Graphs reject explicit overrides.
184
+ * Returns `[{ anchor, score }]`
139
185
  * sorted by score descending — the shape dreamdb-ts's `queryVector` yields.
140
186
  *
141
187
  * Delegates to the real (tested) `dreamdb-dataset` query path: ADC cull +
@@ -152,6 +198,11 @@ export class Space {
152
198
  * authoritative shape and semantic metadata.
153
199
  */
154
200
  readArrayConstant(field: string): Promise<any>;
201
+ /**
202
+ * Point read; full-u64 BigInt anchors are supported. Returned components
203
+ * are owned typed arrays (one Item's bytes), never unaligned aliases.
204
+ */
205
+ readArrayItem(field: string, anchor: any): Promise<any>;
155
206
  /**
156
207
  * Read a scalar track as a `Map<anchorString, value>`. Single-anchor
157
208
  * entries resolve from the track index; multi-anchor entries fetch (and
@@ -231,6 +282,11 @@ export class Writer {
231
282
  private constructor();
232
283
  free(): void;
233
284
  [Symbol.dispose](): void;
285
+ /**
286
+ * Atomically hot-append a complete Sample batch. Embeddings retain v1;
287
+ * scalar/text values use v2. Identified embeddings require embeddingSpecs.
288
+ */
289
+ appendHot(samples: Array<any>, embedding_specs?: object | null): Promise<number>;
234
290
  /**
235
291
  * Append records and commit in one call.
236
292
  *
@@ -244,6 +300,11 @@ export class Writer {
244
300
  * lifetime is under the caller's control.
245
301
  */
246
302
  appendMany(samples: Array<any>): Promise<number>;
303
+ /**
304
+ * Append records with a field-to-`spec_id` map for identified embeddings.
305
+ * Values are full canonical base32 multihashes.
306
+ */
307
+ appendManyWithSpecs(samples: Array<any>, embedding_specs: object): Promise<number>;
247
308
  /**
248
309
  * Flush staged entries and publish a new manifest.
249
310
  *
@@ -253,10 +314,30 @@ export class Writer {
253
314
  * its records on top of the new head is correct.
254
315
  */
255
316
  commit(): Promise<string>;
317
+ /**
318
+ * Producer policy only: TTL is evaluated on append, not by a timer.
319
+ */
320
+ configureHotShard(flush_threshold: number, ttl_seconds: number): void;
321
+ /**
322
+ * Create a never-used key. Sample uses appendMany's tagged fields, no anchor.
323
+ */
324
+ createEntity(key: any, sample: object, embedding_specs?: object | null): Promise<object>;
325
+ /**
326
+ * Delete exactly a live revision, retaining its key and stable identity.
327
+ */
328
+ deleteEntity(key: any, expected: Uint8Array): Promise<object>;
256
329
  /**
257
330
  * Tombstone records by anchor. Returns the new manifest hash.
258
331
  */
259
332
  deleteRecords(anchors: BigUint64Array, reason?: string | null): Promise<string>;
333
+ /**
334
+ * Enable one exact typed entity namespace: string, bytes or int.
335
+ */
336
+ enableEntityKeys(key_kind: string): Promise<void>;
337
+ /**
338
+ * Explicitly fold every pending hot field into cold Tracks in one publish.
339
+ */
340
+ flushHot(): Promise<void>;
260
341
  /**
261
342
  * Open a ref for writing.
262
343
  *
@@ -271,10 +352,27 @@ export class Writer {
271
352
  * until it calls it.
272
353
  */
273
354
  static open(uri: string, backend: any): Promise<Writer>;
355
+ /**
356
+ * Publish prequantized fixed-stride records. Coordinates is
357
+ * {origin:[x,y,z],step:[x,y,z],units:string}; depth is 0..16.
358
+ */
359
+ publishGeometryCells(field: string, anchor: any, coordinates: any, depth: any, records: Uint8Array): Promise<string>;
360
+ /**
361
+ * Each level is {errorGrid,vertices,triangles,bytes:Uint8Array}.
362
+ */
363
+ publishGeometryMesh(field: string, anchor: any, coordinates: any, levels: Array<any>): Promise<string>;
274
364
  /**
275
365
  * Tag the current manifest with an immutable label (`refs/<ref>@<label>`).
276
366
  */
277
367
  snapshot(label: string): Promise<string>;
368
+ /**
369
+ * Replace only a live revision, atomically hiding its old physical row.
370
+ */
371
+ supersedeEntity(key: any, sample: object, expected: Uint8Array, embedding_specs?: object | null): Promise<object>;
372
+ /**
373
+ * Create with no expected token, or replace/restore exactly that revision.
374
+ */
375
+ upsertEntity(key: any, sample: object, expected?: Uint8Array | null, embedding_specs?: object | null): Promise<object>;
278
376
  /**
279
377
  * Current manifest hash, base32.
280
378
  */
@@ -418,6 +516,7 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
418
516
 
419
517
  export interface InitOutput {
420
518
  readonly memory: WebAssembly.Memory;
519
+ readonly __wbg_geometryreader_free: (a: number, b: number) => void;
421
520
  readonly __wbg_s3backend_free: (a: number, b: number) => void;
422
521
  readonly __wbg_space_free: (a: number, b: number) => void;
423
522
  readonly __wbg_writer_free: (a: number, b: number) => void;
@@ -426,6 +525,10 @@ export interface InitOutput {
426
525
  readonly bytesToBase32: (a: number, b: number) => [number, number];
427
526
  readonly decodeCbor: (a: number, b: number) => [number, number, number];
428
527
  readonly encodeCbor: (a: any) => [number, number, number, number];
528
+ readonly geometryreader_extendCellPrefix: (a: number, b: any, c: any) => any;
529
+ readonly geometryreader_metadata: (a: number) => [number, number, number];
530
+ readonly geometryreader_readMeshLod: (a: number, b: any) => any;
531
+ readonly geometryreader_selectCells: (a: number, b: any, c: any) => [number, number, number];
429
532
  readonly modalityParse: (a: number, b: number) => [number, number, number];
430
533
  readonly multihashBase32: (a: number, b: number) => [number, number];
431
534
  readonly multihashHex: (a: number, b: number) => [number, number];
@@ -434,17 +537,23 @@ export interface InitOutput {
434
537
  readonly s3backend_getStream: (a: number, b: number, c: number) => any;
435
538
  readonly s3backend_list: (a: number, b: number, c: number) => any;
436
539
  readonly s3backend_new: (a: number, b: number) => number;
540
+ readonly space_auditArrayField: (a: number, b: number, c: number) => any;
541
+ readonly space_auditGraphIndex: (a: number, b: number, c: number) => any;
437
542
  readonly space_connectorBase: (a: number) => [number, number];
438
543
  readonly space_description: (a: number) => any;
439
544
  readonly space_fromUri: (a: number, b: number, c: any) => any;
545
+ readonly space_getEntity: (a: number, b: any) => any;
440
546
  readonly space_history: (a: number, b: number) => any;
441
547
  readonly space_manifestHash: (a: number) => [number, number];
548
+ readonly space_openGeometryItem: (a: number, b: number, c: number, d: any) => any;
442
549
  readonly space_queryHybrid: (a: number, b: number, c: number, d: any) => any;
550
+ readonly space_queryHybridPlanned: (a: number, b: number, c: number, d: any) => any;
443
551
  readonly space_queryScalar: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
444
552
  readonly space_queryText: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
445
553
  readonly space_queryVector: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
446
554
  readonly space_readArrayColumn: (a: number, b: number, c: number) => any;
447
555
  readonly space_readArrayConstant: (a: number, b: number, c: number) => any;
556
+ readonly space_readArrayItem: (a: number, b: number, c: number, d: any) => any;
448
557
  readonly space_readScalarColumn: (a: number, b: any, c: any) => any;
449
558
  readonly space_readVideoItemRange: (a: number, b: number, c: number, d: any, e: any, f: any) => any;
450
559
  readonly space_resolveObjectIndex: (a: number, b: any) => any;
@@ -462,13 +571,24 @@ export interface InitOutput {
462
571
  readonly timeBucket: (a: bigint, b: number, c: number) => [bigint, number, number];
463
572
  readonly typedArrayDecode: (a: any, b: number, c: number) => [number, number, number];
464
573
  readonly version: () => [number, number];
574
+ readonly writer_appendHot: (a: number, b: any, c: number) => any;
465
575
  readonly writer_appendMany: (a: number, b: any) => any;
576
+ readonly writer_appendManyWithSpecs: (a: number, b: any, c: any) => any;
466
577
  readonly writer_commit: (a: number) => any;
578
+ readonly writer_configureHotShard: (a: number, b: number, c: number) => [number, number];
579
+ readonly writer_createEntity: (a: number, b: any, c: any, d: number) => any;
580
+ readonly writer_deleteEntity: (a: number, b: any, c: any) => any;
467
581
  readonly writer_deleteRecords: (a: number, b: number, c: number, d: number, e: number) => any;
582
+ readonly writer_enableEntityKeys: (a: number, b: number, c: number) => any;
583
+ readonly writer_flushHot: (a: number) => any;
468
584
  readonly writer_manifestHash: (a: number) => [number, number, number, number];
469
585
  readonly writer_open: (a: number, b: number, c: any) => any;
586
+ readonly writer_publishGeometryCells: (a: number, b: number, c: number, d: any, e: any, f: any, g: any) => any;
587
+ readonly writer_publishGeometryMesh: (a: number, b: number, c: number, d: any, e: any, f: any) => any;
470
588
  readonly writer_refName: (a: number) => [number, number];
471
589
  readonly writer_snapshot: (a: number, b: number, c: number) => any;
590
+ readonly writer_supersedeEntity: (a: number, b: any, c: any, d: any, e: number) => any;
591
+ readonly writer_upsertEntity: (a: number, b: any, c: any, d: number, e: number) => any;
472
592
  readonly zeroSpatialKey: () => [number, number];
473
593
  readonly __wasm_init: () => void;
474
594
  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];