@mindees/data 0.12.0 β†’ 0.14.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/README.md CHANGED
@@ -4,9 +4,10 @@
4
4
 
5
5
  > Status: πŸ§ͺ **Experimental** β€” Continuum Phases 10A–10F are implemented and tested:
6
6
  > the reactive document store, Hybrid Logical Clock causality, CRDT conflict resolution
7
- > (per-field LWW + add-wins OR-Set), a local-first delta-sync engine where two peers
8
- > converge offline, a capability-injected reference sync server, and a persistence
9
- > contract with export/restore. Native durable adapters, production sync hardening, and
7
+ > (per-field LWW + add-wins OR-Set + PN-Counter), a local-first delta-sync engine where
8
+ > two peers converge offline, a capability-injected reference sync server, and a
9
+ > persistence contract with export/restore (in-memory + web-storage adapters). Native
10
+ > durable adapters, production sync hardening, and
10
11
  > CRDT-library/rich-text interop are πŸ”¬ research tracks. See the repository
11
12
  > [STATUS.md](../../STATUS.md).
12
13
 
@@ -32,15 +33,17 @@ The package also ships the sync and durability pieces that build on the store:
32
33
 
33
34
  - **Causality primitives** β€” `createClock`, HLC encode/decode/compare helpers, and
34
35
  version vectors for drift-guarded causal ordering.
35
- - **CRDT conflict helpers** β€” per-field LWW Register/Map and add-wins OR-Set merge
36
- utilities, property-tested for convergence.
36
+ - **CRDT conflict helpers** β€” per-field LWW Register/Map, add-wins OR-Set, and a
37
+ PN-Counter (increment/decrement integer counter) merge utilities, property-tested for
38
+ convergence.
37
39
  - **Delta sync** β€” `createSyncEngine`, `createMutationLog`, `createMemoryHub`, and the
38
40
  `SyncTransport` contract for optimistic local writes plus push/pull/merge.
39
41
  - **Reference sync server** β€” `createSyncServer` from `@mindees/data/server` over an
40
42
  injected `OpLogStore`, with a runnable `node:http` example in
41
43
  [`examples/data-sync-server`](../../examples/data-sync-server).
42
- - **Persistence contract** β€” `Persistence`, `createMemoryPersistence`, and engine
43
- `export()`/restore so replicas keep stable identity across restarts.
44
+ - **Persistence contract** β€” `Persistence`, `createMemoryPersistence`,
45
+ `createWebStoragePersistence`, and engine `export()`/restore so replicas keep stable
46
+ identity across restarts.
44
47
 
