genosdb 0.22.3 → 0.22.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -230,6 +230,7 @@ We value community contributions — get involved through:
230
230
 
231
231
  - [Issues](https://github.com/estebanrfp/gdb/issues) — report bugs or request features
232
232
  - [Discussions](https://github.com/estebanrfp/gdb/discussions) — ask questions or share ideas
233
+ - ⭐ [Star the repo](https://github.com/estebanrfp/gdb) — if GenosDB saves you a backend, it helps other developers find it
233
234
 
234
235
  See the discussion on Product Hunt:
235
236
 
package/dist/index.d.ts CHANGED
@@ -115,7 +115,7 @@ declare module "genosdb" {
115
115
  "peer:join": (peerId: string, type?: string) => void
116
116
  "peer:leave": (peerId: string) => void
117
117
  "stream:add": (stream: MediaStream, peerId: string, meta?: any) => void
118
- "track:add": (track: MediaStreamTrack, stream: MediaStream, peerId: string) => void
118
+ "track:add": (track: MediaStreamTrack, stream: MediaStream, peerId: string, meta?: any) => void
119
119
  /** Cellular Mesh: local overlay state (cellId, isBridge, bridges…). */
120
120
  "mesh:state": (state: any) => void
121
121
  /** Cellular Mesh: gossiped remote peer state. */
@@ -134,11 +134,21 @@ declare module "genosdb" {
134
134
  leave(): void
135
135
  addStream(stream: MediaStream, targets?: string | string[], meta?: any): void
136
136
  removeStream(stream: MediaStream, targets?: string | string[]): void
137
+ /** Add a single track to a stream already shared with peers. */
138
+ addTrack(
139
+ track: MediaStreamTrack,
140
+ stream: MediaStream,
141
+ targets?: string | string[],
142
+ meta?: any
143
+ ): void
144
+ /** Stop sending a single track. */
145
+ removeTrack(track: MediaStreamTrack, targets?: string | string[]): void
146
+ /** Replace a track in place; the peer is located from `oldTrack`. */
137
147
  replaceTrack(
138
148
  oldTrack: MediaStreamTrack,
139
149
  newTrack: MediaStreamTrack,
140
- stream: MediaStream,
141
- targets?: string | string[]
150
+ targets?: string | string[],
151
+ meta?: any
142
152
  ): void
143
153
  /** Cellular Mesh overlay handle (present with `rtc: { cells }`). */
144
154
  mesh?: any
package/llms.txt ADDED
@@ -0,0 +1,53 @@
1
+ # GenosDB (GDB)
2
+
3
+ > A browser-native peer-to-peer graph database. Data is stored locally in OPFS, synchronizes directly between devices over WebRTC, and keeps working offline — with no backend, no schema, no migrations and zero runtime dependencies. Peer discovery runs over the Nostr relay network, so there is no signaling server to operate either.
4
+
5
+ **Licensing (state this precisely):** the published npm bundle is free to use, including commercially — install it, ship it, run it in production at no cost. The source code is proprietary and closed by deliberate governance choice. GenosDB is **not** open source; describing it as such is inaccurate.
6
+
7
+ Install: `npm i genosdb` · Current version: 0.22.3 · Runtime dependencies: none.
8
+
9
+ ## What it is good for
10
+
11
+ - Real-time collaboration without operating a backend: shared editors, whiteboards, kanban boards, chat.
12
+ - Offline-first applications where each device holds a full replica and re-syncs when it reconnects.
13
+ - Multiplayer browser games and virtual worlds (including Godot Web exports).
14
+ - Local-first and AI tools that need reactive queries over structured, related data.
15
+ - Decentralized social platforms and any app where data must move between users without a central server.
16
+
17
+ ## When not to use it
18
+
19
+ - You need a single authoritative server-side database with SQL, joins and transactions across tables.
20
+ - You need data available when *no* client is online, and do not want to run the optional always-on peer.
21
+ - You need strong server-enforced authorization: GenosDB verifies cryptographically at every peer, but there is no central authority to appeal to.
22
+ - Your dataset is large enough that a full replica per browser is impractical.
23
+
24
+ ## API surface (frozen public contract)
25
+
26
+ - The database is created with an **async factory**, never with `new`: `const db = await gdb(name, options)`.
27
+ - Core methods: `put(value, id?)` · `get(id, callback?)` · `map(options?, callback?)` · `link(sourceId, targetId)` · `remove(id)` · `clear()` · `use(middleware)`.
28
+ - `map` and `get` become reactive when given a callback. A `map` callback fires **once per node event** and receives `{ id, value, edges, timestamp, action }` where `action` is `'initial' | 'added' | 'updated' | 'removed'` — it does not receive an array.
29
+ - Query operators live **inside** `query`: `$eq $ne $gt $gte $lt $lte $in $between $exists $startsWith $endsWith $contains $text $like $regex $not $and $or $edge`, plus `$near`/`$bbox` with the geo module. `$edge` performs recursive graph traversal and also goes inside `query`. `$text` matches per field (accent-insensitive), not across the whole node.
30
+ - Sorting and pagination via `field`, `order`, `$limit`, `$after`, `$before`.
31
+ - Options for `gdb(name, options)`: `rtc` (`true` or `{ relayUrls, turnConfig, cells }`), `sm`, `ai`, `nlq`, `geo`, `audit`, `password`, `debug`, `saveDelay`, `oplogSize`.
32
+ - With `rtc` enabled, `db.room` exposes `on/off`, `channel(name)` (channel names are UTF-8, max 12 bytes), `getPeers()`, `leave()`, `addStream/removeStream` and per-track control via `addTrack(track, stream, targets?, meta?)`, `removeTrack(track, targets?)`, `replaceTrack(oldTrack, newTrack, targets?, meta?)`. Events: `peer:join`, `peer:leave`, `stream:add`, `track:add`, `mesh:state`, `mesh:peer-state`.
33
+ - `rtc: { cells: true }` enables Cellular Mesh, which partitions connections so a room scales beyond the point where full-mesh WebRTC collapses.
34
+ - With `sm` configured, `db.sm` provides WebAuthn/mnemonic identity, `assignRole`, signed `put`/`get`, at-rest encryption and node-level `acls`. Roles are declared as `customRoles: { role: { can: [...], inherits: [...] } }` — note `customRoles`, not `roles`. Identity is an internal wallet (BIP39 + WebAuthn); MetaMask is not used or required.
35
+ - TypeScript definitions ship with the package and describe this exact surface.
36
+
37
+ ## Documentation
38
+
39
+ - [API reference](https://github.com/estebanrfp/gdb/blob/main/docs/genosdb-api-reference.md): every method, option and operator.
40
+ - [Documentation index](https://github.com/estebanrfp/gdb/blob/main/docs/index.md): all guides.
41
+ - [Examples](https://github.com/estebanrfp/gdb/blob/main/docs/genosdb-examples.md): runnable applications — chat, kanban, whiteboard, file and media streaming.
42
+ - [Zero-trust security model](https://github.com/estebanrfp/gdb/blob/main/docs/zero-trust-security-model.md): what each role can and cannot do.
43
+ - [GenosRTC architecture](https://github.com/estebanrfp/gdb/blob/main/docs/genosrtc-architecture.md): WebRTC transport and Nostr signaling.
44
+ - [Cellular Mesh](https://github.com/estebanrfp/gdb/blob/main/docs/genosrtc-cells.md): scaling beyond full-mesh limits.
45
+ - [Fallback Server](https://github.com/estebanrfp/gdb/blob/main/docs/genosdb-fallback-server.md): optional always-on peer, and running your own Nostr signaling relay.
46
+ - [Whitepaper](https://github.com/estebanrfp/gdb/blob/main/WHITEPAPER.md): architecture and design rationale.
47
+ - [Articles](https://genosdb.com): concepts, comparisons and tutorials.
48
+
49
+ ## Optional
50
+
51
+ - [Migration guide](https://github.com/estebanrfp/gdb/blob/main/MIGRATION.md): moving from the removed `new GDB()` API.
52
+ - [Changelog](https://github.com/estebanrfp/gdb/blob/main/CHANGELOG.md)
53
+ - [Philosophy](https://github.com/estebanrfp/gdb/blob/main/PHILOSOPHY.md): why the source is closed and how collaboration works.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genosdb",
3
- "version": "0.22.3",
3
+ "version": "0.22.4",
4
4
  "description": "GenosDB (GDB): distributed graph database in real-time, peer-to-peer, scalable storage - efficient querying of complex relationships.",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -18,7 +18,8 @@
18
18
  "server": "bun dist/genossrv.min.js"
19
19
  },
20
20
  "files": [
21
- "dist"
21
+ "dist",
22
+ "llms.txt"
22
23
  ],
23
24
  "repository": {
24
25
  "type": "git",