@dreamlake/dreamdb 0.1.2 → 0.2.0
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/dreamdb.d.ts +101 -0
- package/dreamdb.js +9 -0
- package/dreamdb_bg.js +750 -0
- package/dreamdb_bg.wasm +0 -0
- package/index.d.ts +16 -0
- package/index.js +6 -0
- package/package.json +18 -28
- package/README.md +0 -62
- package/dist/index.cjs +0 -2290
- package/dist/index.d.cts +0 -502
- package/dist/index.d.ts +0 -502
- package/dist/index.js +0 -2233
package/dreamdb_bg.wasm
ADDED
|
Binary file
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './dreamdb'
|
|
2
|
+
|
|
3
|
+
/** Zero spatial-key path segment for non-spatial (fragment) object addresses. */
|
|
4
|
+
export const ZERO_SPATIAL_KEY: string
|
|
5
|
+
|
|
6
|
+
/** A resolved manifest track (shape returned by `Space.tracks()`). */
|
|
7
|
+
export interface ResolvedTrack {
|
|
8
|
+
modality: string
|
|
9
|
+
field: string | null
|
|
10
|
+
key: string
|
|
11
|
+
kind: string
|
|
12
|
+
role: string
|
|
13
|
+
address: string
|
|
14
|
+
timeline: string
|
|
15
|
+
coverage: unknown
|
|
16
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// @dreamlake/dreamdb — public entry. Re-exports the wasm-bindgen bindings and
|
|
2
|
+
// adds the plain-constant / type members consumers import.
|
|
3
|
+
export * from './dreamdb.js'
|
|
4
|
+
|
|
5
|
+
/** Zero spatial-key path segment for non-spatial (fragment) object addresses. */
|
|
6
|
+
export const ZERO_SPATIAL_KEY = '0000000000000000'
|
package/package.json
CHANGED
|
@@ -1,33 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dreamlake/dreamdb",
|
|
3
|
-
"version": "0.1.2",
|
|
4
|
-
"description": "TypeScript protocol SDK for DreamDB — multimodal versioned data lake",
|
|
5
3
|
"type": "module",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"import": "./dist/index.js",
|
|
13
|
-
"require": "./dist/index.cjs"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
4
|
+
"description": "WebAssembly binding of dreamdb-dataset — the browser DreamDB SDK (@dreamlake/dreamdb)",
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"license": "MIT OR Apache-2.0",
|
|
16
7
|
"files": [
|
|
17
|
-
"
|
|
8
|
+
"dreamdb_bg.wasm",
|
|
9
|
+
"dreamdb.js",
|
|
10
|
+
"dreamdb_bg.js",
|
|
11
|
+
"dreamdb.d.ts",
|
|
12
|
+
"index.js",
|
|
13
|
+
"index.d.ts"
|
|
18
14
|
],
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
"scripts": {
|
|
30
|
-
"build": "tsup",
|
|
31
|
-
"test": "vitest run"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
15
|
+
"main": "index.js",
|
|
16
|
+
"types": "index.d.ts",
|
|
17
|
+
"sideEffects": [
|
|
18
|
+
"./dreamdb.js",
|
|
19
|
+
"./index.js",
|
|
20
|
+
"./snippets/*"
|
|
21
|
+
],
|
|
22
|
+
"module": "index.js"
|
|
23
|
+
}
|
package/README.md
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
# @dreamlake/dreamdb
|
|
2
|
-
|
|
3
|
-
TypeScript driver for [DreamDB](https://dreamdb.dreamlake.ai) — a storage and retrieval protocol for multimodal signals anchored to a shared timeline.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @dreamlake/dreamdb
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Quick start
|
|
12
|
-
|
|
13
|
-
```typescript
|
|
14
|
-
import { Dataset, Schema, MemoryBackend } from '@dreamlake/dreamdb'
|
|
15
|
-
|
|
16
|
-
// Define a schema
|
|
17
|
-
const schema = new Schema()
|
|
18
|
-
schema.addEmbedding('embedding', 16)
|
|
19
|
-
schema.addImage('image', 'jpeg')
|
|
20
|
-
schema.addScalarCategorical('label')
|
|
21
|
-
|
|
22
|
-
// Create a dataset (in-memory for testing, or use S3Backend for production)
|
|
23
|
-
const backend = new MemoryBackend()
|
|
24
|
-
const ds = await Dataset.create('my-dataset', schema, backend)
|
|
25
|
-
|
|
26
|
-
// Append samples
|
|
27
|
-
await ds.appendMany([
|
|
28
|
-
{ embedding: new Float32Array([...]), image: new Uint8Array([...]), label: 'cat' },
|
|
29
|
-
{ embedding: new Float32Array([...]), image: new Uint8Array([...]), label: 'dog' },
|
|
30
|
-
])
|
|
31
|
-
|
|
32
|
-
// Vector query — find the 5 nearest neighbors
|
|
33
|
-
const batches = await ds.iterVector({
|
|
34
|
-
field: 'embedding',
|
|
35
|
-
query: new Float32Array([...]),
|
|
36
|
-
topK: 5,
|
|
37
|
-
})
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
## Browser usage
|
|
41
|
-
|
|
42
|
-
```typescript
|
|
43
|
-
import { S3Backend, Space } from '@dreamlake/dreamdb'
|
|
44
|
-
|
|
45
|
-
const backend = new S3Backend('https://your-bucket.s3.amazonaws.com')
|
|
46
|
-
const space = new Space(backend)
|
|
47
|
-
|
|
48
|
-
// Resolve a ref to its manifest
|
|
49
|
-
const manifest = await space.resolveRef('my-dataset')
|
|
50
|
-
console.log(manifest.tracks)
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Documentation
|
|
54
|
-
|
|
55
|
-
- [Installation](https://dreamdb.dreamlake.ai/installation)
|
|
56
|
-
- [TypeScript SDK Reference](https://dreamdb.dreamlake.ai/typescript-sdk)
|
|
57
|
-
- [Protocol Specification](https://dreamdb.dreamlake.ai/spec-overview)
|
|
58
|
-
- [Browser Demo](https://demo.dreamdb.dreamlake.ai)
|
|
59
|
-
|
|
60
|
-
## License
|
|
61
|
-
|
|
62
|
-
MIT
|