45
48
  ```ts
46
49
  import { createCollection } from '@mindees/data'
@@ -0,0 +1,33 @@
1
+ //#region src/counter.d.ts
2
+ /**
3
+ * PN-Counter for Continuum β€” a state-based CRDT integer counter supporting both increment and
4
+ * decrement that converges across replicas. Modeled as two grow-only (G-)counters: `inc` and `dec`,
5
+ * each a per-replica **monotonic total**; the value is `Ξ£inc βˆ’ Ξ£dec`. `mergeCounter` takes the
6
+ * per-replica MAX of each side, so it is commutative, associative, and idempotent β€” replicas that
7
+ * apply the same set of operations converge regardless of order or duplication.
8
+ *
9
+ * Each replica must use a stable `replicaId` (e.g. the clock's node id) for its own increments.
10
+ * Plain JSON; safe to sync as data. See `docs/adr/0014-continuum-crdt.md`.
11
+ *
12
+ * @module
13
+ */
14
+ /** A PN-Counter: per-replica increment + decrement totals. */
15
+ interface Counter {
16
+ /** replicaId β†’ total increments observed from that replica (monotonic). */
17
+ readonly inc: Readonly<Record<string, number>>;
18
+ /** replicaId β†’ total decrements observed from that replica (monotonic). */
19
+ readonly dec: Readonly<Record<string, number>>;
20
+ }
21
+ /** An empty counter (value 0). */
22
+ declare function emptyCounter(): Counter;
23
+ /** Increment this replica's contribution by `amount` (default 1; a non-positive amount is a no-op). */
24
+ declare function counterInc(counter: Counter, replicaId: string, amount?: number): Counter;
25
+ /** Decrement this replica's contribution by `amount` (default 1; a non-positive amount is a no-op). */
26
+ declare function counterDec(counter: Counter, replicaId: string, amount?: number): Counter;
27
+ /** The current value: Ξ£ increments βˆ’ Ξ£ decrements across all replicas. */
28
+ declare function counterValue(counter: Counter): number;
29
+ /** Merge two counters β€” commutative, associative, idempotent. Replicas converge. */
30
+ declare function mergeCounter(a: Counter, b: Counter): Counter;
31
+ //#endregion
32
+ export { Counter, counterDec, counterInc, counterValue, emptyCounter, mergeCounter };
33
+ //# sourceMappingURL=counter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"counter.d.ts","names":[],"sources":["../src/counter.ts"],"mappings":";;AAcA;;;;;;;;;;;;UAAiB,OAAA;EAID;EAAA,SAFL,GAAA,EAAK,QAAA,CAAS,MAAA;EAEM;EAAA,SAApB,GAAA,EAAK,QAAA,CAAS,MAAA;AAAA;;iBAIT,YAAA,IAAgB,OAAO;;iBAiBvB,UAAA,CAAW,OAAA,EAAS,OAAA,EAAS,SAAA,UAAmB,MAAA,YAAa,OAAO;AAApF;AAAA,iBAMgB,UAAA,CAAW,OAAA,EAAS,OAAA,EAAS,SAAA,UAAmB,MAAA,YAAa,OAAO;;iBAYpE,YAAA,CAAa,OAAgB,EAAP,OAAO;;iBAmB7B,YAAA,CAAa,CAAA,EAAG,OAAA,EAAS,CAAA,EAAG,OAAA,GAAU,OAAA"}
@@ -0,0 +1,61 @@
1
+ //#region src/counter.ts
2
+ /** An empty counter (value 0). */
3
+ function emptyCounter() {
4
+ return {
5
+ inc: Object.create(null),
6
+ dec: Object.create(null)
7
+ };
8
+ }
9
+ /** Clone a side with `replicaId`'s total raised by `amount` (a G-counter bump). */
10
+ function bump(side, replicaId, amount) {
11
+ const next = Object.create(null);
12
+ for (const key of Object.keys(side)) next[key] = side[key];
13
+ next[replicaId] = (Object.hasOwn(next, replicaId) ? next[replicaId] : 0) + amount;
14
+ return next;
15
+ }
16
+ /** Increment this replica's contribution by `amount` (default 1; a non-positive amount is a no-op). */
17
+ function counterInc(counter, replicaId, amount = 1) {
18
+ if (!(amount > 0)) return counter;
19
+ return {
20
+ inc: bump(counter.inc, replicaId, amount),
21
+ dec: counter.dec
22
+ };
23
+ }
24
+ /** Decrement this replica's contribution by `amount` (default 1; a non-positive amount is a no-op). */
25
+ function counterDec(counter, replicaId, amount = 1) {
26
+ if (!(amount > 0)) return counter;
27
+ return {
28
+ inc: counter.inc,
29
+ dec: bump(counter.dec, replicaId, amount)
30
+ };
31
+ }
32
+ function sum(side) {
33
+ let total = 0;
34
+ for (const key of Object.keys(side)) total += side[key];
35
+ return total;
36
+ }
37
+ /** The current value: Ξ£ increments βˆ’ Ξ£ decrements across all replicas. */
38
+ function counterValue(counter) {
39
+ return sum(counter.inc) - sum(counter.dec);
40
+ }
41
+ /** Per-replica max merge of one side (idempotent, order-independent). */
42
+ function mergeSide(a, b) {
43
+ const out = Object.create(null);
44
+ for (const key of Object.keys(a)) out[key] = a[key];
45
+ for (const key of Object.keys(b)) {
46
+ const value = b[key];
47
+ out[key] = Object.hasOwn(out, key) ? Math.max(out[key], value) : value;
48
+ }
49
+ return out;
50
+ }
51
+ /** Merge two counters β€” commutative, associative, idempotent. Replicas converge. */
52
+ function mergeCounter(a, b) {
53
+ return {
54
+ inc: mergeSide(a.inc, b.inc),
55
+ dec: mergeSide(a.dec, b.dec)
56
+ };
57
+ }
58
+ //#endregion
59
+ export { counterDec, counterInc, counterValue, emptyCounter, mergeCounter };
60
+
61
+ //# sourceMappingURL=counter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"counter.js","names":[],"sources":["../src/counter.ts"],"sourcesContent":["/**\n * PN-Counter for Continuum β€” a state-based CRDT integer counter supporting both increment and\n * decrement that converges across replicas. Modeled as two grow-only (G-)counters: `inc` and `dec`,\n * each a per-replica **monotonic total**; the value is `Ξ£inc βˆ’ Ξ£dec`. `mergeCounter` takes the\n * per-replica MAX of each side, so it is commutative, associative, and idempotent β€” replicas that\n * apply the same set of operations converge regardless of order or duplication.\n *\n * Each replica must use a stable `replicaId` (e.g. the clock's node id) for its own increments.\n * Plain JSON; safe to sync as data. See `docs/adr/0014-continuum-crdt.md`.\n *\n * @module\n */\n\n/** A PN-Counter: per-replica increment + decrement totals. */\nexport interface Counter {\n /** replicaId β†’ total increments observed from that replica (monotonic). */\n readonly inc: Readonly<Record<string, number>>\n /** replicaId β†’ total decrements observed from that replica (monotonic). */\n readonly dec: Readonly<Record<string, number>>\n}\n\n/** An empty counter (value 0). */\nexport function emptyCounter(): Counter {\n return { inc: Object.create(null), dec: Object.create(null) }\n}\n\n/** Clone a side with `replicaId`'s total raised by `amount` (a G-counter bump). */\nfunction bump(\n side: Readonly<Record<string, number>>,\n replicaId: string,\n amount: number,\n): Record<string, number> {\n const next: Record<string, number> = Object.create(null)\n for (const key of Object.keys(side)) next[key] = side[key] as number\n next[replicaId] = (Object.hasOwn(next, replicaId) ? (next[replicaId] as number) : 0) + amount\n return next\n}\n\n/** Increment this replica's contribution by `amount` (default 1; a non-positive amount is a no-op). */\nexport function counterInc(counter: Counter, replicaId: string, amount = 1): Counter {\n if (!(amount > 0)) return counter\n return { inc: bump(counter.inc, replicaId, amount), dec: counter.dec }\n}\n\n/** Decrement this replica's contribution by `amount` (default 1; a non-positive amount is a no-op). */\nexport function counterDec(counter: Counter, replicaId: string, amount = 1): Counter {\n if (!(amount > 0)) return counter\n return { inc: counter.inc, dec: bump(counter.dec, replicaId, amount) }\n}\n\nfunction sum(side: Readonly<Record<string, number>>): number {\n let total = 0\n for (const key of Object.keys(side)) total += side[key] as number\n return total\n}\n\n/** The current value: Ξ£ increments βˆ’ Ξ£ decrements across all replicas. */\nexport function counterValue(counter: Counter): number {\n return sum(counter.inc) - sum(counter.dec)\n}\n\n/** Per-replica max merge of one side (idempotent, order-independent). */\nfunction mergeSide(\n a: Readonly<Record<string, number>>,\n b: Readonly<Record<string, number>>,\n): Record<string, number> {\n const out: Record<string, number> = Object.create(null)\n for (const key of Object.keys(a)) out[key] = a[key] as number\n for (const key of Object.keys(b)) {\n const value = b[key] as number\n out[key] = Object.hasOwn(out, key) ? Math.max(out[key] as number, value) : value\n }\n return out\n}\n\n/** Merge two counters β€” commutative, associative, idempotent. Replicas converge. */\nexport function mergeCounter(a: Counter, b: Counter): Counter {\n return { inc: mergeSide(a.inc, b.inc), dec: mergeSide(a.dec, b.dec) }\n}\n"],"mappings":";;AAsBA,SAAgB,eAAwB;CACtC,OAAO;EAAE,KAAK,OAAO,OAAO,IAAI;EAAG,KAAK,OAAO,OAAO,IAAI;CAAE;AAC9D;;AAGA,SAAS,KACP,MACA,WACA,QACwB;CACxB,MAAM,OAA+B,OAAO,OAAO,IAAI;CACvD,KAAK,MAAM,OAAO,OAAO,KAAK,IAAI,GAAG,KAAK,OAAO,KAAK;CACtD,KAAK,cAAc,OAAO,OAAO,MAAM,SAAS,IAAK,KAAK,aAAwB,KAAK;CACvF,OAAO;AACT;;AAGA,SAAgB,WAAW,SAAkB,WAAmB,SAAS,GAAY;CACnF,IAAI,EAAE,SAAS,IAAI,OAAO;CAC1B,OAAO;EAAE,KAAK,KAAK,QAAQ,KAAK,WAAW,MAAM;EAAG,KAAK,QAAQ;CAAI;AACvE;;AAGA,SAAgB,WAAW,SAAkB,WAAmB,SAAS,GAAY;CACnF,IAAI,EAAE,SAAS,IAAI,OAAO;CAC1B,OAAO;EAAE,KAAK,QAAQ;EAAK,KAAK,KAAK,QAAQ,KAAK,WAAW,MAAM;CAAE;AACvE;AAEA,SAAS,IAAI,MAAgD;CAC3D,IAAI,QAAQ;CACZ,KAAK,MAAM,OAAO,OAAO,KAAK,IAAI,GAAG,SAAS,KAAK;CACnD,OAAO;AACT;;AAGA,SAAgB,aAAa,SAA0B;CACrD,OAAO,IAAI,QAAQ,GAAG,IAAI,IAAI,QAAQ,GAAG;AAC3C;;AAGA,SAAS,UACP,GACA,GACwB;CACxB,MAAM,MAA8B,OAAO,OAAO,IAAI;CACtD,KAAK,MAAM,OAAO,OAAO,KAAK,CAAC,GAAG,IAAI,OAAO,EAAE;CAC/C,KAAK,MAAM,OAAO,OAAO,KAAK,CAAC,GAAG;EAChC,MAAM,QAAQ,EAAE;EAChB,IAAI,OAAO,OAAO,OAAO,KAAK,GAAG,IAAI,KAAK,IAAI,IAAI,MAAgB,KAAK,IAAI;CAC7E;CACA,OAAO;AACT;;AAGA,SAAgB,aAAa,GAAY,GAAqB;CAC5D,OAAO;EAAE,KAAK,UAAU,EAAE,KAAK,EAAE,GAAG;EAAG,KAAK,UAAU,EAAE,KAAK,EAAE,GAAG;CAAE;AACtE"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Collection, CollectionOptions, Id, OptimisticChange, createCollection } from "./collection.js";
2
+ import { Counter, counterDec, counterInc, counterValue, emptyCounter, mergeCounter } from "./counter.js";
2
3
  import { DataError, DataErrorCode } from "./errors.js";
3
4
  import { Clock, ClockOptions, Hlc, compareHlc, createClock, decodeHlc, encodeHlc } from "./hlc.js";
4
5
  import { LwwMap, LwwRegister, lwwDelete, lwwGet, lwwHas, lwwKeys, lwwSet, mergeLwwMap, mergeRegister } from "./lww.js";
@@ -12,7 +13,7 @@ import { Maturity, NotImplementedError, PackageInfo, notImplemented } from "@min
12
13
  /** The npm package name. */
13
14
  declare const name = "@mindees/data";
14
15
  /** The package version. All `@mindees/*` packages share one locked version line. */
