@topgunbuild/core 0.10.0 → 0.11.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/dist/index.d.mts CHANGED
@@ -1,17 +1,55 @@
1
1
  import { z } from 'zod';
2
+ import pino from 'pino';
2
3
 
3
4
  interface Timestamp {
4
5
  millis: number;
5
6
  counter: number;
6
7
  nodeId: string;
7
8
  }
9
+ /**
10
+ * Clock source interface for time dependency injection.
11
+ */
12
+ interface ClockSource {
13
+ now(): number;
14
+ }
15
+ /**
16
+ * Configuration options for HLC behavior.
17
+ */
18
+ interface HLCOptions {
19
+ /**
20
+ * When true, update() throws an error if remote timestamp drift exceeds maxDriftMs.
21
+ * When false (default), a warning is logged but the timestamp is accepted.
22
+ */
23
+ strictMode?: boolean;
24
+ /**
25
+ * Maximum allowable clock drift in milliseconds.
26
+ * Remote timestamps beyond this threshold trigger strict mode rejection or warning.
27
+ * Default: 60000 (1 minute)
28
+ */
29
+ maxDriftMs?: number;
30
+ /**
31
+ * Clock source for time generation.
32
+ * Defaults to Date.now() for production use.
33
+ * Can be replaced with VirtualClock for deterministic testing.
34
+ */
35
+ clockSource?: ClockSource;
36
+ }
8
37
  declare class HLC {
9
38
  private lastMillis;
10
39
  private lastCounter;
11
40
  private readonly nodeId;
12
- private static readonly MAX_DRIFT;
13
- constructor(nodeId: string);
41
+ private readonly strictMode;
42
+ private readonly maxDriftMs;
43
+ private readonly clockSource;
44
+ constructor(nodeId: string, options?: HLCOptions);
14
45
  get getNodeId(): string;
46
+ get getStrictMode(): boolean;
47
+ get getMaxDriftMs(): number;
48
+ /**
49
+ * Returns the clock source used by this HLC instance.
50
+ * Useful for LWWMap/ORMap to access the same clock for TTL checks.
51
+ */
52
+ getClockSource(): ClockSource;
15
53
  /**
16
54
  * Generates a new unique timestamp for a local event.
17
55
  * Ensures monotonicity: always greater than any previously generated or received timestamp.
@@ -1107,8 +1145,6 @@ interface MergeRejection {
1107
1145
  *
1108
1146
  * Uses native xxHash64 when available (via @topgunbuild/native),
1109
1147
  * falls back to FNV-1a for JS-only environments.
1110
- *
1111
- * Phase 3.05: Native Hash Integration
1112
1148
  */
1113
1149
  /**
1114
1150
  * Hash a string to a 32-bit unsigned integer.
@@ -1387,52 +1423,7 @@ declare const QuerySchema: z.ZodObject<{
1387
1423
  limit: z.ZodOptional<z.ZodNumber>;
1388
1424
  cursor: z.ZodOptional<z.ZodString>;
1389
1425
  }, z.core.$strip>;
1390
- /**
1391
- * Cursor status for debugging.
1392
- * - valid: Cursor was valid and applied
1393
- * - expired: Cursor was expired (fell back to first page)
1394
- * - invalid: Cursor was malformed or hash mismatch (fell back to first page)
1395
- * - none: No cursor was provided
1396
- */
1397
- declare const CursorStatusSchema: z.ZodEnum<{
1398
- valid: "valid";
1399
- expired: "expired";
1400
- invalid: "invalid";
1401
- none: "none";
1402
- }>;
1403
- declare const QueryRespPayloadSchema: z.ZodObject<{
1404
- queryId: z.ZodString;
1405
- results: z.ZodArray<z.ZodObject<{
1406
- key: z.ZodString;
1407
- value: z.ZodUnknown;
1408
- }, z.core.$strip>>;
1409
- nextCursor: z.ZodOptional<z.ZodString>;
1410
- hasMore: z.ZodOptional<z.ZodBoolean>;
1411
- cursorStatus: z.ZodOptional<z.ZodEnum<{
1412
- valid: "valid";
1413
- expired: "expired";
1414
- invalid: "invalid";
1415
- none: "none";
1416
- }>>;
1417
- }, z.core.$strip>;
1418
- declare const QueryRespMessageSchema: z.ZodObject<{
1419
- type: z.ZodLiteral<"QUERY_RESP">;
1420
- payload: z.ZodObject<{
1421
- queryId: z.ZodString;
1422
- results: z.ZodArray<z.ZodObject<{
1423
- key: z.ZodString;
1424
- value: z.ZodUnknown;
1425
- }, z.core.$strip>>;
1426
- nextCursor: z.ZodOptional<z.ZodString>;
1427
- hasMore: z.ZodOptional<z.ZodBoolean>;
1428
- cursorStatus: z.ZodOptional<z.ZodEnum<{
1429
- valid: "valid";
1430
- expired: "expired";
1431
- invalid: "invalid";
1432
- none: "none";
1433
- }>>;
1434
- }, z.core.$strip>;
1435
- }, z.core.$strip>;
1426
+ type Query$1 = z.infer<typeof QuerySchema>;
1436
1427
  declare const ClientOpSchema: z.ZodObject<{
1437
1428
  id: z.ZodOptional<z.ZodString>;
1438
1429
  mapName: z.ZodString;
@@ -1467,33 +1458,12 @@ declare const ClientOpSchema: z.ZodObject<{
1467
1458
  }>>;
1468
1459
  timeout: z.ZodOptional<z.ZodNumber>;
1469
1460
  }, z.core.$strip>;
1461
+ type ClientOp = z.infer<typeof ClientOpSchema>;
1470
1462
  declare const AuthMessageSchema: z.ZodObject<{
1471
1463
  type: z.ZodLiteral<"AUTH">;
1472
1464
  token: z.ZodString;
1473
1465
  }, z.core.$strip>;
1474
- declare const QuerySubMessageSchema: z.ZodObject<{
1475
- type: z.ZodLiteral<"QUERY_SUB">;
1476
- payload: z.ZodObject<{
1477
- queryId: z.ZodString;
1478
- mapName: z.ZodString;
1479
- query: z.ZodObject<{
1480
- where: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1481
- predicate: z.ZodOptional<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>;
1482
- sort: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
1483
- asc: "asc";
1484
- desc: "desc";
1485
- }>>>;
1486
- limit: z.ZodOptional<z.ZodNumber>;
1487
- cursor: z.ZodOptional<z.ZodString>;
1488
- }, z.core.$strip>;
1489
- }, z.core.$strip>;
1490
- }, z.core.$strip>;
1491
- declare const QueryUnsubMessageSchema: z.ZodObject<{
1492
- type: z.ZodLiteral<"QUERY_UNSUB">;
1493
- payload: z.ZodObject<{
1494
- queryId: z.ZodString;
1495
- }, z.core.$strip>;
1496
- }, z.core.$strip>;
1466
+
1497
1467
  declare const ClientOpMessageSchema: z.ZodObject<{
1498
1468
  type: z.ZodLiteral<"CLIENT_OP">;
1499
1469
  payload: z.ZodObject<{
@@ -1629,109 +1599,6 @@ declare const MerkleReqBucketMessageSchema: z.ZodObject<{
1629
1599
  path: z.ZodString;
1630
1600
  }, z.core.$strip>;
1631
1601
  }, z.core.$strip>;
1632
- declare const LockRequestSchema: z.ZodObject<{
1633
- type: z.ZodLiteral<"LOCK_REQUEST">;
1634
- payload: z.ZodObject<{
1635
- requestId: z.ZodString;
1636
- name: z.ZodString;
1637
- ttl: z.ZodOptional<z.ZodNumber>;
1638
- }, z.core.$strip>;
1639
- }, z.core.$strip>;
1640
- declare const LockReleaseSchema: z.ZodObject<{
1641
- type: z.ZodLiteral<"LOCK_RELEASE">;
1642
- payload: z.ZodObject<{
1643
- requestId: z.ZodOptional<z.ZodString>;
1644
- name: z.ZodString;
1645
- fencingToken: z.ZodNumber;
1646
- }, z.core.$strip>;
1647
- }, z.core.$strip>;
1648
- declare const TopicSubSchema: z.ZodObject<{
1649
- type: z.ZodLiteral<"TOPIC_SUB">;
1650
- payload: z.ZodObject<{
1651
- topic: z.ZodString;
1652
- }, z.core.$strip>;
1653
- }, z.core.$strip>;
1654
- declare const TopicUnsubSchema: z.ZodObject<{
1655
- type: z.ZodLiteral<"TOPIC_UNSUB">;
1656
- payload: z.ZodObject<{
1657
- topic: z.ZodString;
1658
- }, z.core.$strip>;
1659
- }, z.core.$strip>;
1660
- declare const TopicPubSchema: z.ZodObject<{
1661
- type: z.ZodLiteral<"TOPIC_PUB">;
1662
- payload: z.ZodObject<{
1663
- topic: z.ZodString;
1664
- data: z.ZodAny;
1665
- }, z.core.$strip>;
1666
- }, z.core.$strip>;
1667
- declare const TopicMessageEventSchema: z.ZodObject<{
1668
- type: z.ZodLiteral<"TOPIC_MESSAGE">;
1669
- payload: z.ZodObject<{
1670
- topic: z.ZodString;
1671
- data: z.ZodAny;
1672
- publisherId: z.ZodOptional<z.ZodString>;
1673
- timestamp: z.ZodNumber;
1674
- }, z.core.$strip>;
1675
- }, z.core.$strip>;
1676
- declare const PNCounterStateObjectSchema: z.ZodObject<{
1677
- p: z.ZodRecord<z.ZodString, z.ZodNumber>;
1678
- n: z.ZodRecord<z.ZodString, z.ZodNumber>;
1679
- }, z.core.$strip>;
1680
- declare const CounterRequestSchema: z.ZodObject<{
1681
- type: z.ZodLiteral<"COUNTER_REQUEST">;
1682
- payload: z.ZodObject<{
1683
- name: z.ZodString;
1684
- }, z.core.$strip>;
1685
- }, z.core.$strip>;
1686
- declare const CounterSyncSchema: z.ZodObject<{
1687
- type: z.ZodLiteral<"COUNTER_SYNC">;
1688
- payload: z.ZodObject<{
1689
- name: z.ZodString;
1690
- state: z.ZodObject<{
1691
- p: z.ZodRecord<z.ZodString, z.ZodNumber>;
1692
- n: z.ZodRecord<z.ZodString, z.ZodNumber>;
1693
- }, z.core.$strip>;
1694
- }, z.core.$strip>;
1695
- }, z.core.$strip>;
1696
- declare const CounterResponseSchema: z.ZodObject<{
1697
- type: z.ZodLiteral<"COUNTER_RESPONSE">;
1698
- payload: z.ZodObject<{
1699
- name: z.ZodString;
1700
- state: z.ZodObject<{
1701
- p: z.ZodRecord<z.ZodString, z.ZodNumber>;
1702
- n: z.ZodRecord<z.ZodString, z.ZodNumber>;
1703
- }, z.core.$strip>;
1704
- }, z.core.$strip>;
1705
- }, z.core.$strip>;
1706
- declare const CounterUpdateSchema: z.ZodObject<{
1707
- type: z.ZodLiteral<"COUNTER_UPDATE">;
1708
- payload: z.ZodObject<{
1709
- name: z.ZodString;
1710
- state: z.ZodObject<{
1711
- p: z.ZodRecord<z.ZodString, z.ZodNumber>;
1712
- n: z.ZodRecord<z.ZodString, z.ZodNumber>;
1713
- }, z.core.$strip>;
1714
- }, z.core.$strip>;
1715
- }, z.core.$strip>;
1716
- declare const PingMessageSchema: z.ZodObject<{
1717
- type: z.ZodLiteral<"PING">;
1718
- timestamp: z.ZodNumber;
1719
- }, z.core.$strip>;
1720
- declare const PongMessageSchema: z.ZodObject<{
1721
- type: z.ZodLiteral<"PONG">;
1722
- timestamp: z.ZodNumber;
1723
- serverTime: z.ZodNumber;
1724
- }, z.core.$strip>;
1725
- /**
1726
- * BATCH: Server sends multiple messages batched together.
1727
- * Uses length-prefixed binary format for efficiency.
1728
- * Format: [4 bytes: count][4 bytes: len1][msg1][4 bytes: len2][msg2]...
1729
- */
1730
- declare const BatchMessageSchema: z.ZodObject<{
1731
- type: z.ZodLiteral<"BATCH">;
1732
- count: z.ZodNumber;
1733
- data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
1734
- }, z.core.$strip>;
1735
1602
  /**
1736
1603
  * ORMAP_SYNC_INIT: Client initiates ORMap sync
1737
1604
  * Sends root hash and bucket hashes to server
@@ -1743,9 +1610,6 @@ declare const ORMapSyncInitSchema: z.ZodObject<{
1743
1610
  bucketHashes: z.ZodRecord<z.ZodString, z.ZodNumber>;
1744
1611
  lastSyncTimestamp: z.ZodOptional<z.ZodNumber>;
1745
1612
  }, z.core.$strip>;
1746
- /**
1747
- * ORMAP_SYNC_RESP_ROOT: Server responds with its root hash
1748
- */
1749
1613
  declare const ORMapSyncRespRootSchema: z.ZodObject<{
1750
1614
  type: z.ZodLiteral<"ORMAP_SYNC_RESP_ROOT">;
1751
1615
  payload: z.ZodObject<{
@@ -1758,9 +1622,6 @@ declare const ORMapSyncRespRootSchema: z.ZodObject<{
1758
1622
  }, z.core.$strip>;
1759
1623
  }, z.core.$strip>;
1760
1624
  }, z.core.$strip>;
1761
- /**
1762
- * ORMAP_SYNC_RESP_BUCKETS: Server sends bucket hashes for comparison
1763
- */
1764
1625
  declare const ORMapSyncRespBucketsSchema: z.ZodObject<{
1765
1626
  type: z.ZodLiteral<"ORMAP_SYNC_RESP_BUCKETS">;
1766
1627
  payload: z.ZodObject<{
@@ -1769,9 +1630,6 @@ declare const ORMapSyncRespBucketsSchema: z.ZodObject<{
1769
1630
  buckets: z.ZodRecord<z.ZodString, z.ZodNumber>;
1770
1631
  }, z.core.$strip>;
1771
1632
  }, z.core.$strip>;
1772
- /**
1773
- * ORMAP_MERKLE_REQ_BUCKET: Client requests bucket details
1774
- */
1775
1633
  declare const ORMapMerkleReqBucketSchema: z.ZodObject<{
1776
1634
  type: z.ZodLiteral<"ORMAP_MERKLE_REQ_BUCKET">;
1777
1635
  payload: z.ZodObject<{
@@ -1779,9 +1637,6 @@ declare const ORMapMerkleReqBucketSchema: z.ZodObject<{
1779
1637
  path: z.ZodString;
1780
1638
  }, z.core.$strip>;
1781
1639
  }, z.core.$strip>;
1782
- /**
1783
- * ORMAP_SYNC_RESP_LEAF: Server sends actual records for differing keys
1784
- */
1785
1640
  declare const ORMapSyncRespLeafSchema: z.ZodObject<{
1786
1641
  type: z.ZodLiteral<"ORMAP_SYNC_RESP_LEAF">;
1787
1642
  payload: z.ZodObject<{
@@ -1803,9 +1658,6 @@ declare const ORMapSyncRespLeafSchema: z.ZodObject<{
1803
1658
  }, z.core.$strip>>;
1804
1659
  }, z.core.$strip>;
1805
1660
  }, z.core.$strip>;
1806
- /**
1807
- * ORMAP_DIFF_REQUEST: Client requests data for specific keys
1808
- */
1809
1661
  declare const ORMapDiffRequestSchema: z.ZodObject<{
1810
1662
  type: z.ZodLiteral<"ORMAP_DIFF_REQUEST">;
1811
1663
  payload: z.ZodObject<{
@@ -1813,9 +1665,6 @@ declare const ORMapDiffRequestSchema: z.ZodObject<{
1813
1665
  keys: z.ZodArray<z.ZodString>;
1814
1666
  }, z.core.$strip>;
1815
1667
  }, z.core.$strip>;
1816
- /**
1817
- * ORMAP_DIFF_RESPONSE: Server responds with data for requested keys
1818
- */
1819
1668
  declare const ORMapDiffResponseSchema: z.ZodObject<{
1820
1669
  type: z.ZodLiteral<"ORMAP_DIFF_RESPONSE">;
1821
1670
  payload: z.ZodObject<{
@@ -1836,9 +1685,6 @@ declare const ORMapDiffResponseSchema: z.ZodObject<{
1836
1685
  }, z.core.$strip>>;
1837
1686
  }, z.core.$strip>;
1838
1687
  }, z.core.$strip>;
1839
- /**
1840
- * ORMAP_PUSH_DIFF: Client pushes local diffs to server
1841
- */
1842
1688
  declare const ORMapPushDiffSchema: z.ZodObject<{
1843
1689
  type: z.ZodLiteral<"ORMAP_PUSH_DIFF">;
1844
1690
  payload: z.ZodObject<{
@@ -1859,208 +1705,138 @@ declare const ORMapPushDiffSchema: z.ZodObject<{
1859
1705
  }, z.core.$strip>>;
1860
1706
  }, z.core.$strip>;
1861
1707
  }, z.core.$strip>;
1862
- /**
1863
- * PARTITION_MAP_REQUEST: Client requests current partition map
1864
- */
1865
- declare const PartitionMapRequestSchema: z.ZodObject<{
1866
- type: z.ZodLiteral<"PARTITION_MAP_REQUEST">;
1867
- payload: z.ZodOptional<z.ZodObject<{
1868
- currentVersion: z.ZodOptional<z.ZodNumber>;
1869
- }, z.core.$strip>>;
1708
+ declare const OpResultSchema: z.ZodObject<{
1709
+ opId: z.ZodString;
1710
+ success: z.ZodBoolean;
1711
+ achievedLevel: z.ZodEnum<{
1712
+ FIRE_AND_FORGET: "FIRE_AND_FORGET";
1713
+ MEMORY: "MEMORY";
1714
+ APPLIED: "APPLIED";
1715
+ REPLICATED: "REPLICATED";
1716
+ PERSISTED: "PERSISTED";
1717
+ }>;
1718
+ error: z.ZodOptional<z.ZodString>;
1870
1719
  }, z.core.$strip>;
1871
- /**
1872
- * Entry processor definition schema.
1873
- */
1874
- declare const EntryProcessorSchema: z.ZodObject<{
1875
- name: z.ZodString;
1876
- code: z.ZodString;
1877
- args: z.ZodOptional<z.ZodUnknown>;
1720
+ type OpResult = z.infer<typeof OpResultSchema>;
1721
+ declare const OpAckMessageSchema: z.ZodObject<{
1722
+ type: z.ZodLiteral<"OP_ACK">;
1723
+ payload: z.ZodObject<{
1724
+ lastId: z.ZodString;
1725
+ achievedLevel: z.ZodOptional<z.ZodEnum<{
1726
+ FIRE_AND_FORGET: "FIRE_AND_FORGET";
1727
+ MEMORY: "MEMORY";
1728
+ APPLIED: "APPLIED";
1729
+ REPLICATED: "REPLICATED";
1730
+ PERSISTED: "PERSISTED";
1731
+ }>>;
1732
+ results: z.ZodOptional<z.ZodArray<z.ZodObject<{
1733
+ opId: z.ZodString;
1734
+ success: z.ZodBoolean;
1735
+ achievedLevel: z.ZodEnum<{
1736
+ FIRE_AND_FORGET: "FIRE_AND_FORGET";
1737
+ MEMORY: "MEMORY";
1738
+ APPLIED: "APPLIED";
1739
+ REPLICATED: "REPLICATED";
1740
+ PERSISTED: "PERSISTED";
1741
+ }>;
1742
+ error: z.ZodOptional<z.ZodString>;
1743
+ }, z.core.$strip>>>;
1744
+ }, z.core.$strip>;
1878
1745
  }, z.core.$strip>;
1879
- /**
1880
- * ENTRY_PROCESS: Client requests atomic operation on single key.
1881
- */
1882
- declare const EntryProcessRequestSchema: z.ZodObject<{
1883
- type: z.ZodLiteral<"ENTRY_PROCESS">;
1884
- requestId: z.ZodString;
1885
- mapName: z.ZodString;
1886
- key: z.ZodString;
1887
- processor: z.ZodObject<{
1888
- name: z.ZodString;
1889
- code: z.ZodString;
1890
- args: z.ZodOptional<z.ZodUnknown>;
1891
- }, z.core.$strip>;
1892
- }, z.core.$strip>;
1893
- /**
1894
- * ENTRY_PROCESS_BATCH: Client requests atomic operation on multiple keys.
1895
- */
1896
- declare const EntryProcessBatchRequestSchema: z.ZodObject<{
1897
- type: z.ZodLiteral<"ENTRY_PROCESS_BATCH">;
1898
- requestId: z.ZodString;
1899
- mapName: z.ZodString;
1900
- keys: z.ZodArray<z.ZodString>;
1901
- processor: z.ZodObject<{
1902
- name: z.ZodString;
1903
- code: z.ZodString;
1904
- args: z.ZodOptional<z.ZodUnknown>;
1905
- }, z.core.$strip>;
1906
- }, z.core.$strip>;
1907
- /**
1908
- * ENTRY_PROCESS_RESPONSE: Server responds to single-key processor request.
1909
- */
1910
- declare const EntryProcessResponseSchema: z.ZodObject<{
1911
- type: z.ZodLiteral<"ENTRY_PROCESS_RESPONSE">;
1912
- requestId: z.ZodString;
1913
- success: z.ZodBoolean;
1914
- result: z.ZodOptional<z.ZodUnknown>;
1915
- newValue: z.ZodOptional<z.ZodUnknown>;
1916
- error: z.ZodOptional<z.ZodString>;
1917
- }, z.core.$strip>;
1918
- /**
1919
- * Individual key result in batch response.
1920
- */
1921
- declare const EntryProcessKeyResultSchema: z.ZodObject<{
1922
- success: z.ZodBoolean;
1923
- result: z.ZodOptional<z.ZodUnknown>;
1924
- newValue: z.ZodOptional<z.ZodUnknown>;
1925
- error: z.ZodOptional<z.ZodString>;
1926
- }, z.core.$strip>;
1927
- /**
1928
- * ENTRY_PROCESS_BATCH_RESPONSE: Server responds to multi-key processor request.
1929
- */
1930
- declare const EntryProcessBatchResponseSchema: z.ZodObject<{
1931
- type: z.ZodLiteral<"ENTRY_PROCESS_BATCH_RESPONSE">;
1932
- requestId: z.ZodString;
1933
- results: z.ZodRecord<z.ZodString, z.ZodObject<{
1934
- success: z.ZodBoolean;
1935
- result: z.ZodOptional<z.ZodUnknown>;
1936
- newValue: z.ZodOptional<z.ZodUnknown>;
1937
- error: z.ZodOptional<z.ZodString>;
1938
- }, z.core.$strip>>;
1939
- }, z.core.$strip>;
1940
- /**
1941
- * Journal event type schema.
1942
- */
1943
- declare const JournalEventTypeSchema: z.ZodEnum<{
1944
- PUT: "PUT";
1945
- UPDATE: "UPDATE";
1946
- DELETE: "DELETE";
1947
- }>;
1948
- /**
1949
- * Journal event data (serialized for network).
1950
- */
1951
- declare const JournalEventDataSchema: z.ZodObject<{
1952
- sequence: z.ZodString;
1953
- type: z.ZodEnum<{
1954
- PUT: "PUT";
1955
- UPDATE: "UPDATE";
1956
- DELETE: "DELETE";
1957
- }>;
1958
- mapName: z.ZodString;
1959
- key: z.ZodString;
1960
- value: z.ZodOptional<z.ZodUnknown>;
1961
- previousValue: z.ZodOptional<z.ZodUnknown>;
1962
- timestamp: z.ZodObject<{
1963
- millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
1964
- counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
1965
- nodeId: z.ZodString;
1746
+ type OpAckMessage = z.infer<typeof OpAckMessageSchema>;
1747
+ declare const OpRejectedMessageSchema: z.ZodObject<{
1748
+ type: z.ZodLiteral<"OP_REJECTED">;
1749
+ payload: z.ZodObject<{
1750
+ opId: z.ZodString;
1751
+ reason: z.ZodString;
1752
+ code: z.ZodOptional<z.ZodNumber>;
1966
1753
  }, z.core.$strip>;
1967
- nodeId: z.ZodString;
1968
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1969
- }, z.core.$strip>;
1970
- /**
1971
- * JOURNAL_SUBSCRIBE: Client subscribes to journal events.
1972
- */
1973
- declare const JournalSubscribeRequestSchema: z.ZodObject<{
1974
- type: z.ZodLiteral<"JOURNAL_SUBSCRIBE">;
1975
- requestId: z.ZodString;
1976
- fromSequence: z.ZodOptional<z.ZodString>;
1977
- mapName: z.ZodOptional<z.ZodString>;
1978
- types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
1979
- PUT: "PUT";
1980
- UPDATE: "UPDATE";
1981
- DELETE: "DELETE";
1982
- }>>>;
1983
1754
  }, z.core.$strip>;
1755
+ type OpRejectedMessage = z.infer<typeof OpRejectedMessageSchema>;
1984
1756
  /**
1985
- * JOURNAL_UNSUBSCRIBE: Client unsubscribes from journal events.
1757
+ * BATCH: Server sends multiple messages batched together.
1758
+ * Uses length-prefixed binary format for efficiency.
1759
+ * Format: [4 bytes: count][4 bytes: len1][msg1][4 bytes: len2][msg2]...
1986
1760
  */
1987
- declare const JournalUnsubscribeRequestSchema: z.ZodObject<{
1988
- type: z.ZodLiteral<"JOURNAL_UNSUBSCRIBE">;
1989
- subscriptionId: z.ZodString;
1761
+ declare const BatchMessageSchema: z.ZodObject<{
1762
+ type: z.ZodLiteral<"BATCH">;
1763
+ count: z.ZodNumber;
1764
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
1990
1765
  }, z.core.$strip>;
1991
- /**
1992
- * JOURNAL_EVENT: Server sends journal event to client.
1993
- */
1994
- declare const JournalEventMessageSchema: z.ZodObject<{
1995
- type: z.ZodLiteral<"JOURNAL_EVENT">;
1996
- event: z.ZodObject<{
1997
- sequence: z.ZodString;
1998
- type: z.ZodEnum<{
1999
- PUT: "PUT";
2000
- UPDATE: "UPDATE";
2001
- DELETE: "DELETE";
2002
- }>;
1766
+ type BatchMessage = z.infer<typeof BatchMessageSchema>;
1767
+
1768
+ declare const QuerySubMessageSchema: z.ZodObject<{
1769
+ type: z.ZodLiteral<"QUERY_SUB">;
1770
+ payload: z.ZodObject<{
1771
+ queryId: z.ZodString;
2003
1772
  mapName: z.ZodString;
2004
- key: z.ZodString;
2005
- value: z.ZodOptional<z.ZodUnknown>;
2006
- previousValue: z.ZodOptional<z.ZodUnknown>;
2007
- timestamp: z.ZodObject<{
2008
- millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2009
- counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2010
- nodeId: z.ZodString;
1773
+ query: z.ZodObject<{
1774
+ where: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
1775
+ predicate: z.ZodOptional<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>;
1776
+ sort: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
1777
+ asc: "asc";
1778
+ desc: "desc";
1779
+ }>>>;
1780
+ limit: z.ZodOptional<z.ZodNumber>;
1781
+ cursor: z.ZodOptional<z.ZodString>;
2011
1782
  }, z.core.$strip>;
2012
- nodeId: z.ZodString;
2013
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2014
1783
  }, z.core.$strip>;
2015
1784
  }, z.core.$strip>;
2016
- /**
2017
- * JOURNAL_READ: Client requests events from journal.
2018
- */
2019
- declare const JournalReadRequestSchema: z.ZodObject<{
2020
- type: z.ZodLiteral<"JOURNAL_READ">;
2021
- requestId: z.ZodString;
2022
- fromSequence: z.ZodString;
2023
- limit: z.ZodOptional<z.ZodNumber>;
2024
- mapName: z.ZodOptional<z.ZodString>;
1785
+ declare const QueryUnsubMessageSchema: z.ZodObject<{
1786
+ type: z.ZodLiteral<"QUERY_UNSUB">;
1787
+ payload: z.ZodObject<{
1788
+ queryId: z.ZodString;
1789
+ }, z.core.$strip>;
2025
1790
  }, z.core.$strip>;
2026
- /**
2027
- * JOURNAL_READ_RESPONSE: Server responds with journal events.
2028
- */
2029
- declare const JournalReadResponseSchema: z.ZodObject<{
2030
- type: z.ZodLiteral<"JOURNAL_READ_RESPONSE">;
2031
- requestId: z.ZodString;
2032
- events: z.ZodArray<z.ZodObject<{
2033
- sequence: z.ZodString;
2034
- type: z.ZodEnum<{
2035
- PUT: "PUT";
2036
- UPDATE: "UPDATE";
2037
- DELETE: "DELETE";
2038
- }>;
2039
- mapName: z.ZodString;
1791
+ declare const CursorStatusSchema: z.ZodEnum<{
1792
+ valid: "valid";
1793
+ expired: "expired";
1794
+ invalid: "invalid";
1795
+ none: "none";
1796
+ }>;
1797
+ type CursorStatus$1 = z.infer<typeof CursorStatusSchema>;
1798
+ declare const QueryRespPayloadSchema: z.ZodObject<{
1799
+ queryId: z.ZodString;
1800
+ results: z.ZodArray<z.ZodObject<{
2040
1801
  key: z.ZodString;
2041
- value: z.ZodOptional<z.ZodUnknown>;
2042
- previousValue: z.ZodOptional<z.ZodUnknown>;
2043
- timestamp: z.ZodObject<{
2044
- millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2045
- counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2046
- nodeId: z.ZodString;
2047
- }, z.core.$strip>;
2048
- nodeId: z.ZodString;
2049
- metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1802
+ value: z.ZodUnknown;
2050
1803
  }, z.core.$strip>>;
2051
- hasMore: z.ZodBoolean;
1804
+ nextCursor: z.ZodOptional<z.ZodString>;
1805
+ hasMore: z.ZodOptional<z.ZodBoolean>;
1806
+ cursorStatus: z.ZodOptional<z.ZodEnum<{
1807
+ valid: "valid";
1808
+ expired: "expired";
1809
+ invalid: "invalid";
1810
+ none: "none";
1811
+ }>>;
2052
1812
  }, z.core.$strip>;
2053
- /**
2054
- * Search options schema for FTS queries.
2055
- */
1813
+ type QueryRespPayload = z.infer<typeof QueryRespPayloadSchema>;
1814
+ declare const QueryRespMessageSchema: z.ZodObject<{
1815
+ type: z.ZodLiteral<"QUERY_RESP">;
1816
+ payload: z.ZodObject<{
1817
+ queryId: z.ZodString;
1818
+ results: z.ZodArray<z.ZodObject<{
1819
+ key: z.ZodString;
1820
+ value: z.ZodUnknown;
1821
+ }, z.core.$strip>>;
1822
+ nextCursor: z.ZodOptional<z.ZodString>;
1823
+ hasMore: z.ZodOptional<z.ZodBoolean>;
1824
+ cursorStatus: z.ZodOptional<z.ZodEnum<{
1825
+ valid: "valid";
1826
+ expired: "expired";
1827
+ invalid: "invalid";
1828
+ none: "none";
1829
+ }>>;
1830
+ }, z.core.$strip>;
1831
+ }, z.core.$strip>;
1832
+ type QueryRespMessage = z.infer<typeof QueryRespMessageSchema>;
1833
+
2056
1834
  declare const SearchOptionsSchema: z.ZodObject<{
2057
1835
  limit: z.ZodOptional<z.ZodNumber>;
2058
1836
  minScore: z.ZodOptional<z.ZodNumber>;
2059
1837
  boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
2060
1838
  }, z.core.$strip>;
2061
- /**
2062
- * SEARCH: Client requests one-shot BM25 search.
2063
- */
1839
+ type SearchOptions$1 = z.infer<typeof SearchOptionsSchema>;
2064
1840
  declare const SearchPayloadSchema: z.ZodObject<{
2065
1841
  requestId: z.ZodString;
2066
1842
  mapName: z.ZodString;
@@ -2071,6 +1847,7 @@ declare const SearchPayloadSchema: z.ZodObject<{
2071
1847
  boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
2072
1848
  }, z.core.$strip>>;
2073
1849
  }, z.core.$strip>;
1850
+ type SearchPayload = z.infer<typeof SearchPayloadSchema>;
2074
1851
  declare const SearchMessageSchema: z.ZodObject<{
2075
1852
  type: z.ZodLiteral<"SEARCH">;
2076
1853
  payload: z.ZodObject<{
@@ -2084,9 +1861,7 @@ declare const SearchMessageSchema: z.ZodObject<{
2084
1861
  }, z.core.$strip>>;
2085
1862
  }, z.core.$strip>;
2086
1863
  }, z.core.$strip>;
2087
- /**
2088
- * SEARCH_RESP: Server responds with search results.
2089
- */
1864
+ type SearchMessage = z.infer<typeof SearchMessageSchema>;
2090
1865
  declare const SearchRespPayloadSchema: z.ZodObject<{
2091
1866
  requestId: z.ZodString;
2092
1867
  results: z.ZodArray<z.ZodObject<{
@@ -2098,6 +1873,7 @@ declare const SearchRespPayloadSchema: z.ZodObject<{
2098
1873
  totalCount: z.ZodNumber;
2099
1874
  error: z.ZodOptional<z.ZodString>;
2100
1875
  }, z.core.$strip>;
1876
+ type SearchRespPayload = z.infer<typeof SearchRespPayloadSchema>;
2101
1877
  declare const SearchRespMessageSchema: z.ZodObject<{
2102
1878
  type: z.ZodLiteral<"SEARCH_RESP">;
2103
1879
  payload: z.ZodObject<{
@@ -2112,20 +1888,13 @@ declare const SearchRespMessageSchema: z.ZodObject<{
2112
1888
  error: z.ZodOptional<z.ZodString>;
2113
1889
  }, z.core.$strip>;
2114
1890
  }, z.core.$strip>;
2115
- /**
2116
- * Search delta update type.
2117
- * - ENTER: Document entered the result set (new or score exceeded minScore)
2118
- * - UPDATE: Document score changed while remaining in result set
2119
- * - LEAVE: Document left the result set (removed or score dropped below minScore)
2120
- */
1891
+ type SearchRespMessage = z.infer<typeof SearchRespMessageSchema>;
2121
1892
  declare const SearchUpdateTypeSchema: z.ZodEnum<{
2122
1893
  UPDATE: "UPDATE";
2123
1894
  ENTER: "ENTER";
2124
1895
  LEAVE: "LEAVE";
2125
1896
  }>;
2126
- /**
2127
- * SEARCH_SUB: Client subscribes to live search results.
2128
- */
1897
+ type SearchUpdateType = z.infer<typeof SearchUpdateTypeSchema>;
2129
1898
  declare const SearchSubPayloadSchema: z.ZodObject<{
2130
1899
  subscriptionId: z.ZodString;
2131
1900
  mapName: z.ZodString;
@@ -2136,6 +1905,7 @@ declare const SearchSubPayloadSchema: z.ZodObject<{
2136
1905
  boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
2137
1906
  }, z.core.$strip>>;
2138
1907
  }, z.core.$strip>;
1908
+ type SearchSubPayload = z.infer<typeof SearchSubPayloadSchema>;
2139
1909
  declare const SearchSubMessageSchema: z.ZodObject<{
2140
1910
  type: z.ZodLiteral<"SEARCH_SUB">;
2141
1911
  payload: z.ZodObject<{
@@ -2149,9 +1919,7 @@ declare const SearchSubMessageSchema: z.ZodObject<{
2149
1919
  }, z.core.$strip>>;
2150
1920
  }, z.core.$strip>;
2151
1921
  }, z.core.$strip>;
2152
- /**
2153
- * SEARCH_UPDATE: Server sends delta update for a subscribed search.
2154
- */
1922
+ type SearchSubMessage = z.infer<typeof SearchSubMessageSchema>;
2155
1923
  declare const SearchUpdatePayloadSchema: z.ZodObject<{
2156
1924
  subscriptionId: z.ZodString;
2157
1925
  key: z.ZodString;
@@ -2164,6 +1932,7 @@ declare const SearchUpdatePayloadSchema: z.ZodObject<{
2164
1932
  LEAVE: "LEAVE";
2165
1933
  }>;
2166
1934
  }, z.core.$strip>;
1935
+ type SearchUpdatePayload = z.infer<typeof SearchUpdatePayloadSchema>;
2167
1936
  declare const SearchUpdateMessageSchema: z.ZodObject<{
2168
1937
  type: z.ZodLiteral<"SEARCH_UPDATE">;
2169
1938
  payload: z.ZodObject<{
@@ -2179,163 +1948,25 @@ declare const SearchUpdateMessageSchema: z.ZodObject<{
2179
1948
  }>;
2180
1949
  }, z.core.$strip>;
2181
1950
  }, z.core.$strip>;
2182
- /**
2183
- * SEARCH_UNSUB: Client unsubscribes from live search.
2184
- */
1951
+ type SearchUpdateMessage = z.infer<typeof SearchUpdateMessageSchema>;
2185
1952
  declare const SearchUnsubPayloadSchema: z.ZodObject<{
2186
1953
  subscriptionId: z.ZodString;
2187
1954
  }, z.core.$strip>;
1955
+ type SearchUnsubPayload = z.infer<typeof SearchUnsubPayloadSchema>;
2188
1956
  declare const SearchUnsubMessageSchema: z.ZodObject<{
2189
1957
  type: z.ZodLiteral<"SEARCH_UNSUB">;
2190
1958
  payload: z.ZodObject<{
2191
1959
  subscriptionId: z.ZodString;
2192
1960
  }, z.core.$strip>;
2193
1961
  }, z.core.$strip>;
2194
- /**
2195
- * Conflict resolver definition schema (wire format).
2196
- */
2197
- declare const ConflictResolverSchema: z.ZodObject<{
2198
- name: z.ZodString;
2199
- code: z.ZodString;
2200
- priority: z.ZodOptional<z.ZodNumber>;
2201
- keyPattern: z.ZodOptional<z.ZodString>;
1962
+ type SearchUnsubMessage = z.infer<typeof SearchUnsubMessageSchema>;
1963
+
1964
+ declare const PartitionMapRequestSchema: z.ZodObject<{
1965
+ type: z.ZodLiteral<"PARTITION_MAP_REQUEST">;
1966
+ payload: z.ZodOptional<z.ZodObject<{
1967
+ currentVersion: z.ZodOptional<z.ZodNumber>;
1968
+ }, z.core.$strip>>;
2202
1969
  }, z.core.$strip>;
2203
- /**
2204
- * REGISTER_RESOLVER: Client registers a conflict resolver on server.
2205
- */
2206
- declare const RegisterResolverRequestSchema: z.ZodObject<{
2207
- type: z.ZodLiteral<"REGISTER_RESOLVER">;
2208
- requestId: z.ZodString;
2209
- mapName: z.ZodString;
2210
- resolver: z.ZodObject<{
2211
- name: z.ZodString;
2212
- code: z.ZodString;
2213
- priority: z.ZodOptional<z.ZodNumber>;
2214
- keyPattern: z.ZodOptional<z.ZodString>;
2215
- }, z.core.$strip>;
2216
- }, z.core.$strip>;
2217
- /**
2218
- * REGISTER_RESOLVER_RESPONSE: Server acknowledges resolver registration.
2219
- */
2220
- declare const RegisterResolverResponseSchema: z.ZodObject<{
2221
- type: z.ZodLiteral<"REGISTER_RESOLVER_RESPONSE">;
2222
- requestId: z.ZodString;
2223
- success: z.ZodBoolean;
2224
- error: z.ZodOptional<z.ZodString>;
2225
- }, z.core.$strip>;
2226
- /**
2227
- * UNREGISTER_RESOLVER: Client unregisters a conflict resolver.
2228
- */
2229
- declare const UnregisterResolverRequestSchema: z.ZodObject<{
2230
- type: z.ZodLiteral<"UNREGISTER_RESOLVER">;
2231
- requestId: z.ZodString;
2232
- mapName: z.ZodString;
2233
- resolverName: z.ZodString;
2234
- }, z.core.$strip>;
2235
- /**
2236
- * UNREGISTER_RESOLVER_RESPONSE: Server acknowledges resolver unregistration.
2237
- */
2238
- declare const UnregisterResolverResponseSchema: z.ZodObject<{
2239
- type: z.ZodLiteral<"UNREGISTER_RESOLVER_RESPONSE">;
2240
- requestId: z.ZodString;
2241
- success: z.ZodBoolean;
2242
- error: z.ZodOptional<z.ZodString>;
2243
- }, z.core.$strip>;
2244
- /**
2245
- * MERGE_REJECTED: Server notifies client that a merge was rejected.
2246
- */
2247
- declare const MergeRejectedMessageSchema: z.ZodObject<{
2248
- type: z.ZodLiteral<"MERGE_REJECTED">;
2249
- mapName: z.ZodString;
2250
- key: z.ZodString;
2251
- attemptedValue: z.ZodUnknown;
2252
- reason: z.ZodString;
2253
- timestamp: z.ZodObject<{
2254
- millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2255
- counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2256
- nodeId: z.ZodString;
2257
- }, z.core.$strip>;
2258
- }, z.core.$strip>;
2259
- /**
2260
- * LIST_RESOLVERS: Client requests list of registered resolvers.
2261
- */
2262
- declare const ListResolversRequestSchema: z.ZodObject<{
2263
- type: z.ZodLiteral<"LIST_RESOLVERS">;
2264
- requestId: z.ZodString;
2265
- mapName: z.ZodOptional<z.ZodString>;
2266
- }, z.core.$strip>;
2267
- /**
2268
- * LIST_RESOLVERS_RESPONSE: Server responds with registered resolvers.
2269
- */
2270
- declare const ListResolversResponseSchema: z.ZodObject<{
2271
- type: z.ZodLiteral<"LIST_RESOLVERS_RESPONSE">;
2272
- requestId: z.ZodString;
2273
- resolvers: z.ZodArray<z.ZodObject<{
2274
- mapName: z.ZodString;
2275
- name: z.ZodString;
2276
- priority: z.ZodOptional<z.ZodNumber>;
2277
- keyPattern: z.ZodOptional<z.ZodString>;
2278
- }, z.core.$strip>>;
2279
- }, z.core.$strip>;
2280
- /**
2281
- * Individual operation result within a batch ACK
2282
- */
2283
- declare const OpResultSchema: z.ZodObject<{
2284
- opId: z.ZodString;
2285
- success: z.ZodBoolean;
2286
- achievedLevel: z.ZodEnum<{
2287
- FIRE_AND_FORGET: "FIRE_AND_FORGET";
2288
- MEMORY: "MEMORY";
2289
- APPLIED: "APPLIED";
2290
- REPLICATED: "REPLICATED";
2291
- PERSISTED: "PERSISTED";
2292
- }>;
2293
- error: z.ZodOptional<z.ZodString>;
2294
- }, z.core.$strip>;
2295
- /**
2296
- * OP_ACK: Server acknowledges write operations
2297
- * Extended to support Write Concern levels
2298
- */
2299
- declare const OpAckMessageSchema: z.ZodObject<{
2300
- type: z.ZodLiteral<"OP_ACK">;
2301
- payload: z.ZodObject<{
2302
- lastId: z.ZodString;
2303
- achievedLevel: z.ZodOptional<z.ZodEnum<{
2304
- FIRE_AND_FORGET: "FIRE_AND_FORGET";
2305
- MEMORY: "MEMORY";
2306
- APPLIED: "APPLIED";
2307
- REPLICATED: "REPLICATED";
2308
- PERSISTED: "PERSISTED";
2309
- }>>;
2310
- results: z.ZodOptional<z.ZodArray<z.ZodObject<{
2311
- opId: z.ZodString;
2312
- success: z.ZodBoolean;
2313
- achievedLevel: z.ZodEnum<{
2314
- FIRE_AND_FORGET: "FIRE_AND_FORGET";
2315
- MEMORY: "MEMORY";
2316
- APPLIED: "APPLIED";
2317
- REPLICATED: "REPLICATED";
2318
- PERSISTED: "PERSISTED";
2319
- }>;
2320
- error: z.ZodOptional<z.ZodString>;
2321
- }, z.core.$strip>>>;
2322
- }, z.core.$strip>;
2323
- }, z.core.$strip>;
2324
- /**
2325
- * OP_REJECTED: Server rejects a write operation
2326
- */
2327
- declare const OpRejectedMessageSchema: z.ZodObject<{
2328
- type: z.ZodLiteral<"OP_REJECTED">;
2329
- payload: z.ZodObject<{
2330
- opId: z.ZodString;
2331
- reason: z.ZodString;
2332
- code: z.ZodOptional<z.ZodNumber>;
2333
- }, z.core.$strip>;
2334
- }, z.core.$strip>;
2335
- /**
2336
- * CLUSTER_SUB_REGISTER - Register a distributed subscription on a node.
2337
- * Sent from coordinator to data-owning nodes for both FTS and Query subscriptions.
2338
- */
2339
1970
  declare const ClusterSubRegisterPayloadSchema: z.ZodObject<{
2340
1971
  subscriptionId: z.ZodString;
2341
1972
  coordinatorNodeId: z.ZodString;
@@ -2356,6 +1987,7 @@ declare const ClusterSubRegisterPayloadSchema: z.ZodObject<{
2356
1987
  desc: "desc";
2357
1988
  }>>>;
2358
1989
  }, z.core.$strip>;
1990
+ type ClusterSubRegisterPayload = z.infer<typeof ClusterSubRegisterPayloadSchema>;
2359
1991
  declare const ClusterSubRegisterMessageSchema: z.ZodObject<{
2360
1992
  type: z.ZodLiteral<"CLUSTER_SUB_REGISTER">;
2361
1993
  payload: z.ZodObject<{
@@ -2379,10 +2011,7 @@ declare const ClusterSubRegisterMessageSchema: z.ZodObject<{
2379
2011
  }>>>;
2380
2012
  }, z.core.$strip>;
2381
2013
  }, z.core.$strip>;
2382
- /**
2383
- * CLUSTER_SUB_ACK - Acknowledgment of subscription registration with initial results.
2384
- * Sent from data node back to coordinator.
2385
- */
2014
+ type ClusterSubRegisterMessage = z.infer<typeof ClusterSubRegisterMessageSchema>;
2386
2015
  declare const ClusterSubAckPayloadSchema: z.ZodObject<{
2387
2016
  subscriptionId: z.ZodString;
2388
2017
  nodeId: z.ZodString;
@@ -2396,6 +2025,7 @@ declare const ClusterSubAckPayloadSchema: z.ZodObject<{
2396
2025
  }, z.core.$strip>>>;
2397
2026
  totalHits: z.ZodOptional<z.ZodNumber>;
2398
2027
  }, z.core.$strip>;
2028
+ type ClusterSubAckPayload = z.infer<typeof ClusterSubAckPayloadSchema>;
2399
2029
  declare const ClusterSubAckMessageSchema: z.ZodObject<{
2400
2030
  type: z.ZodLiteral<"CLUSTER_SUB_ACK">;
2401
2031
  payload: z.ZodObject<{
@@ -2412,10 +2042,7 @@ declare const ClusterSubAckMessageSchema: z.ZodObject<{
2412
2042
  totalHits: z.ZodOptional<z.ZodNumber>;
2413
2043
  }, z.core.$strip>;
2414
2044
  }, z.core.$strip>;
2415
- /**
2416
- * CLUSTER_SUB_UPDATE - Delta update from a data node to coordinator.
2417
- * Sent when a document enters/updates/leaves the subscription result set.
2418
- */
2045
+ type ClusterSubAckMessage = z.infer<typeof ClusterSubAckMessageSchema>;
2419
2046
  declare const ClusterSubUpdatePayloadSchema: z.ZodObject<{
2420
2047
  subscriptionId: z.ZodString;
2421
2048
  sourceNodeId: z.ZodString;
@@ -2430,6 +2057,7 @@ declare const ClusterSubUpdatePayloadSchema: z.ZodObject<{
2430
2057
  }>;
2431
2058
  timestamp: z.ZodNumber;
2432
2059
  }, z.core.$strip>;
2060
+ type ClusterSubUpdatePayload = z.infer<typeof ClusterSubUpdatePayloadSchema>;
2433
2061
  declare const ClusterSubUpdateMessageSchema: z.ZodObject<{
2434
2062
  type: z.ZodLiteral<"CLUSTER_SUB_UPDATE">;
2435
2063
  payload: z.ZodObject<{
@@ -2447,19 +2075,916 @@ declare const ClusterSubUpdateMessageSchema: z.ZodObject<{
2447
2075
  timestamp: z.ZodNumber;
2448
2076
  }, z.core.$strip>;
2449
2077
  }, z.core.$strip>;
2078
+ type ClusterSubUpdateMessage = z.infer<typeof ClusterSubUpdateMessageSchema>;
2079
+ declare const ClusterSubUnregisterPayloadSchema: z.ZodObject<{
2080
+ subscriptionId: z.ZodString;
2081
+ }, z.core.$strip>;
2082
+ type ClusterSubUnregisterPayload = z.infer<typeof ClusterSubUnregisterPayloadSchema>;
2083
+ declare const ClusterSubUnregisterMessageSchema: z.ZodObject<{
2084
+ type: z.ZodLiteral<"CLUSTER_SUB_UNREGISTER">;
2085
+ payload: z.ZodObject<{
2086
+ subscriptionId: z.ZodString;
2087
+ }, z.core.$strip>;
2088
+ }, z.core.$strip>;
2089
+ type ClusterSubUnregisterMessage = z.infer<typeof ClusterSubUnregisterMessageSchema>;
2090
+ declare const ClusterSearchReqPayloadSchema: z.ZodObject<{
2091
+ requestId: z.ZodString;
2092
+ mapName: z.ZodString;
2093
+ query: z.ZodString;
2094
+ options: z.ZodObject<{
2095
+ limit: z.ZodNumber;
2096
+ minScore: z.ZodOptional<z.ZodNumber>;
2097
+ boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
2098
+ includeMatchedTerms: z.ZodOptional<z.ZodBoolean>;
2099
+ afterScore: z.ZodOptional<z.ZodNumber>;
2100
+ afterKey: z.ZodOptional<z.ZodString>;
2101
+ }, z.core.$strip>;
2102
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
2103
+ }, z.core.$strip>;
2104
+ type ClusterSearchReqPayload = z.infer<typeof ClusterSearchReqPayloadSchema>;
2105
+ declare const ClusterSearchReqMessageSchema: z.ZodObject<{
2106
+ type: z.ZodLiteral<"CLUSTER_SEARCH_REQ">;
2107
+ payload: z.ZodObject<{
2108
+ requestId: z.ZodString;
2109
+ mapName: z.ZodString;
2110
+ query: z.ZodString;
2111
+ options: z.ZodObject<{
2112
+ limit: z.ZodNumber;
2113
+ minScore: z.ZodOptional<z.ZodNumber>;
2114
+ boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
2115
+ includeMatchedTerms: z.ZodOptional<z.ZodBoolean>;
2116
+ afterScore: z.ZodOptional<z.ZodNumber>;
2117
+ afterKey: z.ZodOptional<z.ZodString>;
2118
+ }, z.core.$strip>;
2119
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
2120
+ }, z.core.$strip>;
2121
+ }, z.core.$strip>;
2122
+ type ClusterSearchReqMessage = z.infer<typeof ClusterSearchReqMessageSchema>;
2123
+ declare const ClusterSearchRespPayloadSchema: z.ZodObject<{
2124
+ requestId: z.ZodString;
2125
+ nodeId: z.ZodString;
2126
+ results: z.ZodArray<z.ZodObject<{
2127
+ key: z.ZodString;
2128
+ value: z.ZodUnknown;
2129
+ score: z.ZodNumber;
2130
+ matchedTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
2131
+ }, z.core.$strip>>;
2132
+ totalHits: z.ZodNumber;
2133
+ executionTimeMs: z.ZodNumber;
2134
+ error: z.ZodOptional<z.ZodString>;
2135
+ }, z.core.$strip>;
2136
+ type ClusterSearchRespPayload = z.infer<typeof ClusterSearchRespPayloadSchema>;
2137
+ declare const ClusterSearchRespMessageSchema: z.ZodObject<{
2138
+ type: z.ZodLiteral<"CLUSTER_SEARCH_RESP">;
2139
+ payload: z.ZodObject<{
2140
+ requestId: z.ZodString;
2141
+ nodeId: z.ZodString;
2142
+ results: z.ZodArray<z.ZodObject<{
2143
+ key: z.ZodString;
2144
+ value: z.ZodUnknown;
2145
+ score: z.ZodNumber;
2146
+ matchedTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
2147
+ }, z.core.$strip>>;
2148
+ totalHits: z.ZodNumber;
2149
+ executionTimeMs: z.ZodNumber;
2150
+ error: z.ZodOptional<z.ZodString>;
2151
+ }, z.core.$strip>;
2152
+ }, z.core.$strip>;
2153
+ type ClusterSearchRespMessage = z.infer<typeof ClusterSearchRespMessageSchema>;
2154
+ declare const ClusterSearchSubscribePayloadSchema: z.ZodObject<{
2155
+ subscriptionId: z.ZodString;
2156
+ mapName: z.ZodString;
2157
+ query: z.ZodString;
2158
+ options: z.ZodOptional<z.ZodObject<{
2159
+ limit: z.ZodOptional<z.ZodNumber>;
2160
+ minScore: z.ZodOptional<z.ZodNumber>;
2161
+ boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
2162
+ }, z.core.$strip>>;
2163
+ }, z.core.$strip>;
2164
+ type ClusterSearchSubscribePayload = z.infer<typeof ClusterSearchSubscribePayloadSchema>;
2165
+ declare const ClusterSearchSubscribeMessageSchema: z.ZodObject<{
2166
+ type: z.ZodLiteral<"CLUSTER_SEARCH_SUBSCRIBE">;
2167
+ payload: z.ZodObject<{
2168
+ subscriptionId: z.ZodString;
2169
+ mapName: z.ZodString;
2170
+ query: z.ZodString;
2171
+ options: z.ZodOptional<z.ZodObject<{
2172
+ limit: z.ZodOptional<z.ZodNumber>;
2173
+ minScore: z.ZodOptional<z.ZodNumber>;
2174
+ boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
2175
+ }, z.core.$strip>>;
2176
+ }, z.core.$strip>;
2177
+ }, z.core.$strip>;
2178
+ type ClusterSearchSubscribeMessage = z.infer<typeof ClusterSearchSubscribeMessageSchema>;
2179
+ declare const ClusterSearchUnsubscribePayloadSchema: z.ZodObject<{
2180
+ subscriptionId: z.ZodString;
2181
+ }, z.core.$strip>;
2182
+ type ClusterSearchUnsubscribePayload = z.infer<typeof ClusterSearchUnsubscribePayloadSchema>;
2183
+ declare const ClusterSearchUnsubscribeMessageSchema: z.ZodObject<{
2184
+ type: z.ZodLiteral<"CLUSTER_SEARCH_UNSUBSCRIBE">;
2185
+ payload: z.ZodObject<{
2186
+ subscriptionId: z.ZodString;
2187
+ }, z.core.$strip>;
2188
+ }, z.core.$strip>;
2189
+ type ClusterSearchUnsubscribeMessage = z.infer<typeof ClusterSearchUnsubscribeMessageSchema>;
2190
+ declare const ClusterSearchUpdatePayloadSchema: z.ZodObject<{
2191
+ subscriptionId: z.ZodString;
2192
+ nodeId: z.ZodString;
2193
+ key: z.ZodString;
2194
+ value: z.ZodUnknown;
2195
+ score: z.ZodNumber;
2196
+ matchedTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
2197
+ type: z.ZodEnum<{
2198
+ UPDATE: "UPDATE";
2199
+ ENTER: "ENTER";
2200
+ LEAVE: "LEAVE";
2201
+ }>;
2202
+ }, z.core.$strip>;
2203
+ type ClusterSearchUpdatePayload = z.infer<typeof ClusterSearchUpdatePayloadSchema>;
2204
+ declare const ClusterSearchUpdateMessageSchema: z.ZodObject<{
2205
+ type: z.ZodLiteral<"CLUSTER_SEARCH_UPDATE">;
2206
+ payload: z.ZodObject<{
2207
+ subscriptionId: z.ZodString;
2208
+ nodeId: z.ZodString;
2209
+ key: z.ZodString;
2210
+ value: z.ZodUnknown;
2211
+ score: z.ZodNumber;
2212
+ matchedTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
2213
+ type: z.ZodEnum<{
2214
+ UPDATE: "UPDATE";
2215
+ ENTER: "ENTER";
2216
+ LEAVE: "LEAVE";
2217
+ }>;
2218
+ }, z.core.$strip>;
2219
+ }, z.core.$strip>;
2220
+ type ClusterSearchUpdateMessage = z.infer<typeof ClusterSearchUpdateMessageSchema>;
2221
+
2222
+ declare const TopicSubSchema: z.ZodObject<{
2223
+ type: z.ZodLiteral<"TOPIC_SUB">;
2224
+ payload: z.ZodObject<{
2225
+ topic: z.ZodString;
2226
+ }, z.core.$strip>;
2227
+ }, z.core.$strip>;
2228
+ declare const TopicUnsubSchema: z.ZodObject<{
2229
+ type: z.ZodLiteral<"TOPIC_UNSUB">;
2230
+ payload: z.ZodObject<{
2231
+ topic: z.ZodString;
2232
+ }, z.core.$strip>;
2233
+ }, z.core.$strip>;
2234
+ declare const TopicPubSchema: z.ZodObject<{
2235
+ type: z.ZodLiteral<"TOPIC_PUB">;
2236
+ payload: z.ZodObject<{
2237
+ topic: z.ZodString;
2238
+ data: z.ZodAny;
2239
+ }, z.core.$strip>;
2240
+ }, z.core.$strip>;
2241
+ declare const TopicMessageEventSchema: z.ZodObject<{
2242
+ type: z.ZodLiteral<"TOPIC_MESSAGE">;
2243
+ payload: z.ZodObject<{
2244
+ topic: z.ZodString;
2245
+ data: z.ZodAny;
2246
+ publisherId: z.ZodOptional<z.ZodString>;
2247
+ timestamp: z.ZodNumber;
2248
+ }, z.core.$strip>;
2249
+ }, z.core.$strip>;
2250
+ declare const LockRequestSchema: z.ZodObject<{
2251
+ type: z.ZodLiteral<"LOCK_REQUEST">;
2252
+ payload: z.ZodObject<{
2253
+ requestId: z.ZodString;
2254
+ name: z.ZodString;
2255
+ ttl: z.ZodOptional<z.ZodNumber>;
2256
+ }, z.core.$strip>;
2257
+ }, z.core.$strip>;
2258
+ declare const LockReleaseSchema: z.ZodObject<{
2259
+ type: z.ZodLiteral<"LOCK_RELEASE">;
2260
+ payload: z.ZodObject<{
2261
+ requestId: z.ZodOptional<z.ZodString>;
2262
+ name: z.ZodString;
2263
+ fencingToken: z.ZodNumber;
2264
+ }, z.core.$strip>;
2265
+ }, z.core.$strip>;
2266
+ declare const PNCounterStateObjectSchema: z.ZodObject<{
2267
+ p: z.ZodRecord<z.ZodString, z.ZodNumber>;
2268
+ n: z.ZodRecord<z.ZodString, z.ZodNumber>;
2269
+ }, z.core.$strip>;
2270
+ declare const CounterRequestSchema: z.ZodObject<{
2271
+ type: z.ZodLiteral<"COUNTER_REQUEST">;
2272
+ payload: z.ZodObject<{
2273
+ name: z.ZodString;
2274
+ }, z.core.$strip>;
2275
+ }, z.core.$strip>;
2276
+ declare const CounterSyncSchema: z.ZodObject<{
2277
+ type: z.ZodLiteral<"COUNTER_SYNC">;
2278
+ payload: z.ZodObject<{
2279
+ name: z.ZodString;
2280
+ state: z.ZodObject<{
2281
+ p: z.ZodRecord<z.ZodString, z.ZodNumber>;
2282
+ n: z.ZodRecord<z.ZodString, z.ZodNumber>;
2283
+ }, z.core.$strip>;
2284
+ }, z.core.$strip>;
2285
+ }, z.core.$strip>;
2286
+ declare const CounterResponseSchema: z.ZodObject<{
2287
+ type: z.ZodLiteral<"COUNTER_RESPONSE">;
2288
+ payload: z.ZodObject<{
2289
+ name: z.ZodString;
2290
+ state: z.ZodObject<{
2291
+ p: z.ZodRecord<z.ZodString, z.ZodNumber>;
2292
+ n: z.ZodRecord<z.ZodString, z.ZodNumber>;
2293
+ }, z.core.$strip>;
2294
+ }, z.core.$strip>;
2295
+ }, z.core.$strip>;
2296
+ declare const CounterUpdateSchema: z.ZodObject<{
2297
+ type: z.ZodLiteral<"COUNTER_UPDATE">;
2298
+ payload: z.ZodObject<{
2299
+ name: z.ZodString;
2300
+ state: z.ZodObject<{
2301
+ p: z.ZodRecord<z.ZodString, z.ZodNumber>;
2302
+ n: z.ZodRecord<z.ZodString, z.ZodNumber>;
2303
+ }, z.core.$strip>;
2304
+ }, z.core.$strip>;
2305
+ }, z.core.$strip>;
2306
+ declare const PingMessageSchema: z.ZodObject<{
2307
+ type: z.ZodLiteral<"PING">;
2308
+ timestamp: z.ZodNumber;
2309
+ }, z.core.$strip>;
2310
+ type PingMessage = z.infer<typeof PingMessageSchema>;
2311
+ declare const PongMessageSchema: z.ZodObject<{
2312
+ type: z.ZodLiteral<"PONG">;
2313
+ timestamp: z.ZodNumber;
2314
+ serverTime: z.ZodNumber;
2315
+ }, z.core.$strip>;
2316
+ type PongMessage = z.infer<typeof PongMessageSchema>;
2317
+ declare const EntryProcessorSchema: z.ZodObject<{
2318
+ name: z.ZodString;
2319
+ code: z.ZodString;
2320
+ args: z.ZodOptional<z.ZodUnknown>;
2321
+ }, z.core.$strip>;
2322
+ declare const EntryProcessRequestSchema: z.ZodObject<{
2323
+ type: z.ZodLiteral<"ENTRY_PROCESS">;
2324
+ requestId: z.ZodString;
2325
+ mapName: z.ZodString;
2326
+ key: z.ZodString;
2327
+ processor: z.ZodObject<{
2328
+ name: z.ZodString;
2329
+ code: z.ZodString;
2330
+ args: z.ZodOptional<z.ZodUnknown>;
2331
+ }, z.core.$strip>;
2332
+ }, z.core.$strip>;
2333
+ type EntryProcessRequest = z.infer<typeof EntryProcessRequestSchema>;
2334
+ declare const EntryProcessBatchRequestSchema: z.ZodObject<{
2335
+ type: z.ZodLiteral<"ENTRY_PROCESS_BATCH">;
2336
+ requestId: z.ZodString;
2337
+ mapName: z.ZodString;
2338
+ keys: z.ZodArray<z.ZodString>;
2339
+ processor: z.ZodObject<{
2340
+ name: z.ZodString;
2341
+ code: z.ZodString;
2342
+ args: z.ZodOptional<z.ZodUnknown>;
2343
+ }, z.core.$strip>;
2344
+ }, z.core.$strip>;
2345
+ type EntryProcessBatchRequest = z.infer<typeof EntryProcessBatchRequestSchema>;
2346
+ declare const EntryProcessResponseSchema: z.ZodObject<{
2347
+ type: z.ZodLiteral<"ENTRY_PROCESS_RESPONSE">;
2348
+ requestId: z.ZodString;
2349
+ success: z.ZodBoolean;
2350
+ result: z.ZodOptional<z.ZodUnknown>;
2351
+ newValue: z.ZodOptional<z.ZodUnknown>;
2352
+ error: z.ZodOptional<z.ZodString>;
2353
+ }, z.core.$strip>;
2354
+ type EntryProcessResponse = z.infer<typeof EntryProcessResponseSchema>;
2355
+ declare const EntryProcessKeyResultSchema: z.ZodObject<{
2356
+ success: z.ZodBoolean;
2357
+ result: z.ZodOptional<z.ZodUnknown>;
2358
+ newValue: z.ZodOptional<z.ZodUnknown>;
2359
+ error: z.ZodOptional<z.ZodString>;
2360
+ }, z.core.$strip>;
2361
+ type EntryProcessKeyResult = z.infer<typeof EntryProcessKeyResultSchema>;
2362
+ declare const EntryProcessBatchResponseSchema: z.ZodObject<{
2363
+ type: z.ZodLiteral<"ENTRY_PROCESS_BATCH_RESPONSE">;
2364
+ requestId: z.ZodString;
2365
+ results: z.ZodRecord<z.ZodString, z.ZodObject<{
2366
+ success: z.ZodBoolean;
2367
+ result: z.ZodOptional<z.ZodUnknown>;
2368
+ newValue: z.ZodOptional<z.ZodUnknown>;
2369
+ error: z.ZodOptional<z.ZodString>;
2370
+ }, z.core.$strip>>;
2371
+ }, z.core.$strip>;
2372
+ type EntryProcessBatchResponse = z.infer<typeof EntryProcessBatchResponseSchema>;
2373
+ declare const JournalEventTypeSchema: z.ZodEnum<{
2374
+ PUT: "PUT";
2375
+ UPDATE: "UPDATE";
2376
+ DELETE: "DELETE";
2377
+ }>;
2378
+ declare const JournalEventDataSchema: z.ZodObject<{
2379
+ sequence: z.ZodString;
2380
+ type: z.ZodEnum<{
2381
+ PUT: "PUT";
2382
+ UPDATE: "UPDATE";
2383
+ DELETE: "DELETE";
2384
+ }>;
2385
+ mapName: z.ZodString;
2386
+ key: z.ZodString;
2387
+ value: z.ZodOptional<z.ZodUnknown>;
2388
+ previousValue: z.ZodOptional<z.ZodUnknown>;
2389
+ timestamp: z.ZodObject<{
2390
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2391
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2392
+ nodeId: z.ZodString;
2393
+ }, z.core.$strip>;
2394
+ nodeId: z.ZodString;
2395
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2396
+ }, z.core.$strip>;
2397
+ type JournalEventData = z.infer<typeof JournalEventDataSchema>;
2398
+ declare const JournalSubscribeRequestSchema: z.ZodObject<{
2399
+ type: z.ZodLiteral<"JOURNAL_SUBSCRIBE">;
2400
+ requestId: z.ZodString;
2401
+ fromSequence: z.ZodOptional<z.ZodString>;
2402
+ mapName: z.ZodOptional<z.ZodString>;
2403
+ types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
2404
+ PUT: "PUT";
2405
+ UPDATE: "UPDATE";
2406
+ DELETE: "DELETE";
2407
+ }>>>;
2408
+ }, z.core.$strip>;
2409
+ type JournalSubscribeRequest = z.infer<typeof JournalSubscribeRequestSchema>;
2410
+ declare const JournalUnsubscribeRequestSchema: z.ZodObject<{
2411
+ type: z.ZodLiteral<"JOURNAL_UNSUBSCRIBE">;
2412
+ subscriptionId: z.ZodString;
2413
+ }, z.core.$strip>;
2414
+ type JournalUnsubscribeRequest = z.infer<typeof JournalUnsubscribeRequestSchema>;
2415
+ declare const JournalEventMessageSchema: z.ZodObject<{
2416
+ type: z.ZodLiteral<"JOURNAL_EVENT">;
2417
+ event: z.ZodObject<{
2418
+ sequence: z.ZodString;
2419
+ type: z.ZodEnum<{
2420
+ PUT: "PUT";
2421
+ UPDATE: "UPDATE";
2422
+ DELETE: "DELETE";
2423
+ }>;
2424
+ mapName: z.ZodString;
2425
+ key: z.ZodString;
2426
+ value: z.ZodOptional<z.ZodUnknown>;
2427
+ previousValue: z.ZodOptional<z.ZodUnknown>;
2428
+ timestamp: z.ZodObject<{
2429
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2430
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2431
+ nodeId: z.ZodString;
2432
+ }, z.core.$strip>;
2433
+ nodeId: z.ZodString;
2434
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2435
+ }, z.core.$strip>;
2436
+ }, z.core.$strip>;
2437
+ type JournalEventMessage = z.infer<typeof JournalEventMessageSchema>;
2438
+ declare const JournalReadRequestSchema: z.ZodObject<{
2439
+ type: z.ZodLiteral<"JOURNAL_READ">;
2440
+ requestId: z.ZodString;
2441
+ fromSequence: z.ZodString;
2442
+ limit: z.ZodOptional<z.ZodNumber>;
2443
+ mapName: z.ZodOptional<z.ZodString>;
2444
+ }, z.core.$strip>;
2445
+ type JournalReadRequest = z.infer<typeof JournalReadRequestSchema>;
2446
+ declare const JournalReadResponseSchema: z.ZodObject<{
2447
+ type: z.ZodLiteral<"JOURNAL_READ_RESPONSE">;
2448
+ requestId: z.ZodString;
2449
+ events: z.ZodArray<z.ZodObject<{
2450
+ sequence: z.ZodString;
2451
+ type: z.ZodEnum<{
2452
+ PUT: "PUT";
2453
+ UPDATE: "UPDATE";
2454
+ DELETE: "DELETE";
2455
+ }>;
2456
+ mapName: z.ZodString;
2457
+ key: z.ZodString;
2458
+ value: z.ZodOptional<z.ZodUnknown>;
2459
+ previousValue: z.ZodOptional<z.ZodUnknown>;
2460
+ timestamp: z.ZodObject<{
2461
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2462
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2463
+ nodeId: z.ZodString;
2464
+ }, z.core.$strip>;
2465
+ nodeId: z.ZodString;
2466
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2467
+ }, z.core.$strip>>;
2468
+ hasMore: z.ZodBoolean;
2469
+ }, z.core.$strip>;
2470
+ type JournalReadResponse = z.infer<typeof JournalReadResponseSchema>;
2471
+ declare const ConflictResolverSchema: z.ZodObject<{
2472
+ name: z.ZodString;
2473
+ code: z.ZodString;
2474
+ priority: z.ZodOptional<z.ZodNumber>;
2475
+ keyPattern: z.ZodOptional<z.ZodString>;
2476
+ }, z.core.$strip>;
2477
+ type ConflictResolver = z.infer<typeof ConflictResolverSchema>;
2478
+ declare const RegisterResolverRequestSchema: z.ZodObject<{
2479
+ type: z.ZodLiteral<"REGISTER_RESOLVER">;
2480
+ requestId: z.ZodString;
2481
+ mapName: z.ZodString;
2482
+ resolver: z.ZodObject<{
2483
+ name: z.ZodString;
2484
+ code: z.ZodString;
2485
+ priority: z.ZodOptional<z.ZodNumber>;
2486
+ keyPattern: z.ZodOptional<z.ZodString>;
2487
+ }, z.core.$strip>;
2488
+ }, z.core.$strip>;
2489
+ type RegisterResolverRequest = z.infer<typeof RegisterResolverRequestSchema>;
2490
+ declare const RegisterResolverResponseSchema: z.ZodObject<{
2491
+ type: z.ZodLiteral<"REGISTER_RESOLVER_RESPONSE">;
2492
+ requestId: z.ZodString;
2493
+ success: z.ZodBoolean;
2494
+ error: z.ZodOptional<z.ZodString>;
2495
+ }, z.core.$strip>;
2496
+ type RegisterResolverResponse = z.infer<typeof RegisterResolverResponseSchema>;
2497
+ declare const UnregisterResolverRequestSchema: z.ZodObject<{
2498
+ type: z.ZodLiteral<"UNREGISTER_RESOLVER">;
2499
+ requestId: z.ZodString;
2500
+ mapName: z.ZodString;
2501
+ resolverName: z.ZodString;
2502
+ }, z.core.$strip>;
2503
+ type UnregisterResolverRequest = z.infer<typeof UnregisterResolverRequestSchema>;
2504
+ declare const UnregisterResolverResponseSchema: z.ZodObject<{
2505
+ type: z.ZodLiteral<"UNREGISTER_RESOLVER_RESPONSE">;
2506
+ requestId: z.ZodString;
2507
+ success: z.ZodBoolean;
2508
+ error: z.ZodOptional<z.ZodString>;
2509
+ }, z.core.$strip>;
2510
+ type UnregisterResolverResponse = z.infer<typeof UnregisterResolverResponseSchema>;
2511
+ declare const MergeRejectedMessageSchema: z.ZodObject<{
2512
+ type: z.ZodLiteral<"MERGE_REJECTED">;
2513
+ mapName: z.ZodString;
2514
+ key: z.ZodString;
2515
+ attemptedValue: z.ZodUnknown;
2516
+ reason: z.ZodString;
2517
+ timestamp: z.ZodObject<{
2518
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2519
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2520
+ nodeId: z.ZodString;
2521
+ }, z.core.$strip>;
2522
+ }, z.core.$strip>;
2523
+ type MergeRejectedMessage = z.infer<typeof MergeRejectedMessageSchema>;
2524
+ declare const ListResolversRequestSchema: z.ZodObject<{
2525
+ type: z.ZodLiteral<"LIST_RESOLVERS">;
2526
+ requestId: z.ZodString;
2527
+ mapName: z.ZodOptional<z.ZodString>;
2528
+ }, z.core.$strip>;
2529
+ type ListResolversRequest = z.infer<typeof ListResolversRequestSchema>;
2530
+ declare const ListResolversResponseSchema: z.ZodObject<{
2531
+ type: z.ZodLiteral<"LIST_RESOLVERS_RESPONSE">;
2532
+ requestId: z.ZodString;
2533
+ resolvers: z.ZodArray<z.ZodObject<{
2534
+ mapName: z.ZodString;
2535
+ name: z.ZodString;
2536
+ priority: z.ZodOptional<z.ZodNumber>;
2537
+ keyPattern: z.ZodOptional<z.ZodString>;
2538
+ }, z.core.$strip>>;
2539
+ }, z.core.$strip>;
2540
+ type ListResolversResponse = z.infer<typeof ListResolversResponseSchema>;
2541
+
2542
+ declare const ServerEventPayloadSchema: z.ZodObject<{
2543
+ mapName: z.ZodString;
2544
+ eventType: z.ZodEnum<{
2545
+ PUT: "PUT";
2546
+ REMOVE: "REMOVE";
2547
+ OR_ADD: "OR_ADD";
2548
+ OR_REMOVE: "OR_REMOVE";
2549
+ }>;
2550
+ key: z.ZodString;
2551
+ record: z.ZodOptional<z.ZodObject<{
2552
+ value: z.ZodNullable<z.ZodAny>;
2553
+ timestamp: z.ZodObject<{
2554
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2555
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2556
+ nodeId: z.ZodString;
2557
+ }, z.core.$strip>;
2558
+ ttlMs: z.ZodOptional<z.ZodNumber>;
2559
+ }, z.core.$strip>>;
2560
+ orRecord: z.ZodOptional<z.ZodObject<{
2561
+ value: z.ZodAny;
2562
+ timestamp: z.ZodObject<{
2563
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2564
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2565
+ nodeId: z.ZodString;
2566
+ }, z.core.$strip>;
2567
+ tag: z.ZodString;
2568
+ ttlMs: z.ZodOptional<z.ZodNumber>;
2569
+ }, z.core.$strip>>;
2570
+ orTag: z.ZodOptional<z.ZodString>;
2571
+ }, z.core.$strip>;
2572
+ type ServerEventPayload = z.infer<typeof ServerEventPayloadSchema>;
2573
+ declare const ServerEventMessageSchema: z.ZodObject<{
2574
+ type: z.ZodLiteral<"SERVER_EVENT">;
2575
+ payload: z.ZodObject<{
2576
+ mapName: z.ZodString;
2577
+ eventType: z.ZodEnum<{
2578
+ PUT: "PUT";
2579
+ REMOVE: "REMOVE";
2580
+ OR_ADD: "OR_ADD";
2581
+ OR_REMOVE: "OR_REMOVE";
2582
+ }>;
2583
+ key: z.ZodString;
2584
+ record: z.ZodOptional<z.ZodObject<{
2585
+ value: z.ZodNullable<z.ZodAny>;
2586
+ timestamp: z.ZodObject<{
2587
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2588
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2589
+ nodeId: z.ZodString;
2590
+ }, z.core.$strip>;
2591
+ ttlMs: z.ZodOptional<z.ZodNumber>;
2592
+ }, z.core.$strip>>;
2593
+ orRecord: z.ZodOptional<z.ZodObject<{
2594
+ value: z.ZodAny;
2595
+ timestamp: z.ZodObject<{
2596
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2597
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2598
+ nodeId: z.ZodString;
2599
+ }, z.core.$strip>;
2600
+ tag: z.ZodString;
2601
+ ttlMs: z.ZodOptional<z.ZodNumber>;
2602
+ }, z.core.$strip>>;
2603
+ orTag: z.ZodOptional<z.ZodString>;
2604
+ }, z.core.$strip>;
2605
+ }, z.core.$strip>;
2606
+ type ServerEventMessage = z.infer<typeof ServerEventMessageSchema>;
2607
+ declare const ServerBatchEventMessageSchema: z.ZodObject<{
2608
+ type: z.ZodLiteral<"SERVER_BATCH_EVENT">;
2609
+ payload: z.ZodObject<{
2610
+ events: z.ZodArray<z.ZodObject<{
2611
+ mapName: z.ZodString;
2612
+ eventType: z.ZodEnum<{
2613
+ PUT: "PUT";
2614
+ REMOVE: "REMOVE";
2615
+ OR_ADD: "OR_ADD";
2616
+ OR_REMOVE: "OR_REMOVE";
2617
+ }>;
2618
+ key: z.ZodString;
2619
+ record: z.ZodOptional<z.ZodObject<{
2620
+ value: z.ZodNullable<z.ZodAny>;
2621
+ timestamp: z.ZodObject<{
2622
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2623
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2624
+ nodeId: z.ZodString;
2625
+ }, z.core.$strip>;
2626
+ ttlMs: z.ZodOptional<z.ZodNumber>;
2627
+ }, z.core.$strip>>;
2628
+ orRecord: z.ZodOptional<z.ZodObject<{
2629
+ value: z.ZodAny;
2630
+ timestamp: z.ZodObject<{
2631
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2632
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2633
+ nodeId: z.ZodString;
2634
+ }, z.core.$strip>;
2635
+ tag: z.ZodString;
2636
+ ttlMs: z.ZodOptional<z.ZodNumber>;
2637
+ }, z.core.$strip>>;
2638
+ orTag: z.ZodOptional<z.ZodString>;
2639
+ }, z.core.$strip>>;
2640
+ }, z.core.$strip>;
2641
+ }, z.core.$strip>;
2642
+ type ServerBatchEventMessage = z.infer<typeof ServerBatchEventMessageSchema>;
2643
+ declare const QueryUpdatePayloadSchema: z.ZodObject<{
2644
+ queryId: z.ZodString;
2645
+ key: z.ZodString;
2646
+ value: z.ZodUnknown;
2647
+ type: z.ZodEnum<{
2648
+ UPDATE: "UPDATE";
2649
+ REMOVE: "REMOVE";
2650
+ ENTER: "ENTER";
2651
+ }>;
2652
+ }, z.core.$strip>;
2653
+ type QueryUpdatePayload = z.infer<typeof QueryUpdatePayloadSchema>;
2654
+ declare const QueryUpdateMessageSchema: z.ZodObject<{
2655
+ type: z.ZodLiteral<"QUERY_UPDATE">;
2656
+ payload: z.ZodObject<{
2657
+ queryId: z.ZodString;
2658
+ key: z.ZodString;
2659
+ value: z.ZodUnknown;
2660
+ type: z.ZodEnum<{
2661
+ UPDATE: "UPDATE";
2662
+ REMOVE: "REMOVE";
2663
+ ENTER: "ENTER";
2664
+ }>;
2665
+ }, z.core.$strip>;
2666
+ }, z.core.$strip>;
2667
+ type QueryUpdateMessage = z.infer<typeof QueryUpdateMessageSchema>;
2668
+ declare const GcPrunePayloadSchema: z.ZodObject<{
2669
+ olderThan: z.ZodObject<{
2670
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2671
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2672
+ nodeId: z.ZodString;
2673
+ }, z.core.$strip>;
2674
+ }, z.core.$strip>;
2675
+ type GcPrunePayload = z.infer<typeof GcPrunePayloadSchema>;
2676
+ declare const GcPruneMessageSchema: z.ZodObject<{
2677
+ type: z.ZodLiteral<"GC_PRUNE">;
2678
+ payload: z.ZodObject<{
2679
+ olderThan: z.ZodObject<{
2680
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2681
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2682
+ nodeId: z.ZodString;
2683
+ }, z.core.$strip>;
2684
+ }, z.core.$strip>;
2685
+ }, z.core.$strip>;
2686
+ type GcPruneMessage = z.infer<typeof GcPruneMessageSchema>;
2687
+ declare const AuthFailMessageSchema: z.ZodObject<{
2688
+ type: z.ZodLiteral<"AUTH_FAIL">;
2689
+ error: z.ZodOptional<z.ZodString>;
2690
+ code: z.ZodOptional<z.ZodNumber>;
2691
+ }, z.core.$strip>;
2692
+ type AuthFailMessage = z.infer<typeof AuthFailMessageSchema>;
2693
+ declare const HybridQueryRespPayloadSchema: z.ZodObject<{
2694
+ subscriptionId: z.ZodString;
2695
+ results: z.ZodArray<z.ZodObject<{
2696
+ key: z.ZodString;
2697
+ value: z.ZodUnknown;
2698
+ score: z.ZodNumber;
2699
+ matchedTerms: z.ZodArray<z.ZodString>;
2700
+ }, z.core.$strip>>;
2701
+ nextCursor: z.ZodOptional<z.ZodString>;
2702
+ hasMore: z.ZodOptional<z.ZodBoolean>;
2703
+ cursorStatus: z.ZodOptional<z.ZodEnum<{
2704
+ valid: "valid";
2705
+ expired: "expired";
2706
+ invalid: "invalid";
2707
+ none: "none";
2708
+ }>>;
2709
+ }, z.core.$strip>;
2710
+ type HybridQueryRespPayload = z.infer<typeof HybridQueryRespPayloadSchema>;
2711
+ declare const HybridQueryDeltaPayloadSchema: z.ZodObject<{
2712
+ subscriptionId: z.ZodString;
2713
+ key: z.ZodString;
2714
+ value: z.ZodNullable<z.ZodUnknown>;
2715
+ score: z.ZodOptional<z.ZodNumber>;
2716
+ matchedTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
2717
+ type: z.ZodEnum<{
2718
+ UPDATE: "UPDATE";
2719
+ ENTER: "ENTER";
2720
+ LEAVE: "LEAVE";
2721
+ }>;
2722
+ }, z.core.$strip>;
2723
+ type HybridQueryDeltaPayload = z.infer<typeof HybridQueryDeltaPayloadSchema>;
2724
+ declare const LockGrantedPayloadSchema: z.ZodObject<{
2725
+ requestId: z.ZodString;
2726
+ fencingToken: z.ZodNumber;
2727
+ }, z.core.$strip>;
2728
+ type LockGrantedPayload = z.infer<typeof LockGrantedPayloadSchema>;
2729
+ declare const LockReleasedPayloadSchema: z.ZodObject<{
2730
+ requestId: z.ZodString;
2731
+ success: z.ZodBoolean;
2732
+ }, z.core.$strip>;
2733
+ type LockReleasedPayload = z.infer<typeof LockReleasedPayloadSchema>;
2734
+ declare const SyncResetRequiredPayloadSchema: z.ZodObject<{
2735
+ mapName: z.ZodString;
2736
+ reason: z.ZodString;
2737
+ }, z.core.$strip>;
2738
+ type SyncResetRequiredPayload = z.infer<typeof SyncResetRequiredPayloadSchema>;
2739
+ type SyncRespRootPayload = z.infer<typeof SyncRespRootMessageSchema>['payload'];
2740
+ type SyncRespBucketsPayload = z.infer<typeof SyncRespBucketsMessageSchema>['payload'];
2741
+ type SyncRespLeafPayload = z.infer<typeof SyncRespLeafMessageSchema>['payload'];
2742
+ type ORMapSyncRespRootPayload = z.infer<typeof ORMapSyncRespRootSchema>['payload'];
2743
+ type ORMapSyncRespBucketsPayload = z.infer<typeof ORMapSyncRespBucketsSchema>['payload'];
2744
+ type ORMapSyncRespLeafPayload = z.infer<typeof ORMapSyncRespLeafSchema>['payload'];
2745
+ type ORMapDiffResponsePayload = z.infer<typeof ORMapDiffResponseSchema>['payload'];
2746
+
2747
+ /**
2748
+ * Schema for individual sync map entries, specifying which maps the client
2749
+ * wants deltas for and the last known sync HLC timestamp for each.
2750
+ */
2751
+ declare const SyncMapEntrySchema: z.ZodObject<{
2752
+ mapName: z.ZodString;
2753
+ lastSyncTimestamp: z.ZodObject<{
2754
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2755
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2756
+ nodeId: z.ZodString;
2757
+ }, z.core.$strip>;
2758
+ }, z.core.$strip>;
2759
+ /**
2760
+ * Schema for one-shot query requests over HTTP.
2761
+ */
2762
+ declare const HttpQueryRequestSchema: z.ZodObject<{
2763
+ queryId: z.ZodString;
2764
+ mapName: z.ZodString;
2765
+ filter: z.ZodAny;
2766
+ limit: z.ZodOptional<z.ZodNumber>;
2767
+ offset: z.ZodOptional<z.ZodNumber>;
2768
+ }, z.core.$strip>;
2769
+ /**
2770
+ * Schema for one-shot search requests over HTTP.
2771
+ */
2772
+ declare const HttpSearchRequestSchema: z.ZodObject<{
2773
+ searchId: z.ZodString;
2774
+ mapName: z.ZodString;
2775
+ query: z.ZodString;
2776
+ options: z.ZodOptional<z.ZodAny>;
2777
+ }, z.core.$strip>;
2778
+ /**
2779
+ * HTTP sync request body sent by the client as POST /sync.
2780
+ * Contains all context needed for a stateless request: client identity,
2781
+ * HLC state, operations to push, maps to pull deltas for, and queries/searches.
2782
+ */
2783
+ declare const HttpSyncRequestSchema: z.ZodObject<{
2784
+ clientId: z.ZodString;
2785
+ clientHlc: z.ZodObject<{
2786
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2787
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2788
+ nodeId: z.ZodString;
2789
+ }, z.core.$strip>;
2790
+ operations: z.ZodOptional<z.ZodArray<z.ZodObject<{
2791
+ id: z.ZodOptional<z.ZodString>;
2792
+ mapName: z.ZodString;
2793
+ key: z.ZodString;
2794
+ opType: z.ZodOptional<z.ZodString>;
2795
+ record: z.ZodOptional<z.ZodNullable<z.ZodObject<{
2796
+ value: z.ZodNullable<z.ZodAny>;
2797
+ timestamp: z.ZodObject<{
2798
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2799
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2800
+ nodeId: z.ZodString;
2801
+ }, z.core.$strip>;
2802
+ ttlMs: z.ZodOptional<z.ZodNumber>;
2803
+ }, z.core.$strip>>>;
2804
+ orRecord: z.ZodOptional<z.ZodNullable<z.ZodObject<{
2805
+ value: z.ZodAny;
2806
+ timestamp: z.ZodObject<{
2807
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2808
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2809
+ nodeId: z.ZodString;
2810
+ }, z.core.$strip>;
2811
+ tag: z.ZodString;
2812
+ ttlMs: z.ZodOptional<z.ZodNumber>;
2813
+ }, z.core.$strip>>>;
2814
+ orTag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2815
+ writeConcern: z.ZodOptional<z.ZodEnum<{
2816
+ FIRE_AND_FORGET: "FIRE_AND_FORGET";
2817
+ MEMORY: "MEMORY";
2818
+ APPLIED: "APPLIED";
2819
+ REPLICATED: "REPLICATED";
2820
+ PERSISTED: "PERSISTED";
2821
+ }>>;
2822
+ timeout: z.ZodOptional<z.ZodNumber>;
2823
+ }, z.core.$strip>>>;
2824
+ syncMaps: z.ZodOptional<z.ZodArray<z.ZodObject<{
2825
+ mapName: z.ZodString;
2826
+ lastSyncTimestamp: z.ZodObject<{
2827
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2828
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2829
+ nodeId: z.ZodString;
2830
+ }, z.core.$strip>;
2831
+ }, z.core.$strip>>>;
2832
+ queries: z.ZodOptional<z.ZodArray<z.ZodObject<{
2833
+ queryId: z.ZodString;
2834
+ mapName: z.ZodString;
2835
+ filter: z.ZodAny;
2836
+ limit: z.ZodOptional<z.ZodNumber>;
2837
+ offset: z.ZodOptional<z.ZodNumber>;
2838
+ }, z.core.$strip>>>;
2839
+ searches: z.ZodOptional<z.ZodArray<z.ZodObject<{
2840
+ searchId: z.ZodString;
2841
+ mapName: z.ZodString;
2842
+ query: z.ZodString;
2843
+ options: z.ZodOptional<z.ZodAny>;
2844
+ }, z.core.$strip>>>;
2845
+ }, z.core.$strip>;
2846
+ type HttpSyncRequest = z.infer<typeof HttpSyncRequestSchema>;
2847
+ /**
2848
+ * Delta record for a single key within a map.
2849
+ */
2850
+ declare const DeltaRecordSchema: z.ZodObject<{
2851
+ key: z.ZodString;
2852
+ record: z.ZodObject<{
2853
+ value: z.ZodNullable<z.ZodAny>;
2854
+ timestamp: z.ZodObject<{
2855
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2856
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2857
+ nodeId: z.ZodString;
2858
+ }, z.core.$strip>;
2859
+ ttlMs: z.ZodOptional<z.ZodNumber>;
2860
+ }, z.core.$strip>;
2861
+ eventType: z.ZodEnum<{
2862
+ PUT: "PUT";
2863
+ REMOVE: "REMOVE";
2864
+ }>;
2865
+ }, z.core.$strip>;
2866
+ /**
2867
+ * Delta records for a specific map, containing all new/changed records
2868
+ * since the client's lastSyncTimestamp.
2869
+ */
2870
+ declare const MapDeltaSchema: z.ZodObject<{
2871
+ mapName: z.ZodString;
2872
+ records: z.ZodArray<z.ZodObject<{
2873
+ key: z.ZodString;
2874
+ record: z.ZodObject<{
2875
+ value: z.ZodNullable<z.ZodAny>;
2876
+ timestamp: z.ZodObject<{
2877
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2878
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2879
+ nodeId: z.ZodString;
2880
+ }, z.core.$strip>;
2881
+ ttlMs: z.ZodOptional<z.ZodNumber>;
2882
+ }, z.core.$strip>;
2883
+ eventType: z.ZodEnum<{
2884
+ PUT: "PUT";
2885
+ REMOVE: "REMOVE";
2886
+ }>;
2887
+ }, z.core.$strip>>;
2888
+ serverSyncTimestamp: z.ZodObject<{
2889
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2890
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2891
+ nodeId: z.ZodString;
2892
+ }, z.core.$strip>;
2893
+ }, z.core.$strip>;
2894
+ /**
2895
+ * Query result for a one-shot HTTP query.
2896
+ */
2897
+ declare const HttpQueryResultSchema: z.ZodObject<{
2898
+ queryId: z.ZodString;
2899
+ results: z.ZodArray<z.ZodAny>;
2900
+ hasMore: z.ZodOptional<z.ZodBoolean>;
2901
+ nextCursor: z.ZodOptional<z.ZodString>;
2902
+ }, z.core.$strip>;
2450
2903
  /**
2451
- * CLUSTER_SUB_UNREGISTER - Remove a subscription from a node.
2452
- * Sent from coordinator to data-owning nodes when client unsubscribes.
2904
+ * Search result for a one-shot HTTP search.
2453
2905
  */
2454
- declare const ClusterSubUnregisterPayloadSchema: z.ZodObject<{
2455
- subscriptionId: z.ZodString;
2906
+ declare const HttpSearchResultSchema: z.ZodObject<{
2907
+ searchId: z.ZodString;
2908
+ results: z.ZodArray<z.ZodAny>;
2909
+ totalCount: z.ZodOptional<z.ZodNumber>;
2456
2910
  }, z.core.$strip>;
2457
- declare const ClusterSubUnregisterMessageSchema: z.ZodObject<{
2458
- type: z.ZodLiteral<"CLUSTER_SUB_UNREGISTER">;
2459
- payload: z.ZodObject<{
2460
- subscriptionId: z.ZodString;
2911
+ /**
2912
+ * Error entry for individual operation failures.
2913
+ */
2914
+ declare const HttpSyncErrorSchema: z.ZodObject<{
2915
+ code: z.ZodNumber;
2916
+ message: z.ZodString;
2917
+ context: z.ZodOptional<z.ZodString>;
2918
+ }, z.core.$strip>;
2919
+ /**
2920
+ * HTTP sync response returned by the server for POST /sync.
2921
+ * Contains operation acknowledgments, delta records, query/search results,
2922
+ * and the server's current HLC for the client to use in subsequent requests.
2923
+ */
2924
+ declare const HttpSyncResponseSchema: z.ZodObject<{
2925
+ serverHlc: z.ZodObject<{
2926
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2927
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2928
+ nodeId: z.ZodString;
2461
2929
  }, z.core.$strip>;
2930
+ ack: z.ZodOptional<z.ZodObject<{
2931
+ lastId: z.ZodString;
2932
+ results: z.ZodOptional<z.ZodArray<z.ZodObject<{
2933
+ opId: z.ZodString;
2934
+ success: z.ZodBoolean;
2935
+ achievedLevel: z.ZodEnum<{
2936
+ FIRE_AND_FORGET: "FIRE_AND_FORGET";
2937
+ MEMORY: "MEMORY";
2938
+ APPLIED: "APPLIED";
2939
+ REPLICATED: "REPLICATED";
2940
+ PERSISTED: "PERSISTED";
2941
+ }>;
2942
+ error: z.ZodOptional<z.ZodString>;
2943
+ }, z.core.$strip>>>;
2944
+ }, z.core.$strip>>;
2945
+ deltas: z.ZodOptional<z.ZodArray<z.ZodObject<{
2946
+ mapName: z.ZodString;
2947
+ records: z.ZodArray<z.ZodObject<{
2948
+ key: z.ZodString;
2949
+ record: z.ZodObject<{
2950
+ value: z.ZodNullable<z.ZodAny>;
2951
+ timestamp: z.ZodObject<{
2952
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2953
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2954
+ nodeId: z.ZodString;
2955
+ }, z.core.$strip>;
2956
+ ttlMs: z.ZodOptional<z.ZodNumber>;
2957
+ }, z.core.$strip>;
2958
+ eventType: z.ZodEnum<{
2959
+ PUT: "PUT";
2960
+ REMOVE: "REMOVE";
2961
+ }>;
2962
+ }, z.core.$strip>>;
2963
+ serverSyncTimestamp: z.ZodObject<{
2964
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2965
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2966
+ nodeId: z.ZodString;
2967
+ }, z.core.$strip>;
2968
+ }, z.core.$strip>>>;
2969
+ queryResults: z.ZodOptional<z.ZodArray<z.ZodObject<{
2970
+ queryId: z.ZodString;
2971
+ results: z.ZodArray<z.ZodAny>;
2972
+ hasMore: z.ZodOptional<z.ZodBoolean>;
2973
+ nextCursor: z.ZodOptional<z.ZodString>;
2974
+ }, z.core.$strip>>>;
2975
+ searchResults: z.ZodOptional<z.ZodArray<z.ZodObject<{
2976
+ searchId: z.ZodString;
2977
+ results: z.ZodArray<z.ZodAny>;
2978
+ totalCount: z.ZodOptional<z.ZodNumber>;
2979
+ }, z.core.$strip>>>;
2980
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
2981
+ code: z.ZodNumber;
2982
+ message: z.ZodString;
2983
+ context: z.ZodOptional<z.ZodString>;
2984
+ }, z.core.$strip>>>;
2462
2985
  }, z.core.$strip>;
2986
+ type HttpSyncResponse = z.infer<typeof HttpSyncResponseSchema>;
2987
+
2463
2988
  declare const MessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2464
2989
  type: z.ZodLiteral<"AUTH">;
2465
2990
  token: z.ZodString;
@@ -3015,214 +3540,16 @@ declare const MessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3015
3540
  changeType: z.ZodEnum<{
3016
3541
  UPDATE: "UPDATE";
3017
3542
  ENTER: "ENTER";
3018
- LEAVE: "LEAVE";
3019
- }>;
3020
- timestamp: z.ZodNumber;
3021
- }, z.core.$strip>;
3022
- }, z.core.$strip>, z.ZodObject<{
3023
- type: z.ZodLiteral<"CLUSTER_SUB_UNREGISTER">;
3024
- payload: z.ZodObject<{
3025
- subscriptionId: z.ZodString;
3026
- }, z.core.$strip>;
3027
- }, z.core.$strip>], "type">;
3028
- type Query$1 = z.infer<typeof QuerySchema>;
3029
- type ClientOp = z.infer<typeof ClientOpSchema>;
3030
- type Message = z.infer<typeof MessageSchema>;
3031
- type PingMessage = z.infer<typeof PingMessageSchema>;
3032
- type PongMessage = z.infer<typeof PongMessageSchema>;
3033
- type BatchMessage = z.infer<typeof BatchMessageSchema>;
3034
- type OpAckMessage = z.infer<typeof OpAckMessageSchema>;
3035
- type OpRejectedMessage = z.infer<typeof OpRejectedMessageSchema>;
3036
- type OpResult = z.infer<typeof OpResultSchema>;
3037
- type EntryProcessRequest = z.infer<typeof EntryProcessRequestSchema>;
3038
- type EntryProcessBatchRequest = z.infer<typeof EntryProcessBatchRequestSchema>;
3039
- type EntryProcessResponse = z.infer<typeof EntryProcessResponseSchema>;
3040
- type EntryProcessBatchResponse = z.infer<typeof EntryProcessBatchResponseSchema>;
3041
- type EntryProcessKeyResult = z.infer<typeof EntryProcessKeyResultSchema>;
3042
- type JournalEventData = z.infer<typeof JournalEventDataSchema>;
3043
- type JournalSubscribeRequest = z.infer<typeof JournalSubscribeRequestSchema>;
3044
- type JournalUnsubscribeRequest = z.infer<typeof JournalUnsubscribeRequestSchema>;
3045
- type JournalEventMessage = z.infer<typeof JournalEventMessageSchema>;
3046
- type JournalReadRequest = z.infer<typeof JournalReadRequestSchema>;
3047
- type JournalReadResponse = z.infer<typeof JournalReadResponseSchema>;
3048
- type ConflictResolver = z.infer<typeof ConflictResolverSchema>;
3049
- type RegisterResolverRequest = z.infer<typeof RegisterResolverRequestSchema>;
3050
- type RegisterResolverResponse = z.infer<typeof RegisterResolverResponseSchema>;
3051
- type UnregisterResolverRequest = z.infer<typeof UnregisterResolverRequestSchema>;
3052
- type UnregisterResolverResponse = z.infer<typeof UnregisterResolverResponseSchema>;
3053
- type MergeRejectedMessage = z.infer<typeof MergeRejectedMessageSchema>;
3054
- type ListResolversRequest = z.infer<typeof ListResolversRequestSchema>;
3055
- type ListResolversResponse = z.infer<typeof ListResolversResponseSchema>;
3056
- type SearchOptions$1 = z.infer<typeof SearchOptionsSchema>;
3057
- type SearchPayload = z.infer<typeof SearchPayloadSchema>;
3058
- type SearchMessage = z.infer<typeof SearchMessageSchema>;
3059
- type SearchRespPayload = z.infer<typeof SearchRespPayloadSchema>;
3060
- type SearchRespMessage = z.infer<typeof SearchRespMessageSchema>;
3061
- type SearchUpdateType = z.infer<typeof SearchUpdateTypeSchema>;
3062
- type SearchSubPayload = z.infer<typeof SearchSubPayloadSchema>;
3063
- type SearchSubMessage = z.infer<typeof SearchSubMessageSchema>;
3064
- type SearchUpdatePayload = z.infer<typeof SearchUpdatePayloadSchema>;
3065
- type SearchUpdateMessage = z.infer<typeof SearchUpdateMessageSchema>;
3066
- type SearchUnsubPayload = z.infer<typeof SearchUnsubPayloadSchema>;
3067
- type SearchUnsubMessage = z.infer<typeof SearchUnsubMessageSchema>;
3068
- /**
3069
- * CLUSTER_SEARCH_REQ: Broadcast search request to cluster nodes.
3070
- * Sent from coordinator to data-owning nodes.
3071
- */
3072
- declare const ClusterSearchReqPayloadSchema: z.ZodObject<{
3073
- requestId: z.ZodString;
3074
- mapName: z.ZodString;
3075
- query: z.ZodString;
3076
- options: z.ZodObject<{
3077
- limit: z.ZodNumber;
3078
- minScore: z.ZodOptional<z.ZodNumber>;
3079
- boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
3080
- includeMatchedTerms: z.ZodOptional<z.ZodBoolean>;
3081
- afterScore: z.ZodOptional<z.ZodNumber>;
3082
- afterKey: z.ZodOptional<z.ZodString>;
3083
- }, z.core.$strip>;
3084
- timeoutMs: z.ZodOptional<z.ZodNumber>;
3085
- }, z.core.$strip>;
3086
- declare const ClusterSearchReqMessageSchema: z.ZodObject<{
3087
- type: z.ZodLiteral<"CLUSTER_SEARCH_REQ">;
3088
- payload: z.ZodObject<{
3089
- requestId: z.ZodString;
3090
- mapName: z.ZodString;
3091
- query: z.ZodString;
3092
- options: z.ZodObject<{
3093
- limit: z.ZodNumber;
3094
- minScore: z.ZodOptional<z.ZodNumber>;
3095
- boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
3096
- includeMatchedTerms: z.ZodOptional<z.ZodBoolean>;
3097
- afterScore: z.ZodOptional<z.ZodNumber>;
3098
- afterKey: z.ZodOptional<z.ZodString>;
3099
- }, z.core.$strip>;
3100
- timeoutMs: z.ZodOptional<z.ZodNumber>;
3101
- }, z.core.$strip>;
3102
- }, z.core.$strip>;
3103
- /**
3104
- * CLUSTER_SEARCH_RESP: Response from a node with local search results.
3105
- */
3106
- declare const ClusterSearchRespPayloadSchema: z.ZodObject<{
3107
- requestId: z.ZodString;
3108
- nodeId: z.ZodString;
3109
- results: z.ZodArray<z.ZodObject<{
3110
- key: z.ZodString;
3111
- value: z.ZodUnknown;
3112
- score: z.ZodNumber;
3113
- matchedTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
3114
- }, z.core.$strip>>;
3115
- totalHits: z.ZodNumber;
3116
- executionTimeMs: z.ZodNumber;
3117
- error: z.ZodOptional<z.ZodString>;
3118
- }, z.core.$strip>;
3119
- declare const ClusterSearchRespMessageSchema: z.ZodObject<{
3120
- type: z.ZodLiteral<"CLUSTER_SEARCH_RESP">;
3121
- payload: z.ZodObject<{
3122
- requestId: z.ZodString;
3123
- nodeId: z.ZodString;
3124
- results: z.ZodArray<z.ZodObject<{
3125
- key: z.ZodString;
3126
- value: z.ZodUnknown;
3127
- score: z.ZodNumber;
3128
- matchedTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
3129
- }, z.core.$strip>>;
3130
- totalHits: z.ZodNumber;
3131
- executionTimeMs: z.ZodNumber;
3132
- error: z.ZodOptional<z.ZodString>;
3133
- }, z.core.$strip>;
3134
- }, z.core.$strip>;
3135
- /**
3136
- * CLUSTER_SEARCH_SUBSCRIBE: Live distributed search subscription.
3137
- */
3138
- declare const ClusterSearchSubscribePayloadSchema: z.ZodObject<{
3139
- subscriptionId: z.ZodString;
3140
- mapName: z.ZodString;
3141
- query: z.ZodString;
3142
- options: z.ZodOptional<z.ZodObject<{
3143
- limit: z.ZodOptional<z.ZodNumber>;
3144
- minScore: z.ZodOptional<z.ZodNumber>;
3145
- boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
3146
- }, z.core.$strip>>;
3147
- }, z.core.$strip>;
3148
- declare const ClusterSearchSubscribeMessageSchema: z.ZodObject<{
3149
- type: z.ZodLiteral<"CLUSTER_SEARCH_SUBSCRIBE">;
3150
- payload: z.ZodObject<{
3151
- subscriptionId: z.ZodString;
3152
- mapName: z.ZodString;
3153
- query: z.ZodString;
3154
- options: z.ZodOptional<z.ZodObject<{
3155
- limit: z.ZodOptional<z.ZodNumber>;
3156
- minScore: z.ZodOptional<z.ZodNumber>;
3157
- boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
3158
- }, z.core.$strip>>;
3159
- }, z.core.$strip>;
3160
- }, z.core.$strip>;
3161
- /**
3162
- * CLUSTER_SEARCH_UNSUBSCRIBE: Unsubscribe from distributed search.
3163
- */
3164
- declare const ClusterSearchUnsubscribePayloadSchema: z.ZodObject<{
3165
- subscriptionId: z.ZodString;
3166
- }, z.core.$strip>;
3167
- declare const ClusterSearchUnsubscribeMessageSchema: z.ZodObject<{
3168
- type: z.ZodLiteral<"CLUSTER_SEARCH_UNSUBSCRIBE">;
3169
- payload: z.ZodObject<{
3170
- subscriptionId: z.ZodString;
3171
- }, z.core.$strip>;
3172
- }, z.core.$strip>;
3173
- /**
3174
- * CLUSTER_SEARCH_UPDATE: Delta update for live distributed search.
3175
- */
3176
- declare const ClusterSearchUpdatePayloadSchema: z.ZodObject<{
3177
- subscriptionId: z.ZodString;
3178
- nodeId: z.ZodString;
3179
- key: z.ZodString;
3180
- value: z.ZodUnknown;
3181
- score: z.ZodNumber;
3182
- matchedTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
3183
- type: z.ZodEnum<{
3184
- UPDATE: "UPDATE";
3185
- ENTER: "ENTER";
3186
- LEAVE: "LEAVE";
3187
- }>;
3188
- }, z.core.$strip>;
3189
- declare const ClusterSearchUpdateMessageSchema: z.ZodObject<{
3190
- type: z.ZodLiteral<"CLUSTER_SEARCH_UPDATE">;
3191
- payload: z.ZodObject<{
3192
- subscriptionId: z.ZodString;
3193
- nodeId: z.ZodString;
3194
- key: z.ZodString;
3195
- value: z.ZodUnknown;
3196
- score: z.ZodNumber;
3197
- matchedTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
3198
- type: z.ZodEnum<{
3199
- UPDATE: "UPDATE";
3200
- ENTER: "ENTER";
3201
- LEAVE: "LEAVE";
3202
- }>;
3203
- }, z.core.$strip>;
3204
- }, z.core.$strip>;
3205
- type ClusterSearchReqPayload = z.infer<typeof ClusterSearchReqPayloadSchema>;
3206
- type ClusterSearchReqMessage = z.infer<typeof ClusterSearchReqMessageSchema>;
3207
- type ClusterSearchRespPayload = z.infer<typeof ClusterSearchRespPayloadSchema>;
3208
- type ClusterSearchRespMessage = z.infer<typeof ClusterSearchRespMessageSchema>;
3209
- type ClusterSearchSubscribePayload = z.infer<typeof ClusterSearchSubscribePayloadSchema>;
3210
- type ClusterSearchSubscribeMessage = z.infer<typeof ClusterSearchSubscribeMessageSchema>;
3211
- type ClusterSearchUnsubscribePayload = z.infer<typeof ClusterSearchUnsubscribePayloadSchema>;
3212
- type ClusterSearchUnsubscribeMessage = z.infer<typeof ClusterSearchUnsubscribeMessageSchema>;
3213
- type ClusterSearchUpdatePayload = z.infer<typeof ClusterSearchUpdatePayloadSchema>;
3214
- type ClusterSearchUpdateMessage = z.infer<typeof ClusterSearchUpdateMessageSchema>;
3215
- type ClusterSubRegisterPayload = z.infer<typeof ClusterSubRegisterPayloadSchema>;
3216
- type ClusterSubRegisterMessage = z.infer<typeof ClusterSubRegisterMessageSchema>;
3217
- type ClusterSubAckPayload = z.infer<typeof ClusterSubAckPayloadSchema>;
3218
- type ClusterSubAckMessage = z.infer<typeof ClusterSubAckMessageSchema>;
3219
- type ClusterSubUpdatePayload = z.infer<typeof ClusterSubUpdatePayloadSchema>;
3220
- type ClusterSubUpdateMessage = z.infer<typeof ClusterSubUpdateMessageSchema>;
3221
- type ClusterSubUnregisterPayload = z.infer<typeof ClusterSubUnregisterPayloadSchema>;
3222
- type ClusterSubUnregisterMessage = z.infer<typeof ClusterSubUnregisterMessageSchema>;
3223
- type CursorStatus$1 = z.infer<typeof CursorStatusSchema>;
3224
- type QueryRespPayload = z.infer<typeof QueryRespPayloadSchema>;
3225
- type QueryRespMessage = z.infer<typeof QueryRespMessageSchema>;
3543
+ LEAVE: "LEAVE";
3544
+ }>;
3545
+ timestamp: z.ZodNumber;
3546
+ }, z.core.$strip>;
3547
+ }, z.core.$strip>, z.ZodObject<{
3548
+ type: z.ZodLiteral<"CLUSTER_SUB_UNREGISTER">;
3549
+ payload: z.ZodObject<{
3550
+ subscriptionId: z.ZodString;
3551
+ }, z.core.$strip>;
3552
+ }, z.core.$strip>], "type">;
3226
3553
 
3227
3554
  /**
3228
3555
  * Write Concern - Configurable Acknowledgment Levels
@@ -3351,7 +3678,7 @@ declare function isWriteConcernAchieved(achieved: Set<WriteConcern>, target: Wri
3351
3678
  declare function getHighestWriteConcernLevel(achieved: Set<WriteConcern>): WriteConcern;
3352
3679
 
3353
3680
  /**
3354
- * Cluster types for Phase 4: Clustering Improvements
3681
+ * Cluster types
3355
3682
  *
3356
3683
  * These types are shared between client and server packages
3357
3684
  * for partition-aware routing and cluster communication.
@@ -4330,14 +4657,36 @@ interface QueryOptions {
4330
4657
  sort?: Record<string, 'asc' | 'desc'>;
4331
4658
  /** Maximum number of results to return */
4332
4659
  limit?: number;
4333
- /** Cursor for pagination (Phase 14.1: replaces offset) */
4660
+ /** Cursor for pagination (replaces offset) */
4334
4661
  cursor?: string;
4662
+ /** Force use of an index on this attribute name. Throws if no index exists for the attribute. */
4663
+ useIndex?: string;
4664
+ /** Require that the query plan uses at least one index. Throws if plan would be a full scan. */
4665
+ forceIndexScan?: boolean;
4666
+ /** Skip all optimization; produce a full-scan plan. Useful for debugging. */
4667
+ disableOptimization?: boolean;
4668
+ }
4669
+ /**
4670
+ * Point lookup step - O(1) direct key access.
4671
+ */
4672
+ interface PointLookupStep {
4673
+ type: 'point-lookup';
4674
+ key: unknown;
4675
+ cost: number;
4676
+ }
4677
+ /**
4678
+ * Multi-point lookup step - O(k) direct key access for k keys.
4679
+ */
4680
+ interface MultiPointLookupStep {
4681
+ type: 'multi-point-lookup';
4682
+ keys: unknown[];
4683
+ cost: number;
4335
4684
  }
4336
4685
  /**
4337
4686
  * Execution plan step.
4338
4687
  * Represents a single operation in the query execution plan.
4339
4688
  */
4340
- type PlanStep = IndexScanStep | FullScanStep | IntersectionStep | UnionStep | FilterStep | NotStep | FTSScanStep | FusionStep;
4689
+ type PlanStep = PointLookupStep | MultiPointLookupStep | IndexScanStep | FullScanStep | IntersectionStep | UnionStep | FilterStep | NotStep | FTSScanStep | FusionStep;
4341
4690
  /**
4342
4691
  * Index scan step - retrieves from an index.
4343
4692
  */
@@ -4437,9 +4786,58 @@ interface QueryPlan {
4437
4786
  };
4438
4787
  /** Limit configuration */
4439
4788
  limit?: number;
4440
- /** Cursor for pagination (Phase 14.1: replaces offset) */
4789
+ /** Cursor for pagination (replaces offset) */
4441
4790
  cursor?: string;
4442
- }
4791
+ /** Index hint that was applied (attribute name from useIndex option) */
4792
+ hint?: string;
4793
+ }
4794
+ /**
4795
+ * Query execution context for distributed cost estimation.
4796
+ */
4797
+ interface QueryContext {
4798
+ /** Whether query executes in distributed mode */
4799
+ isDistributed: boolean;
4800
+ /** Number of nodes in cluster */
4801
+ nodeCount: number;
4802
+ /** Whether query uses PostgreSQL storage */
4803
+ usesStorage: boolean;
4804
+ /** Local node ID for partition ownership checks */
4805
+ localNodeId?: string;
4806
+ /** Partition ownership map: partitionId -> ownerNodeId */
4807
+ partitionOwners?: Map<number, string>;
4808
+ }
4809
+ /**
4810
+ * Distributed query cost model.
4811
+ * Inspired by Hazelcast CostUtils.java
4812
+ */
4813
+ interface DistributedCost {
4814
+ /** Estimated number of rows */
4815
+ rows: number;
4816
+ /** CPU cost (computation) */
4817
+ cpu: number;
4818
+ /** Network cost (data transfer between nodes) */
4819
+ network: number;
4820
+ /** I/O cost (disk reads for PostgreSQL) */
4821
+ io: number;
4822
+ }
4823
+ /**
4824
+ * Cost multipliers for distributed query optimization.
4825
+ * Network is weighted 10x higher than CPU because network latency
4826
+ * typically dominates query execution time in distributed systems.
4827
+ */
4828
+ declare const COST_WEIGHTS: {
4829
+ readonly CPU: 1;
4830
+ readonly NETWORK: 10;
4831
+ readonly IO: 5;
4832
+ readonly ROWS: 0.001;
4833
+ };
4834
+ /**
4835
+ * Calculate total cost from distributed cost components.
4836
+ *
4837
+ * @param cost - Distributed cost breakdown
4838
+ * @returns Weighted total cost
4839
+ */
4840
+ declare function calculateTotalCost(cost: DistributedCost): number;
4443
4841
  /**
4444
4842
  * Check if a query is a simple query node.
4445
4843
  */
@@ -4952,7 +5350,7 @@ declare class InvertedIndex<K, V, A extends string = string> implements Index<K,
4952
5350
  }
4953
5351
 
4954
5352
  /**
4955
- * CompoundIndex Implementation (Phase 9.03)
5353
+ * CompoundIndex Implementation
4956
5354
  *
4957
5355
  * Multi-attribute index for optimizing AND queries.
4958
5356
  * Creates a composite key from multiple attribute values for O(1) lookup.
@@ -5096,7 +5494,7 @@ interface CompoundIndexStats extends IndexStats {
5096
5494
  }
5097
5495
 
5098
5496
  /**
5099
- * Types for Adaptive Indexing System (Phase 8.02)
5497
+ * Types for Adaptive Indexing System
5100
5498
  *
5101
5499
  * Defines interfaces for query pattern tracking, index suggestions,
5102
5500
  * and auto-indexing configuration.
@@ -5130,7 +5528,7 @@ interface QueryStatistics {
5130
5528
  hasIndex: boolean;
5131
5529
  }
5132
5530
  /**
5133
- * Statistics for compound query patterns (Phase 9.03).
5531
+ * * Statistics for compound query patterns.
5134
5532
  * Tracks AND combinations of attributes for compound index suggestions.
5135
5533
  */
5136
5534
  interface CompoundQueryStatistics {
@@ -5238,7 +5636,7 @@ interface AdaptiveIndexingConfig {
5238
5636
  autoIndex?: AutoIndexConfig;
5239
5637
  }
5240
5638
  /**
5241
- * Progress callback for lazy index building (Phase 9.01).
5639
+ * * Progress callback for lazy index building.
5242
5640
  */
5243
5641
  type IndexBuildProgressCallback = (attributeName: string, progress: number, // 0-100
5244
5642
  recordsProcessed: number, totalRecords: number) => void;
@@ -5251,13 +5649,13 @@ interface IndexedMapOptions {
5251
5649
  /** Default indexing strategy (default: 'none') */
5252
5650
  defaultIndexing?: DefaultIndexingStrategy;
5253
5651
  /**
5254
- * Enable lazy index building (Phase 9.01).
5652
+ * Enable lazy index building.
5255
5653
  * When true, indexes are not built until first query.
5256
5654
  * Default: false
5257
5655
  */
5258
5656
  lazyIndexBuilding?: boolean;
5259
5657
  /**
5260
- * Callback for index building progress (Phase 9.01).
5658
+ * Callback for index building progress.
5261
5659
  * Called during lazy index materialization.
5262
5660
  */
5263
5661
  onIndexBuilding?: IndexBuildProgressCallback;
@@ -5266,7 +5664,7 @@ interface IndexedMapOptions {
5266
5664
  /**
5267
5665
  * Lazy Index Types
5268
5666
  *
5269
- * Types and interfaces for lazy index building (Phase 9.01).
5667
+ * Types and interfaces for lazy index building.
5270
5668
  * Lazy indexes defer actual index construction until first query.
5271
5669
  *
5272
5670
  * @module query/indexes/lazy/types
@@ -5315,7 +5713,7 @@ interface LazyIndexOptions {
5315
5713
  /**
5316
5714
  * LazyHashIndex Implementation
5317
5715
  *
5318
- * Hash-based index with deferred building (Phase 9.01).
5716
+ * Hash-based index with deferred building.
5319
5717
  * Records are buffered until first query, then index is materialized.
5320
5718
  *
5321
5719
  * Benefits:
@@ -5372,7 +5770,7 @@ declare class LazyHashIndex<K, V, A> implements LazyIndex<K, V, A> {
5372
5770
  /**
5373
5771
  * LazyNavigableIndex Implementation
5374
5772
  *
5375
- * Sorted index with deferred building (Phase 9.01).
5773
+ * Sorted index with deferred building.
5376
5774
  * Records are buffered until first query, then index is materialized.
5377
5775
  *
5378
5776
  * Benefits:
@@ -5441,7 +5839,7 @@ declare class LazyNavigableIndex<K, V, A extends string | number> implements Laz
5441
5839
  /**
5442
5840
  * LazyInvertedIndex Implementation
5443
5841
  *
5444
- * Full-text search index with deferred building (Phase 9.01).
5842
+ * Full-text search index with deferred building.
5445
5843
  * Records are buffered until first query, then index is materialized.
5446
5844
  *
5447
5845
  * Benefits:
@@ -6487,7 +6885,7 @@ declare function createFieldComparator<V>(field: string, direction: 'asc' | 'des
6487
6885
  * Implements early termination for efficiency.
6488
6886
  *
6489
6887
  * NOTE: The offset parameter is intentionally retained in this internal component
6490
- * even though Phase 14.1 replaced offset with cursor-based pagination in the query API.
6888
+ * even though cursor-based pagination replaced offset in the query API.
6491
6889
  * This class is used internally by:
6492
6890
  * - EventJournalService (SQL queries require numeric offset)
6493
6891
  * - Index result set operations where offset is computed internally
@@ -6579,7 +6977,7 @@ declare class LimitResultSet<K> implements ResultSet<K> {
6579
6977
  declare class IndexRegistry<K, V> {
6580
6978
  /** Indexes grouped by attribute name */
6581
6979
  private attributeIndexes;
6582
- /** Compound indexes (Phase 9.03) - keyed by sorted attribute names */
6980
+ /** Compound indexes - keyed by sorted attribute names */
6583
6981
  private compoundIndexes;
6584
6982
  /** Fallback index for full scan (optional) */
6585
6983
  private fallbackIndex;
@@ -6591,7 +6989,7 @@ declare class IndexRegistry<K, V> {
6591
6989
  */
6592
6990
  addIndex<A>(index: Index<K, V, A>): void;
6593
6991
  /**
6594
- * Register a compound index (Phase 9.03).
6992
+ * Register a compound index.
6595
6993
  *
6596
6994
  * @param index - Compound index to register
6597
6995
  */
@@ -6604,7 +7002,7 @@ declare class IndexRegistry<K, V> {
6604
7002
  */
6605
7003
  removeIndex<A>(index: Index<K, V, A>): boolean;
6606
7004
  /**
6607
- * Remove a compound index (Phase 9.03).
7005
+ * Remove a compound index.
6608
7006
  *
6609
7007
  * @param index - Compound index to remove
6610
7008
  * @returns true if index was found and removed
@@ -6654,7 +7052,7 @@ declare class IndexRegistry<K, V> {
6654
7052
  */
6655
7053
  findIndexes(attributeName: string, queryType: string): Index<K, V, unknown>[];
6656
7054
  /**
6657
- * Find a compound index that covers the given attribute names (Phase 9.03).
7055
+ * Find a compound index that covers the given attribute names.
6658
7056
  * The compound index must cover ALL the attributes (exact match or superset).
6659
7057
  *
6660
7058
  * @param attributeNames - Array of attribute names to search for
@@ -6662,14 +7060,14 @@ declare class IndexRegistry<K, V> {
6662
7060
  */
6663
7061
  findCompoundIndex(attributeNames: string[]): CompoundIndex<K, V> | null;
6664
7062
  /**
6665
- * Check if a compound index exists for the given attributes (Phase 9.03).
7063
+ * Check if a compound index exists for the given attributes.
6666
7064
  *
6667
7065
  * @param attributeNames - Array of attribute names
6668
7066
  * @returns true if a compound index exists
6669
7067
  */
6670
7068
  hasCompoundIndex(attributeNames: string[]): boolean;
6671
7069
  /**
6672
- * Get all compound indexes (Phase 9.03).
7070
+ * Get all compound indexes.
6673
7071
  *
6674
7072
  * @returns Array of all compound indexes
6675
7073
  */
@@ -6738,7 +7136,7 @@ interface IndexRegistryStats {
6738
7136
  totalIndexes: number;
6739
7137
  /** Number of indexed attributes */
6740
7138
  indexedAttributes: number;
6741
- /** Number of compound indexes (Phase 9.03) */
7139
+ /** Number of compound indexes */
6742
7140
  compoundIndexes?: number;
6743
7141
  /** Stats for each index */
6744
7142
  indexes: Array<{
@@ -6931,7 +7329,7 @@ interface QueryOptimizerOptions<K, V> {
6931
7329
  indexRegistry: IndexRegistry<K, V>;
6932
7330
  /** Standing query registry for pre-computed queries (optional) */
6933
7331
  standingQueryRegistry?: StandingQueryRegistry<K, V>;
6934
- /** Full-text index registry for FTS queries (Phase 12) */
7332
+ /** Full-text index registry for FTS queries */
6935
7333
  fullTextIndexes?: Map<string, FullTextIndex>;
6936
7334
  }
6937
7335
  /**
@@ -6960,32 +7358,31 @@ declare class QueryOptimizer<K, V> {
6960
7358
  /**
6961
7359
  * Create a QueryOptimizer.
6962
7360
  *
6963
- * @param indexRegistryOrOptions - IndexRegistry or options object
6964
- * @param standingQueryRegistry - Optional StandingQueryRegistry (deprecated, use options)
7361
+ * @param options - QueryOptimizer options
6965
7362
  */
6966
- constructor(indexRegistryOrOptions: IndexRegistry<K, V> | QueryOptimizerOptions<K, V>, standingQueryRegistry?: StandingQueryRegistry<K, V>);
7363
+ constructor(options: QueryOptimizerOptions<K, V>);
6967
7364
  /**
6968
- * Register a full-text index for a field (Phase 12).
7365
+ * Register a full-text index for a field.
6969
7366
  *
6970
7367
  * @param field - Field name
6971
7368
  * @param index - FullTextIndex instance
6972
7369
  */
6973
7370
  registerFullTextIndex(field: string, index: FullTextIndex): void;
6974
7371
  /**
6975
- * Unregister a full-text index (Phase 12).
7372
+ * Unregister a full-text index.
6976
7373
  *
6977
7374
  * @param field - Field name
6978
7375
  */
6979
7376
  unregisterFullTextIndex(field: string): void;
6980
7377
  /**
6981
- * Get registered full-text index for a field (Phase 12).
7378
+ * Get registered full-text index for a field.
6982
7379
  *
6983
7380
  * @param field - Field name
6984
7381
  * @returns FullTextIndex or undefined
6985
7382
  */
6986
7383
  getFullTextIndex(field: string): FullTextIndex | undefined;
6987
7384
  /**
6988
- * Check if a full-text index exists for a field (Phase 12).
7385
+ * Check if a full-text index exists for a field.
6989
7386
  *
6990
7387
  * @param field - Field name
6991
7388
  * @returns True if FTS index exists
@@ -6995,46 +7392,79 @@ declare class QueryOptimizer<K, V> {
6995
7392
  * Optimize a query and return an execution plan.
6996
7393
  *
6997
7394
  * Optimization order (by cost):
6998
- * 1. StandingQueryIndex (cost: 10) - pre-computed results
6999
- * 2. Other indexes via optimizeNode
7395
+ * 1. Point lookup (cost: 1) - direct primary key access
7396
+ * 2. StandingQueryIndex (cost: 10) - pre-computed results
7397
+ * 3. Other indexes via optimizeNode
7000
7398
  *
7001
7399
  * @param query - Query to optimize
7002
7400
  * @returns Query execution plan
7003
7401
  */
7004
7402
  optimize(query: Query): QueryPlan;
7005
7403
  /**
7006
- * Optimize a query with sort/limit/offset options.
7404
+ * Optimize a query with sort/limit/offset options and index hints.
7405
+ *
7406
+ * Hint precedence: disableOptimization > useIndex > forceIndexScan.
7007
7407
  *
7008
7408
  * @param query - Query to optimize
7009
- * @param options - Query options (sort, limit, offset)
7409
+ * @param options - Query options (sort, limit, cursor, hints)
7010
7410
  * @returns Query execution plan with options
7011
7411
  */
7012
7412
  optimizeWithOptions(query: Query, options: QueryOptions): QueryPlan;
7413
+ /**
7414
+ * Apply sort/limit/cursor options to a query plan.
7415
+ *
7416
+ * @param plan - Base query plan
7417
+ * @param options - Query options with sort/limit/cursor
7418
+ * @returns Plan with options applied
7419
+ */
7420
+ private applyPlanOptions;
7421
+ /**
7422
+ * Extract the relevant index query for a hinted attribute from the query tree.
7423
+ * If the query directly references the attribute, build an index query from it.
7424
+ * For compound (logical) queries, extract the matching child predicate.
7425
+ * Falls back to { type: 'has' } when no matching predicate is found,
7426
+ * retrieving all entries from the index for post-filtering.
7427
+ * FTS query nodes also fall back to { type: 'has' } since full-text search
7428
+ * queries are not compatible with regular index lookups.
7429
+ *
7430
+ * @param query - Original query tree
7431
+ * @param attributeName - Hinted attribute name
7432
+ * @returns Index query for the hinted attribute
7433
+ */
7434
+ private buildHintedIndexQuery;
7435
+ /**
7436
+ * Try to optimize query as a point lookup.
7437
+ * Returns a point lookup step if query is an equality or IN query on primary key.
7438
+ *
7439
+ * @param query - Query to check
7440
+ * @returns Point lookup step or null
7441
+ */
7442
+ private tryPointLookup;
7013
7443
  /**
7014
7444
  * Optimize a single query node.
7015
7445
  */
7016
7446
  private optimizeNode;
7017
7447
  /**
7018
- * Optimize a full-text search query (Phase 12).
7448
+ * Optimize a full-text search query.
7019
7449
  */
7020
7450
  private optimizeFTS;
7021
7451
  /**
7022
- * Build an FTS scan step from a query node (Phase 12).
7452
+ * Build an FTS scan step from a query node.
7023
7453
  */
7024
7454
  private buildFTSScanStep;
7025
7455
  /**
7026
- * Estimate cost of FTS query based on index size (Phase 12).
7456
+ * Estimate cost of FTS query based on index size.
7027
7457
  */
7028
7458
  private estimateFTSCost;
7029
7459
  /**
7030
- * Classify predicates by type for hybrid query planning (Phase 12).
7460
+ * Classify predicates by type for hybrid query planning.
7031
7461
  *
7032
7462
  * @param predicates - Array of predicates to classify
7033
7463
  * @returns Classified predicates
7034
7464
  */
7035
7465
  classifyPredicates(predicates: Query[]): ClassifiedPredicates;
7036
7466
  /**
7037
- * Determine fusion strategy based on step types (Phase 12).
7467
+ * Determine fusion strategy based on step types.
7038
7468
  *
7039
7469
  * Strategy selection:
7040
7470
  * - All binary (exact/range with no scores) → 'intersection'
@@ -7046,7 +7476,7 @@ declare class QueryOptimizer<K, V> {
7046
7476
  */
7047
7477
  determineFusionStrategy(steps: PlanStep[]): FusionStrategy;
7048
7478
  /**
7049
- * Check if a plan step returns scored results (Phase 12).
7479
+ * Check if a plan step returns scored results.
7050
7480
  */
7051
7481
  private stepReturnsScored;
7052
7482
  /**
@@ -7062,14 +7492,14 @@ declare class QueryOptimizer<K, V> {
7062
7492
  * Strategy: Find child with lowest cost, use as base, filter with rest.
7063
7493
  *
7064
7494
  * CQEngine "smallest first" strategy:
7065
- * 1. Check for CompoundIndex covering all eq children (Phase 9.03)
7495
+ * 1. Check for CompoundIndex covering all eq children
7066
7496
  * 2. Sort children by merge cost
7067
7497
  * 3. Use intersection if multiple indexes available
7068
7498
  * 4. Apply remaining predicates as filters
7069
7499
  */
7070
7500
  private optimizeAnd;
7071
7501
  /**
7072
- * Try to use a CompoundIndex for an AND query (Phase 9.03).
7502
+ * Try to use a CompoundIndex for an AND query.
7073
7503
  *
7074
7504
  * Returns a compound index scan step if:
7075
7505
  * 1. All children are simple 'eq' queries
@@ -7110,6 +7540,29 @@ declare class QueryOptimizer<K, V> {
7110
7540
  * Estimate the execution cost of a plan step.
7111
7541
  */
7112
7542
  private estimateCost;
7543
+ /**
7544
+ * Estimate distributed cost including network overhead.
7545
+ *
7546
+ * Network cost is assigned based on step type:
7547
+ * - full-scan: broadcast to all nodes (highest cost)
7548
+ * - index-scan: 0 if local partition, 5 if remote
7549
+ * - point-lookup: 0 if local key, 5 if remote
7550
+ * - intersection/union: aggregating results from multiple sources
7551
+ *
7552
+ * @param step - Plan step to estimate
7553
+ * @param context - Distributed query context (optional)
7554
+ * @returns Distributed cost breakdown
7555
+ */
7556
+ estimateDistributedCost(step: PlanStep, context?: QueryContext): DistributedCost;
7557
+ /**
7558
+ * Get total distributed cost for a plan step.
7559
+ * Convenience method combining estimateDistributedCost and calculateTotalCost.
7560
+ *
7561
+ * @param step - Plan step to estimate
7562
+ * @param context - Distributed query context (optional)
7563
+ * @returns Weighted total cost
7564
+ */
7565
+ getTotalDistributedCost(step: PlanStep, context?: QueryContext): number;
7113
7566
  /**
7114
7567
  * Check if a plan step uses any indexes.
7115
7568
  */
@@ -7274,7 +7727,7 @@ interface LiveQueryManagerStats extends StandingQueryRegistryStats {
7274
7727
  }
7275
7728
 
7276
7729
  /**
7277
- * QueryPatternTracker (Phase 8.02.1)
7730
+ * * QueryPatternTracker
7278
7731
  *
7279
7732
  * Collects runtime statistics on query execution patterns.
7280
7733
  * Used by IndexAdvisor to generate index suggestions.
@@ -7322,7 +7775,7 @@ interface QueryPatternTrackerOptions {
7322
7775
  * tracker.recordQuery('category', 'eq', 5.2, 100, false);
7323
7776
  * tracker.recordQuery('category', 'eq', 4.8, 100, false);
7324
7777
  *
7325
- * // Record compound AND queries (Phase 9.03)
7778
+ * * // Record compound AND queries
7326
7779
  * tracker.recordCompoundQuery(['status', 'category'], 10.5, 50, false);
7327
7780
  *
7328
7781
  * // Get statistics
@@ -7349,7 +7802,7 @@ declare class QueryPatternTracker {
7349
7802
  */
7350
7803
  recordQuery(attribute: string, queryType: TrackedQueryType, executionTime: number, resultSize: number, hasIndex: boolean): void;
7351
7804
  /**
7352
- * Record a compound (AND) query execution for pattern tracking (Phase 9.03).
7805
+ * Record a compound (AND) query execution for pattern tracking.
7353
7806
  *
7354
7807
  * @param attributes - Array of attribute names being queried together
7355
7808
  * @param executionTime - Query execution time in milliseconds
@@ -7358,7 +7811,7 @@ declare class QueryPatternTracker {
7358
7811
  */
7359
7812
  recordCompoundQuery(attributes: string[], executionTime: number, resultSize: number, hasCompoundIndex: boolean): void;
7360
7813
  /**
7361
- * Get all compound query statistics (Phase 9.03).
7814
+ * Get all compound query statistics.
7362
7815
  *
7363
7816
  * @returns Array of compound query statistics, sorted by query count descending
7364
7817
  */
@@ -7464,17 +7917,17 @@ declare class QueryPatternTracker {
7464
7917
  */
7465
7918
  private pruneStale;
7466
7919
  /**
7467
- * Evict the oldest compound query entry (Phase 9.03).
7920
+ * Evict the oldest compound query entry.
7468
7921
  */
7469
7922
  private evictOldestCompound;
7470
7923
  /**
7471
- * Prune stale compound statistics (Phase 9.03).
7924
+ * Prune stale compound statistics.
7472
7925
  */
7473
7926
  private pruneStaleCompound;
7474
7927
  }
7475
7928
 
7476
7929
  /**
7477
- * IndexAdvisor (Phase 8.02.2)
7930
+ * * IndexAdvisor
7478
7931
  *
7479
7932
  * Analyzes query patterns and generates index suggestions.
7480
7933
  * Used in production mode to help developers optimize their indexes.
@@ -7629,7 +8082,7 @@ declare class IndexAdvisor {
7629
8082
  }
7630
8083
 
7631
8084
  /**
7632
- * AutoIndexManager (Phase 8.02.3)
8085
+ * * AutoIndexManager
7633
8086
  *
7634
8087
  * Automatically creates indexes based on query patterns.
7635
8088
  * Intended for development mode to simplify index management.
@@ -7778,7 +8231,7 @@ declare class AutoIndexManager<K, V> {
7778
8231
  }
7779
8232
 
7780
8233
  /**
7781
- * QueryExecutor Implementation (Phase 12)
8234
+ * QueryExecutor Implementation
7782
8235
  *
7783
8236
  * Executes query plans produced by QueryOptimizer.
7784
8237
  * Supports hybrid queries with FTS and traditional predicates,
@@ -7805,7 +8258,7 @@ interface QueryResult<K, V> {
7805
8258
  */
7806
8259
  type CursorStatus = 'valid' | 'expired' | 'invalid' | 'none';
7807
8260
  /**
7808
- * Extended query result with cursor info (Phase 14.1).
8261
+ * Extended query result with cursor info.
7809
8262
  */
7810
8263
  interface QueryResultWithCursor<K, V> {
7811
8264
  /** Query results */
@@ -7819,7 +8272,7 @@ interface QueryResultWithCursor<K, V> {
7819
8272
  }
7820
8273
 
7821
8274
  /**
7822
- * QueryCursor - Cursor-based pagination for distributed queries (Phase 14.1)
8275
+ * QueryCursor - Cursor-based pagination for distributed queries
7823
8276
  *
7824
8277
  * Implements opaque cursor encoding for efficient deep pagination in distributed
7825
8278
  * predicate-based queries. Cursors encode the last seen position per node, enabling
@@ -8081,6 +8534,9 @@ declare function decodeBase64Url(encoded: string): string;
8081
8534
  */
8082
8535
  declare function compareValues(a: unknown, b: unknown): number;
8083
8536
 
8537
+ declare const logger: pino.Logger<never, boolean>;
8538
+ type Logger = typeof logger;
8539
+
8084
8540
  /**
8085
8541
  * IndexedLWWMap Implementation
8086
8542
  *
@@ -8092,7 +8548,7 @@ declare function compareValues(a: unknown, b: unknown): number;
8092
8548
  * - Live queries with StandingQueryIndex
8093
8549
  * - Automatic index updates on CRDT operations
8094
8550
  * - Cost-based query optimization
8095
- * - Adaptive indexing with query pattern tracking (Phase 8.02)
8551
+ * - Adaptive indexing with query pattern tracking
8096
8552
  *
8097
8553
  * @module IndexedLWWMap
8098
8554
  */
@@ -8185,7 +8641,7 @@ declare class IndexedLWWMap<K extends string, V> extends LWWMap<K, V> {
8185
8641
  * Execute a query using indexes.
8186
8642
  * Returns lazy ResultSet of matching keys.
8187
8643
  *
8188
- * Also tracks query patterns for adaptive indexing (Phase 8.02).
8644
+ * Also tracks query patterns for adaptive indexing.
8189
8645
  *
8190
8646
  * @param query - Query to execute
8191
8647
  * @returns ResultSet of matching keys
@@ -8409,7 +8865,7 @@ declare class IndexedLWWMap<K extends string, V> extends LWWMap<K, V> {
8409
8865
  * - Composite key indexing (key:tag)
8410
8866
  * - Automatic index updates on CRDT operations
8411
8867
  * - Lazy filtering for tombstones
8412
- * - Adaptive indexing with query pattern tracking (Phase 8.02)
8868
+ * - Adaptive indexing with query pattern tracking
8413
8869
  *
8414
8870
  * @module IndexedORMap
8415
8871
  */
@@ -8563,7 +9019,7 @@ declare class IndexedORMap<K extends string, V> extends ORMap<K, V> {
8563
9019
  * Execute a query across all records.
8564
9020
  * Returns array of matching results with key, tag, and value.
8565
9021
  *
8566
- * Also tracks query patterns for adaptive indexing (Phase 8.02).
9022
+ * Also tracks query patterns for adaptive indexing.
8567
9023
  *
8568
9024
  * @param query - Query to execute
8569
9025
  * @returns Array of query results
@@ -8989,4 +9445,618 @@ declare class SearchCursor {
8989
9445
  static merge(cursors: SearchCursorData[], query: string): SearchCursorData;
8990
9446
  }
8991
9447
 
8992
- export { type Attribute, AuthMessageSchema, type BM25Options, BM25Scorer, type BatchMessage, BatchMessageSchema, BuiltInProcessors, BuiltInResolvers, type CircuitBreakerConfig, type ClientOp, ClientOpMessageSchema, ClientOpSchema, type ClusterClientConfig, type ClusterEvents, type ReadOptions as ClusterReadOptions, type ClusterSearchReqMessage, ClusterSearchReqMessageSchema, type ClusterSearchReqPayload, ClusterSearchReqPayloadSchema, type ClusterSearchRespMessage, ClusterSearchRespMessageSchema, type ClusterSearchRespPayload, ClusterSearchRespPayloadSchema, type ClusterSearchSubscribeMessage, ClusterSearchSubscribeMessageSchema, type ClusterSearchSubscribePayload, ClusterSearchSubscribePayloadSchema, type ClusterSearchUnsubscribeMessage, ClusterSearchUnsubscribeMessageSchema, type ClusterSearchUnsubscribePayload, ClusterSearchUnsubscribePayloadSchema, type ClusterSearchUpdateMessage, ClusterSearchUpdateMessageSchema, type ClusterSearchUpdatePayload, ClusterSearchUpdatePayloadSchema, type ClusterSubAckMessage, ClusterSubAckMessageSchema, type ClusterSubAckPayload, ClusterSubAckPayloadSchema, type ClusterSubRegisterMessage, ClusterSubRegisterMessageSchema, type ClusterSubRegisterPayload, ClusterSubRegisterPayloadSchema, type ClusterSubUnregisterMessage, ClusterSubUnregisterMessageSchema, type ClusterSubUnregisterPayload, ClusterSubUnregisterPayloadSchema, type ClusterSubUpdateMessage, ClusterSubUpdateMessageSchema, type ClusterSubUpdatePayload, ClusterSubUpdatePayloadSchema, type WriteOptions as ClusterWriteOptions, type CompareFn, type ConflictResolver, type ConflictResolverDef, ConflictResolverDefSchema, type ConflictResolverFn, ConflictResolverSchema, type ConnectionPoolConfig, type ConnectionState, ConsistencyLevel, CounterRequestSchema, CounterResponseSchema, CounterSyncSchema, CounterUpdateSchema, type CursorStatus$1 as CursorStatus, CursorStatusSchema, type CursorableQueryResult, type CursorableResult, DEFAULT_BACKUP_COUNT, DEFAULT_CIRCUIT_BREAKER_CONFIG, DEFAULT_CONNECTION_POOL_CONFIG, DEFAULT_CURSOR_MAX_AGE_MS, DEFAULT_EVENT_JOURNAL_CONFIG, DEFAULT_MIGRATION_CONFIG, DEFAULT_PARTITION_ROUTER_CONFIG, DEFAULT_PROCESSOR_RATE_LIMITS, DEFAULT_QUERY_CURSOR_MAX_AGE_MS, DEFAULT_REPLICATION_CONFIG, DEFAULT_RESOLVER_RATE_LIMITS, DEFAULT_STOP_WORDS, DEFAULT_WRITE_CONCERN_TIMEOUT, ENGLISH_STOPWORDS, type EntryProcessBatchRequest, EntryProcessBatchRequestSchema, type EntryProcessBatchResponse, EntryProcessBatchResponseSchema, type EntryProcessKeyResult, EntryProcessKeyResultSchema, type EntryProcessRequest, EntryProcessRequestSchema, type EntryProcessResponse, EntryProcessResponseSchema, type EntryProcessorDef, EntryProcessorDefSchema, type EntryProcessorFn, type EntryProcessorResult, EntryProcessorSchema, type EventJournal, type EventJournalConfig, EventJournalImpl, FORBIDDEN_PATTERNS, BM25InvertedIndex as FTSInvertedIndex, type SearchOptions as FTSSearchOptions, type SearchResult as FTSSearchResult, BM25Tokenizer as FTSTokenizer, type TokenizerOptions as FTSTokenizerOptions, FallbackIndex, type FilterStep, FilteringResultSet, type FullScanStep, FullTextIndex, type FullTextIndexConfig, HLC, HashIndex, type Index, type IndexQuery, IndexRegistry, type IndexRegistryStats, type IndexScanStep, type IndexStats, IndexedLWWMap, IndexedORMap, IntersectionResultSet, type IntersectionStep, InvertedIndex, type InvertedIndexStats, type IteratorFactory, type JournalEvent, type JournalEventData, JournalEventDataSchema, type JournalEventInput, type JournalEventListener, type JournalEventMessage, JournalEventMessageSchema, type JournalEventType, JournalEventTypeSchema, type JournalReadRequest, JournalReadRequestSchema, type JournalReadResponse, JournalReadResponseSchema, type JournalSubscribeRequest, JournalSubscribeRequestSchema, type JournalUnsubscribeRequest, JournalUnsubscribeRequestSchema, LWWMap, type LWWRecord, LWWRecordSchema, LazyResultSet, LimitResultSet, type ListResolversRequest, ListResolversRequestSchema, type ListResolversResponse, ListResolversResponseSchema, type LiveQueryCallback, type LiveQueryDeltaEvent, type LiveQueryEvent, type LiveQueryInitialEvent, LiveQueryManager, type LiveQueryManagerOptions, type LiveQueryManagerStats, LockReleaseSchema, LockRequestSchema, type LogicalQueryNode, LowercaseFilter, type MatchOptions, MaxLengthFilter, type MergeContext, type MergeKeyResult, type MergeRejectedMessage, MergeRejectedMessageSchema, type MergeRejection, type MergeResult, type MergedResult, MerkleReqBucketMessageSchema, MerkleTree, type Message, MessageSchema, type MigrationChunkAckMessage, type MigrationChunkMessage, type MigrationCompleteMessage, type MigrationConfig, type MigrationMessage, type MigrationMetrics, type MigrationStartMessage, type MigrationStatus, type MigrationVerifyMessage, MinLengthFilter, MultiValueAttribute, NGramTokenizer, NavigableIndex, type NodeHealth, type NodeInfo, type NodeStatus, type NotOwnerError, type NotStep, ORMap, ORMapDiffRequestSchema, ORMapDiffResponseSchema, type ORMapMerkleNode, ORMapMerkleReqBucketSchema, ORMapMerkleTree, ORMapPushDiffSchema, type ORMapQueryResult, type ORMapRecord, ORMapRecordSchema, type ORMapSearchResult, type ORMapSnapshot, ORMapSyncInitSchema, ORMapSyncRespBucketsSchema, ORMapSyncRespLeafSchema, ORMapSyncRespRootSchema, type OpAckMessage, OpAckMessageSchema, OpBatchMessageSchema, type OpRejectedMessage, OpRejectedMessageSchema, type OpResult, OpResultSchema, PARTITION_COUNT, type PNCounter, type PNCounterConfig, PNCounterImpl, type PNCounterState, type PNCounterStateObject, PNCounterStateObjectSchema, type PartitionChange, type PartitionInfo, type PartitionMap, type PartitionMapDeltaMessage, type PartitionMapMessage, type PartitionMapRequestMessage, PartitionMapRequestSchema, type PartitionMigration, type PartitionRouterConfig, PartitionState, type PendingWrite, type PermissionPolicy, type PermissionType, type PingMessage, PingMessageSchema, type PlanStep, type PongMessage, PongMessageSchema, type Posting, type PredicateFn, type PredicateNode, PredicateNodeSchema, type PredicateOp, PredicateOpSchema, Predicates, type Principal, type ProcessorRateLimitConfig, type Query$1 as Query, QueryCursor, type QueryCursorData, type QueryCursorOptions, type Query as QueryExpression, type QueryNode, QueryOptimizer, type QueryOptimizerOptions, type QueryOptions, type QueryPlan, type QueryRespMessage, QueryRespMessageSchema, type QueryRespPayload, QueryRespPayloadSchema, type QueryResultWithCursor, QuerySchema, QuerySubMessageSchema, QueryUnsubMessageSchema, RESOLVER_FORBIDDEN_PATTERNS, type RRFConfig, type RankedResult, ReciprocalRankFusion, type RegisterResolverRequest, RegisterResolverRequestSchema, type RegisterResolverResponse, RegisterResolverResponseSchema, type ReplicationAckMessage, type ReplicationBatchAckMessage, type ReplicationBatchMessage, type ReplicationConfig, type ReplicationHealth, type ReplicationLag, type ReplicationMessage, type ReplicationProtocolMessage, type ReplicationResult, type ReplicationTask, type ResolverRateLimitConfig, type ResultSet, Ringbuffer, type RoutingError, type ScoredDocument, SearchCursor, type SearchCursorData, type SearchMessage, SearchMessageSchema, type SearchOptions$1 as SearchOptions, SearchOptionsSchema, type SearchPayload, SearchPayloadSchema, type SearchRespMessage, SearchRespMessageSchema, type SearchRespPayload, SearchRespPayloadSchema, type SearchSubMessage, SearchSubMessageSchema, type SearchSubPayload, SearchSubPayloadSchema, type SearchUnsubMessage, SearchUnsubMessageSchema, type SearchUnsubPayload, SearchUnsubPayloadSchema, type SearchUpdateMessage, SearchUpdateMessageSchema, type SearchUpdatePayload, SearchUpdatePayloadSchema, type SearchUpdateType, SearchUpdateTypeSchema, type SerializedIndex, SetResultSet, SimpleAttribute, type SimpleQueryNode, SortedMap, SortedResultSet, type StaleMapError, type StandingQueryChange, StandingQueryIndex, type StandingQueryIndexOptions, StandingQueryRegistry, type StandingQueryRegistryOptions, type StandingQueryRegistryStats, StopWordFilter, SyncInitMessageSchema, SyncRespBucketsMessageSchema, SyncRespLeafMessageSchema, SyncRespRootMessageSchema, type TermInfo, type Timestamp, TimestampSchema, type TokenFilter, TokenizationPipeline, type TokenizationPipelineOptions, type Tokenizer, TopicMessageEventSchema, TopicPubSchema, TopicSubSchema, TopicUnsubSchema, TrimFilter, UnionResultSet, type UnionStep, UniqueFilter, type UnregisterResolverRequest, UnregisterResolverRequestSchema, type UnregisterResolverResponse, UnregisterResolverResponseSchema, WRITE_CONCERN_ORDER, WhitespaceTokenizer, WordBoundaryTokenizer, WriteConcern, WriteConcernSchema, type WriteConcernValue, type WriteOptions$1 as WriteOptions, type WriteResult, combineHashes, compareHLCTimestamps, compareTimestamps, compareValues, createFieldComparator, createPredicateMatcher, decodeBase64Url, deepMerge, deserialize, disableNativeHash, encodeBase64Url, evaluatePredicate, getHighestWriteConcernLevel, hashORMapEntry, hashORMapRecord, hashObject, hashString, isLogicalQuery, isSimpleQuery, isUsingNativeHash, isWriteConcernAchieved, multiAttribute, porterStem, resetNativeHash, serialize, simpleAttribute, timestampToString, validateProcessorCode, validateResolverCode };
9448
+ /**
9449
+ * Snapshot of a CRDT operation for debugging and replay.
9450
+ */
9451
+ interface CRDTSnapshot {
9452
+ id: string;
9453
+ timestamp: Timestamp;
9454
+ operation: 'set' | 'delete' | 'merge';
9455
+ mapId: string;
9456
+ key?: string;
9457
+ value?: unknown;
9458
+ oldValue?: unknown;
9459
+ nodeId: string;
9460
+ merkleRoot?: string;
9461
+ metadata?: Record<string, unknown>;
9462
+ }
9463
+ /**
9464
+ * Information about a resolved conflict.
9465
+ */
9466
+ interface ConflictInfo {
9467
+ mapId: string;
9468
+ key: string;
9469
+ winnerTimestamp: Timestamp;
9470
+ winnerNodeId: string;
9471
+ winnerValue: unknown;
9472
+ loserTimestamp: Timestamp;
9473
+ loserNodeId: string;
9474
+ loserValue: unknown;
9475
+ resolvedAt: Date;
9476
+ }
9477
+ /**
9478
+ * Statistics about CRDT operations.
9479
+ */
9480
+ interface DebugStatistics {
9481
+ totalOperations: number;
9482
+ operationsByType: Record<string, number>;
9483
+ operationsByNode: Record<string, number>;
9484
+ conflictsResolved: number;
9485
+ timeRange: {
9486
+ start: Timestamp | null;
9487
+ end: Timestamp | null;
9488
+ };
9489
+ uniqueKeys: number;
9490
+ averageOpsPerSecond: number;
9491
+ }
9492
+ /**
9493
+ * Options for querying operations.
9494
+ */
9495
+ interface OperationQueryOptions {
9496
+ mapId?: string;
9497
+ nodeId?: string;
9498
+ operation?: string;
9499
+ since?: Timestamp;
9500
+ until?: Timestamp;
9501
+ limit?: number;
9502
+ }
9503
+ /**
9504
+ * CRDTDebugger - Records and analyzes CRDT operations for debugging.
9505
+ *
9506
+ * Features:
9507
+ * - Record all CRDT operations (set, delete, merge)
9508
+ * - Detect and track conflicts
9509
+ * - Replay operations to any point in time
9510
+ * - Export/import operation history
9511
+ * - Statistics and analysis
9512
+ *
9513
+ * @see PHASE_14C_OBSERVABILITY.md for specification
9514
+ */
9515
+ declare class CRDTDebugger {
9516
+ private snapshots;
9517
+ private conflicts;
9518
+ private maxSnapshots;
9519
+ private enabled;
9520
+ private idCounter;
9521
+ constructor(options?: {
9522
+ maxSnapshots?: number;
9523
+ enabled?: boolean;
9524
+ });
9525
+ isEnabled(): boolean;
9526
+ enable(): void;
9527
+ disable(): void;
9528
+ recordOperation(snapshot: Omit<CRDTSnapshot, 'id'>): void;
9529
+ recordSet(mapId: string, key: string, value: unknown, timestamp: Timestamp, nodeId: string, oldValue?: unknown, merkleRoot?: string): void;
9530
+ recordDelete(mapId: string, key: string, timestamp: Timestamp, nodeId: string, oldValue?: unknown, merkleRoot?: string): void;
9531
+ recordMerge(mapId: string, key: string, value: unknown, timestamp: Timestamp, nodeId: string, wasUpdated: boolean, oldValue?: unknown, merkleRoot?: string): void;
9532
+ recordConflict(conflict: ConflictInfo): void;
9533
+ getOperations(options?: OperationQueryOptions): CRDTSnapshot[];
9534
+ getConflicts(mapId?: string): ConflictInfo[];
9535
+ getLastOperation(): CRDTSnapshot | undefined;
9536
+ getOperationsForKey(mapId: string, key: string): CRDTSnapshot[];
9537
+ getStatistics(mapId?: string): DebugStatistics;
9538
+ /**
9539
+ * Replays operations up to the target timestamp and returns the map state.
9540
+ */
9541
+ replayUntil<K extends string, V>(targetTimestamp: Timestamp, mapId?: string, hlc?: HLC): LWWMap<K, V>;
9542
+ /**
9543
+ * Creates a timeline of operations grouped by time intervals.
9544
+ */
9545
+ getTimeline(intervalMs?: number, mapId?: string): Array<{
9546
+ timestamp: number;
9547
+ operations: CRDTSnapshot[];
9548
+ }>;
9549
+ exportHistory(format?: 'json' | 'csv' | 'ndjson'): string;
9550
+ private toCSV;
9551
+ importHistory(json: string): void;
9552
+ /**
9553
+ * Compares two points in time and returns the differences.
9554
+ */
9555
+ diff(fromTimestamp: Timestamp, toTimestamp: Timestamp, mapId?: string): {
9556
+ added: CRDTSnapshot[];
9557
+ modified: CRDTSnapshot[];
9558
+ deleted: CRDTSnapshot[];
9559
+ };
9560
+ clear(): void;
9561
+ private compareTimestamp;
9562
+ }
9563
+ declare function getCRDTDebugger(): CRDTDebugger;
9564
+ declare function resetCRDTDebugger(): void;
9565
+
9566
+ /**
9567
+ * BM25 scoring debug information.
9568
+ */
9569
+ interface BM25DebugInfo {
9570
+ score: number;
9571
+ matchedTerms: string[];
9572
+ tf: Record<string, number>;
9573
+ idf: Record<string, number>;
9574
+ fieldWeights: Record<string, number>;
9575
+ avgDocLength: number;
9576
+ docLength: number;
9577
+ k1: number;
9578
+ b: number;
9579
+ }
9580
+ /**
9581
+ * Exact match debug information.
9582
+ */
9583
+ interface ExactMatchDebugInfo {
9584
+ score: number;
9585
+ matchedFields: string[];
9586
+ boostApplied: number;
9587
+ }
9588
+ /**
9589
+ * Reciprocal Rank Fusion (RRF) debug information.
9590
+ */
9591
+ interface RRFDebugInfo {
9592
+ rank: number;
9593
+ score: number;
9594
+ k: number;
9595
+ contributingRanks: {
9596
+ source: string;
9597
+ rank: number;
9598
+ }[];
9599
+ }
9600
+ /**
9601
+ * Vector similarity debug information.
9602
+ */
9603
+ interface VectorDebugInfo {
9604
+ score: number;
9605
+ distance: number;
9606
+ similarity: 'cosine' | 'euclidean' | 'dot';
9607
+ }
9608
+ /**
9609
+ * Debug information for a single search result.
9610
+ */
9611
+ interface SearchResultDebug {
9612
+ docId: string;
9613
+ finalScore: number;
9614
+ scoreBreakdown: {
9615
+ bm25?: BM25DebugInfo;
9616
+ exact?: ExactMatchDebugInfo;
9617
+ rrf?: RRFDebugInfo;
9618
+ vector?: VectorDebugInfo;
9619
+ };
9620
+ matchedDocument?: Record<string, unknown>;
9621
+ }
9622
+ /**
9623
+ * Index statistics for a search operation.
9624
+ */
9625
+ interface SearchIndexStats {
9626
+ indexType: string;
9627
+ indexSize: number;
9628
+ termsSearched: number;
9629
+ }
9630
+ /**
9631
+ * Timing information for search operations.
9632
+ */
9633
+ interface SearchTiming {
9634
+ tokenization: number;
9635
+ indexLookup: number;
9636
+ scoring: number;
9637
+ ranking: number;
9638
+ fusion?: number;
9639
+ total: number;
9640
+ }
9641
+ /**
9642
+ * Complete debug information for a search query.
9643
+ */
9644
+ interface SearchDebugInfo {
9645
+ query: string;
9646
+ queryTokens: string[];
9647
+ mapId: string;
9648
+ searchType: 'bm25' | 'exact' | 'hybrid' | 'vector';
9649
+ totalDocuments: number;
9650
+ matchingDocuments: number;
9651
+ results: SearchResultDebug[];
9652
+ timing: SearchTiming;
9653
+ indexStats: SearchIndexStats;
9654
+ }
9655
+ /**
9656
+ * SearchDebugger - Records and analyzes search operations for debugging.
9657
+ *
9658
+ * Features:
9659
+ * - Record search queries with full debug info
9660
+ * - BM25 score breakdown per term
9661
+ * - RRF fusion explanation
9662
+ * - Timing breakdown
9663
+ * - Query history
9664
+ *
9665
+ * @see PHASE_14C_OBSERVABILITY.md for specification
9666
+ */
9667
+ declare class SearchDebugger {
9668
+ private enabled;
9669
+ private lastQuery;
9670
+ private history;
9671
+ private maxHistory;
9672
+ constructor(options?: {
9673
+ enabled?: boolean;
9674
+ maxHistory?: number;
9675
+ });
9676
+ isEnabled(): boolean;
9677
+ enable(): void;
9678
+ disable(): void;
9679
+ recordSearch(debugInfo: SearchDebugInfo): void;
9680
+ getLastQuery(): SearchDebugInfo | null;
9681
+ getHistory(): SearchDebugInfo[];
9682
+ getHistoryByMap(mapId: string): SearchDebugInfo[];
9683
+ explainResult(docId: string): SearchResultDebug | undefined;
9684
+ formatExplanation(docId: string): string;
9685
+ formatQuerySummary(): string;
9686
+ formatAllResults(): string;
9687
+ exportDebugInfo(): string;
9688
+ exportHistory(): string;
9689
+ getSearchStats(): {
9690
+ totalQueries: number;
9691
+ averageResultCount: number;
9692
+ averageLatencyMs: number;
9693
+ queryTypeBreakdown: Record<string, number>;
9694
+ };
9695
+ clear(): void;
9696
+ }
9697
+ declare function getSearchDebugger(): SearchDebugger;
9698
+ declare function resetSearchDebugger(): void;
9699
+
9700
+ /**
9701
+ * Real clock source using system time.
9702
+ */
9703
+ declare const RealClock: ClockSource;
9704
+ /**
9705
+ * Virtual clock for deterministic testing.
9706
+ * Time only advances when explicitly requested via advance() or set().
9707
+ *
9708
+ * Usage:
9709
+ * ```typescript
9710
+ * const clock = new VirtualClock(1000000);
9711
+ * clock.now(); // 1000000
9712
+ * clock.advance(500);
9713
+ * clock.now(); // 1000500
9714
+ * ```
9715
+ */
9716
+ declare class VirtualClock implements ClockSource {
9717
+ private currentTime;
9718
+ /**
9719
+ * @param initialTime Starting timestamp in milliseconds (default: 0)
9720
+ */
9721
+ constructor(initialTime?: number);
9722
+ /**
9723
+ * Returns the current virtual time.
9724
+ * Time remains frozen until advance() or set() is called.
9725
+ */
9726
+ now(): number;
9727
+ /**
9728
+ * Advances time forward by the specified milliseconds.
9729
+ * @param ms Milliseconds to advance (must be non-negative)
9730
+ */
9731
+ advance(ms: number): void;
9732
+ /**
9733
+ * Sets the clock to a specific time.
9734
+ * Allows moving time forward or backward (useful for testing).
9735
+ * @param time Absolute timestamp in milliseconds
9736
+ */
9737
+ set(time: number): void;
9738
+ /**
9739
+ * Resets the clock to zero.
9740
+ */
9741
+ reset(): void;
9742
+ }
9743
+
9744
+ /**
9745
+ * Seeded pseudo-random number generator for deterministic testing.
9746
+ * Uses the mulberry32 algorithm for fast, high-quality randomness.
9747
+ *
9748
+ * Usage:
9749
+ * ```typescript
9750
+ * const rng = new SeededRNG(12345);
9751
+ * rng.random(); // 0.6011..., always same for seed 12345
9752
+ * rng.randomInt(1, 10); // Deterministic integer in range
9753
+ * ```
9754
+ */
9755
+ declare class SeededRNG {
9756
+ private state;
9757
+ private readonly originalSeed;
9758
+ /**
9759
+ * @param seed Integer seed value. Same seed = same sequence.
9760
+ */
9761
+ constructor(seed: number);
9762
+ /**
9763
+ * Returns the original seed used to construct this RNG.
9764
+ */
9765
+ getSeed(): number;
9766
+ /**
9767
+ * Generates the next random number in [0, 1).
9768
+ * Uses mulberry32 algorithm for deterministic, high-quality randomness.
9769
+ */
9770
+ random(): number;
9771
+ /**
9772
+ * Generates a random integer in [min, max] (inclusive).
9773
+ * @param min Minimum value (inclusive)
9774
+ * @param max Maximum value (inclusive)
9775
+ */
9776
+ randomInt(min: number, max: number): number;
9777
+ /**
9778
+ * Generates a random boolean value.
9779
+ * @param probability Probability of returning true (default: 0.5)
9780
+ */
9781
+ randomBool(probability?: number): boolean;
9782
+ /**
9783
+ * Shuffles an array in place using Fisher-Yates algorithm.
9784
+ * Returns the shuffled array.
9785
+ * @param array Array to shuffle
9786
+ */
9787
+ shuffle<T>(array: T[]): T[];
9788
+ /**
9789
+ * Picks a random element from an array.
9790
+ * @param array Array to pick from
9791
+ * @returns Random element, or undefined if array is empty
9792
+ */
9793
+ pick<T>(array: T[]): T | undefined;
9794
+ /**
9795
+ * Resets the RNG to its original seed.
9796
+ * Useful for reproducing a sequence from the start.
9797
+ */
9798
+ reset(): void;
9799
+ }
9800
+
9801
+ /**
9802
+ * Network configuration for chaos injection.
9803
+ */
9804
+ interface NetworkConfig {
9805
+ /** Latency range in milliseconds */
9806
+ latencyMs: {
9807
+ min: number;
9808
+ max: number;
9809
+ };
9810
+ /** Packet loss rate (0.0 to 1.0) */
9811
+ packetLossRate: number;
9812
+ /** Groups that cannot communicate with each other */
9813
+ partitions: string[][];
9814
+ }
9815
+ /**
9816
+ * A message in flight through the virtual network.
9817
+ */
9818
+ interface Message {
9819
+ from: string;
9820
+ to: string;
9821
+ payload: unknown;
9822
+ scheduledTime: number;
9823
+ }
9824
+ /**
9825
+ * Virtual network for deterministic chaos testing.
9826
+ * Simulates packet loss, latency, and network partitions.
9827
+ *
9828
+ * Usage:
9829
+ * ```typescript
9830
+ * const rng = new SeededRNG(123);
9831
+ * const clock = new VirtualClock(1000);
9832
+ * const network = new VirtualNetwork(rng, clock);
9833
+ *
9834
+ * network.configure({ packetLossRate: 0.1, latencyMs: { min: 10, max: 50 } });
9835
+ * network.send('node-a', 'node-b', { type: 'sync' });
9836
+ *
9837
+ * clock.advance(30);
9838
+ * const delivered = network.tick(); // Messages delivered at current time
9839
+ * ```
9840
+ */
9841
+ declare class VirtualNetwork {
9842
+ private readonly rng;
9843
+ private readonly clock;
9844
+ private config;
9845
+ private pendingMessages;
9846
+ constructor(rng: SeededRNG, clock: VirtualClock);
9847
+ /**
9848
+ * Updates network configuration.
9849
+ * Partially updates existing config with provided values.
9850
+ */
9851
+ configure(config: Partial<NetworkConfig>): void;
9852
+ /**
9853
+ * Sends a message through the network.
9854
+ * Subject to packet loss, latency, and partition rules.
9855
+ */
9856
+ send(from: string, to: string, payload: unknown): void;
9857
+ /**
9858
+ * Creates a network partition between two groups.
9859
+ * Nodes in groupA cannot communicate with nodes in groupB.
9860
+ */
9861
+ partition(groupA: string[], groupB: string[]): void;
9862
+ /**
9863
+ * Removes all network partitions.
9864
+ */
9865
+ heal(): void;
9866
+ /**
9867
+ * Delivers all messages scheduled at or before the current time.
9868
+ * @returns Array of delivered messages
9869
+ */
9870
+ tick(): Message[];
9871
+ /**
9872
+ * Returns the number of messages currently in flight.
9873
+ */
9874
+ getPendingCount(): number;
9875
+ /**
9876
+ * Clears all pending messages.
9877
+ */
9878
+ clear(): void;
9879
+ /**
9880
+ * Checks if two nodes are partitioned from each other.
9881
+ */
9882
+ private isPartitioned;
9883
+ /**
9884
+ * Returns all pending messages (useful for debugging).
9885
+ */
9886
+ getPendingMessages(): Message[];
9887
+ }
9888
+
9889
+ /**
9890
+ * Invariant function signature.
9891
+ * Returns true if the invariant holds, false otherwise.
9892
+ */
9893
+ type Invariant<T> = (state: T) => boolean;
9894
+ /**
9895
+ * Result of invariant verification.
9896
+ */
9897
+ interface InvariantResult {
9898
+ passed: boolean;
9899
+ failures: string[];
9900
+ }
9901
+ /**
9902
+ * Checker for property-based invariants.
9903
+ * Used to verify CRDT consistency during simulation.
9904
+ *
9905
+ * Usage:
9906
+ * ```typescript
9907
+ * const checker = new InvariantChecker<MyState>();
9908
+ * checker.addInvariant('no-nulls', (state) => state.value !== null);
9909
+ * const result = checker.verify(state);
9910
+ * if (!result.passed) {
9911
+ * console.log('Failures:', result.failures);
9912
+ * }
9913
+ * ```
9914
+ */
9915
+ declare class InvariantChecker<T> {
9916
+ private invariants;
9917
+ /**
9918
+ * Adds an invariant to be checked.
9919
+ * @param name Unique name for this invariant
9920
+ * @param check Function that returns true if invariant holds
9921
+ */
9922
+ addInvariant(name: string, check: Invariant<T>): void;
9923
+ /**
9924
+ * Removes an invariant by name.
9925
+ */
9926
+ removeInvariant(name: string): boolean;
9927
+ /**
9928
+ * Verifies all invariants against the provided state.
9929
+ * @returns Result with pass/fail status and list of failed invariants
9930
+ */
9931
+ verify(state: T): InvariantResult;
9932
+ /**
9933
+ * Returns the number of registered invariants.
9934
+ */
9935
+ get count(): number;
9936
+ /**
9937
+ * Clears all invariants.
9938
+ */
9939
+ clear(): void;
9940
+ }
9941
+ /**
9942
+ * Predefined CRDT invariants for common testing scenarios.
9943
+ */
9944
+ declare const CRDTInvariants: {
9945
+ /**
9946
+ * Verifies LWW-Map convergence: all maps contain the same values for same keys.
9947
+ */
9948
+ lwwConvergence: <K, V>(maps: LWWMap<K, V>[]) => boolean;
9949
+ /**
9950
+ * Verifies OR-Map convergence: all maps contain the same values for same keys.
9951
+ */
9952
+ orMapConvergence: <K, V>(maps: ORMap<K, V>[]) => boolean;
9953
+ /**
9954
+ * Verifies HLC monotonicity: timestamps are strictly increasing.
9955
+ */
9956
+ hlcMonotonicity: (timestamps: Timestamp[]) => boolean;
9957
+ /**
9958
+ * Verifies Merkle tree consistency: trees with same data have same root hash.
9959
+ */
9960
+ merkleConsistency: (trees: MerkleTree[]) => boolean;
9961
+ };
9962
+
9963
+ /**
9964
+ * Configuration for a simulation scenario.
9965
+ */
9966
+ interface ScenarioConfig {
9967
+ /** Random seed for reproducibility (auto-generated if not provided) */
9968
+ seed?: number;
9969
+ /** List of node identifiers participating in the scenario */
9970
+ nodes: string[];
9971
+ /** Total duration in virtual milliseconds */
9972
+ duration: number;
9973
+ /** Virtual ms to advance per tick (default: 1) */
9974
+ tickInterval?: number;
9975
+ }
9976
+ /**
9977
+ * Result of a scenario execution.
9978
+ */
9979
+ interface ScenarioResult {
9980
+ /** Seed used for this run (for reproduction) */
9981
+ seed: number;
9982
+ /** Whether all invariants passed */
9983
+ passed: boolean;
9984
+ /** Number of ticks executed */
9985
+ ticks: number;
9986
+ /** List of invariant failures */
9987
+ invariantFailures: string[];
9988
+ /** Final state captured at end of scenario */
9989
+ finalStates: Map<string, unknown>;
9990
+ }
9991
+ /**
9992
+ * Orchestrates deterministic simulation scenarios.
9993
+ * Combines virtual clock, seeded RNG, and virtual network for reproducible testing.
9994
+ *
9995
+ * Usage:
9996
+ * ```typescript
9997
+ * const runner = new ScenarioRunner({
9998
+ * seed: 12345,
9999
+ * nodes: ['node-a', 'node-b'],
10000
+ * duration: 1000
10001
+ * });
10002
+ *
10003
+ * const result = runner.run(
10004
+ * (r) => {
10005
+ * // Setup: create CRDTs, configure network
10006
+ * r.getNetwork().configure({ packetLossRate: 0.1 });
10007
+ * },
10008
+ * (r, tick) => {
10009
+ * // Step: simulate operations, deliver messages
10010
+ * if (tick === 500) r.getNetwork().heal();
10011
+ * },
10012
+ * invariants
10013
+ * );
10014
+ *
10015
+ * if (!result.passed) {
10016
+ * console.log(`Failed with seed ${result.seed}`);
10017
+ * }
10018
+ * ```
10019
+ */
10020
+ declare class ScenarioRunner {
10021
+ private readonly config;
10022
+ private readonly clock;
10023
+ private readonly rng;
10024
+ private readonly network;
10025
+ private readonly seed;
10026
+ constructor(config: ScenarioConfig);
10027
+ /**
10028
+ * Returns the seed used for this scenario.
10029
+ */
10030
+ getSeed(): number;
10031
+ /**
10032
+ * Returns the virtual clock instance.
10033
+ */
10034
+ getClock(): VirtualClock;
10035
+ /**
10036
+ * Returns the seeded RNG instance.
10037
+ */
10038
+ getRNG(): SeededRNG;
10039
+ /**
10040
+ * Returns the virtual network instance.
10041
+ */
10042
+ getNetwork(): VirtualNetwork;
10043
+ /**
10044
+ * Returns the list of nodes in this scenario.
10045
+ */
10046
+ getNodes(): string[];
10047
+ /**
10048
+ * Executes the simulation scenario.
10049
+ *
10050
+ * @param setup Called once before simulation starts. Initialize state here.
10051
+ * @param step Called on each tick. Perform operations and message delivery.
10052
+ * @param invariants Checker for verifying correctness throughout execution.
10053
+ * @returns Result with pass/fail status and captured state
10054
+ */
10055
+ run(setup: (runner: ScenarioRunner) => void, step: (runner: ScenarioRunner, tick: number) => void, invariants: InvariantChecker<unknown>): ScenarioResult;
10056
+ /**
10057
+ * Stores state for a node (useful for capturing final state).
10058
+ */
10059
+ setState(nodeId: string, state: unknown): void;
10060
+ }
10061
+
10062
+ export { type Attribute, type AuthFailMessage, AuthFailMessageSchema, AuthMessageSchema, type BM25DebugInfo, type BM25Options, BM25Scorer, type BatchMessage, BatchMessageSchema, BuiltInProcessors, BuiltInResolvers, COST_WEIGHTS, CRDTDebugger, CRDTInvariants, type CRDTSnapshot, type CircuitBreakerConfig, type ClientOp, ClientOpMessageSchema, ClientOpSchema, type ClockSource, type ClusterClientConfig, type ClusterEvents, type ReadOptions as ClusterReadOptions, type ClusterSearchReqMessage, ClusterSearchReqMessageSchema, type ClusterSearchReqPayload, ClusterSearchReqPayloadSchema, type ClusterSearchRespMessage, ClusterSearchRespMessageSchema, type ClusterSearchRespPayload, ClusterSearchRespPayloadSchema, type ClusterSearchSubscribeMessage, ClusterSearchSubscribeMessageSchema, type ClusterSearchSubscribePayload, ClusterSearchSubscribePayloadSchema, type ClusterSearchUnsubscribeMessage, ClusterSearchUnsubscribeMessageSchema, type ClusterSearchUnsubscribePayload, ClusterSearchUnsubscribePayloadSchema, type ClusterSearchUpdateMessage, ClusterSearchUpdateMessageSchema, type ClusterSearchUpdatePayload, ClusterSearchUpdatePayloadSchema, type ClusterSubAckMessage, ClusterSubAckMessageSchema, type ClusterSubAckPayload, ClusterSubAckPayloadSchema, type ClusterSubRegisterMessage, ClusterSubRegisterMessageSchema, type ClusterSubRegisterPayload, ClusterSubRegisterPayloadSchema, type ClusterSubUnregisterMessage, ClusterSubUnregisterMessageSchema, type ClusterSubUnregisterPayload, ClusterSubUnregisterPayloadSchema, type ClusterSubUpdateMessage, ClusterSubUpdateMessageSchema, type ClusterSubUpdatePayload, ClusterSubUpdatePayloadSchema, type WriteOptions as ClusterWriteOptions, type CompareFn, type ConflictInfo, type ConflictResolver, type ConflictResolverDef, ConflictResolverDefSchema, type ConflictResolverFn, ConflictResolverSchema, type ConnectionPoolConfig, type ConnectionState, ConsistencyLevel, CounterRequestSchema, CounterResponseSchema, CounterSyncSchema, CounterUpdateSchema, type CursorStatus$1 as CursorStatus, CursorStatusSchema, type CursorableQueryResult, type CursorableResult, DEFAULT_BACKUP_COUNT, DEFAULT_CIRCUIT_BREAKER_CONFIG, DEFAULT_CONNECTION_POOL_CONFIG, DEFAULT_CURSOR_MAX_AGE_MS, DEFAULT_EVENT_JOURNAL_CONFIG, DEFAULT_MIGRATION_CONFIG, DEFAULT_PARTITION_ROUTER_CONFIG, DEFAULT_PROCESSOR_RATE_LIMITS, DEFAULT_QUERY_CURSOR_MAX_AGE_MS, DEFAULT_REPLICATION_CONFIG, DEFAULT_RESOLVER_RATE_LIMITS, DEFAULT_STOP_WORDS, DEFAULT_WRITE_CONCERN_TIMEOUT, type DebugStatistics, DeltaRecordSchema, type DistributedCost, ENGLISH_STOPWORDS, type EntryProcessBatchRequest, EntryProcessBatchRequestSchema, type EntryProcessBatchResponse, EntryProcessBatchResponseSchema, type EntryProcessKeyResult, EntryProcessKeyResultSchema, type EntryProcessRequest, EntryProcessRequestSchema, type EntryProcessResponse, EntryProcessResponseSchema, type EntryProcessorDef, EntryProcessorDefSchema, type EntryProcessorFn, type EntryProcessorResult, EntryProcessorSchema, type EventJournal, type EventJournalConfig, EventJournalImpl, type ExactMatchDebugInfo, FORBIDDEN_PATTERNS, BM25InvertedIndex as FTSInvertedIndex, type SearchOptions as FTSSearchOptions, type SearchResult as FTSSearchResult, BM25Tokenizer as FTSTokenizer, type TokenizerOptions as FTSTokenizerOptions, FallbackIndex, type FilterStep, FilteringResultSet, type FullScanStep, FullTextIndex, type FullTextIndexConfig, type GcPruneMessage, GcPruneMessageSchema, type GcPrunePayload, GcPrunePayloadSchema, HLC, HashIndex, HttpQueryRequestSchema, HttpQueryResultSchema, HttpSearchRequestSchema, HttpSearchResultSchema, HttpSyncErrorSchema, type HttpSyncRequest, HttpSyncRequestSchema, type HttpSyncResponse, HttpSyncResponseSchema, type HybridQueryDeltaPayload, HybridQueryDeltaPayloadSchema, type HybridQueryRespPayload, HybridQueryRespPayloadSchema, type Index, type IndexQuery, IndexRegistry, type IndexRegistryStats, type IndexScanStep, type IndexStats, IndexedLWWMap, IndexedORMap, IntersectionResultSet, type IntersectionStep, type Invariant, InvariantChecker, type InvariantResult, InvertedIndex, type InvertedIndexStats, type IteratorFactory, type JournalEvent, type JournalEventData, JournalEventDataSchema, type JournalEventInput, type JournalEventListener, type JournalEventMessage, JournalEventMessageSchema, type JournalEventType, JournalEventTypeSchema, type JournalReadRequest, JournalReadRequestSchema, type JournalReadResponse, JournalReadResponseSchema, type JournalSubscribeRequest, JournalSubscribeRequestSchema, type JournalUnsubscribeRequest, JournalUnsubscribeRequestSchema, LWWMap, type LWWRecord, LWWRecordSchema, LazyResultSet, LimitResultSet, type ListResolversRequest, ListResolversRequestSchema, type ListResolversResponse, ListResolversResponseSchema, type LiveQueryCallback, type LiveQueryDeltaEvent, type LiveQueryEvent, type LiveQueryInitialEvent, LiveQueryManager, type LiveQueryManagerOptions, type LiveQueryManagerStats, type LockGrantedPayload, LockGrantedPayloadSchema, LockReleaseSchema, type LockReleasedPayload, LockReleasedPayloadSchema, LockRequestSchema, type Logger, type LogicalQueryNode, LowercaseFilter, MapDeltaSchema, type MatchOptions, MaxLengthFilter, type MergeContext, type MergeKeyResult, type MergeRejectedMessage, MergeRejectedMessageSchema, type MergeRejection, type MergeResult, type MergedResult, MerkleReqBucketMessageSchema, MerkleTree, type Message, MessageSchema, type MigrationChunkAckMessage, type MigrationChunkMessage, type MigrationCompleteMessage, type MigrationConfig, type MigrationMessage, type MigrationMetrics, type MigrationStartMessage, type MigrationStatus, type MigrationVerifyMessage, MinLengthFilter, MultiValueAttribute, NGramTokenizer, NavigableIndex, type NetworkConfig, type NodeHealth, type NodeInfo, type NodeStatus, type NotOwnerError, type NotStep, ORMap, ORMapDiffRequestSchema, type ORMapDiffResponsePayload, ORMapDiffResponseSchema, type ORMapMerkleNode, ORMapMerkleReqBucketSchema, ORMapMerkleTree, ORMapPushDiffSchema, type ORMapQueryResult, type ORMapRecord, ORMapRecordSchema, type ORMapSearchResult, type ORMapSnapshot, ORMapSyncInitSchema, type ORMapSyncRespBucketsPayload, ORMapSyncRespBucketsSchema, type ORMapSyncRespLeafPayload, ORMapSyncRespLeafSchema, type ORMapSyncRespRootPayload, ORMapSyncRespRootSchema, type OpAckMessage, OpAckMessageSchema, OpBatchMessageSchema, type OpRejectedMessage, OpRejectedMessageSchema, type OpResult, OpResultSchema, type OperationQueryOptions, PARTITION_COUNT, type PNCounter, type PNCounterConfig, PNCounterImpl, type PNCounterState, type PNCounterStateObject, PNCounterStateObjectSchema, type PartitionChange, type PartitionInfo, type PartitionMap, type PartitionMapDeltaMessage, type PartitionMapMessage, type PartitionMapRequestMessage, PartitionMapRequestSchema, type PartitionMigration, type PartitionRouterConfig, PartitionState, type PendingWrite, type PermissionPolicy, type PermissionType, type PingMessage, PingMessageSchema, type PlanStep, type PongMessage, PongMessageSchema, type Posting, type PredicateFn, type PredicateNode, PredicateNodeSchema, type PredicateOp, PredicateOpSchema, Predicates, type Principal, type ProcessorRateLimitConfig, type Query$1 as Query, type QueryContext, QueryCursor, type QueryCursorData, type QueryCursorOptions, type Query as QueryExpression, type QueryNode, QueryOptimizer, type QueryOptimizerOptions, type QueryOptions, type QueryPlan, type QueryRespMessage, QueryRespMessageSchema, type QueryRespPayload, QueryRespPayloadSchema, type QueryResultWithCursor, QuerySchema, QuerySubMessageSchema, QueryUnsubMessageSchema, type QueryUpdateMessage, QueryUpdateMessageSchema, type QueryUpdatePayload, QueryUpdatePayloadSchema, RESOLVER_FORBIDDEN_PATTERNS, type RRFConfig, type RRFDebugInfo, type RankedResult, RealClock, ReciprocalRankFusion, type RegisterResolverRequest, RegisterResolverRequestSchema, type RegisterResolverResponse, RegisterResolverResponseSchema, type ReplicationAckMessage, type ReplicationBatchAckMessage, type ReplicationBatchMessage, type ReplicationConfig, type ReplicationHealth, type ReplicationLag, type ReplicationMessage, type ReplicationProtocolMessage, type ReplicationResult, type ReplicationTask, type ResolverRateLimitConfig, type ResultSet, Ringbuffer, type RoutingError, type ScenarioConfig, type ScenarioResult, ScenarioRunner, type ScoredDocument, SearchCursor, type SearchCursorData, type SearchDebugInfo, SearchDebugger, type SearchIndexStats, type SearchMessage, SearchMessageSchema, type SearchOptions$1 as SearchOptions, SearchOptionsSchema, type SearchPayload, SearchPayloadSchema, type SearchRespMessage, SearchRespMessageSchema, type SearchRespPayload, SearchRespPayloadSchema, type SearchResultDebug, type SearchSubMessage, SearchSubMessageSchema, type SearchSubPayload, SearchSubPayloadSchema, type SearchTiming, type SearchUnsubMessage, SearchUnsubMessageSchema, type SearchUnsubPayload, SearchUnsubPayloadSchema, type SearchUpdateMessage, SearchUpdateMessageSchema, type SearchUpdatePayload, SearchUpdatePayloadSchema, type SearchUpdateType, SearchUpdateTypeSchema, SeededRNG, type SerializedIndex, type ServerBatchEventMessage, ServerBatchEventMessageSchema, type ServerEventMessage, ServerEventMessageSchema, type ServerEventPayload, ServerEventPayloadSchema, SetResultSet, SimpleAttribute, type SimpleQueryNode, SortedMap, SortedResultSet, type StaleMapError, type StandingQueryChange, StandingQueryIndex, type StandingQueryIndexOptions, StandingQueryRegistry, type StandingQueryRegistryOptions, type StandingQueryRegistryStats, StopWordFilter, SyncInitMessageSchema, SyncMapEntrySchema, type SyncResetRequiredPayload, SyncResetRequiredPayloadSchema, SyncRespBucketsMessageSchema, type SyncRespBucketsPayload, SyncRespLeafMessageSchema, type SyncRespLeafPayload, SyncRespRootMessageSchema, type SyncRespRootPayload, type TermInfo, type Timestamp, TimestampSchema, type TokenFilter, TokenizationPipeline, type TokenizationPipelineOptions, type Tokenizer, TopicMessageEventSchema, TopicPubSchema, TopicSubSchema, TopicUnsubSchema, TrimFilter, UnionResultSet, type UnionStep, UniqueFilter, type UnregisterResolverRequest, UnregisterResolverRequestSchema, type UnregisterResolverResponse, UnregisterResolverResponseSchema, type VectorDebugInfo, VirtualClock, VirtualNetwork, WRITE_CONCERN_ORDER, WhitespaceTokenizer, WordBoundaryTokenizer, WriteConcern, WriteConcernSchema, type WriteConcernValue, type WriteOptions$1 as WriteOptions, type WriteResult, calculateTotalCost, combineHashes, compareHLCTimestamps, compareTimestamps, compareValues, createFieldComparator, createPredicateMatcher, decodeBase64Url, deepMerge, deserialize, disableNativeHash, encodeBase64Url, evaluatePredicate, getCRDTDebugger, getHighestWriteConcernLevel, getSearchDebugger, hashORMapEntry, hashORMapRecord, hashObject, hashString, isLogicalQuery, isSimpleQuery, isUsingNativeHash, isWriteConcernAchieved, logger, multiAttribute, porterStem, resetCRDTDebugger, resetNativeHash, resetSearchDebugger, serialize, simpleAttribute, timestampToString, validateProcessorCode, validateResolverCode };