@dreamlake/dreamdb 0.5.0 → 0.5.2
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/LICENSE-APACHE +20 -0
- package/LICENSE-MIT +21 -0
- package/README.md +18 -3
- package/browser/dreamdb.d.ts +89 -0
- package/browser/dreamdb.js +1 -1
- package/browser/dreamdb_bg.js +396 -2
- package/browser/dreamdb_bg.wasm +0 -0
- package/browser/dreamdb_bg.wasm.d.ts +13 -2
- package/browser-extras.mjs +82 -7
- package/browser.mjs +7 -0
- package/index.d.ts +212 -2
- package/node/dreamdb.cjs +508 -4
- package/node/dreamdb.d.cts +134 -0
- package/node/dreamdb_bg.wasm +0 -0
- package/node/dreamdb_bg.wasm.d.ts +15 -2
- package/node.mjs +1 -1
- package/package.json +4 -2
- package/web/dreamdb.d.ts +102 -2
- package/web/dreamdb.js +403 -2
- package/web/dreamdb_bg.wasm +0 -0
- package/web/dreamdb_bg.wasm.d.ts +13 -2
- package/web.mjs +5 -0
package/node/dreamdb.d.cts
CHANGED
|
@@ -8,6 +8,14 @@ export class Authoring {
|
|
|
8
8
|
private constructor();
|
|
9
9
|
free(): void;
|
|
10
10
|
[Symbol.dispose](): void;
|
|
11
|
+
/**
|
|
12
|
+
* Add one fixed-shape typed-array Constant.
|
|
13
|
+
*
|
|
14
|
+
* `field` is the same `{name, kind:'array', ...}` descriptor accepted by
|
|
15
|
+
* `create`, with `trackKind:'constant'` and `objectKind:'constant'`.
|
|
16
|
+
* `payload` is a raw or NPY payload matching that declaration.
|
|
17
|
+
*/
|
|
18
|
+
addArrayConstant(field: any, payload: Uint8Array): Promise<void>;
|
|
11
19
|
/**
|
|
12
20
|
* Add an embedding column whose index artifacts already exist.
|
|
13
21
|
*
|
|
@@ -112,6 +120,15 @@ export class S3Backend {
|
|
|
112
120
|
* content is hash-addressed; refs are read fresh each page load anyway).
|
|
113
121
|
*/
|
|
114
122
|
get(path: string, _opts: any): Promise<Uint8Array>;
|
|
123
|
+
/**
|
|
124
|
+
* Stream `path` without first aggregating the response in wasm memory.
|
|
125
|
+
*
|
|
126
|
+
* Returning the length beside the browser stream satisfies the optional
|
|
127
|
+
* `Backend.getStream` contract. Older injected backends that implement
|
|
128
|
+
* only [`Self::get`] remain compatible, but cannot claim bounded memory
|
|
129
|
+
* for historical oversized inline Track reads.
|
|
130
|
+
*/
|
|
131
|
+
getStream(path: string): Promise<any>;
|
|
115
132
|
/**
|
|
116
133
|
* List object paths under `prefix`. Stub (returns empty); the current
|
|
117
134
|
* consumer read paths don't require listing.
|
|
@@ -127,6 +144,32 @@ export class Space {
|
|
|
127
144
|
private constructor();
|
|
128
145
|
free(): void;
|
|
129
146
|
[Symbol.dispose](): void;
|
|
147
|
+
/**
|
|
148
|
+
* The Space's human-readable description, or `undefined` when none is set.
|
|
149
|
+
*
|
|
150
|
+
* The read half of `Authoring.setDescription` (#129). It lives here rather
|
|
151
|
+
* than on `Authoring` because that type is `write-full` and so exists only
|
|
152
|
+
* in the Node build — a description is metadata a READER wants, and
|
|
153
|
+
* `Space` is the surface all three build targets share.
|
|
154
|
+
*
|
|
155
|
+
* `async` although `Dataset::description` is not: the value comes from the
|
|
156
|
+
* Dataset this Space opens lazily at the Manifest hash already pinned by
|
|
157
|
+
* this Space, so the first call may perform that open without re-resolving
|
|
158
|
+
* a source Ref.
|
|
159
|
+
*
|
|
160
|
+
* Deliberately routed through `Dataset::description` rather than read out
|
|
161
|
+
* of `self.manifest`'s registry, which would be shorter and would also
|
|
162
|
+
* serve the cached decoded Manifest. `Dataset::recover_meta` is not a prefix
|
|
163
|
+
* filter: it accepts the legacy `vortex.*` namespace as well as
|
|
164
|
+
* `dreamdb.*`, canonicalises, and drops structural keys. Matching
|
|
165
|
+
* `dreamdb.description` here would silently return nothing for a legacy
|
|
166
|
+
* Space whose description is on disk and readable from Rust — the exact
|
|
167
|
+
* defect `recover_meta`'s own comment records.
|
|
168
|
+
*
|
|
169
|
+
* `Option<String>` marshals to `string | undefined`, NOT to `""`. An unset
|
|
170
|
+
* description and an empty one stay distinguishable across the boundary.
|
|
171
|
+
*/
|
|
172
|
+
description(): Promise<string | undefined>;
|
|
130
173
|
/**
|
|
131
174
|
* Open a Space from a `.../refs/<name>` or `.../manifests/<hash>` URI,
|
|
132
175
|
* resolving the ref (if any) and loading the manifest. If `backend` is
|
|
@@ -206,18 +249,55 @@ export class Space {
|
|
|
206
249
|
* two-pass rerank + HotShard merge + tombstone suppression.
|
|
207
250
|
*/
|
|
208
251
|
queryVector(field: string, query: Float32Array, opts: any): Promise<Array<any>>;
|
|
252
|
+
/**
|
|
253
|
+
* Read an Event/Unbucketed or Continuous/TimeBatch typed-array field as
|
|
254
|
+
* `Map<anchorString, {values, shape, ...}>`.
|
|
255
|
+
*/
|
|
256
|
+
readArrayColumn(field: string): Promise<Map<any, any>>;
|
|
257
|
+
/**
|
|
258
|
+
* Read a typed-array Constant and decode it to a JS TypedArray plus its
|
|
259
|
+
* authoritative shape and semantic metadata.
|
|
260
|
+
*/
|
|
261
|
+
readArrayConstant(field: string): Promise<any>;
|
|
209
262
|
/**
|
|
210
263
|
* Read a scalar track as a `Map<anchorString, value>`. Single-anchor
|
|
211
264
|
* entries resolve from the track index; multi-anchor entries fetch (and
|
|
212
265
|
* de-dupe) their bucket and roaring-decode the anchor set.
|
|
213
266
|
*/
|
|
214
267
|
readScalarColumn(track: any, _opts: any): Promise<Map<any, any>>;
|
|
268
|
+
/**
|
|
269
|
+
* Fetch verified initialization and complete Fragments overlapping one
|
|
270
|
+
* item-relative half-open range. This materializes the selected bytes; it
|
|
271
|
+
* is not a streaming API.
|
|
272
|
+
*/
|
|
273
|
+
readVideoItemRange(field: string, item_key: Uint8Array, relative_start_ns: any, relative_end_ns: any): Promise<any>;
|
|
215
274
|
/**
|
|
216
275
|
* Fetch a track object and return its `object_index` (array of CBOR
|
|
217
276
|
* entries). Inline indexes only — paged indexes are not resolved (matching
|
|
218
277
|
* dreamdb-ts, which also doesn't support them on this path).
|
|
219
278
|
*/
|
|
220
279
|
resolveObjectIndex(track: any): Promise<Array<any>>;
|
|
280
|
+
/**
|
|
281
|
+
* Semantic-cache capacity in bytes (spec/0006 §3.6). Default 1 GiB.
|
|
282
|
+
*/
|
|
283
|
+
semanticCacheCapacity(): Promise<number>;
|
|
284
|
+
/**
|
|
285
|
+
* Semantic-cache occupancy as `{ entries, bytesUsed, maxBytes }`.
|
|
286
|
+
*/
|
|
287
|
+
semanticCacheStats(): Promise<object>;
|
|
288
|
+
/**
|
|
289
|
+
* Set the semantic-cache capacity in bytes, evicting down to it before
|
|
290
|
+
* returning. Returns the bytes evicted. `0` disables the cache.
|
|
291
|
+
*
|
|
292
|
+
* An index whose accounted size exceeds the cap is not cached and is
|
|
293
|
+
* re-fetched on every query, reported honestly as a miss. The default is
|
|
294
|
+
* not raised globally to suit one corpus.
|
|
295
|
+
*
|
|
296
|
+
* Sizing is workload- and architecture-dependent, and figures measured on
|
|
297
|
+
* a 64-bit host do NOT carry over here: `usize` is 32 bits on `wasm32`, so
|
|
298
|
+
* every offset and length inside a decoded index accounts differently.
|
|
299
|
+
*/
|
|
300
|
+
setSemanticCacheCapacity(n_bytes: number): Promise<number>;
|
|
221
301
|
/**
|
|
222
302
|
* Base32 hash of the manifest's first timeline.
|
|
223
303
|
*/
|
|
@@ -230,6 +310,16 @@ export class Space {
|
|
|
230
310
|
* List resolved tracks from this manifest.
|
|
231
311
|
*/
|
|
232
312
|
tracks(): Array<any>;
|
|
313
|
+
/**
|
|
314
|
+
* Look up the logical VideoItem containing one absolute Timeline anchor
|
|
315
|
+
* without fetching media. Exact nanosecond values are returned as bigint.
|
|
316
|
+
*/
|
|
317
|
+
videoItemAt(field: string, anchor_ns: any): Promise<any>;
|
|
318
|
+
/**
|
|
319
|
+
* Look up one logical VideoItem by its stable opaque key without fetching
|
|
320
|
+
* initialization or Fragment bytes.
|
|
321
|
+
*/
|
|
322
|
+
videoItemByKey(field: string, item_key: Uint8Array): Promise<any>;
|
|
233
323
|
/**
|
|
234
324
|
* The base URL objects are fetched relative to (consumers build their own
|
|
235
325
|
* object URLs from this — e.g. `dreamdb-demo`'s track readers).
|
|
@@ -274,6 +364,43 @@ export class Writer {
|
|
|
274
364
|
* Tombstone records by anchor. Returns the new manifest hash.
|
|
275
365
|
*/
|
|
276
366
|
deleteRecords(anchors: BigUint64Array, reason?: string | null): Promise<string>;
|
|
367
|
+
/**
|
|
368
|
+
* Ingest a pre-fragmented CMAF (fragmented-MP4) video into a Video field
|
|
369
|
+
* as a `spec/0007` §5 media Track — the thing that makes a video Track
|
|
370
|
+
* time-seekable and MSE-playable rather than one opaque blob.
|
|
371
|
+
*
|
|
372
|
+
* ```js
|
|
373
|
+
* const out = await writer.ingestCmaf('video', initBytes, [
|
|
374
|
+
* [frag0, 0n, 2_000_000_000n],
|
|
375
|
+
* [frag1, 2_000_000_000n, 4_000_000_000n],
|
|
376
|
+
* ])
|
|
377
|
+
* ```
|
|
378
|
+
*
|
|
379
|
+
* - `init` is the initialization segment (`ftyp`+`moov`).
|
|
380
|
+
* - each fragment is `[Uint8Array, tStartNs, tEndNs]`, half-open, already
|
|
381
|
+
* offset to the timeline anchor the caller wants. Pass `bigint`s:
|
|
382
|
+
* wall-clock nanosecond anchors are far past `Number.MAX_SAFE_INTEGER`
|
|
383
|
+
* and a rounded `tStart` writes the fragment into a 60 s bucket that
|
|
384
|
+
* does not match the address it is indexed at.
|
|
385
|
+
*
|
|
386
|
+
* Calling it again on the SAME field APPENDS (one episode per call on a
|
|
387
|
+
* shared timeline) and reuses the track's existing init segment; a clip
|
|
388
|
+
* whose init differs — different codec, resolution, fps or audio config —
|
|
389
|
+
* is refused, because a Track carries exactly one init segment and the
|
|
390
|
+
* mismatch would produce fragments that decode against the wrong one.
|
|
391
|
+
*
|
|
392
|
+
* Returns `{field, modality, initHash, fragmentCount, coverage: [bigint,
|
|
393
|
+
* bigint], trackHash, manifestHash}`. `coverage` is `bigint` for the
|
|
394
|
+
* reason above; `fragmentCount` is the track's total after the append,
|
|
395
|
+
* not the number passed in.
|
|
396
|
+
*
|
|
397
|
+
* **Node only** (`write-full`). This takes every fragment's bytes as an
|
|
398
|
+
* argument, so peak memory is the whole clip; the native path form streams
|
|
399
|
+
* fragment-by-fragment off disk, which wasm32 cannot do because it has no
|
|
400
|
+
* filesystem. Fragmenting a multi-GB source inside a browser tab's 32-bit
|
|
401
|
+
* address space is not a workflow worth pretending to support.
|
|
402
|
+
*/
|
|
403
|
+
ingestCmaf(field: string, init: Uint8Array, fragments: Array<any>): Promise<any>;
|
|
277
404
|
/**
|
|
278
405
|
* Open a ref for writing.
|
|
279
406
|
*
|
|
@@ -413,6 +540,13 @@ export function timeAnchorHex(value: bigint): string;
|
|
|
413
540
|
*/
|
|
414
541
|
export function timeBucket(t_start: bigint, duration: string): bigint;
|
|
415
542
|
|
|
543
|
+
/**
|
|
544
|
+
* Decode one spec/0025 item using the same declaration and payload path as
|
|
545
|
+
* `Space.readArrayColumn`, without requiring storage IO. This is the SDK's
|
|
546
|
+
* pure conformance entry point for language-neutral vectors.
|
|
547
|
+
*/
|
|
548
|
+
export function typedArrayDecode(item_type: any, payload: Uint8Array): any;
|
|
549
|
+
|
|
416
550
|
/**
|
|
417
551
|
* Package version — useful for consumers to confirm which build is loaded.
|
|
418
552
|
*/
|
package/node/dreamdb_bg.wasm
CHANGED
|
Binary file
|
|
@@ -6,6 +6,7 @@ export const __wbg_s3backend_free: (a: number, b: number) => void;
|
|
|
6
6
|
export const __wbg_space_free: (a: number, b: number) => void;
|
|
7
7
|
export const addressRoundTrip: (a: number, b: number) => [number, number, number, number];
|
|
8
8
|
export const addressVariant: (a: number, b: number) => [number, number, number, number];
|
|
9
|
+
export const authoring_addArrayConstant: (a: number, b: any, c: any) => any;
|
|
9
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;
|
|
10
11
|
export const authoring_addField: (a: number, b: any) => any;
|
|
11
12
|
export const authoring_addImageLayer: (a: number, b: number, c: number, d: number, e: number, f: any, g: number, h: number) => any;
|
|
@@ -28,9 +29,11 @@ export const multihashBase32: (a: number, b: number) => [number, number];
|
|
|
28
29
|
export const multihashHex: (a: number, b: number) => [number, number];
|
|
29
30
|
export const rangeHeader: (a: bigint, b: bigint) => [number, number, number, number];
|
|
30
31
|
export const s3backend_get: (a: number, b: number, c: number, d: any) => any;
|
|
32
|
+
export const s3backend_getStream: (a: number, b: number, c: number) => any;
|
|
31
33
|
export const s3backend_list: (a: number, b: number, c: number) => any;
|
|
32
34
|
export const s3backend_new: (a: number, b: number) => number;
|
|
33
35
|
export const space_connectorBase: (a: number) => [number, number];
|
|
36
|
+
export const space_description: (a: number) => any;
|
|
34
37
|
export const space_fromUri: (a: number, b: number, c: any) => any;
|
|
35
38
|
export const space_history: (a: number, b: number) => any;
|
|
36
39
|
export const space_manifestHash: (a: number) => [number, number];
|
|
@@ -38,19 +41,29 @@ export const space_queryHybrid: (a: number, b: number, c: number, d: any) => any
|
|
|
38
41
|
export const space_queryScalar: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
|
|
39
42
|
export const space_queryText: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
40
43
|
export const space_queryVector: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
|
|
44
|
+
export const space_readArrayColumn: (a: number, b: number, c: number) => any;
|
|
45
|
+
export const space_readArrayConstant: (a: number, b: number, c: number) => any;
|
|
41
46
|
export const space_readScalarColumn: (a: number, b: any, c: any) => any;
|
|
47
|
+
export const space_readVideoItemRange: (a: number, b: number, c: number, d: any, e: any, f: any) => any;
|
|
42
48
|
export const space_resolveObjectIndex: (a: number, b: any) => any;
|
|
49
|
+
export const space_semanticCacheCapacity: (a: number) => any;
|
|
50
|
+
export const space_semanticCacheStats: (a: number) => any;
|
|
51
|
+
export const space_setSemanticCacheCapacity: (a: number, b: number) => any;
|
|
43
52
|
export const space_timelineId: (a: number) => [number, number, number, number];
|
|
44
|
-
export const space_trackFor: (a: number, b: number, c: number) =>
|
|
45
|
-
export const space_tracks: (a: number) =>
|
|
53
|
+
export const space_trackFor: (a: number, b: number, c: number) => [number, number, number];
|
|
54
|
+
export const space_tracks: (a: number) => [number, number, number];
|
|
55
|
+
export const space_videoItemAt: (a: number, b: number, c: number, d: any) => any;
|
|
56
|
+
export const space_videoItemByKey: (a: number, b: number, c: number, d: any) => any;
|
|
46
57
|
export const spatialKeyRoundTrip: (a: number, b: number) => [number, number, number, number];
|
|
47
58
|
export const timeAnchorFromHex: (a: number, b: number) => [bigint, number, number];
|
|
48
59
|
export const timeAnchorHex: (a: bigint) => [number, number];
|
|
49
60
|
export const timeBucket: (a: bigint, b: number, c: number) => [bigint, number, number];
|
|
61
|
+
export const typedArrayDecode: (a: any, b: number, c: number) => [number, number, number];
|
|
50
62
|
export const version: () => [number, number];
|
|
51
63
|
export const writer_appendMany: (a: number, b: any) => any;
|
|
52
64
|
export const writer_commit: (a: number) => any;
|
|
53
65
|
export const writer_deleteRecords: (a: number, b: number, c: number, d: number, e: number) => any;
|
|
66
|
+
export const writer_ingestCmaf: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
|
|
54
67
|
export const writer_manifestHash: (a: number) => [number, number, number, number];
|
|
55
68
|
export const writer_open: (a: number, b: number, c: any) => any;
|
|
56
69
|
export const writer_snapshot: (a: number, b: number, c: number) => any;
|
package/node.mjs
CHANGED
|
@@ -11,7 +11,7 @@ export const {
|
|
|
11
11
|
Authoring, S3Backend, Space, Writer, addressRoundTrip,
|
|
12
12
|
addressVariant, bytesToBase32, decodeCbor, encodeCbor, modalityParse,
|
|
13
13
|
multihashBase32, multihashHex, rangeHeader, spatialKeyRoundTrip, timeAnchorFromHex,
|
|
14
|
-
timeAnchorHex, timeBucket, version, zeroSpatialKey,
|
|
14
|
+
timeAnchorHex, timeBucket, typedArrayDecode, version, zeroSpatialKey,
|
|
15
15
|
} = mod
|
|
16
16
|
|
|
17
17
|
/** 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.
|
|
3
|
+
"version": "0.5.2",
|
|
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",
|
|
@@ -36,7 +36,9 @@
|
|
|
36
36
|
"node.cjs",
|
|
37
37
|
"browser-extras.mjs",
|
|
38
38
|
"index.d.ts",
|
|
39
|
-
"README.md"
|
|
39
|
+
"README.md",
|
|
40
|
+
"LICENSE-MIT",
|
|
41
|
+
"LICENSE-APACHE"
|
|
40
42
|
],
|
|
41
43
|
"sideEffects": [
|
|
42
44
|
"./browser/dreamdb.js",
|
package/web/dreamdb.d.ts
CHANGED
|
@@ -13,6 +13,15 @@ export class S3Backend {
|
|
|
13
13
|
* content is hash-addressed; refs are read fresh each page load anyway).
|
|
14
14
|
*/
|
|
15
15
|
get(path: string, _opts: any): Promise<Uint8Array>;
|
|
16
|
+
/**
|
|
17
|
+
* Stream `path` without first aggregating the response in wasm memory.
|
|
18
|
+
*
|
|
19
|
+
* Returning the length beside the browser stream satisfies the optional
|
|
20
|
+
* `Backend.getStream` contract. Older injected backends that implement
|
|
21
|
+
* only [`Self::get`] remain compatible, but cannot claim bounded memory
|
|
22
|
+
* for historical oversized inline Track reads.
|
|
23
|
+
*/
|
|
24
|
+
getStream(path: string): Promise<any>;
|
|
16
25
|
/**
|
|
17
26
|
* List object paths under `prefix`. Stub (returns empty); the current
|
|
18
27
|
* consumer read paths don't require listing.
|
|
@@ -28,6 +37,32 @@ export class Space {
|
|
|
28
37
|
private constructor();
|
|
29
38
|
free(): void;
|
|
30
39
|
[Symbol.dispose](): void;
|
|
40
|
+
/**
|
|
41
|
+
* The Space's human-readable description, or `undefined` when none is set.
|
|
42
|
+
*
|
|
43
|
+
* The read half of `Authoring.setDescription` (#129). It lives here rather
|
|
44
|
+
* than on `Authoring` because that type is `write-full` and so exists only
|
|
45
|
+
* in the Node build — a description is metadata a READER wants, and
|
|
46
|
+
* `Space` is the surface all three build targets share.
|
|
47
|
+
*
|
|
48
|
+
* `async` although `Dataset::description` is not: the value comes from the
|
|
49
|
+
* Dataset this Space opens lazily at the Manifest hash already pinned by
|
|
50
|
+
* this Space, so the first call may perform that open without re-resolving
|
|
51
|
+
* a source Ref.
|
|
52
|
+
*
|
|
53
|
+
* Deliberately routed through `Dataset::description` rather than read out
|
|
54
|
+
* of `self.manifest`'s registry, which would be shorter and would also
|
|
55
|
+
* serve the cached decoded Manifest. `Dataset::recover_meta` is not a prefix
|
|
56
|
+
* filter: it accepts the legacy `vortex.*` namespace as well as
|
|
57
|
+
* `dreamdb.*`, canonicalises, and drops structural keys. Matching
|
|
58
|
+
* `dreamdb.description` here would silently return nothing for a legacy
|
|
59
|
+
* Space whose description is on disk and readable from Rust — the exact
|
|
60
|
+
* defect `recover_meta`'s own comment records.
|
|
61
|
+
*
|
|
62
|
+
* `Option<String>` marshals to `string | undefined`, NOT to `""`. An unset
|
|
63
|
+
* description and an empty one stay distinguishable across the boundary.
|
|
64
|
+
*/
|
|
65
|
+
description(): Promise<string | undefined>;
|
|
31
66
|
/**
|
|
32
67
|
* Open a Space from a `.../refs/<name>` or `.../manifests/<hash>` URI,
|
|
33
68
|
* resolving the ref (if any) and loading the manifest. If `backend` is
|
|
@@ -107,18 +142,55 @@ export class Space {
|
|
|
107
142
|
* two-pass rerank + HotShard merge + tombstone suppression.
|
|
108
143
|
*/
|
|
109
144
|
queryVector(field: string, query: Float32Array, opts: any): Promise<Array<any>>;
|
|
145
|
+
/**
|
|
146
|
+
* Read an Event/Unbucketed or Continuous/TimeBatch typed-array field as
|
|
147
|
+
* `Map<anchorString, {values, shape, ...}>`.
|
|
148
|
+
*/
|
|
149
|
+
readArrayColumn(field: string): Promise<Map<any, any>>;
|
|
150
|
+
/**
|
|
151
|
+
* Read a typed-array Constant and decode it to a JS TypedArray plus its
|
|
152
|
+
* authoritative shape and semantic metadata.
|
|
153
|
+
*/
|
|
154
|
+
readArrayConstant(field: string): Promise<any>;
|
|
110
155
|
/**
|
|
111
156
|
* Read a scalar track as a `Map<anchorString, value>`. Single-anchor
|
|
112
157
|
* entries resolve from the track index; multi-anchor entries fetch (and
|
|
113
158
|
* de-dupe) their bucket and roaring-decode the anchor set.
|
|
114
159
|
*/
|
|
115
160
|
readScalarColumn(track: any, _opts: any): Promise<Map<any, any>>;
|
|
161
|
+
/**
|
|
162
|
+
* Fetch verified initialization and complete Fragments overlapping one
|
|
163
|
+
* item-relative half-open range. This materializes the selected bytes; it
|
|
164
|
+
* is not a streaming API.
|
|
165
|
+
*/
|
|
166
|
+
readVideoItemRange(field: string, item_key: Uint8Array, relative_start_ns: any, relative_end_ns: any): Promise<any>;
|
|
116
167
|
/**
|
|
117
168
|
* Fetch a track object and return its `object_index` (array of CBOR
|
|
118
169
|
* entries). Inline indexes only — paged indexes are not resolved (matching
|
|
119
170
|
* dreamdb-ts, which also doesn't support them on this path).
|
|
120
171
|
*/
|
|
121
172
|
resolveObjectIndex(track: any): Promise<Array<any>>;
|
|
173
|
+
/**
|
|
174
|
+
* Semantic-cache capacity in bytes (spec/0006 §3.6). Default 1 GiB.
|
|
175
|
+
*/
|
|
176
|
+
semanticCacheCapacity(): Promise<number>;
|
|
177
|
+
/**
|
|
178
|
+
* Semantic-cache occupancy as `{ entries, bytesUsed, maxBytes }`.
|
|
179
|
+
*/
|
|
180
|
+
semanticCacheStats(): Promise<object>;
|
|
181
|
+
/**
|
|
182
|
+
* Set the semantic-cache capacity in bytes, evicting down to it before
|
|
183
|
+
* returning. Returns the bytes evicted. `0` disables the cache.
|
|
184
|
+
*
|
|
185
|
+
* An index whose accounted size exceeds the cap is not cached and is
|
|
186
|
+
* re-fetched on every query, reported honestly as a miss. The default is
|
|
187
|
+
* not raised globally to suit one corpus.
|
|
188
|
+
*
|
|
189
|
+
* Sizing is workload- and architecture-dependent, and figures measured on
|
|
190
|
+
* a 64-bit host do NOT carry over here: `usize` is 32 bits on `wasm32`, so
|
|
191
|
+
* every offset and length inside a decoded index accounts differently.
|
|
192
|
+
*/
|
|
193
|
+
setSemanticCacheCapacity(n_bytes: number): Promise<number>;
|
|
122
194
|
/**
|
|
123
195
|
* Base32 hash of the manifest's first timeline.
|
|
124
196
|
*/
|
|
@@ -131,6 +203,16 @@ export class Space {
|
|
|
131
203
|
* List resolved tracks from this manifest.
|
|
132
204
|
*/
|
|
133
205
|
tracks(): Array<any>;
|
|
206
|
+
/**
|
|
207
|
+
* Look up the logical VideoItem containing one absolute Timeline anchor
|
|
208
|
+
* without fetching media. Exact nanosecond values are returned as bigint.
|
|
209
|
+
*/
|
|
210
|
+
videoItemAt(field: string, anchor_ns: any): Promise<any>;
|
|
211
|
+
/**
|
|
212
|
+
* Look up one logical VideoItem by its stable opaque key without fetching
|
|
213
|
+
* initialization or Fragment bytes.
|
|
214
|
+
*/
|
|
215
|
+
videoItemByKey(field: string, item_key: Uint8Array): Promise<any>;
|
|
134
216
|
/**
|
|
135
217
|
* The base URL objects are fetched relative to (consumers build their own
|
|
136
218
|
* object URLs from this — e.g. `dreamdb-demo`'s track readers).
|
|
@@ -314,6 +396,13 @@ export function timeAnchorHex(value: bigint): string;
|
|
|
314
396
|
*/
|
|
315
397
|
export function timeBucket(t_start: bigint, duration: string): bigint;
|
|
316
398
|
|
|
399
|
+
/**
|
|
400
|
+
* Decode one spec/0025 item using the same declaration and payload path as
|
|
401
|
+
* `Space.readArrayColumn`, without requiring storage IO. This is the SDK's
|
|
402
|
+
* pure conformance entry point for language-neutral vectors.
|
|
403
|
+
*/
|
|
404
|
+
export function typedArrayDecode(item_type: any, payload: Uint8Array): any;
|
|
405
|
+
|
|
317
406
|
/**
|
|
318
407
|
* Package version — useful for consumers to confirm which build is loaded.
|
|
319
408
|
*/
|
|
@@ -342,9 +431,11 @@ export interface InitOutput {
|
|
|
342
431
|
readonly multihashHex: (a: number, b: number) => [number, number];
|
|
343
432
|
readonly rangeHeader: (a: bigint, b: bigint) => [number, number, number, number];
|
|
344
433
|
readonly s3backend_get: (a: number, b: number, c: number, d: any) => any;
|
|
434
|
+
readonly s3backend_getStream: (a: number, b: number, c: number) => any;
|
|
345
435
|
readonly s3backend_list: (a: number, b: number, c: number) => any;
|
|
346
436
|
readonly s3backend_new: (a: number, b: number) => number;
|
|
347
437
|
readonly space_connectorBase: (a: number) => [number, number];
|
|
438
|
+
readonly space_description: (a: number) => any;
|
|
348
439
|
readonly space_fromUri: (a: number, b: number, c: any) => any;
|
|
349
440
|
readonly space_history: (a: number, b: number) => any;
|
|
350
441
|
readonly space_manifestHash: (a: number) => [number, number];
|
|
@@ -352,15 +443,24 @@ export interface InitOutput {
|
|
|
352
443
|
readonly space_queryScalar: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
|
|
353
444
|
readonly space_queryText: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
354
445
|
readonly space_queryVector: (a: number, b: number, c: number, d: number, e: number, f: any) => any;
|
|
446
|
+
readonly space_readArrayColumn: (a: number, b: number, c: number) => any;
|
|
447
|
+
readonly space_readArrayConstant: (a: number, b: number, c: number) => any;
|
|
355
448
|
readonly space_readScalarColumn: (a: number, b: any, c: any) => any;
|
|
449
|
+
readonly space_readVideoItemRange: (a: number, b: number, c: number, d: any, e: any, f: any) => any;
|
|
356
450
|
readonly space_resolveObjectIndex: (a: number, b: any) => any;
|
|
451
|
+
readonly space_semanticCacheCapacity: (a: number) => any;
|
|
452
|
+
readonly space_semanticCacheStats: (a: number) => any;
|
|
453
|
+
readonly space_setSemanticCacheCapacity: (a: number, b: number) => any;
|
|
357
454
|
readonly space_timelineId: (a: number) => [number, number, number, number];
|
|
358
|
-
readonly space_trackFor: (a: number, b: number, c: number) =>
|
|
359
|
-
readonly space_tracks: (a: number) =>
|
|
455
|
+
readonly space_trackFor: (a: number, b: number, c: number) => [number, number, number];
|
|
456
|
+
readonly space_tracks: (a: number) => [number, number, number];
|
|
457
|
+
readonly space_videoItemAt: (a: number, b: number, c: number, d: any) => any;
|
|
458
|
+
readonly space_videoItemByKey: (a: number, b: number, c: number, d: any) => any;
|
|
360
459
|
readonly spatialKeyRoundTrip: (a: number, b: number) => [number, number, number, number];
|
|
361
460
|
readonly timeAnchorFromHex: (a: number, b: number) => [bigint, number, number];
|
|
362
461
|
readonly timeAnchorHex: (a: bigint) => [number, number];
|
|
363
462
|
readonly timeBucket: (a: bigint, b: number, c: number) => [bigint, number, number];
|
|
463
|
+
readonly typedArrayDecode: (a: any, b: number, c: number) => [number, number, number];
|
|
364
464
|
readonly version: () => [number, number];
|
|
365
465
|
readonly writer_appendMany: (a: number, b: any) => any;
|
|
366
466
|
readonly writer_commit: (a: number) => any;
|