15
- declare const VERSION = "0.12.0";
16
+ declare const VERSION = "0.14.0";
16
17
  /** Current maturity of this package. See the repository `STATUS.md`. */
17
18
  declare const maturity: Maturity;
18
19
  /**
@@ -22,5 +23,5 @@ declare const maturity: Maturity;
22
23
  */
23
24
  declare const info: PackageInfo;
24
25
  //#endregion
25
- export { type Clock, type ClockOptions, type Collection, type CollectionOptions, type Cursor, DataError, type DataErrorCode, type Hlc, type Id, type LwwMap, type LwwRegister, type Maturity, type MutationLog, NotImplementedError, type Op, type OptimisticChange, type OrSet, type PackageInfo, type Persistence, type PersistentEngineOptions, type SyncEngine, type SyncEngineOptions, type SyncSnapshot, type SyncTransport, VERSION, type VersionVector, type WebStorageLike, compareHlc, createClock, createCollection, createMemoryHub, createMemoryPersistence, createMutationLog, createPersistentEngine, createSyncEngine, createWebStoragePersistence, decodeHlc, emptyOrSet, encodeHlc, info, loadSnapshot, lwwDelete, lwwGet, lwwHas, lwwKeys, lwwSet, maturity, mergeLwwMap, mergeOrSet, mergeRegister, name, notImplemented, orAdd, orHas, orRemove, orValues, persistEngine, vvDominates, vvEquals, vvGet, vvMerge, vvObserve };
26
+ export { type Clock, type ClockOptions, type Collection, type CollectionOptions, type Counter, type Cursor, DataError, type DataErrorCode, type Hlc, type Id, type LwwMap, type LwwRegister, type Maturity, type MutationLog, NotImplementedError, type Op, type OptimisticChange, type OrSet, type PackageInfo, type Persistence, type PersistentEngineOptions, type SyncEngine, type SyncEngineOptions, type SyncSnapshot, type SyncTransport, VERSION, type VersionVector, type WebStorageLike, compareHlc, counterDec, counterInc, counterValue, createClock, createCollection, createMemoryHub, createMemoryPersistence, createMutationLog, createPersistentEngine, createSyncEngine, createWebStoragePersistence, decodeHlc, emptyCounter, emptyOrSet, encodeHlc, info, loadSnapshot, lwwDelete, lwwGet, lwwHas, lwwKeys, lwwSet, maturity, mergeCounter, mergeLwwMap, mergeOrSet, mergeRegister, name, notImplemented, orAdd, orHas, orRemove, orValues, persistEngine, vvDominates, vvEquals, vvGet, vvMerge, vvObserve };
26
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;cAoBa,IAAA;;cAGA,OAAA;AAGb;AAAA,cAAa,QAAA,EAAU,QAAyB;;;AAAA;AAOhD;;cAAa,IAAA,EAAM,WAAiE"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;;;;;AAuBA;AAAA,cAHa,IAAA;;cAGA,OAAA;AAAO;AAAA,cAGP,QAAA,EAAU,QAAyB;;;;AAAA;AAOhD;cAAa,IAAA,EAAM,WAAiE"}
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import { DataError } from "./errors.js";
2
2
  import { createCollection } from "./collection.js";
3
+ import { counterDec, counterInc, counterValue, emptyCounter, mergeCounter } from "./counter.js";
3
4
  import { compareHlc, createClock, decodeHlc, encodeHlc } from "./hlc.js";
4
5
  import { lwwDelete, lwwGet, lwwHas, lwwKeys, lwwSet, mergeLwwMap, mergeRegister } from "./lww.js";
5
6
  import { emptyOrSet, mergeOrSet, orAdd, orHas, orRemove, orValues } from "./or-set.js";
@@ -11,7 +12,7 @@ import { NotImplementedError, notImplemented } from "@mindees/core";
11
12
  /** The npm package name. */
12
13
  const name = "@mindees/data";
13
14
  /** The package version. All `@mindees/*` packages share one locked version line. */
14
- const VERSION = "0.12.0";
15
+ const VERSION = "0.14.0";
15
16
  /** Current maturity of this package. See the repository `STATUS.md`. */
16
17
  const maturity = "experimental";
17
18
  /**
@@ -25,6 +26,6 @@ const info = Object.freeze({
25
26
  maturity
26
27
  });
27
28
  //#endregion
28
- export { DataError, NotImplementedError, VERSION, compareHlc, createClock, createCollection, createMemoryHub, createMemoryPersistence, createMutationLog, createPersistentEngine, createSyncEngine, createWebStoragePersistence, decodeHlc, emptyOrSet, encodeHlc, info, loadSnapshot, lwwDelete, lwwGet, lwwHas, lwwKeys, lwwSet, maturity, mergeLwwMap, mergeOrSet, mergeRegister, name, notImplemented, orAdd, orHas, orRemove, orValues, persistEngine, vvDominates, vvEquals, vvGet, vvMerge, vvObserve };
29
+ export { DataError, NotImplementedError, VERSION, compareHlc, counterDec, counterInc, counterValue, createClock, createCollection, createMemoryHub, createMemoryPersistence, createMutationLog, createPersistentEngine, createSyncEngine, createWebStoragePersistence, decodeHlc, emptyCounter, emptyOrSet, encodeHlc, info, loadSnapshot, lwwDelete, lwwGet, lwwHas, lwwKeys, lwwSet, maturity, mergeCounter, mergeLwwMap, mergeOrSet, mergeRegister, name, notImplemented, orAdd, orHas, orRemove, orValues, persistEngine, vvDominates, vvEquals, vvGet, vvMerge, vvObserve };
29
30
 
30
31
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * `@mindees/data` (Continuum) β€” local-first reactive store + sync.\n *\n * Phase 10 ships the **reactive document store**: {@link createCollection}, a\n * signals-native, in-memory collection with fine-grained reactive reads\n * (`get`/`has`/`all`/`where`/`size`), atomic mutations (`insert`/`upsert`/`update`/\n * `delete`/`clear`/`tx`), and {@link Collection.optimistic optimistic} changes that can\n * be rolled back. Built on `@mindees/core` signals only. Hybrid-logical-clock causality,\n * CRDT conflict resolution, the local-first sync engine, a reference sync server on the\n * `@mindees/data/server` subpath, and a persistence contract/export/restore path build\n * on this. Native durable adapters, production sync hardening, and CRDT-library/rich-text\n * interop remain research tracks.\n *\n * @module\n */\n\nimport type { Maturity, PackageInfo } from '@mindees/core'\nimport { NotImplementedError, notImplemented } from '@mindees/core'\n\n/** The npm package name. */\nexport const name = '@mindees/data'\n\n/** The package version. All `@mindees/*` packages share one locked version line. */\nexport const VERSION = '0.12.0'\n\n/** Current maturity of this package. See the repository `STATUS.md`. */\nexport const maturity: Maturity = 'experimental'\n\n/**\n * Static identity + maturity metadata for this package. Frozen so the\n * self-reported identity tooling introspects cannot be mutated at runtime,\n * matching the `readonly` fields of {@link PackageInfo}.\n */\nexport const info: PackageInfo = Object.freeze({ name, version: VERSION, maturity })\n\nexport {\n type Collection,\n type CollectionOptions,\n createCollection,\n type Id,\n type OptimisticChange,\n} from './collection'\nexport { DataError, type DataErrorCode } from './errors'\nexport {\n type Clock,\n type ClockOptions,\n compareHlc,\n createClock,\n decodeHlc,\n encodeHlc,\n type Hlc,\n} from './hlc'\nexport {\n type LwwMap,\n type LwwRegister,\n lwwDelete,\n lwwGet,\n lwwHas,\n lwwKeys,\n lwwSet,\n mergeLwwMap,\n mergeRegister,\n} from './lww'\nexport {\n emptyOrSet,\n mergeOrSet,\n type OrSet,\n orAdd,\n orHas,\n orRemove,\n orValues,\n} from './or-set'\nexport {\n createMemoryPersistence,\n createPersistentEngine,\n createWebStoragePersistence,\n loadSnapshot,\n type Persistence,\n type PersistentEngineOptions,\n persistEngine,\n type WebStorageLike,\n} from './persist'\nexport {\n type Cursor,\n createMemoryHub,\n createMutationLog,\n createSyncEngine,\n type MutationLog,\n type Op,\n type SyncEngine,\n type SyncEngineOptions,\n type SyncSnapshot,\n type SyncTransport,\n} from './sync'\nexport {\n type VersionVector,\n vvDominates,\n vvEquals,\n vvGet,\n vvMerge,\n vvObserve,\n} from './version-vector'\n\nexport type { Maturity, PackageInfo }\nexport { NotImplementedError, notImplemented }\n"],"mappings":";;;;;;;;;;;AAoBA,MAAa,OAAO;;AAGpB,MAAa,UAAU;;AAGvB,MAAa,WAAqB;;;;;;AAOlC,MAAa,OAAoB,OAAO,OAAO;CAAE;CAAM,SAAS;CAAS;AAAS,CAAC"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * `@mindees/data` (Continuum) β€” local-first reactive store + sync.\n *\n * Phase 10 ships the **reactive document store**: {@link createCollection}, a\n * signals-native, in-memory collection with fine-grained reactive reads\n * (`get`/`has`/`all`/`where`/`size`), atomic mutations (`insert`/`upsert`/`update`/\n * `delete`/`clear`/`tx`), and {@link Collection.optimistic optimistic} changes that can\n * be rolled back. Built on `@mindees/core` signals only. Hybrid-logical-clock causality,\n * CRDT conflict resolution, the local-first sync engine, a reference sync server on the\n * `@mindees/data/server` subpath, and a persistence contract/export/restore path build\n * on this. Native durable adapters, production sync hardening, and CRDT-library/rich-text\n * interop remain research tracks.\n *\n * @module\n */\n\nimport type { Maturity, PackageInfo } from '@mindees/core'\nimport { NotImplementedError, notImplemented } from '@mindees/core'\n\n/** The npm package name. */\nexport const name = '@mindees/data'\n\n/** The package version. All `@mindees/*` packages share one locked version line. */\nexport const VERSION = '0.14.0'\n\n/** Current maturity of this package. See the repository `STATUS.md`. */\nexport const maturity: Maturity = 'experimental'\n\n/**\n * Static identity + maturity metadata for this package. Frozen so the\n * self-reported identity tooling introspects cannot be mutated at runtime,\n * matching the `readonly` fields of {@link PackageInfo}.\n */\nexport const info: PackageInfo = Object.freeze({ name, version: VERSION, maturity })\n\nexport {\n type Collection,\n type CollectionOptions,\n createCollection,\n type Id,\n type OptimisticChange,\n} from './collection'\nexport {\n type Counter,\n counterDec,\n counterInc,\n counterValue,\n emptyCounter,\n mergeCounter,\n} from './counter'\nexport { DataError, type DataErrorCode } from './errors'\nexport {\n type Clock,\n type ClockOptions,\n compareHlc,\n createClock,\n decodeHlc,\n encodeHlc,\n type Hlc,\n} from './hlc'\nexport {\n type LwwMap,\n type LwwRegister,\n lwwDelete,\n lwwGet,\n lwwHas,\n lwwKeys,\n lwwSet,\n mergeLwwMap,\n mergeRegister,\n} from './lww'\nexport {\n emptyOrSet,\n mergeOrSet,\n type OrSet,\n orAdd,\n orHas,\n orRemove,\n orValues,\n} from './or-set'\nexport {\n createMemoryPersistence,\n createPersistentEngine,\n createWebStoragePersistence,\n loadSnapshot,\n type Persistence,\n type PersistentEngineOptions,\n persistEngine,\n type WebStorageLike,\n} from './persist'\nexport {\n type Cursor,\n createMemoryHub,\n createMutationLog,\n createSyncEngine,\n type MutationLog,\n type Op,\n type SyncEngine,\n type SyncEngineOptions,\n type SyncSnapshot,\n type SyncTransport,\n} from './sync'\nexport {\n type VersionVector,\n vvDominates,\n vvEquals,\n vvGet,\n vvMerge,\n vvObserve,\n} from './version-vector'\n\nexport type { Maturity, PackageInfo }\nexport { NotImplementedError, notImplemented }\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAa,OAAO;;AAGpB,MAAa,UAAU;;AAGvB,MAAa,WAAqB;;;;;;AAOlC,MAAa,OAAoB,OAAO,OAAO;CAAE;CAAM,SAAS;CAAS;AAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindees/data",
3
- "version": "0.12.0",
3
+ "version": "0.14.0",
4
4
  "description": "MindeesNative Continuum - local-first reactive store and sync: a signals-native document store with fine-grained reactive queries, optimistic updates, CRDT conflict resolution, and delta sync.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "type": "module",
@@ -27,7 +27,7 @@
27
27
  "directory": "packages/data"
28
28
  },
29
29
  "dependencies": {
30
- "@mindees/core": "0.12.0"
30
+ "@mindees/core": "0.14.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "fast-check": "4.8.0"