@topgunbuild/core 0.10.1 → 0.12.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.ts CHANGED
@@ -6,6 +6,12 @@ interface Timestamp {
6
6
  counter: number;
7
7
  nodeId: string;
8
8
  }
9
+ /**
10
+ * Clock source interface for time dependency injection.
11
+ */
12
+ interface ClockSource {
13
+ now(): number;
14
+ }
9
15
  /**
10
16
  * Configuration options for HLC behavior.
11
17
  */
@@ -21,6 +27,12 @@ interface HLCOptions {
21
27
  * Default: 60000 (1 minute)
22
28
  */
23
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;
24
36
  }
25
37
  declare class HLC {
26
38
  private lastMillis;
@@ -28,10 +40,16 @@ declare class HLC {
28
40
  private readonly nodeId;
29
41
  private readonly strictMode;
30
42
  private readonly maxDriftMs;
43
+ private readonly clockSource;
31
44
  constructor(nodeId: string, options?: HLCOptions);
32
45
  get getNodeId(): string;
33
46
  get getStrictMode(): boolean;
34
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;
35
53
  /**
36
54
  * Generates a new unique timestamp for a local event.
37
55
  * Ensures monotonicity: always greater than any previously generated or received timestamp.
@@ -1125,14 +1143,13 @@ interface MergeRejection {
1125
1143
  /**
1126
1144
  * Hash utilities for TopGun
1127
1145
  *
1128
- * Uses native xxHash64 when available (via @topgunbuild/native),
1129
- * falls back to FNV-1a for JS-only environments.
1146
+ * Uses FNV-1a for all hashing deterministic, cross-language compatible
1147
+ * with Rust core-rust/src/hash.rs implementation.
1130
1148
  */
1131
1149
  /**
1132
- * Hash a string to a 32-bit unsigned integer.
1133
- *
1134
- * Uses native xxHash64 (truncated to 32 bits) when available,
1135
- * otherwise falls back to FNV-1a.
1150
+ * FNV-1a Hash implementation for strings.
1151
+ * Fast, non-cryptographic, synchronous.
1152
+ * Iterates over UTF-16 code units (charCodeAt), matching Rust's encode_utf16().
1136
1153
  *
1137
1154
  * @param str - String to hash
1138
1155
  * @returns 32-bit unsigned integer hash
@@ -1148,21 +1165,6 @@ declare function hashString(str: string): number;
1148
1165
  * @returns Combined hash as 32-bit unsigned integer
1149
1166
  */
1150
1167
  declare function combineHashes(hashes: number[]): number;
1151
- /**
1152
- * Check if native hash module is being used.
1153
- * Useful for diagnostics and testing.
1154
- */
1155
- declare function isUsingNativeHash(): boolean;
1156
- /**
1157
- * Force use of FNV-1a hash (for testing/compatibility).
1158
- * After calling this, hashString will always use FNV-1a.
1159
- */
1160
- declare function disableNativeHash(): void;
1161
- /**
1162
- * Re-enable native hash loading (for testing).
1163
- * Resets the load state so native module can be loaded again.
1164
- */
1165
- declare function resetNativeHash(): void;
1166
1168
  /**
1167
1169
  * Hash an object to a 32-bit unsigned integer.
1168
1170
  * Uses deterministic JSON serialization + hashString.
@@ -1381,6 +1383,16 @@ declare const ORMapRecordSchema: z.ZodObject<{
1381
1383
  tag: z.ZodString;
1382
1384
  ttlMs: z.ZodOptional<z.ZodNumber>;
1383
1385
  }, z.core.$strip>;
1386
+ /**
1387
+ * Unified change event type used across query updates, search updates,
1388
+ * and cluster subscription updates.
1389
+ */
1390
+ declare const ChangeEventTypeSchema: z.ZodEnum<{
1391
+ UPDATE: "UPDATE";
1392
+ ENTER: "ENTER";
1393
+ LEAVE: "LEAVE";
1394
+ }>;
1395
+ type ChangeEventType = z.infer<typeof ChangeEventTypeSchema>;
1384
1396
  declare const PredicateOpSchema: z.ZodEnum<{
1385
1397
  eq: "eq";
1386
1398
  neq: "neq";
@@ -1444,7 +1456,16 @@ type ClientOp = z.infer<typeof ClientOpSchema>;
1444
1456
  declare const AuthMessageSchema: z.ZodObject<{
1445
1457
  type: z.ZodLiteral<"AUTH">;
1446
1458
  token: z.ZodString;
1459
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
1447
1460
  }, z.core.$strip>;
1461
+ type AuthMessage = z.infer<typeof AuthMessageSchema>;
1462
+ /**
1463
+ * AUTH_REQUIRED: Server tells client that authentication is needed.
1464
+ */
1465
+ declare const AuthRequiredMessageSchema: z.ZodObject<{
1466
+ type: z.ZodLiteral<"AUTH_REQUIRED">;
1467
+ }, z.core.$strip>;
1468
+ type AuthRequiredMessage = z.infer<typeof AuthRequiredMessageSchema>;
1448
1469
 
1449
1470
  declare const ClientOpMessageSchema: z.ZodObject<{
1450
1471
  type: z.ZodLiteral<"CLIENT_OP">;
@@ -1483,6 +1504,7 @@ declare const ClientOpMessageSchema: z.ZodObject<{
1483
1504
  timeout: z.ZodOptional<z.ZodNumber>;
1484
1505
  }, z.core.$strip>;
1485
1506
  }, z.core.$strip>;
1507
+ type ClientOpMessage = z.infer<typeof ClientOpMessageSchema>;
1486
1508
  declare const OpBatchMessageSchema: z.ZodObject<{
1487
1509
  type: z.ZodLiteral<"OP_BATCH">;
1488
1510
  payload: z.ZodObject<{
@@ -1530,11 +1552,13 @@ declare const OpBatchMessageSchema: z.ZodObject<{
1530
1552
  timeout: z.ZodOptional<z.ZodNumber>;
1531
1553
  }, z.core.$strip>;
1532
1554
  }, z.core.$strip>;
1555
+ type OpBatchMessage = z.infer<typeof OpBatchMessageSchema>;
1533
1556
  declare const SyncInitMessageSchema: z.ZodObject<{
1534
1557
  type: z.ZodLiteral<"SYNC_INIT">;
1535
1558
  mapName: z.ZodString;
1536
1559
  lastSyncTimestamp: z.ZodOptional<z.ZodNumber>;
1537
1560
  }, z.core.$strip>;
1561
+ type SyncInitMessage = z.infer<typeof SyncInitMessageSchema>;
1538
1562
  declare const SyncRespRootMessageSchema: z.ZodObject<{
1539
1563
  type: z.ZodLiteral<"SYNC_RESP_ROOT">;
1540
1564
  payload: z.ZodObject<{
@@ -1547,6 +1571,7 @@ declare const SyncRespRootMessageSchema: z.ZodObject<{
1547
1571
  }, z.core.$strip>;
1548
1572
  }, z.core.$strip>;
1549
1573
  }, z.core.$strip>;
1574
+ type SyncRespRootMessage = z.infer<typeof SyncRespRootMessageSchema>;
1550
1575
  declare const SyncRespBucketsMessageSchema: z.ZodObject<{
1551
1576
  type: z.ZodLiteral<"SYNC_RESP_BUCKETS">;
1552
1577
  payload: z.ZodObject<{
@@ -1555,6 +1580,7 @@ declare const SyncRespBucketsMessageSchema: z.ZodObject<{
1555
1580
  buckets: z.ZodRecord<z.ZodString, z.ZodNumber>;
1556
1581
  }, z.core.$strip>;
1557
1582
  }, z.core.$strip>;
1583
+ type SyncRespBucketsMessage = z.infer<typeof SyncRespBucketsMessageSchema>;
1558
1584
  declare const SyncRespLeafMessageSchema: z.ZodObject<{
1559
1585
  type: z.ZodLiteral<"SYNC_RESP_LEAF">;
1560
1586
  payload: z.ZodObject<{
@@ -1574,6 +1600,7 @@ declare const SyncRespLeafMessageSchema: z.ZodObject<{
1574
1600
  }, z.core.$strip>>;
1575
1601
  }, z.core.$strip>;
1576
1602
  }, z.core.$strip>;
1603
+ type SyncRespLeafMessage = z.infer<typeof SyncRespLeafMessageSchema>;
1577
1604
  declare const MerkleReqBucketMessageSchema: z.ZodObject<{
1578
1605
  type: z.ZodLiteral<"MERKLE_REQ_BUCKET">;
1579
1606
  payload: z.ZodObject<{
@@ -1581,6 +1608,26 @@ declare const MerkleReqBucketMessageSchema: z.ZodObject<{
1581
1608
  path: z.ZodString;
1582
1609
  }, z.core.$strip>;
1583
1610
  }, z.core.$strip>;
1611
+ type MerkleReqBucketMessage = z.infer<typeof MerkleReqBucketMessageSchema>;
1612
+ /**
1613
+ * Shared entry shape for ORMap sync messages.
1614
+ * Used in ORMap leaf responses, diff responses, and push diffs.
1615
+ */
1616
+ declare const ORMapEntrySchema: z.ZodObject<{
1617
+ key: z.ZodString;
1618
+ records: z.ZodArray<z.ZodObject<{
1619
+ value: z.ZodAny;
1620
+ timestamp: z.ZodObject<{
1621
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
1622
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
1623
+ nodeId: z.ZodString;
1624
+ }, z.core.$strip>;
1625
+ tag: z.ZodString;
1626
+ ttlMs: z.ZodOptional<z.ZodNumber>;
1627
+ }, z.core.$strip>>;
1628
+ tombstones: z.ZodArray<z.ZodString>;
1629
+ }, z.core.$strip>;
1630
+ type ORMapEntry = z.infer<typeof ORMapEntrySchema>;
1584
1631
  /**
1585
1632
  * ORMAP_SYNC_INIT: Client initiates ORMap sync
1586
1633
  * Sends root hash and bucket hashes to server
@@ -1592,6 +1639,7 @@ declare const ORMapSyncInitSchema: z.ZodObject<{
1592
1639
  bucketHashes: z.ZodRecord<z.ZodString, z.ZodNumber>;
1593
1640
  lastSyncTimestamp: z.ZodOptional<z.ZodNumber>;
1594
1641
  }, z.core.$strip>;
1642
+ type ORMapSyncInit = z.infer<typeof ORMapSyncInitSchema>;
1595
1643
  declare const ORMapSyncRespRootSchema: z.ZodObject<{
1596
1644
  type: z.ZodLiteral<"ORMAP_SYNC_RESP_ROOT">;
1597
1645
  payload: z.ZodObject<{
@@ -1604,6 +1652,7 @@ declare const ORMapSyncRespRootSchema: z.ZodObject<{
1604
1652
  }, z.core.$strip>;
1605
1653
  }, z.core.$strip>;
1606
1654
  }, z.core.$strip>;
1655
+ type ORMapSyncRespRoot = z.infer<typeof ORMapSyncRespRootSchema>;
1607
1656
  declare const ORMapSyncRespBucketsSchema: z.ZodObject<{
1608
1657
  type: z.ZodLiteral<"ORMAP_SYNC_RESP_BUCKETS">;
1609
1658
  payload: z.ZodObject<{
@@ -1612,6 +1661,7 @@ declare const ORMapSyncRespBucketsSchema: z.ZodObject<{
1612
1661
  buckets: z.ZodRecord<z.ZodString, z.ZodNumber>;
1613
1662
  }, z.core.$strip>;
1614
1663
  }, z.core.$strip>;
1664
+ type ORMapSyncRespBuckets = z.infer<typeof ORMapSyncRespBucketsSchema>;
1615
1665
  declare const ORMapMerkleReqBucketSchema: z.ZodObject<{
1616
1666
  type: z.ZodLiteral<"ORMAP_MERKLE_REQ_BUCKET">;
1617
1667
  payload: z.ZodObject<{
@@ -1619,6 +1669,7 @@ declare const ORMapMerkleReqBucketSchema: z.ZodObject<{
1619
1669
  path: z.ZodString;
1620
1670
  }, z.core.$strip>;
1621
1671
  }, z.core.$strip>;
1672
+ type ORMapMerkleReqBucket = z.infer<typeof ORMapMerkleReqBucketSchema>;
1622
1673
  declare const ORMapSyncRespLeafSchema: z.ZodObject<{
1623
1674
  type: z.ZodLiteral<"ORMAP_SYNC_RESP_LEAF">;
1624
1675
  payload: z.ZodObject<{
@@ -1640,6 +1691,7 @@ declare const ORMapSyncRespLeafSchema: z.ZodObject<{
1640
1691
  }, z.core.$strip>>;
1641
1692
  }, z.core.$strip>;
1642
1693
  }, z.core.$strip>;
1694
+ type ORMapSyncRespLeaf = z.infer<typeof ORMapSyncRespLeafSchema>;
1643
1695
  declare const ORMapDiffRequestSchema: z.ZodObject<{
1644
1696
  type: z.ZodLiteral<"ORMAP_DIFF_REQUEST">;
1645
1697
  payload: z.ZodObject<{
@@ -1647,6 +1699,7 @@ declare const ORMapDiffRequestSchema: z.ZodObject<{
1647
1699
  keys: z.ZodArray<z.ZodString>;
1648
1700
  }, z.core.$strip>;
1649
1701
  }, z.core.$strip>;
1702
+ type ORMapDiffRequest = z.infer<typeof ORMapDiffRequestSchema>;
1650
1703
  declare const ORMapDiffResponseSchema: z.ZodObject<{
1651
1704
  type: z.ZodLiteral<"ORMAP_DIFF_RESPONSE">;
1652
1705
  payload: z.ZodObject<{
@@ -1667,6 +1720,7 @@ declare const ORMapDiffResponseSchema: z.ZodObject<{
1667
1720
  }, z.core.$strip>>;
1668
1721
  }, z.core.$strip>;
1669
1722
  }, z.core.$strip>;
1723
+ type ORMapDiffResponse = z.infer<typeof ORMapDiffResponseSchema>;
1670
1724
  declare const ORMapPushDiffSchema: z.ZodObject<{
1671
1725
  type: z.ZodLiteral<"ORMAP_PUSH_DIFF">;
1672
1726
  payload: z.ZodObject<{
@@ -1687,6 +1741,7 @@ declare const ORMapPushDiffSchema: z.ZodObject<{
1687
1741
  }, z.core.$strip>>;
1688
1742
  }, z.core.$strip>;
1689
1743
  }, z.core.$strip>;
1744
+ type ORMapPushDiff = z.infer<typeof ORMapPushDiffSchema>;
1690
1745
  declare const OpResultSchema: z.ZodObject<{
1691
1746
  opId: z.ZodString;
1692
1747
  success: z.ZodBoolean;
@@ -1764,12 +1819,14 @@ declare const QuerySubMessageSchema: z.ZodObject<{
1764
1819
  }, z.core.$strip>;
1765
1820
  }, z.core.$strip>;
1766
1821
  }, z.core.$strip>;
1822
+ type QuerySubMessage = z.infer<typeof QuerySubMessageSchema>;
1767
1823
  declare const QueryUnsubMessageSchema: z.ZodObject<{
1768
1824
  type: z.ZodLiteral<"QUERY_UNSUB">;
1769
1825
  payload: z.ZodObject<{
1770
1826
  queryId: z.ZodString;
1771
1827
  }, z.core.$strip>;
1772
1828
  }, z.core.$strip>;
1829
+ type QueryUnsubMessage = z.infer<typeof QueryUnsubMessageSchema>;
1773
1830
  declare const CursorStatusSchema: z.ZodEnum<{
1774
1831
  valid: "valid";
1775
1832
  expired: "expired";
@@ -1908,7 +1965,7 @@ declare const SearchUpdatePayloadSchema: z.ZodObject<{
1908
1965
  value: z.ZodUnknown;
1909
1966
  score: z.ZodNumber;
1910
1967
  matchedTerms: z.ZodArray<z.ZodString>;
1911
- type: z.ZodEnum<{
1968
+ changeType: z.ZodEnum<{
1912
1969
  UPDATE: "UPDATE";
1913
1970
  ENTER: "ENTER";
1914
1971
  LEAVE: "LEAVE";
@@ -1923,7 +1980,7 @@ declare const SearchUpdateMessageSchema: z.ZodObject<{
1923
1980
  value: z.ZodUnknown;
1924
1981
  score: z.ZodNumber;
1925
1982
  matchedTerms: z.ZodArray<z.ZodString>;
1926
- type: z.ZodEnum<{
1983
+ changeType: z.ZodEnum<{
1927
1984
  UPDATE: "UPDATE";
1928
1985
  ENTER: "ENTER";
1929
1986
  LEAVE: "LEAVE";
@@ -1949,6 +2006,81 @@ declare const PartitionMapRequestSchema: z.ZodObject<{
1949
2006
  currentVersion: z.ZodOptional<z.ZodNumber>;
1950
2007
  }, z.core.$strip>>;
1951
2008
  }, z.core.$strip>;
2009
+ type PartitionMapRequest = z.infer<typeof PartitionMapRequestSchema>;
2010
+ declare const NodeInfoSchema: z.ZodObject<{
2011
+ nodeId: z.ZodString;
2012
+ endpoints: z.ZodObject<{
2013
+ websocket: z.ZodString;
2014
+ http: z.ZodOptional<z.ZodString>;
2015
+ }, z.core.$strip>;
2016
+ status: z.ZodEnum<{
2017
+ ACTIVE: "ACTIVE";
2018
+ JOINING: "JOINING";
2019
+ LEAVING: "LEAVING";
2020
+ SUSPECTED: "SUSPECTED";
2021
+ FAILED: "FAILED";
2022
+ }>;
2023
+ }, z.core.$strip>;
2024
+ type NodeInfoZod = z.infer<typeof NodeInfoSchema>;
2025
+ declare const PartitionInfoSchema: z.ZodObject<{
2026
+ partitionId: z.ZodNumber;
2027
+ ownerNodeId: z.ZodString;
2028
+ backupNodeIds: z.ZodArray<z.ZodString>;
2029
+ }, z.core.$strip>;
2030
+ type PartitionInfoZod = z.infer<typeof PartitionInfoSchema>;
2031
+ declare const PartitionMapPayloadSchema: z.ZodObject<{
2032
+ version: z.ZodNumber;
2033
+ partitionCount: z.ZodNumber;
2034
+ nodes: z.ZodArray<z.ZodObject<{
2035
+ nodeId: z.ZodString;
2036
+ endpoints: z.ZodObject<{
2037
+ websocket: z.ZodString;
2038
+ http: z.ZodOptional<z.ZodString>;
2039
+ }, z.core.$strip>;
2040
+ status: z.ZodEnum<{
2041
+ ACTIVE: "ACTIVE";
2042
+ JOINING: "JOINING";
2043
+ LEAVING: "LEAVING";
2044
+ SUSPECTED: "SUSPECTED";
2045
+ FAILED: "FAILED";
2046
+ }>;
2047
+ }, z.core.$strip>>;
2048
+ partitions: z.ZodArray<z.ZodObject<{
2049
+ partitionId: z.ZodNumber;
2050
+ ownerNodeId: z.ZodString;
2051
+ backupNodeIds: z.ZodArray<z.ZodString>;
2052
+ }, z.core.$strip>>;
2053
+ generatedAt: z.ZodNumber;
2054
+ }, z.core.$strip>;
2055
+ type PartitionMapPayload = z.infer<typeof PartitionMapPayloadSchema>;
2056
+ declare const PartitionMapMessageSchema: z.ZodObject<{
2057
+ type: z.ZodLiteral<"PARTITION_MAP">;
2058
+ payload: z.ZodObject<{
2059
+ version: z.ZodNumber;
2060
+ partitionCount: z.ZodNumber;
2061
+ nodes: z.ZodArray<z.ZodObject<{
2062
+ nodeId: z.ZodString;
2063
+ endpoints: z.ZodObject<{
2064
+ websocket: z.ZodString;
2065
+ http: z.ZodOptional<z.ZodString>;
2066
+ }, z.core.$strip>;
2067
+ status: z.ZodEnum<{
2068
+ ACTIVE: "ACTIVE";
2069
+ JOINING: "JOINING";
2070
+ LEAVING: "LEAVING";
2071
+ SUSPECTED: "SUSPECTED";
2072
+ FAILED: "FAILED";
2073
+ }>;
2074
+ }, z.core.$strip>>;
2075
+ partitions: z.ZodArray<z.ZodObject<{
2076
+ partitionId: z.ZodNumber;
2077
+ ownerNodeId: z.ZodString;
2078
+ backupNodeIds: z.ZodArray<z.ZodString>;
2079
+ }, z.core.$strip>>;
2080
+ generatedAt: z.ZodNumber;
2081
+ }, z.core.$strip>;
2082
+ }, z.core.$strip>;
2083
+ type PartitionMapMessage = z.infer<typeof PartitionMapMessageSchema>;
1952
2084
  declare const ClusterSubRegisterPayloadSchema: z.ZodObject<{
1953
2085
  subscriptionId: z.ZodString;
1954
2086
  coordinatorNodeId: z.ZodString;
@@ -2074,9 +2206,9 @@ declare const ClusterSearchReqPayloadSchema: z.ZodObject<{
2074
2206
  mapName: z.ZodString;
2075
2207
  query: z.ZodString;
2076
2208
  options: z.ZodObject<{
2077
- limit: z.ZodNumber;
2078
2209
  minScore: z.ZodOptional<z.ZodNumber>;
2079
2210
  boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
2211
+ limit: z.ZodNumber;
2080
2212
  includeMatchedTerms: z.ZodOptional<z.ZodBoolean>;
2081
2213
  afterScore: z.ZodOptional<z.ZodNumber>;
2082
2214
  afterKey: z.ZodOptional<z.ZodString>;
@@ -2091,9 +2223,9 @@ declare const ClusterSearchReqMessageSchema: z.ZodObject<{
2091
2223
  mapName: z.ZodString;
2092
2224
  query: z.ZodString;
2093
2225
  options: z.ZodObject<{
2094
- limit: z.ZodNumber;
2095
2226
  minScore: z.ZodOptional<z.ZodNumber>;
2096
2227
  boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
2228
+ limit: z.ZodNumber;
2097
2229
  includeMatchedTerms: z.ZodOptional<z.ZodBoolean>;
2098
2230
  afterScore: z.ZodOptional<z.ZodNumber>;
2099
2231
  afterKey: z.ZodOptional<z.ZodString>;
@@ -2176,7 +2308,7 @@ declare const ClusterSearchUpdatePayloadSchema: z.ZodObject<{
2176
2308
  value: z.ZodUnknown;
2177
2309
  score: z.ZodNumber;
2178
2310
  matchedTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
2179
- type: z.ZodEnum<{
2311
+ changeType: z.ZodEnum<{
2180
2312
  UPDATE: "UPDATE";
2181
2313
  ENTER: "ENTER";
2182
2314
  LEAVE: "LEAVE";
@@ -2192,7 +2324,7 @@ declare const ClusterSearchUpdateMessageSchema: z.ZodObject<{
2192
2324
  value: z.ZodUnknown;
2193
2325
  score: z.ZodNumber;
2194
2326
  matchedTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
2195
- type: z.ZodEnum<{
2327
+ changeType: z.ZodEnum<{
2196
2328
  UPDATE: "UPDATE";
2197
2329
  ENTER: "ENTER";
2198
2330
  LEAVE: "LEAVE";
@@ -2207,12 +2339,14 @@ declare const TopicSubSchema: z.ZodObject<{
2207
2339
  topic: z.ZodString;
2208
2340
  }, z.core.$strip>;
2209
2341
  }, z.core.$strip>;
2342
+ type TopicSub = z.infer<typeof TopicSubSchema>;
2210
2343
  declare const TopicUnsubSchema: z.ZodObject<{
2211
2344
  type: z.ZodLiteral<"TOPIC_UNSUB">;
2212
2345
  payload: z.ZodObject<{
2213
2346
  topic: z.ZodString;
2214
2347
  }, z.core.$strip>;
2215
2348
  }, z.core.$strip>;
2349
+ type TopicUnsub = z.infer<typeof TopicUnsubSchema>;
2216
2350
  declare const TopicPubSchema: z.ZodObject<{
2217
2351
  type: z.ZodLiteral<"TOPIC_PUB">;
2218
2352
  payload: z.ZodObject<{
@@ -2220,6 +2354,7 @@ declare const TopicPubSchema: z.ZodObject<{
2220
2354
  data: z.ZodAny;
2221
2355
  }, z.core.$strip>;
2222
2356
  }, z.core.$strip>;
2357
+ type TopicPub = z.infer<typeof TopicPubSchema>;
2223
2358
  declare const TopicMessageEventSchema: z.ZodObject<{
2224
2359
  type: z.ZodLiteral<"TOPIC_MESSAGE">;
2225
2360
  payload: z.ZodObject<{
@@ -2229,6 +2364,7 @@ declare const TopicMessageEventSchema: z.ZodObject<{
2229
2364
  timestamp: z.ZodNumber;
2230
2365
  }, z.core.$strip>;
2231
2366
  }, z.core.$strip>;
2367
+ type TopicMessageEvent = z.infer<typeof TopicMessageEventSchema>;
2232
2368
  declare const LockRequestSchema: z.ZodObject<{
2233
2369
  type: z.ZodLiteral<"LOCK_REQUEST">;
2234
2370
  payload: z.ZodObject<{
@@ -2237,6 +2373,7 @@ declare const LockRequestSchema: z.ZodObject<{
2237
2373
  ttl: z.ZodOptional<z.ZodNumber>;
2238
2374
  }, z.core.$strip>;
2239
2375
  }, z.core.$strip>;
2376
+ type LockRequest = z.infer<typeof LockRequestSchema>;
2240
2377
  declare const LockReleaseSchema: z.ZodObject<{
2241
2378
  type: z.ZodLiteral<"LOCK_RELEASE">;
2242
2379
  payload: z.ZodObject<{
@@ -2245,6 +2382,7 @@ declare const LockReleaseSchema: z.ZodObject<{
2245
2382
  fencingToken: z.ZodNumber;
2246
2383
  }, z.core.$strip>;
2247
2384
  }, z.core.$strip>;
2385
+ type LockRelease = z.infer<typeof LockReleaseSchema>;
2248
2386
  declare const PNCounterStateObjectSchema: z.ZodObject<{
2249
2387
  p: z.ZodRecord<z.ZodString, z.ZodNumber>;
2250
2388
  n: z.ZodRecord<z.ZodString, z.ZodNumber>;
@@ -2255,6 +2393,7 @@ declare const CounterRequestSchema: z.ZodObject<{
2255
2393
  name: z.ZodString;
2256
2394
  }, z.core.$strip>;
2257
2395
  }, z.core.$strip>;
2396
+ type CounterRequest = z.infer<typeof CounterRequestSchema>;
2258
2397
  declare const CounterSyncSchema: z.ZodObject<{
2259
2398
  type: z.ZodLiteral<"COUNTER_SYNC">;
2260
2399
  payload: z.ZodObject<{
@@ -2265,6 +2404,7 @@ declare const CounterSyncSchema: z.ZodObject<{
2265
2404
  }, z.core.$strip>;
2266
2405
  }, z.core.$strip>;
2267
2406
  }, z.core.$strip>;
2407
+ type CounterSync = z.infer<typeof CounterSyncSchema>;
2268
2408
  declare const CounterResponseSchema: z.ZodObject<{
2269
2409
  type: z.ZodLiteral<"COUNTER_RESPONSE">;
2270
2410
  payload: z.ZodObject<{
@@ -2275,6 +2415,7 @@ declare const CounterResponseSchema: z.ZodObject<{
2275
2415
  }, z.core.$strip>;
2276
2416
  }, z.core.$strip>;
2277
2417
  }, z.core.$strip>;
2418
+ type CounterResponse = z.infer<typeof CounterResponseSchema>;
2278
2419
  declare const CounterUpdateSchema: z.ZodObject<{
2279
2420
  type: z.ZodLiteral<"COUNTER_UPDATE">;
2280
2421
  payload: z.ZodObject<{
@@ -2285,6 +2426,7 @@ declare const CounterUpdateSchema: z.ZodObject<{
2285
2426
  }, z.core.$strip>;
2286
2427
  }, z.core.$strip>;
2287
2428
  }, z.core.$strip>;
2429
+ type CounterUpdate = z.infer<typeof CounterUpdateSchema>;
2288
2430
  declare const PingMessageSchema: z.ZodObject<{
2289
2431
  type: z.ZodLiteral<"PING">;
2290
2432
  timestamp: z.ZodNumber;
@@ -2301,6 +2443,7 @@ declare const EntryProcessorSchema: z.ZodObject<{
2301
2443
  code: z.ZodString;
2302
2444
  args: z.ZodOptional<z.ZodUnknown>;
2303
2445
  }, z.core.$strip>;
2446
+ type EntryProcessor = z.infer<typeof EntryProcessorSchema>;
2304
2447
  declare const EntryProcessRequestSchema: z.ZodObject<{
2305
2448
  type: z.ZodLiteral<"ENTRY_PROCESS">;
2306
2449
  requestId: z.ZodString;
@@ -2626,10 +2769,10 @@ declare const QueryUpdatePayloadSchema: z.ZodObject<{
2626
2769
  queryId: z.ZodString;
2627
2770
  key: z.ZodString;
2628
2771
  value: z.ZodUnknown;
2629
- type: z.ZodEnum<{
2772
+ changeType: z.ZodEnum<{
2630
2773
  UPDATE: "UPDATE";
2631
- REMOVE: "REMOVE";
2632
2774
  ENTER: "ENTER";
2775
+ LEAVE: "LEAVE";
2633
2776
  }>;
2634
2777
  }, z.core.$strip>;
2635
2778
  type QueryUpdatePayload = z.infer<typeof QueryUpdatePayloadSchema>;
@@ -2639,10 +2782,10 @@ declare const QueryUpdateMessageSchema: z.ZodObject<{
2639
2782
  queryId: z.ZodString;
2640
2783
  key: z.ZodString;
2641
2784
  value: z.ZodUnknown;
2642
- type: z.ZodEnum<{
2785
+ changeType: z.ZodEnum<{
2643
2786
  UPDATE: "UPDATE";
2644
- REMOVE: "REMOVE";
2645
2787
  ENTER: "ENTER";
2788
+ LEAVE: "LEAVE";
2646
2789
  }>;
2647
2790
  }, z.core.$strip>;
2648
2791
  }, z.core.$strip>;
@@ -2666,58 +2809,70 @@ declare const GcPruneMessageSchema: z.ZodObject<{
2666
2809
  }, z.core.$strip>;
2667
2810
  }, z.core.$strip>;
2668
2811
  type GcPruneMessage = z.infer<typeof GcPruneMessageSchema>;
2812
+ declare const AuthAckMessageSchema: z.ZodObject<{
2813
+ type: z.ZodLiteral<"AUTH_ACK">;
2814
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
2815
+ userId: z.ZodOptional<z.ZodString>;
2816
+ }, z.core.$strip>;
2817
+ type AuthAckMessage = z.infer<typeof AuthAckMessageSchema>;
2669
2818
  declare const AuthFailMessageSchema: z.ZodObject<{
2670
2819
  type: z.ZodLiteral<"AUTH_FAIL">;
2671
2820
  error: z.ZodOptional<z.ZodString>;
2672
2821
  code: z.ZodOptional<z.ZodNumber>;
2673
2822
  }, z.core.$strip>;
2674
2823
  type AuthFailMessage = z.infer<typeof AuthFailMessageSchema>;
2675
- declare const HybridQueryRespPayloadSchema: z.ZodObject<{
2676
- subscriptionId: z.ZodString;
2677
- results: z.ZodArray<z.ZodObject<{
2678
- key: z.ZodString;
2679
- value: z.ZodUnknown;
2680
- score: z.ZodNumber;
2681
- matchedTerms: z.ZodArray<z.ZodString>;
2682
- }, z.core.$strip>>;
2683
- nextCursor: z.ZodOptional<z.ZodString>;
2684
- hasMore: z.ZodOptional<z.ZodBoolean>;
2685
- cursorStatus: z.ZodOptional<z.ZodEnum<{
2686
- valid: "valid";
2687
- expired: "expired";
2688
- invalid: "invalid";
2689
- none: "none";
2690
- }>>;
2691
- }, z.core.$strip>;
2692
- type HybridQueryRespPayload = z.infer<typeof HybridQueryRespPayloadSchema>;
2693
- declare const HybridQueryDeltaPayloadSchema: z.ZodObject<{
2694
- subscriptionId: z.ZodString;
2695
- key: z.ZodString;
2696
- value: z.ZodNullable<z.ZodUnknown>;
2697
- score: z.ZodOptional<z.ZodNumber>;
2698
- matchedTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
2699
- type: z.ZodEnum<{
2700
- UPDATE: "UPDATE";
2701
- ENTER: "ENTER";
2702
- LEAVE: "LEAVE";
2703
- }>;
2824
+ declare const ErrorMessageSchema: z.ZodObject<{
2825
+ type: z.ZodLiteral<"ERROR">;
2826
+ payload: z.ZodObject<{
2827
+ code: z.ZodNumber;
2828
+ message: z.ZodString;
2829
+ details: z.ZodOptional<z.ZodUnknown>;
2830
+ }, z.core.$strip>;
2704
2831
  }, z.core.$strip>;
2705
- type HybridQueryDeltaPayload = z.infer<typeof HybridQueryDeltaPayloadSchema>;
2832
+ type ErrorMessage = z.infer<typeof ErrorMessageSchema>;
2706
2833
  declare const LockGrantedPayloadSchema: z.ZodObject<{
2707
2834
  requestId: z.ZodString;
2835
+ name: z.ZodString;
2708
2836
  fencingToken: z.ZodNumber;
2709
2837
  }, z.core.$strip>;
2710
2838
  type LockGrantedPayload = z.infer<typeof LockGrantedPayloadSchema>;
2711
2839
  declare const LockReleasedPayloadSchema: z.ZodObject<{
2712
2840
  requestId: z.ZodString;
2841
+ name: z.ZodString;
2713
2842
  success: z.ZodBoolean;
2714
2843
  }, z.core.$strip>;
2715
2844
  type LockReleasedPayload = z.infer<typeof LockReleasedPayloadSchema>;
2845
+ declare const LockGrantedMessageSchema: z.ZodObject<{
2846
+ type: z.ZodLiteral<"LOCK_GRANTED">;
2847
+ payload: z.ZodObject<{
2848
+ requestId: z.ZodString;
2849
+ name: z.ZodString;
2850
+ fencingToken: z.ZodNumber;
2851
+ }, z.core.$strip>;
2852
+ }, z.core.$strip>;
2853
+ type LockGrantedMessage = z.infer<typeof LockGrantedMessageSchema>;
2854
+ declare const LockReleasedMessageSchema: z.ZodObject<{
2855
+ type: z.ZodLiteral<"LOCK_RELEASED">;
2856
+ payload: z.ZodObject<{
2857
+ requestId: z.ZodString;
2858
+ name: z.ZodString;
2859
+ success: z.ZodBoolean;
2860
+ }, z.core.$strip>;
2861
+ }, z.core.$strip>;
2862
+ type LockReleasedMessage = z.infer<typeof LockReleasedMessageSchema>;
2716
2863
  declare const SyncResetRequiredPayloadSchema: z.ZodObject<{
2717
2864
  mapName: z.ZodString;
2718
2865
  reason: z.ZodString;
2719
2866
  }, z.core.$strip>;
2720
2867
  type SyncResetRequiredPayload = z.infer<typeof SyncResetRequiredPayloadSchema>;
2868
+ declare const SyncResetRequiredMessageSchema: z.ZodObject<{
2869
+ type: z.ZodLiteral<"SYNC_RESET_REQUIRED">;
2870
+ payload: z.ZodObject<{
2871
+ mapName: z.ZodString;
2872
+ reason: z.ZodString;
2873
+ }, z.core.$strip>;
2874
+ }, z.core.$strip>;
2875
+ type SyncResetRequiredMessage = z.infer<typeof SyncResetRequiredMessageSchema>;
2721
2876
  type SyncRespRootPayload = z.infer<typeof SyncRespRootMessageSchema>['payload'];
2722
2877
  type SyncRespBucketsPayload = z.infer<typeof SyncRespBucketsMessageSchema>['payload'];
2723
2878
  type SyncRespLeafPayload = z.infer<typeof SyncRespLeafMessageSchema>['payload'];
@@ -2726,33 +2881,53 @@ type ORMapSyncRespBucketsPayload = z.infer<typeof ORMapSyncRespBucketsSchema>['p
2726
2881
  type ORMapSyncRespLeafPayload = z.infer<typeof ORMapSyncRespLeafSchema>['payload'];
2727
2882
  type ORMapDiffResponsePayload = z.infer<typeof ORMapDiffResponseSchema>['payload'];
2728
2883
 
2729
- declare const MessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2730
- type: z.ZodLiteral<"AUTH">;
2731
- token: z.ZodString;
2732
- }, z.core.$strip>, z.ZodObject<{
2733
- type: z.ZodLiteral<"QUERY_SUB">;
2734
- payload: z.ZodObject<{
2735
- queryId: z.ZodString;
2736
- mapName: z.ZodString;
2737
- query: z.ZodObject<{
2738
- where: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2739
- predicate: z.ZodOptional<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>;
2740
- sort: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
2741
- asc: "asc";
2742
- desc: "desc";
2743
- }>>>;
2744
- limit: z.ZodOptional<z.ZodNumber>;
2745
- cursor: z.ZodOptional<z.ZodString>;
2746
- }, z.core.$strip>;
2884
+ /**
2885
+ * Schema for individual sync map entries, specifying which maps the client
2886
+ * wants deltas for and the last known sync HLC timestamp for each.
2887
+ */
2888
+ declare const SyncMapEntrySchema: z.ZodObject<{
2889
+ mapName: z.ZodString;
2890
+ lastSyncTimestamp: z.ZodObject<{
2891
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2892
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2893
+ nodeId: z.ZodString;
2747
2894
  }, z.core.$strip>;
2748
- }, z.core.$strip>, z.ZodObject<{
2749
- type: z.ZodLiteral<"QUERY_UNSUB">;
2750
- payload: z.ZodObject<{
2751
- queryId: z.ZodString;
2895
+ }, z.core.$strip>;
2896
+ type SyncMapEntry = z.infer<typeof SyncMapEntrySchema>;
2897
+ /**
2898
+ * Schema for one-shot query requests over HTTP.
2899
+ */
2900
+ declare const HttpQueryRequestSchema: z.ZodObject<{
2901
+ queryId: z.ZodString;
2902
+ mapName: z.ZodString;
2903
+ filter: z.ZodAny;
2904
+ limit: z.ZodOptional<z.ZodNumber>;
2905
+ offset: z.ZodOptional<z.ZodNumber>;
2906
+ }, z.core.$strip>;
2907
+ type HttpQueryRequest = z.infer<typeof HttpQueryRequestSchema>;
2908
+ /**
2909
+ * Schema for one-shot search requests over HTTP.
2910
+ */
2911
+ declare const HttpSearchRequestSchema: z.ZodObject<{
2912
+ searchId: z.ZodString;
2913
+ mapName: z.ZodString;
2914
+ query: z.ZodString;
2915
+ options: z.ZodOptional<z.ZodAny>;
2916
+ }, z.core.$strip>;
2917
+ type HttpSearchRequest = z.infer<typeof HttpSearchRequestSchema>;
2918
+ /**
2919
+ * HTTP sync request body sent by the client as POST /sync.
2920
+ * Contains all context needed for a stateless request: client identity,
2921
+ * HLC state, operations to push, maps to pull deltas for, and queries/searches.
2922
+ */
2923
+ declare const HttpSyncRequestSchema: z.ZodObject<{
2924
+ clientId: z.ZodString;
2925
+ clientHlc: 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;
2752
2929
  }, z.core.$strip>;
2753
- }, z.core.$strip>, z.ZodObject<{
2754
- type: z.ZodLiteral<"CLIENT_OP">;
2755
- payload: z.ZodObject<{
2930
+ operations: z.ZodOptional<z.ZodArray<z.ZodObject<{
2756
2931
  id: z.ZodOptional<z.ZodString>;
2757
2932
  mapName: z.ZodString;
2758
2933
  key: z.ZodString;
@@ -2785,112 +2960,696 @@ declare const MessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2785
2960
  PERSISTED: "PERSISTED";
2786
2961
  }>>;
2787
2962
  timeout: z.ZodOptional<z.ZodNumber>;
2788
- }, z.core.$strip>;
2789
- }, z.core.$strip>, z.ZodObject<{
2790
- type: z.ZodLiteral<"OP_BATCH">;
2791
- payload: z.ZodObject<{
2792
- ops: z.ZodArray<z.ZodObject<{
2793
- id: z.ZodOptional<z.ZodString>;
2794
- mapName: z.ZodString;
2795
- key: z.ZodString;
2796
- opType: z.ZodOptional<z.ZodString>;
2797
- record: z.ZodOptional<z.ZodNullable<z.ZodObject<{
2798
- value: z.ZodNullable<z.ZodAny>;
2799
- timestamp: z.ZodObject<{
2800
- millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2801
- counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2802
- nodeId: z.ZodString;
2803
- }, z.core.$strip>;
2804
- ttlMs: z.ZodOptional<z.ZodNumber>;
2805
- }, z.core.$strip>>>;
2806
- orRecord: z.ZodOptional<z.ZodNullable<z.ZodObject<{
2807
- value: z.ZodAny;
2808
- timestamp: z.ZodObject<{
2809
- millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2810
- counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2811
- nodeId: z.ZodString;
2812
- }, z.core.$strip>;
2813
- tag: z.ZodString;
2814
- ttlMs: z.ZodOptional<z.ZodNumber>;
2815
- }, z.core.$strip>>>;
2816
- orTag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
2817
- writeConcern: z.ZodOptional<z.ZodEnum<{
2818
- FIRE_AND_FORGET: "FIRE_AND_FORGET";
2819
- MEMORY: "MEMORY";
2820
- APPLIED: "APPLIED";
2821
- REPLICATED: "REPLICATED";
2822
- PERSISTED: "PERSISTED";
2823
- }>>;
2824
- timeout: z.ZodOptional<z.ZodNumber>;
2825
- }, z.core.$strip>>;
2826
- writeConcern: z.ZodOptional<z.ZodEnum<{
2827
- FIRE_AND_FORGET: "FIRE_AND_FORGET";
2828
- MEMORY: "MEMORY";
2829
- APPLIED: "APPLIED";
2830
- REPLICATED: "REPLICATED";
2831
- PERSISTED: "PERSISTED";
2832
- }>>;
2833
- timeout: z.ZodOptional<z.ZodNumber>;
2834
- }, z.core.$strip>;
2835
- }, z.core.$strip>, z.ZodObject<{
2836
- type: z.ZodLiteral<"SYNC_INIT">;
2837
- mapName: z.ZodString;
2838
- lastSyncTimestamp: z.ZodOptional<z.ZodNumber>;
2839
- }, z.core.$strip>, z.ZodObject<{
2840
- type: z.ZodLiteral<"SYNC_RESP_ROOT">;
2841
- payload: z.ZodObject<{
2963
+ }, z.core.$strip>>>;
2964
+ syncMaps: z.ZodOptional<z.ZodArray<z.ZodObject<{
2842
2965
  mapName: z.ZodString;
2843
- rootHash: z.ZodNumber;
2844
- timestamp: z.ZodObject<{
2966
+ lastSyncTimestamp: z.ZodObject<{
2845
2967
  millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2846
2968
  counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2847
2969
  nodeId: z.ZodString;
2848
2970
  }, z.core.$strip>;
2849
- }, z.core.$strip>;
2850
- }, z.core.$strip>, z.ZodObject<{
2851
- type: z.ZodLiteral<"SYNC_RESP_BUCKETS">;
2852
- payload: z.ZodObject<{
2971
+ }, z.core.$strip>>>;
2972
+ queries: z.ZodOptional<z.ZodArray<z.ZodObject<{
2973
+ queryId: z.ZodString;
2853
2974
  mapName: z.ZodString;
2854
- path: z.ZodString;
2855
- buckets: z.ZodRecord<z.ZodString, z.ZodNumber>;
2856
- }, z.core.$strip>;
2857
- }, z.core.$strip>, z.ZodObject<{
2858
- type: z.ZodLiteral<"SYNC_RESP_LEAF">;
2859
- payload: z.ZodObject<{
2975
+ filter: z.ZodAny;
2976
+ limit: z.ZodOptional<z.ZodNumber>;
2977
+ offset: z.ZodOptional<z.ZodNumber>;
2978
+ }, z.core.$strip>>>;
2979
+ searches: z.ZodOptional<z.ZodArray<z.ZodObject<{
2980
+ searchId: z.ZodString;
2860
2981
  mapName: z.ZodString;
2861
- path: z.ZodString;
2862
- records: z.ZodArray<z.ZodObject<{
2863
- key: z.ZodString;
2864
- record: z.ZodObject<{
2865
- value: z.ZodNullable<z.ZodAny>;
2866
- timestamp: z.ZodObject<{
2867
- millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2868
- counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2869
- nodeId: z.ZodString;
2870
- }, z.core.$strip>;
2871
- ttlMs: z.ZodOptional<z.ZodNumber>;
2872
- }, z.core.$strip>;
2873
- }, z.core.$strip>>;
2874
- }, z.core.$strip>;
2875
- }, z.core.$strip>, z.ZodObject<{
2982
+ query: z.ZodString;
2983
+ options: z.ZodOptional<z.ZodAny>;
2984
+ }, z.core.$strip>>>;
2985
+ }, z.core.$strip>;
2986
+ type HttpSyncRequest = z.infer<typeof HttpSyncRequestSchema>;
2987
+ /**
2988
+ * Delta record for a single key within a map.
2989
+ */
2990
+ declare const DeltaRecordSchema: z.ZodObject<{
2991
+ key: z.ZodString;
2992
+ record: z.ZodObject<{
2993
+ value: z.ZodNullable<z.ZodAny>;
2994
+ timestamp: z.ZodObject<{
2995
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2996
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2997
+ nodeId: z.ZodString;
2998
+ }, z.core.$strip>;
2999
+ ttlMs: z.ZodOptional<z.ZodNumber>;
3000
+ }, z.core.$strip>;
3001
+ eventType: z.ZodEnum<{
3002
+ PUT: "PUT";
3003
+ REMOVE: "REMOVE";
3004
+ }>;
3005
+ }, z.core.$strip>;
3006
+ type DeltaRecord = z.infer<typeof DeltaRecordSchema>;
3007
+ /**
3008
+ * Delta records for a specific map, containing all new/changed records
3009
+ * since the client's lastSyncTimestamp.
3010
+ */
3011
+ declare const MapDeltaSchema: z.ZodObject<{
3012
+ mapName: z.ZodString;
3013
+ records: z.ZodArray<z.ZodObject<{
3014
+ key: z.ZodString;
3015
+ record: z.ZodObject<{
3016
+ value: z.ZodNullable<z.ZodAny>;
3017
+ timestamp: z.ZodObject<{
3018
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3019
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3020
+ nodeId: z.ZodString;
3021
+ }, z.core.$strip>;
3022
+ ttlMs: z.ZodOptional<z.ZodNumber>;
3023
+ }, z.core.$strip>;
3024
+ eventType: z.ZodEnum<{
3025
+ PUT: "PUT";
3026
+ REMOVE: "REMOVE";
3027
+ }>;
3028
+ }, z.core.$strip>>;
3029
+ serverSyncTimestamp: z.ZodObject<{
3030
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3031
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3032
+ nodeId: z.ZodString;
3033
+ }, z.core.$strip>;
3034
+ }, z.core.$strip>;
3035
+ type MapDelta = z.infer<typeof MapDeltaSchema>;
3036
+ /**
3037
+ * Query result for a one-shot HTTP query.
3038
+ */
3039
+ declare const HttpQueryResultSchema: z.ZodObject<{
3040
+ queryId: z.ZodString;
3041
+ results: z.ZodArray<z.ZodAny>;
3042
+ hasMore: z.ZodOptional<z.ZodBoolean>;
3043
+ nextCursor: z.ZodOptional<z.ZodString>;
3044
+ }, z.core.$strip>;
3045
+ type HttpQueryResult = z.infer<typeof HttpQueryResultSchema>;
3046
+ /**
3047
+ * Search result for a one-shot HTTP search.
3048
+ */
3049
+ declare const HttpSearchResultSchema: z.ZodObject<{
3050
+ searchId: z.ZodString;
3051
+ results: z.ZodArray<z.ZodAny>;
3052
+ totalCount: z.ZodOptional<z.ZodNumber>;
3053
+ }, z.core.$strip>;
3054
+ type HttpSearchResult = z.infer<typeof HttpSearchResultSchema>;
3055
+ /**
3056
+ * Error entry for individual operation failures.
3057
+ */
3058
+ declare const HttpSyncErrorSchema: z.ZodObject<{
3059
+ code: z.ZodNumber;
3060
+ message: z.ZodString;
3061
+ context: z.ZodOptional<z.ZodString>;
3062
+ }, z.core.$strip>;
3063
+ type HttpSyncError = z.infer<typeof HttpSyncErrorSchema>;
3064
+ /**
3065
+ * HTTP sync response returned by the server for POST /sync.
3066
+ * Contains operation acknowledgments, delta records, query/search results,
3067
+ * and the server's current HLC for the client to use in subsequent requests.
3068
+ */
3069
+ declare const HttpSyncResponseSchema: z.ZodObject<{
3070
+ serverHlc: z.ZodObject<{
3071
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3072
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3073
+ nodeId: z.ZodString;
3074
+ }, z.core.$strip>;
3075
+ ack: z.ZodOptional<z.ZodObject<{
3076
+ lastId: z.ZodString;
3077
+ results: z.ZodOptional<z.ZodArray<z.ZodObject<{
3078
+ opId: z.ZodString;
3079
+ success: z.ZodBoolean;
3080
+ achievedLevel: z.ZodEnum<{
3081
+ FIRE_AND_FORGET: "FIRE_AND_FORGET";
3082
+ MEMORY: "MEMORY";
3083
+ APPLIED: "APPLIED";
3084
+ REPLICATED: "REPLICATED";
3085
+ PERSISTED: "PERSISTED";
3086
+ }>;
3087
+ error: z.ZodOptional<z.ZodString>;
3088
+ }, z.core.$strip>>>;
3089
+ }, z.core.$strip>>;
3090
+ deltas: z.ZodOptional<z.ZodArray<z.ZodObject<{
3091
+ mapName: z.ZodString;
3092
+ records: z.ZodArray<z.ZodObject<{
3093
+ key: z.ZodString;
3094
+ record: z.ZodObject<{
3095
+ value: z.ZodNullable<z.ZodAny>;
3096
+ timestamp: z.ZodObject<{
3097
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3098
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3099
+ nodeId: z.ZodString;
3100
+ }, z.core.$strip>;
3101
+ ttlMs: z.ZodOptional<z.ZodNumber>;
3102
+ }, z.core.$strip>;
3103
+ eventType: z.ZodEnum<{
3104
+ PUT: "PUT";
3105
+ REMOVE: "REMOVE";
3106
+ }>;
3107
+ }, z.core.$strip>>;
3108
+ serverSyncTimestamp: z.ZodObject<{
3109
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3110
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3111
+ nodeId: z.ZodString;
3112
+ }, z.core.$strip>;
3113
+ }, z.core.$strip>>>;
3114
+ queryResults: z.ZodOptional<z.ZodArray<z.ZodObject<{
3115
+ queryId: z.ZodString;
3116
+ results: z.ZodArray<z.ZodAny>;
3117
+ hasMore: z.ZodOptional<z.ZodBoolean>;
3118
+ nextCursor: z.ZodOptional<z.ZodString>;
3119
+ }, z.core.$strip>>>;
3120
+ searchResults: z.ZodOptional<z.ZodArray<z.ZodObject<{
3121
+ searchId: z.ZodString;
3122
+ results: z.ZodArray<z.ZodAny>;
3123
+ totalCount: z.ZodOptional<z.ZodNumber>;
3124
+ }, z.core.$strip>>>;
3125
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
3126
+ code: z.ZodNumber;
3127
+ message: z.ZodString;
3128
+ context: z.ZodOptional<z.ZodString>;
3129
+ }, z.core.$strip>>>;
3130
+ }, z.core.$strip>;
3131
+ type HttpSyncResponse = z.infer<typeof HttpSyncResponseSchema>;
3132
+
3133
+ declare const MessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3134
+ type: z.ZodLiteral<"AUTH">;
3135
+ token: z.ZodString;
3136
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
3137
+ }, z.core.$strip>, z.ZodObject<{
3138
+ type: z.ZodLiteral<"AUTH_REQUIRED">;
3139
+ }, z.core.$strip>, z.ZodObject<{
3140
+ type: z.ZodLiteral<"CLIENT_OP">;
3141
+ payload: z.ZodObject<{
3142
+ id: z.ZodOptional<z.ZodString>;
3143
+ mapName: z.ZodString;
3144
+ key: z.ZodString;
3145
+ opType: z.ZodOptional<z.ZodString>;
3146
+ record: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3147
+ value: z.ZodNullable<z.ZodAny>;
3148
+ timestamp: z.ZodObject<{
3149
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3150
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3151
+ nodeId: z.ZodString;
3152
+ }, z.core.$strip>;
3153
+ ttlMs: z.ZodOptional<z.ZodNumber>;
3154
+ }, z.core.$strip>>>;
3155
+ orRecord: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3156
+ value: z.ZodAny;
3157
+ timestamp: z.ZodObject<{
3158
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3159
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3160
+ nodeId: z.ZodString;
3161
+ }, z.core.$strip>;
3162
+ tag: z.ZodString;
3163
+ ttlMs: z.ZodOptional<z.ZodNumber>;
3164
+ }, z.core.$strip>>>;
3165
+ orTag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3166
+ writeConcern: z.ZodOptional<z.ZodEnum<{
3167
+ FIRE_AND_FORGET: "FIRE_AND_FORGET";
3168
+ MEMORY: "MEMORY";
3169
+ APPLIED: "APPLIED";
3170
+ REPLICATED: "REPLICATED";
3171
+ PERSISTED: "PERSISTED";
3172
+ }>>;
3173
+ timeout: z.ZodOptional<z.ZodNumber>;
3174
+ }, z.core.$strip>;
3175
+ }, z.core.$strip>, z.ZodObject<{
3176
+ type: z.ZodLiteral<"OP_BATCH">;
3177
+ payload: z.ZodObject<{
3178
+ ops: z.ZodArray<z.ZodObject<{
3179
+ id: z.ZodOptional<z.ZodString>;
3180
+ mapName: z.ZodString;
3181
+ key: z.ZodString;
3182
+ opType: z.ZodOptional<z.ZodString>;
3183
+ record: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3184
+ value: z.ZodNullable<z.ZodAny>;
3185
+ timestamp: z.ZodObject<{
3186
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3187
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3188
+ nodeId: z.ZodString;
3189
+ }, z.core.$strip>;
3190
+ ttlMs: z.ZodOptional<z.ZodNumber>;
3191
+ }, z.core.$strip>>>;
3192
+ orRecord: z.ZodOptional<z.ZodNullable<z.ZodObject<{
3193
+ value: z.ZodAny;
3194
+ timestamp: z.ZodObject<{
3195
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3196
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3197
+ nodeId: z.ZodString;
3198
+ }, z.core.$strip>;
3199
+ tag: z.ZodString;
3200
+ ttlMs: z.ZodOptional<z.ZodNumber>;
3201
+ }, z.core.$strip>>>;
3202
+ orTag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3203
+ writeConcern: z.ZodOptional<z.ZodEnum<{
3204
+ FIRE_AND_FORGET: "FIRE_AND_FORGET";
3205
+ MEMORY: "MEMORY";
3206
+ APPLIED: "APPLIED";
3207
+ REPLICATED: "REPLICATED";
3208
+ PERSISTED: "PERSISTED";
3209
+ }>>;
3210
+ timeout: z.ZodOptional<z.ZodNumber>;
3211
+ }, z.core.$strip>>;
3212
+ writeConcern: z.ZodOptional<z.ZodEnum<{
3213
+ FIRE_AND_FORGET: "FIRE_AND_FORGET";
3214
+ MEMORY: "MEMORY";
3215
+ APPLIED: "APPLIED";
3216
+ REPLICATED: "REPLICATED";
3217
+ PERSISTED: "PERSISTED";
3218
+ }>>;
3219
+ timeout: z.ZodOptional<z.ZodNumber>;
3220
+ }, z.core.$strip>;
3221
+ }, z.core.$strip>, z.ZodObject<{
3222
+ type: z.ZodLiteral<"SYNC_INIT">;
3223
+ mapName: z.ZodString;
3224
+ lastSyncTimestamp: z.ZodOptional<z.ZodNumber>;
3225
+ }, z.core.$strip>, z.ZodObject<{
3226
+ type: z.ZodLiteral<"SYNC_RESP_ROOT">;
3227
+ payload: z.ZodObject<{
3228
+ mapName: z.ZodString;
3229
+ rootHash: z.ZodNumber;
3230
+ timestamp: z.ZodObject<{
3231
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3232
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3233
+ nodeId: z.ZodString;
3234
+ }, z.core.$strip>;
3235
+ }, z.core.$strip>;
3236
+ }, z.core.$strip>, z.ZodObject<{
3237
+ type: z.ZodLiteral<"SYNC_RESP_BUCKETS">;
3238
+ payload: z.ZodObject<{
3239
+ mapName: z.ZodString;
3240
+ path: z.ZodString;
3241
+ buckets: z.ZodRecord<z.ZodString, z.ZodNumber>;
3242
+ }, z.core.$strip>;
3243
+ }, z.core.$strip>, z.ZodObject<{
3244
+ type: z.ZodLiteral<"SYNC_RESP_LEAF">;
3245
+ payload: z.ZodObject<{
3246
+ mapName: z.ZodString;
3247
+ path: z.ZodString;
3248
+ records: z.ZodArray<z.ZodObject<{
3249
+ key: z.ZodString;
3250
+ record: z.ZodObject<{
3251
+ value: z.ZodNullable<z.ZodAny>;
3252
+ timestamp: z.ZodObject<{
3253
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3254
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3255
+ nodeId: z.ZodString;
3256
+ }, z.core.$strip>;
3257
+ ttlMs: z.ZodOptional<z.ZodNumber>;
3258
+ }, z.core.$strip>;
3259
+ }, z.core.$strip>>;
3260
+ }, z.core.$strip>;
3261
+ }, z.core.$strip>, z.ZodObject<{
2876
3262
  type: z.ZodLiteral<"MERKLE_REQ_BUCKET">;
2877
3263
  payload: z.ZodObject<{
2878
3264
  mapName: z.ZodString;
2879
- path: z.ZodString;
3265
+ path: z.ZodString;
3266
+ }, z.core.$strip>;
3267
+ }, z.core.$strip>, z.ZodObject<{
3268
+ type: z.ZodLiteral<"OP_ACK">;
3269
+ payload: z.ZodObject<{
3270
+ lastId: z.ZodString;
3271
+ achievedLevel: z.ZodOptional<z.ZodEnum<{
3272
+ FIRE_AND_FORGET: "FIRE_AND_FORGET";
3273
+ MEMORY: "MEMORY";
3274
+ APPLIED: "APPLIED";
3275
+ REPLICATED: "REPLICATED";
3276
+ PERSISTED: "PERSISTED";
3277
+ }>>;
3278
+ results: z.ZodOptional<z.ZodArray<z.ZodObject<{
3279
+ opId: z.ZodString;
3280
+ success: z.ZodBoolean;
3281
+ achievedLevel: z.ZodEnum<{
3282
+ FIRE_AND_FORGET: "FIRE_AND_FORGET";
3283
+ MEMORY: "MEMORY";
3284
+ APPLIED: "APPLIED";
3285
+ REPLICATED: "REPLICATED";
3286
+ PERSISTED: "PERSISTED";
3287
+ }>;
3288
+ error: z.ZodOptional<z.ZodString>;
3289
+ }, z.core.$strip>>>;
3290
+ }, z.core.$strip>;
3291
+ }, z.core.$strip>, z.ZodObject<{
3292
+ type: z.ZodLiteral<"OP_REJECTED">;
3293
+ payload: z.ZodObject<{
3294
+ opId: z.ZodString;
3295
+ reason: z.ZodString;
3296
+ code: z.ZodOptional<z.ZodNumber>;
3297
+ }, z.core.$strip>;
3298
+ }, z.core.$strip>, z.ZodObject<{
3299
+ type: z.ZodLiteral<"BATCH">;
3300
+ count: z.ZodNumber;
3301
+ data: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
3302
+ }, z.core.$strip>, z.ZodObject<{
3303
+ type: z.ZodLiteral<"ORMAP_SYNC_INIT">;
3304
+ mapName: z.ZodString;
3305
+ rootHash: z.ZodNumber;
3306
+ bucketHashes: z.ZodRecord<z.ZodString, z.ZodNumber>;
3307
+ lastSyncTimestamp: z.ZodOptional<z.ZodNumber>;
3308
+ }, z.core.$strip>, z.ZodObject<{
3309
+ type: z.ZodLiteral<"ORMAP_SYNC_RESP_ROOT">;
3310
+ payload: z.ZodObject<{
3311
+ mapName: z.ZodString;
3312
+ rootHash: z.ZodNumber;
3313
+ timestamp: z.ZodObject<{
3314
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3315
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3316
+ nodeId: z.ZodString;
3317
+ }, z.core.$strip>;
3318
+ }, z.core.$strip>;
3319
+ }, z.core.$strip>, z.ZodObject<{
3320
+ type: z.ZodLiteral<"ORMAP_SYNC_RESP_BUCKETS">;
3321
+ payload: z.ZodObject<{
3322
+ mapName: z.ZodString;
3323
+ path: z.ZodString;
3324
+ buckets: z.ZodRecord<z.ZodString, z.ZodNumber>;
3325
+ }, z.core.$strip>;
3326
+ }, z.core.$strip>, z.ZodObject<{
3327
+ type: z.ZodLiteral<"ORMAP_MERKLE_REQ_BUCKET">;
3328
+ payload: z.ZodObject<{
3329
+ mapName: z.ZodString;
3330
+ path: z.ZodString;
3331
+ }, z.core.$strip>;
3332
+ }, z.core.$strip>, z.ZodObject<{
3333
+ type: z.ZodLiteral<"ORMAP_SYNC_RESP_LEAF">;
3334
+ payload: z.ZodObject<{
3335
+ mapName: z.ZodString;
3336
+ path: z.ZodString;
3337
+ entries: z.ZodArray<z.ZodObject<{
3338
+ key: z.ZodString;
3339
+ records: z.ZodArray<z.ZodObject<{
3340
+ value: z.ZodAny;
3341
+ timestamp: z.ZodObject<{
3342
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3343
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3344
+ nodeId: z.ZodString;
3345
+ }, z.core.$strip>;
3346
+ tag: z.ZodString;
3347
+ ttlMs: z.ZodOptional<z.ZodNumber>;
3348
+ }, z.core.$strip>>;
3349
+ tombstones: z.ZodArray<z.ZodString>;
3350
+ }, z.core.$strip>>;
3351
+ }, z.core.$strip>;
3352
+ }, z.core.$strip>, z.ZodObject<{
3353
+ type: z.ZodLiteral<"ORMAP_DIFF_REQUEST">;
3354
+ payload: z.ZodObject<{
3355
+ mapName: z.ZodString;
3356
+ keys: z.ZodArray<z.ZodString>;
3357
+ }, z.core.$strip>;
3358
+ }, z.core.$strip>, z.ZodObject<{
3359
+ type: z.ZodLiteral<"ORMAP_DIFF_RESPONSE">;
3360
+ payload: z.ZodObject<{
3361
+ mapName: z.ZodString;
3362
+ entries: z.ZodArray<z.ZodObject<{
3363
+ key: z.ZodString;
3364
+ records: z.ZodArray<z.ZodObject<{
3365
+ value: z.ZodAny;
3366
+ timestamp: z.ZodObject<{
3367
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3368
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3369
+ nodeId: z.ZodString;
3370
+ }, z.core.$strip>;
3371
+ tag: z.ZodString;
3372
+ ttlMs: z.ZodOptional<z.ZodNumber>;
3373
+ }, z.core.$strip>>;
3374
+ tombstones: z.ZodArray<z.ZodString>;
3375
+ }, z.core.$strip>>;
3376
+ }, z.core.$strip>;
3377
+ }, z.core.$strip>, z.ZodObject<{
3378
+ type: z.ZodLiteral<"ORMAP_PUSH_DIFF">;
3379
+ payload: z.ZodObject<{
3380
+ mapName: z.ZodString;
3381
+ entries: z.ZodArray<z.ZodObject<{
3382
+ key: z.ZodString;
3383
+ records: z.ZodArray<z.ZodObject<{
3384
+ value: z.ZodAny;
3385
+ timestamp: z.ZodObject<{
3386
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3387
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3388
+ nodeId: z.ZodString;
3389
+ }, z.core.$strip>;
3390
+ tag: z.ZodString;
3391
+ ttlMs: z.ZodOptional<z.ZodNumber>;
3392
+ }, z.core.$strip>>;
3393
+ tombstones: z.ZodArray<z.ZodString>;
3394
+ }, z.core.$strip>>;
3395
+ }, z.core.$strip>;
3396
+ }, z.core.$strip>, z.ZodObject<{
3397
+ type: z.ZodLiteral<"QUERY_SUB">;
3398
+ payload: z.ZodObject<{
3399
+ queryId: z.ZodString;
3400
+ mapName: z.ZodString;
3401
+ query: z.ZodObject<{
3402
+ where: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3403
+ predicate: z.ZodOptional<z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>;
3404
+ sort: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
3405
+ asc: "asc";
3406
+ desc: "desc";
3407
+ }>>>;
3408
+ limit: z.ZodOptional<z.ZodNumber>;
3409
+ cursor: z.ZodOptional<z.ZodString>;
3410
+ }, z.core.$strip>;
3411
+ }, z.core.$strip>;
3412
+ }, z.core.$strip>, z.ZodObject<{
3413
+ type: z.ZodLiteral<"QUERY_UNSUB">;
3414
+ payload: z.ZodObject<{
3415
+ queryId: z.ZodString;
3416
+ }, z.core.$strip>;
3417
+ }, z.core.$strip>, z.ZodObject<{
3418
+ type: z.ZodLiteral<"QUERY_RESP">;
3419
+ payload: z.ZodObject<{
3420
+ queryId: z.ZodString;
3421
+ results: z.ZodArray<z.ZodObject<{
3422
+ key: z.ZodString;
3423
+ value: z.ZodUnknown;
3424
+ }, z.core.$strip>>;
3425
+ nextCursor: z.ZodOptional<z.ZodString>;
3426
+ hasMore: z.ZodOptional<z.ZodBoolean>;
3427
+ cursorStatus: z.ZodOptional<z.ZodEnum<{
3428
+ valid: "valid";
3429
+ expired: "expired";
3430
+ invalid: "invalid";
3431
+ none: "none";
3432
+ }>>;
3433
+ }, z.core.$strip>;
3434
+ }, z.core.$strip>, z.ZodObject<{
3435
+ type: z.ZodLiteral<"QUERY_UPDATE">;
3436
+ payload: z.ZodObject<{
3437
+ queryId: z.ZodString;
3438
+ key: z.ZodString;
3439
+ value: z.ZodUnknown;
3440
+ changeType: z.ZodEnum<{
3441
+ UPDATE: "UPDATE";
3442
+ ENTER: "ENTER";
3443
+ LEAVE: "LEAVE";
3444
+ }>;
3445
+ }, z.core.$strip>;
3446
+ }, z.core.$strip>, z.ZodObject<{
3447
+ type: z.ZodLiteral<"SEARCH">;
3448
+ payload: z.ZodObject<{
3449
+ requestId: z.ZodString;
3450
+ mapName: z.ZodString;
3451
+ query: z.ZodString;
3452
+ options: z.ZodOptional<z.ZodObject<{
3453
+ limit: z.ZodOptional<z.ZodNumber>;
3454
+ minScore: z.ZodOptional<z.ZodNumber>;
3455
+ boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
3456
+ }, z.core.$strip>>;
3457
+ }, z.core.$strip>;
3458
+ }, z.core.$strip>, z.ZodObject<{
3459
+ type: z.ZodLiteral<"SEARCH_RESP">;
3460
+ payload: z.ZodObject<{
3461
+ requestId: z.ZodString;
3462
+ results: z.ZodArray<z.ZodObject<{
3463
+ key: z.ZodString;
3464
+ value: z.ZodUnknown;
3465
+ score: z.ZodNumber;
3466
+ matchedTerms: z.ZodArray<z.ZodString>;
3467
+ }, z.core.$strip>>;
3468
+ totalCount: z.ZodNumber;
3469
+ error: z.ZodOptional<z.ZodString>;
3470
+ }, z.core.$strip>;
3471
+ }, z.core.$strip>, z.ZodObject<{
3472
+ type: z.ZodLiteral<"SEARCH_SUB">;
3473
+ payload: z.ZodObject<{
3474
+ subscriptionId: z.ZodString;
3475
+ mapName: z.ZodString;
3476
+ query: z.ZodString;
3477
+ options: z.ZodOptional<z.ZodObject<{
3478
+ limit: z.ZodOptional<z.ZodNumber>;
3479
+ minScore: z.ZodOptional<z.ZodNumber>;
3480
+ boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
3481
+ }, z.core.$strip>>;
3482
+ }, z.core.$strip>;
3483
+ }, z.core.$strip>, z.ZodObject<{
3484
+ type: z.ZodLiteral<"SEARCH_UPDATE">;
3485
+ payload: z.ZodObject<{
3486
+ subscriptionId: z.ZodString;
3487
+ key: z.ZodString;
3488
+ value: z.ZodUnknown;
3489
+ score: z.ZodNumber;
3490
+ matchedTerms: z.ZodArray<z.ZodString>;
3491
+ changeType: z.ZodEnum<{
3492
+ UPDATE: "UPDATE";
3493
+ ENTER: "ENTER";
3494
+ LEAVE: "LEAVE";
3495
+ }>;
3496
+ }, z.core.$strip>;
3497
+ }, z.core.$strip>, z.ZodObject<{
3498
+ type: z.ZodLiteral<"SEARCH_UNSUB">;
3499
+ payload: z.ZodObject<{
3500
+ subscriptionId: z.ZodString;
3501
+ }, z.core.$strip>;
3502
+ }, z.core.$strip>, z.ZodObject<{
3503
+ type: z.ZodLiteral<"PARTITION_MAP_REQUEST">;
3504
+ payload: z.ZodOptional<z.ZodObject<{
3505
+ currentVersion: z.ZodOptional<z.ZodNumber>;
3506
+ }, z.core.$strip>>;
3507
+ }, z.core.$strip>, z.ZodObject<{
3508
+ type: z.ZodLiteral<"PARTITION_MAP">;
3509
+ payload: z.ZodObject<{
3510
+ version: z.ZodNumber;
3511
+ partitionCount: z.ZodNumber;
3512
+ nodes: z.ZodArray<z.ZodObject<{
3513
+ nodeId: z.ZodString;
3514
+ endpoints: z.ZodObject<{
3515
+ websocket: z.ZodString;
3516
+ http: z.ZodOptional<z.ZodString>;
3517
+ }, z.core.$strip>;
3518
+ status: z.ZodEnum<{
3519
+ ACTIVE: "ACTIVE";
3520
+ JOINING: "JOINING";
3521
+ LEAVING: "LEAVING";
3522
+ SUSPECTED: "SUSPECTED";
3523
+ FAILED: "FAILED";
3524
+ }>;
3525
+ }, z.core.$strip>>;
3526
+ partitions: z.ZodArray<z.ZodObject<{
3527
+ partitionId: z.ZodNumber;
3528
+ ownerNodeId: z.ZodString;
3529
+ backupNodeIds: z.ZodArray<z.ZodString>;
3530
+ }, z.core.$strip>>;
3531
+ generatedAt: z.ZodNumber;
3532
+ }, z.core.$strip>;
3533
+ }, z.core.$strip>, z.ZodObject<{
3534
+ type: z.ZodLiteral<"CLUSTER_SUB_REGISTER">;
3535
+ payload: z.ZodObject<{
3536
+ subscriptionId: z.ZodString;
3537
+ coordinatorNodeId: z.ZodString;
3538
+ mapName: z.ZodString;
3539
+ type: z.ZodEnum<{
3540
+ SEARCH: "SEARCH";
3541
+ QUERY: "QUERY";
3542
+ }>;
3543
+ searchQuery: z.ZodOptional<z.ZodString>;
3544
+ searchOptions: z.ZodOptional<z.ZodObject<{
3545
+ limit: z.ZodOptional<z.ZodNumber>;
3546
+ minScore: z.ZodOptional<z.ZodNumber>;
3547
+ boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
3548
+ }, z.core.$strip>>;
3549
+ queryPredicate: z.ZodOptional<z.ZodAny>;
3550
+ querySort: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
3551
+ asc: "asc";
3552
+ desc: "desc";
3553
+ }>>>;
3554
+ }, z.core.$strip>;
3555
+ }, z.core.$strip>, z.ZodObject<{
3556
+ type: z.ZodLiteral<"CLUSTER_SUB_ACK">;
3557
+ payload: z.ZodObject<{
3558
+ subscriptionId: z.ZodString;
3559
+ nodeId: z.ZodString;
3560
+ success: z.ZodBoolean;
3561
+ error: z.ZodOptional<z.ZodString>;
3562
+ initialResults: z.ZodOptional<z.ZodArray<z.ZodObject<{
3563
+ key: z.ZodString;
3564
+ value: z.ZodUnknown;
3565
+ score: z.ZodOptional<z.ZodNumber>;
3566
+ matchedTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
3567
+ }, z.core.$strip>>>;
3568
+ totalHits: z.ZodOptional<z.ZodNumber>;
3569
+ }, z.core.$strip>;
3570
+ }, z.core.$strip>, z.ZodObject<{
3571
+ type: z.ZodLiteral<"CLUSTER_SUB_UPDATE">;
3572
+ payload: z.ZodObject<{
3573
+ subscriptionId: z.ZodString;
3574
+ sourceNodeId: z.ZodString;
3575
+ key: z.ZodString;
3576
+ value: z.ZodUnknown;
3577
+ score: z.ZodOptional<z.ZodNumber>;
3578
+ matchedTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
3579
+ changeType: z.ZodEnum<{
3580
+ UPDATE: "UPDATE";
3581
+ ENTER: "ENTER";
3582
+ LEAVE: "LEAVE";
3583
+ }>;
3584
+ timestamp: z.ZodNumber;
3585
+ }, z.core.$strip>;
3586
+ }, z.core.$strip>, z.ZodObject<{
3587
+ type: z.ZodLiteral<"CLUSTER_SUB_UNREGISTER">;
3588
+ payload: z.ZodObject<{
3589
+ subscriptionId: z.ZodString;
3590
+ }, z.core.$strip>;
3591
+ }, z.core.$strip>, z.ZodObject<{
3592
+ type: z.ZodLiteral<"CLUSTER_SEARCH_REQ">;
3593
+ payload: z.ZodObject<{
3594
+ requestId: z.ZodString;
3595
+ mapName: z.ZodString;
3596
+ query: z.ZodString;
3597
+ options: z.ZodObject<{
3598
+ minScore: z.ZodOptional<z.ZodNumber>;
3599
+ boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
3600
+ limit: z.ZodNumber;
3601
+ includeMatchedTerms: z.ZodOptional<z.ZodBoolean>;
3602
+ afterScore: z.ZodOptional<z.ZodNumber>;
3603
+ afterKey: z.ZodOptional<z.ZodString>;
3604
+ }, z.core.$strip>;
3605
+ timeoutMs: z.ZodOptional<z.ZodNumber>;
3606
+ }, z.core.$strip>;
3607
+ }, z.core.$strip>, z.ZodObject<{
3608
+ type: z.ZodLiteral<"CLUSTER_SEARCH_RESP">;
3609
+ payload: z.ZodObject<{
3610
+ requestId: z.ZodString;
3611
+ nodeId: z.ZodString;
3612
+ results: z.ZodArray<z.ZodObject<{
3613
+ key: z.ZodString;
3614
+ value: z.ZodUnknown;
3615
+ score: z.ZodNumber;
3616
+ matchedTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
3617
+ }, z.core.$strip>>;
3618
+ totalHits: z.ZodNumber;
3619
+ executionTimeMs: z.ZodNumber;
3620
+ error: z.ZodOptional<z.ZodString>;
3621
+ }, z.core.$strip>;
3622
+ }, z.core.$strip>, z.ZodObject<{
3623
+ type: z.ZodLiteral<"CLUSTER_SEARCH_SUBSCRIBE">;
3624
+ payload: z.ZodObject<{
3625
+ subscriptionId: z.ZodString;
3626
+ mapName: z.ZodString;
3627
+ query: z.ZodString;
3628
+ options: z.ZodOptional<z.ZodObject<{
3629
+ limit: z.ZodOptional<z.ZodNumber>;
3630
+ minScore: z.ZodOptional<z.ZodNumber>;
3631
+ boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
3632
+ }, z.core.$strip>>;
2880
3633
  }, z.core.$strip>;
2881
3634
  }, z.core.$strip>, z.ZodObject<{
2882
- type: z.ZodLiteral<"LOCK_REQUEST">;
3635
+ type: z.ZodLiteral<"CLUSTER_SEARCH_UNSUBSCRIBE">;
2883
3636
  payload: z.ZodObject<{
2884
- requestId: z.ZodString;
2885
- name: z.ZodString;
2886
- ttl: z.ZodOptional<z.ZodNumber>;
3637
+ subscriptionId: z.ZodString;
2887
3638
  }, z.core.$strip>;
2888
3639
  }, z.core.$strip>, z.ZodObject<{
2889
- type: z.ZodLiteral<"LOCK_RELEASE">;
3640
+ type: z.ZodLiteral<"CLUSTER_SEARCH_UPDATE">;
2890
3641
  payload: z.ZodObject<{
2891
- requestId: z.ZodOptional<z.ZodString>;
2892
- name: z.ZodString;
2893
- fencingToken: z.ZodNumber;
3642
+ subscriptionId: z.ZodString;
3643
+ nodeId: z.ZodString;
3644
+ key: z.ZodString;
3645
+ value: z.ZodUnknown;
3646
+ score: z.ZodNumber;
3647
+ matchedTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
3648
+ changeType: z.ZodEnum<{
3649
+ UPDATE: "UPDATE";
3650
+ ENTER: "ENTER";
3651
+ LEAVE: "LEAVE";
3652
+ }>;
2894
3653
  }, z.core.$strip>;
2895
3654
  }, z.core.$strip>, z.ZodObject<{
2896
3655
  type: z.ZodLiteral<"TOPIC_SUB">;
@@ -2909,118 +3668,52 @@ declare const MessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2909
3668
  data: z.ZodAny;
2910
3669
  }, z.core.$strip>;
2911
3670
  }, z.core.$strip>, z.ZodObject<{
2912
- type: z.ZodLiteral<"PING">;
2913
- timestamp: z.ZodNumber;
2914
- }, z.core.$strip>, z.ZodObject<{
2915
- type: z.ZodLiteral<"PONG">;
2916
- timestamp: z.ZodNumber;
2917
- serverTime: z.ZodNumber;
2918
- }, z.core.$strip>, z.ZodObject<{
2919
- type: z.ZodLiteral<"ORMAP_SYNC_INIT">;
2920
- mapName: z.ZodString;
2921
- rootHash: z.ZodNumber;
2922
- bucketHashes: z.ZodRecord<z.ZodString, z.ZodNumber>;
2923
- lastSyncTimestamp: z.ZodOptional<z.ZodNumber>;
2924
- }, z.core.$strip>, z.ZodObject<{
2925
- type: z.ZodLiteral<"ORMAP_SYNC_RESP_ROOT">;
2926
- payload: z.ZodObject<{
2927
- mapName: z.ZodString;
2928
- rootHash: z.ZodNumber;
2929
- timestamp: z.ZodObject<{
2930
- millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2931
- counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2932
- nodeId: z.ZodString;
2933
- }, z.core.$strip>;
2934
- }, z.core.$strip>;
2935
- }, z.core.$strip>, z.ZodObject<{
2936
- type: z.ZodLiteral<"ORMAP_SYNC_RESP_BUCKETS">;
2937
- payload: z.ZodObject<{
2938
- mapName: z.ZodString;
2939
- path: z.ZodString;
2940
- buckets: z.ZodRecord<z.ZodString, z.ZodNumber>;
2941
- }, z.core.$strip>;
2942
- }, z.core.$strip>, z.ZodObject<{
2943
- type: z.ZodLiteral<"ORMAP_MERKLE_REQ_BUCKET">;
3671
+ type: z.ZodLiteral<"TOPIC_MESSAGE">;
2944
3672
  payload: z.ZodObject<{
2945
- mapName: z.ZodString;
2946
- path: z.ZodString;
3673
+ topic: z.ZodString;
3674
+ data: z.ZodAny;
3675
+ publisherId: z.ZodOptional<z.ZodString>;
3676
+ timestamp: z.ZodNumber;
2947
3677
  }, z.core.$strip>;
2948
3678
  }, z.core.$strip>, z.ZodObject<{
2949
- type: z.ZodLiteral<"ORMAP_SYNC_RESP_LEAF">;
3679
+ type: z.ZodLiteral<"LOCK_REQUEST">;
2950
3680
  payload: z.ZodObject<{
2951
- mapName: z.ZodString;
2952
- path: z.ZodString;
2953
- entries: z.ZodArray<z.ZodObject<{
2954
- key: z.ZodString;
2955
- records: z.ZodArray<z.ZodObject<{
2956
- value: z.ZodAny;
2957
- timestamp: z.ZodObject<{
2958
- millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2959
- counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2960
- nodeId: z.ZodString;
2961
- }, z.core.$strip>;
2962
- tag: z.ZodString;
2963
- ttlMs: z.ZodOptional<z.ZodNumber>;
2964
- }, z.core.$strip>>;
2965
- tombstones: z.ZodArray<z.ZodString>;
2966
- }, z.core.$strip>>;
3681
+ requestId: z.ZodString;
3682
+ name: z.ZodString;
3683
+ ttl: z.ZodOptional<z.ZodNumber>;
2967
3684
  }, z.core.$strip>;
2968
3685
  }, z.core.$strip>, z.ZodObject<{
2969
- type: z.ZodLiteral<"ORMAP_DIFF_REQUEST">;
3686
+ type: z.ZodLiteral<"LOCK_RELEASE">;
2970
3687
  payload: z.ZodObject<{
2971
- mapName: z.ZodString;
2972
- keys: z.ZodArray<z.ZodString>;
3688
+ requestId: z.ZodOptional<z.ZodString>;
3689
+ name: z.ZodString;
3690
+ fencingToken: z.ZodNumber;
2973
3691
  }, z.core.$strip>;
2974
3692
  }, z.core.$strip>, z.ZodObject<{
2975
- type: z.ZodLiteral<"ORMAP_DIFF_RESPONSE">;
3693
+ type: z.ZodLiteral<"COUNTER_REQUEST">;
2976
3694
  payload: z.ZodObject<{
2977
- mapName: z.ZodString;
2978
- entries: z.ZodArray<z.ZodObject<{
2979
- key: z.ZodString;
2980
- records: z.ZodArray<z.ZodObject<{
2981
- value: z.ZodAny;
2982
- timestamp: z.ZodObject<{
2983
- millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2984
- counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
2985
- nodeId: z.ZodString;
2986
- }, z.core.$strip>;
2987
- tag: z.ZodString;
2988
- ttlMs: z.ZodOptional<z.ZodNumber>;
2989
- }, z.core.$strip>>;
2990
- tombstones: z.ZodArray<z.ZodString>;
2991
- }, z.core.$strip>>;
3695
+ name: z.ZodString;
2992
3696
  }, z.core.$strip>;
2993
3697
  }, z.core.$strip>, z.ZodObject<{
2994
- type: z.ZodLiteral<"ORMAP_PUSH_DIFF">;
3698
+ type: z.ZodLiteral<"COUNTER_SYNC">;
2995
3699
  payload: z.ZodObject<{
2996
- mapName: z.ZodString;
2997
- entries: z.ZodArray<z.ZodObject<{
2998
- key: z.ZodString;
2999
- records: z.ZodArray<z.ZodObject<{
3000
- value: z.ZodAny;
3001
- timestamp: z.ZodObject<{
3002
- millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3003
- counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3004
- nodeId: z.ZodString;
3005
- }, z.core.$strip>;
3006
- tag: z.ZodString;
3007
- ttlMs: z.ZodOptional<z.ZodNumber>;
3008
- }, z.core.$strip>>;
3009
- tombstones: z.ZodArray<z.ZodString>;
3010
- }, z.core.$strip>>;
3700
+ name: z.ZodString;
3701
+ state: z.ZodObject<{
3702
+ p: z.ZodRecord<z.ZodString, z.ZodNumber>;
3703
+ n: z.ZodRecord<z.ZodString, z.ZodNumber>;
3704
+ }, z.core.$strip>;
3011
3705
  }, z.core.$strip>;
3012
3706
  }, z.core.$strip>, z.ZodObject<{
3013
- type: z.ZodLiteral<"PARTITION_MAP_REQUEST">;
3014
- payload: z.ZodOptional<z.ZodObject<{
3015
- currentVersion: z.ZodOptional<z.ZodNumber>;
3016
- }, z.core.$strip>>;
3017
- }, z.core.$strip>, z.ZodObject<{
3018
- type: z.ZodLiteral<"COUNTER_REQUEST">;
3707
+ type: z.ZodLiteral<"COUNTER_RESPONSE">;
3019
3708
  payload: z.ZodObject<{
3020
3709
  name: z.ZodString;
3710
+ state: z.ZodObject<{
3711
+ p: z.ZodRecord<z.ZodString, z.ZodNumber>;
3712
+ n: z.ZodRecord<z.ZodString, z.ZodNumber>;
3713
+ }, z.core.$strip>;
3021
3714
  }, z.core.$strip>;
3022
3715
  }, z.core.$strip>, z.ZodObject<{
3023
- type: z.ZodLiteral<"COUNTER_SYNC">;
3716
+ type: z.ZodLiteral<"COUNTER_UPDATE">;
3024
3717
  payload: z.ZodObject<{
3025
3718
  name: z.ZodString;
3026
3719
  state: z.ZodObject<{
@@ -3028,6 +3721,13 @@ declare const MessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3028
3721
  n: z.ZodRecord<z.ZodString, z.ZodNumber>;
3029
3722
  }, z.core.$strip>;
3030
3723
  }, z.core.$strip>;
3724
+ }, z.core.$strip>, z.ZodObject<{
3725
+ type: z.ZodLiteral<"PING">;
3726
+ timestamp: z.ZodNumber;
3727
+ }, z.core.$strip>, z.ZodObject<{
3728
+ type: z.ZodLiteral<"PONG">;
3729
+ timestamp: z.ZodNumber;
3730
+ serverTime: z.ZodNumber;
3031
3731
  }, z.core.$strip>, z.ZodObject<{
3032
3732
  type: z.ZodLiteral<"ENTRY_PROCESS">;
3033
3733
  requestId: z.ZodString;
@@ -3177,121 +3877,116 @@ declare const MessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3177
3877
  keyPattern: z.ZodOptional<z.ZodString>;
3178
3878
  }, z.core.$strip>>;
3179
3879
  }, z.core.$strip>, z.ZodObject<{
3180
- type: z.ZodLiteral<"SEARCH">;
3880
+ type: z.ZodLiteral<"SERVER_EVENT">;
3181
3881
  payload: z.ZodObject<{
3182
- requestId: z.ZodString;
3183
3882
  mapName: z.ZodString;
3184
- query: z.ZodString;
3185
- options: z.ZodOptional<z.ZodObject<{
3186
- limit: z.ZodOptional<z.ZodNumber>;
3187
- minScore: z.ZodOptional<z.ZodNumber>;
3188
- boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
3189
- }, z.core.$strip>>;
3190
- }, z.core.$strip>;
3191
- }, z.core.$strip>, z.ZodObject<{
3192
- type: z.ZodLiteral<"SEARCH_RESP">;
3193
- payload: z.ZodObject<{
3194
- requestId: z.ZodString;
3195
- results: z.ZodArray<z.ZodObject<{
3196
- key: z.ZodString;
3197
- value: z.ZodUnknown;
3198
- score: z.ZodNumber;
3199
- matchedTerms: z.ZodArray<z.ZodString>;
3883
+ eventType: z.ZodEnum<{
3884
+ PUT: "PUT";
3885
+ REMOVE: "REMOVE";
3886
+ OR_ADD: "OR_ADD";
3887
+ OR_REMOVE: "OR_REMOVE";
3888
+ }>;
3889
+ key: z.ZodString;
3890
+ record: z.ZodOptional<z.ZodObject<{
3891
+ value: z.ZodNullable<z.ZodAny>;
3892
+ timestamp: z.ZodObject<{
3893
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3894
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3895
+ nodeId: z.ZodString;
3896
+ }, z.core.$strip>;
3897
+ ttlMs: z.ZodOptional<z.ZodNumber>;
3200
3898
  }, z.core.$strip>>;
3201
- totalCount: z.ZodNumber;
3202
- error: z.ZodOptional<z.ZodString>;
3203
- }, z.core.$strip>;
3204
- }, z.core.$strip>, z.ZodObject<{
3205
- type: z.ZodLiteral<"SEARCH_SUB">;
3206
- payload: z.ZodObject<{
3207
- subscriptionId: z.ZodString;
3208
- mapName: z.ZodString;
3209
- query: z.ZodString;
3210
- options: z.ZodOptional<z.ZodObject<{
3211
- limit: z.ZodOptional<z.ZodNumber>;
3212
- minScore: z.ZodOptional<z.ZodNumber>;
3213
- boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
3899
+ orRecord: z.ZodOptional<z.ZodObject<{
3900
+ value: z.ZodAny;
3901
+ timestamp: z.ZodObject<{
3902
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3903
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3904
+ nodeId: z.ZodString;
3905
+ }, z.core.$strip>;
3906
+ tag: z.ZodString;
3907
+ ttlMs: z.ZodOptional<z.ZodNumber>;
3214
3908
  }, z.core.$strip>>;
3909
+ orTag: z.ZodOptional<z.ZodString>;
3215
3910
  }, z.core.$strip>;
3216
3911
  }, z.core.$strip>, z.ZodObject<{
3217
- type: z.ZodLiteral<"SEARCH_UPDATE">;
3912
+ type: z.ZodLiteral<"SERVER_BATCH_EVENT">;
3218
3913
  payload: z.ZodObject<{
3219
- subscriptionId: z.ZodString;
3220
- key: z.ZodString;
3221
- value: z.ZodUnknown;
3222
- score: z.ZodNumber;
3223
- matchedTerms: z.ZodArray<z.ZodString>;
3224
- type: z.ZodEnum<{
3225
- UPDATE: "UPDATE";
3226
- ENTER: "ENTER";
3227
- LEAVE: "LEAVE";
3228
- }>;
3914
+ events: z.ZodArray<z.ZodObject<{
3915
+ mapName: z.ZodString;
3916
+ eventType: z.ZodEnum<{
3917
+ PUT: "PUT";
3918
+ REMOVE: "REMOVE";
3919
+ OR_ADD: "OR_ADD";
3920
+ OR_REMOVE: "OR_REMOVE";
3921
+ }>;
3922
+ key: z.ZodString;
3923
+ record: z.ZodOptional<z.ZodObject<{
3924
+ value: z.ZodNullable<z.ZodAny>;
3925
+ timestamp: z.ZodObject<{
3926
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3927
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3928
+ nodeId: z.ZodString;
3929
+ }, z.core.$strip>;
3930
+ ttlMs: z.ZodOptional<z.ZodNumber>;
3931
+ }, z.core.$strip>>;
3932
+ orRecord: z.ZodOptional<z.ZodObject<{
3933
+ value: z.ZodAny;
3934
+ timestamp: z.ZodObject<{
3935
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3936
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3937
+ nodeId: z.ZodString;
3938
+ }, z.core.$strip>;
3939
+ tag: z.ZodString;
3940
+ ttlMs: z.ZodOptional<z.ZodNumber>;
3941
+ }, z.core.$strip>>;
3942
+ orTag: z.ZodOptional<z.ZodString>;
3943
+ }, z.core.$strip>>;
3229
3944
  }, z.core.$strip>;
3230
3945
  }, z.core.$strip>, z.ZodObject<{
3231
- type: z.ZodLiteral<"SEARCH_UNSUB">;
3946
+ type: z.ZodLiteral<"GC_PRUNE">;
3232
3947
  payload: z.ZodObject<{
3233
- subscriptionId: z.ZodString;
3948
+ olderThan: z.ZodObject<{
3949
+ millis: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3950
+ counter: z.ZodPipe<z.ZodUnion<readonly [z.ZodNumber, z.ZodBigInt]>, z.ZodTransform<number, number | bigint>>;
3951
+ nodeId: z.ZodString;
3952
+ }, z.core.$strip>;
3234
3953
  }, z.core.$strip>;
3235
3954
  }, z.core.$strip>, z.ZodObject<{
3236
- type: z.ZodLiteral<"CLUSTER_SUB_REGISTER">;
3955
+ type: z.ZodLiteral<"AUTH_ACK">;
3956
+ protocolVersion: z.ZodOptional<z.ZodNumber>;
3957
+ userId: z.ZodOptional<z.ZodString>;
3958
+ }, z.core.$strip>, z.ZodObject<{
3959
+ type: z.ZodLiteral<"AUTH_FAIL">;
3960
+ error: z.ZodOptional<z.ZodString>;
3961
+ code: z.ZodOptional<z.ZodNumber>;
3962
+ }, z.core.$strip>, z.ZodObject<{
3963
+ type: z.ZodLiteral<"ERROR">;
3237
3964
  payload: z.ZodObject<{
3238
- subscriptionId: z.ZodString;
3239
- coordinatorNodeId: z.ZodString;
3240
- mapName: z.ZodString;
3241
- type: z.ZodEnum<{
3242
- SEARCH: "SEARCH";
3243
- QUERY: "QUERY";
3244
- }>;
3245
- searchQuery: z.ZodOptional<z.ZodString>;
3246
- searchOptions: z.ZodOptional<z.ZodObject<{
3247
- limit: z.ZodOptional<z.ZodNumber>;
3248
- minScore: z.ZodOptional<z.ZodNumber>;
3249
- boost: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
3250
- }, z.core.$strip>>;
3251
- queryPredicate: z.ZodOptional<z.ZodAny>;
3252
- querySort: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
3253
- asc: "asc";
3254
- desc: "desc";
3255
- }>>>;
3965
+ code: z.ZodNumber;
3966
+ message: z.ZodString;
3967
+ details: z.ZodOptional<z.ZodUnknown>;
3256
3968
  }, z.core.$strip>;
3257
3969
  }, z.core.$strip>, z.ZodObject<{
3258
- type: z.ZodLiteral<"CLUSTER_SUB_ACK">;
3970
+ type: z.ZodLiteral<"LOCK_GRANTED">;
3259
3971
  payload: z.ZodObject<{
3260
- subscriptionId: z.ZodString;
3261
- nodeId: z.ZodString;
3262
- success: z.ZodBoolean;
3263
- error: z.ZodOptional<z.ZodString>;
3264
- initialResults: z.ZodOptional<z.ZodArray<z.ZodObject<{
3265
- key: z.ZodString;
3266
- value: z.ZodUnknown;
3267
- score: z.ZodOptional<z.ZodNumber>;
3268
- matchedTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
3269
- }, z.core.$strip>>>;
3270
- totalHits: z.ZodOptional<z.ZodNumber>;
3972
+ requestId: z.ZodString;
3973
+ name: z.ZodString;
3974
+ fencingToken: z.ZodNumber;
3271
3975
  }, z.core.$strip>;
3272
3976
  }, z.core.$strip>, z.ZodObject<{
3273
- type: z.ZodLiteral<"CLUSTER_SUB_UPDATE">;
3977
+ type: z.ZodLiteral<"LOCK_RELEASED">;
3274
3978
  payload: z.ZodObject<{
3275
- subscriptionId: z.ZodString;
3276
- sourceNodeId: z.ZodString;
3277
- key: z.ZodString;
3278
- value: z.ZodUnknown;
3279
- score: z.ZodOptional<z.ZodNumber>;
3280
- matchedTerms: z.ZodOptional<z.ZodArray<z.ZodString>>;
3281
- changeType: z.ZodEnum<{
3282
- UPDATE: "UPDATE";
3283
- ENTER: "ENTER";
3284
- LEAVE: "LEAVE";
3285
- }>;
3286
- timestamp: z.ZodNumber;
3979
+ requestId: z.ZodString;
3980
+ name: z.ZodString;
3981
+ success: z.ZodBoolean;
3287
3982
  }, z.core.$strip>;
3288
3983
  }, z.core.$strip>, z.ZodObject<{
3289
- type: z.ZodLiteral<"CLUSTER_SUB_UNREGISTER">;
3984
+ type: z.ZodLiteral<"SYNC_RESET_REQUIRED">;
3290
3985
  payload: z.ZodObject<{
3291
- subscriptionId: z.ZodString;
3986
+ mapName: z.ZodString;
3987
+ reason: z.ZodString;
3292
3988
  }, z.core.$strip>;
3293
3989
  }, z.core.$strip>], "type">;
3294
- type Message = z.infer<typeof MessageSchema>;
3295
3990
 
3296
3991
  /**
3297
3992
  * Write Concern - Configurable Acknowledgment Levels
@@ -3446,16 +4141,7 @@ interface PartitionMap {
3446
4141
  partitions: PartitionInfo[];
3447
4142
  generatedAt: number;
3448
4143
  }
3449
- interface PartitionMapMessage {
3450
- type: 'PARTITION_MAP';
3451
- payload: PartitionMap;
3452
- }
3453
- interface PartitionMapRequestMessage {
3454
- type: 'PARTITION_MAP_REQUEST';
3455
- payload?: {
3456
- currentVersion?: number;
3457
- };
3458
- }
4144
+
3459
4145
  interface PartitionChange {
3460
4146
  partitionId: number;
3461
4147
  previousOwner: string;
@@ -4401,12 +5087,34 @@ interface QueryOptions {
4401
5087
  limit?: number;
4402
5088
  /** Cursor for pagination (replaces offset) */
4403
5089
  cursor?: string;
5090
+ /** Force use of an index on this attribute name. Throws if no index exists for the attribute. */
5091
+ useIndex?: string;
5092
+ /** Require that the query plan uses at least one index. Throws if plan would be a full scan. */
5093
+ forceIndexScan?: boolean;
5094
+ /** Skip all optimization; produce a full-scan plan. Useful for debugging. */
5095
+ disableOptimization?: boolean;
5096
+ }
5097
+ /**
5098
+ * Point lookup step - O(1) direct key access.
5099
+ */
5100
+ interface PointLookupStep {
5101
+ type: 'point-lookup';
5102
+ key: unknown;
5103
+ cost: number;
5104
+ }
5105
+ /**
5106
+ * Multi-point lookup step - O(k) direct key access for k keys.
5107
+ */
5108
+ interface MultiPointLookupStep {
5109
+ type: 'multi-point-lookup';
5110
+ keys: unknown[];
5111
+ cost: number;
4404
5112
  }
4405
5113
  /**
4406
5114
  * Execution plan step.
4407
5115
  * Represents a single operation in the query execution plan.
4408
5116
  */
4409
- type PlanStep = IndexScanStep | FullScanStep | IntersectionStep | UnionStep | FilterStep | NotStep | FTSScanStep | FusionStep;
5117
+ type PlanStep = PointLookupStep | MultiPointLookupStep | IndexScanStep | FullScanStep | IntersectionStep | UnionStep | FilterStep | NotStep | FTSScanStep | FusionStep;
4410
5118
  /**
4411
5119
  * Index scan step - retrieves from an index.
4412
5120
  */
@@ -4508,7 +5216,56 @@ interface QueryPlan {
4508
5216
  limit?: number;
4509
5217
  /** Cursor for pagination (replaces offset) */
4510
5218
  cursor?: string;
4511
- }
5219
+ /** Index hint that was applied (attribute name from useIndex option) */
5220
+ hint?: string;
5221
+ }
5222
+ /**
5223
+ * Query execution context for distributed cost estimation.
5224
+ */
5225
+ interface QueryContext {
5226
+ /** Whether query executes in distributed mode */
5227
+ isDistributed: boolean;
5228
+ /** Number of nodes in cluster */
5229
+ nodeCount: number;
5230
+ /** Whether query uses PostgreSQL storage */
5231
+ usesStorage: boolean;
5232
+ /** Local node ID for partition ownership checks */
5233
+ localNodeId?: string;
5234
+ /** Partition ownership map: partitionId -> ownerNodeId */
5235
+ partitionOwners?: Map<number, string>;
5236
+ }
5237
+ /**
5238
+ * Distributed query cost model.
5239
+ * Inspired by Hazelcast CostUtils.java
5240
+ */
5241
+ interface DistributedCost {
5242
+ /** Estimated number of rows */
5243
+ rows: number;
5244
+ /** CPU cost (computation) */
5245
+ cpu: number;
5246
+ /** Network cost (data transfer between nodes) */
5247
+ network: number;
5248
+ /** I/O cost (disk reads for PostgreSQL) */
5249
+ io: number;
5250
+ }
5251
+ /**
5252
+ * Cost multipliers for distributed query optimization.
5253
+ * Network is weighted 10x higher than CPU because network latency
5254
+ * typically dominates query execution time in distributed systems.
5255
+ */
5256
+ declare const COST_WEIGHTS: {
5257
+ readonly CPU: 1;
5258
+ readonly NETWORK: 10;
5259
+ readonly IO: 5;
5260
+ readonly ROWS: 0.001;
5261
+ };
5262
+ /**
5263
+ * Calculate total cost from distributed cost components.
5264
+ *
5265
+ * @param cost - Distributed cost breakdown
5266
+ * @returns Weighted total cost
5267
+ */
5268
+ declare function calculateTotalCost(cost: DistributedCost): number;
4512
5269
  /**
4513
5270
  * Check if a query is a simple query node.
4514
5271
  */
@@ -7063,21 +7820,54 @@ declare class QueryOptimizer<K, V> {
7063
7820
  * Optimize a query and return an execution plan.
7064
7821
  *
7065
7822
  * Optimization order (by cost):
7066
- * 1. StandingQueryIndex (cost: 10) - pre-computed results
7067
- * 2. Other indexes via optimizeNode
7823
+ * 1. Point lookup (cost: 1) - direct primary key access
7824
+ * 2. StandingQueryIndex (cost: 10) - pre-computed results
7825
+ * 3. Other indexes via optimizeNode
7068
7826
  *
7069
7827
  * @param query - Query to optimize
7070
7828
  * @returns Query execution plan
7071
7829
  */
7072
7830
  optimize(query: Query): QueryPlan;
7073
7831
  /**
7074
- * Optimize a query with sort/limit/offset options.
7832
+ * Optimize a query with sort/limit/offset options and index hints.
7833
+ *
7834
+ * Hint precedence: disableOptimization > useIndex > forceIndexScan.
7075
7835
  *
7076
7836
  * @param query - Query to optimize
7077
- * @param options - Query options (sort, limit, offset)
7837
+ * @param options - Query options (sort, limit, cursor, hints)
7078
7838
  * @returns Query execution plan with options
7079
7839
  */
7080
7840
  optimizeWithOptions(query: Query, options: QueryOptions): QueryPlan;
7841
+ /**
7842
+ * Apply sort/limit/cursor options to a query plan.
7843
+ *
7844
+ * @param plan - Base query plan
7845
+ * @param options - Query options with sort/limit/cursor
7846
+ * @returns Plan with options applied
7847
+ */
7848
+ private applyPlanOptions;
7849
+ /**
7850
+ * Extract the relevant index query for a hinted attribute from the query tree.
7851
+ * If the query directly references the attribute, build an index query from it.
7852
+ * For compound (logical) queries, extract the matching child predicate.
7853
+ * Falls back to { type: 'has' } when no matching predicate is found,
7854
+ * retrieving all entries from the index for post-filtering.
7855
+ * FTS query nodes also fall back to { type: 'has' } since full-text search
7856
+ * queries are not compatible with regular index lookups.
7857
+ *
7858
+ * @param query - Original query tree
7859
+ * @param attributeName - Hinted attribute name
7860
+ * @returns Index query for the hinted attribute
7861
+ */
7862
+ private buildHintedIndexQuery;
7863
+ /**
7864
+ * Try to optimize query as a point lookup.
7865
+ * Returns a point lookup step if query is an equality or IN query on primary key.
7866
+ *
7867
+ * @param query - Query to check
7868
+ * @returns Point lookup step or null
7869
+ */
7870
+ private tryPointLookup;
7081
7871
  /**
7082
7872
  * Optimize a single query node.
7083
7873
  */
@@ -7178,6 +7968,29 @@ declare class QueryOptimizer<K, V> {
7178
7968
  * Estimate the execution cost of a plan step.
7179
7969
  */
7180
7970
  private estimateCost;
7971
+ /**
7972
+ * Estimate distributed cost including network overhead.
7973
+ *
7974
+ * Network cost is assigned based on step type:
7975
+ * - full-scan: broadcast to all nodes (highest cost)
7976
+ * - index-scan: 0 if local partition, 5 if remote
7977
+ * - point-lookup: 0 if local key, 5 if remote
7978
+ * - intersection/union: aggregating results from multiple sources
7979
+ *
7980
+ * @param step - Plan step to estimate
7981
+ * @param context - Distributed query context (optional)
7982
+ * @returns Distributed cost breakdown
7983
+ */
7984
+ estimateDistributedCost(step: PlanStep, context?: QueryContext): DistributedCost;
7985
+ /**
7986
+ * Get total distributed cost for a plan step.
7987
+ * Convenience method combining estimateDistributedCost and calculateTotalCost.
7988
+ *
7989
+ * @param step - Plan step to estimate
7990
+ * @param context - Distributed query context (optional)
7991
+ * @returns Weighted total cost
7992
+ */
7993
+ getTotalDistributedCost(step: PlanStep, context?: QueryContext): number;
7181
7994
  /**
7182
7995
  * Check if a plan step uses any indexes.
7183
7996
  */
@@ -9312,4 +10125,366 @@ declare class SearchDebugger {
9312
10125
  declare function getSearchDebugger(): SearchDebugger;
9313
10126
  declare function resetSearchDebugger(): void;
9314
10127
 
9315
- export { type Attribute, type AuthFailMessage, AuthFailMessageSchema, AuthMessageSchema, type BM25DebugInfo, type BM25Options, BM25Scorer, type BatchMessage, BatchMessageSchema, BuiltInProcessors, BuiltInResolvers, CRDTDebugger, type CRDTSnapshot, 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 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, 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, type HybridQueryDeltaPayload, HybridQueryDeltaPayloadSchema, type HybridQueryRespPayload, HybridQueryRespPayloadSchema, 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, type LockGrantedPayload, LockGrantedPayloadSchema, LockReleaseSchema, type LockReleasedPayload, LockReleasedPayloadSchema, LockRequestSchema, type Logger, 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, 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, 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, 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 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, 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, 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, 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, getCRDTDebugger, getHighestWriteConcernLevel, getSearchDebugger, hashORMapEntry, hashORMapRecord, hashObject, hashString, isLogicalQuery, isSimpleQuery, isUsingNativeHash, isWriteConcernAchieved, logger, multiAttribute, porterStem, resetCRDTDebugger, resetNativeHash, resetSearchDebugger, serialize, simpleAttribute, timestampToString, validateProcessorCode, validateResolverCode };
10128
+ /**
10129
+ * Real clock source using system time.
10130
+ */
10131
+ declare const RealClock: ClockSource;
10132
+ /**
10133
+ * Virtual clock for deterministic testing.
10134
+ * Time only advances when explicitly requested via advance() or set().
10135
+ *
10136
+ * Usage:
10137
+ * ```typescript
10138
+ * const clock = new VirtualClock(1000000);
10139
+ * clock.now(); // 1000000
10140
+ * clock.advance(500);
10141
+ * clock.now(); // 1000500
10142
+ * ```
10143
+ */
10144
+ declare class VirtualClock implements ClockSource {
10145
+ private currentTime;
10146
+ /**
10147
+ * @param initialTime Starting timestamp in milliseconds (default: 0)
10148
+ */
10149
+ constructor(initialTime?: number);
10150
+ /**
10151
+ * Returns the current virtual time.
10152
+ * Time remains frozen until advance() or set() is called.
10153
+ */
10154
+ now(): number;
10155
+ /**
10156
+ * Advances time forward by the specified milliseconds.
10157
+ * @param ms Milliseconds to advance (must be non-negative)
10158
+ */
10159
+ advance(ms: number): void;
10160
+ /**
10161
+ * Sets the clock to a specific time.
10162
+ * Allows moving time forward or backward (useful for testing).
10163
+ * @param time Absolute timestamp in milliseconds
10164
+ */
10165
+ set(time: number): void;
10166
+ /**
10167
+ * Resets the clock to zero.
10168
+ */
10169
+ reset(): void;
10170
+ }
10171
+
10172
+ /**
10173
+ * Seeded pseudo-random number generator for deterministic testing.
10174
+ * Uses the mulberry32 algorithm for fast, high-quality randomness.
10175
+ *
10176
+ * Usage:
10177
+ * ```typescript
10178
+ * const rng = new SeededRNG(12345);
10179
+ * rng.random(); // 0.6011..., always same for seed 12345
10180
+ * rng.randomInt(1, 10); // Deterministic integer in range
10181
+ * ```
10182
+ */
10183
+ declare class SeededRNG {
10184
+ private state;
10185
+ private readonly originalSeed;
10186
+ /**
10187
+ * @param seed Integer seed value. Same seed = same sequence.
10188
+ */
10189
+ constructor(seed: number);
10190
+ /**
10191
+ * Returns the original seed used to construct this RNG.
10192
+ */
10193
+ getSeed(): number;
10194
+ /**
10195
+ * Generates the next random number in [0, 1).
10196
+ * Uses mulberry32 algorithm for deterministic, high-quality randomness.
10197
+ */
10198
+ random(): number;
10199
+ /**
10200
+ * Generates a random integer in [min, max] (inclusive).
10201
+ * @param min Minimum value (inclusive)
10202
+ * @param max Maximum value (inclusive)
10203
+ */
10204
+ randomInt(min: number, max: number): number;
10205
+ /**
10206
+ * Generates a random boolean value.
10207
+ * @param probability Probability of returning true (default: 0.5)
10208
+ */
10209
+ randomBool(probability?: number): boolean;
10210
+ /**
10211
+ * Shuffles an array in place using Fisher-Yates algorithm.
10212
+ * Returns the shuffled array.
10213
+ * @param array Array to shuffle
10214
+ */
10215
+ shuffle<T>(array: T[]): T[];
10216
+ /**
10217
+ * Picks a random element from an array.
10218
+ * @param array Array to pick from
10219
+ * @returns Random element, or undefined if array is empty
10220
+ */
10221
+ pick<T>(array: T[]): T | undefined;
10222
+ /**
10223
+ * Resets the RNG to its original seed.
10224
+ * Useful for reproducing a sequence from the start.
10225
+ */
10226
+ reset(): void;
10227
+ }
10228
+
10229
+ /**
10230
+ * Network configuration for chaos injection.
10231
+ */
10232
+ interface NetworkConfig {
10233
+ /** Latency range in milliseconds */
10234
+ latencyMs: {
10235
+ min: number;
10236
+ max: number;
10237
+ };
10238
+ /** Packet loss rate (0.0 to 1.0) */
10239
+ packetLossRate: number;
10240
+ /** Groups that cannot communicate with each other */
10241
+ partitions: string[][];
10242
+ }
10243
+ /**
10244
+ * A message in flight through the virtual network.
10245
+ */
10246
+ interface Message {
10247
+ from: string;
10248
+ to: string;
10249
+ payload: unknown;
10250
+ scheduledTime: number;
10251
+ }
10252
+ /**
10253
+ * Virtual network for deterministic chaos testing.
10254
+ * Simulates packet loss, latency, and network partitions.
10255
+ *
10256
+ * Usage:
10257
+ * ```typescript
10258
+ * const rng = new SeededRNG(123);
10259
+ * const clock = new VirtualClock(1000);
10260
+ * const network = new VirtualNetwork(rng, clock);
10261
+ *
10262
+ * network.configure({ packetLossRate: 0.1, latencyMs: { min: 10, max: 50 } });
10263
+ * network.send('node-a', 'node-b', { type: 'sync' });
10264
+ *
10265
+ * clock.advance(30);
10266
+ * const delivered = network.tick(); // Messages delivered at current time
10267
+ * ```
10268
+ */
10269
+ declare class VirtualNetwork {
10270
+ private readonly rng;
10271
+ private readonly clock;
10272
+ private config;
10273
+ private pendingMessages;
10274
+ constructor(rng: SeededRNG, clock: VirtualClock);
10275
+ /**
10276
+ * Updates network configuration.
10277
+ * Partially updates existing config with provided values.
10278
+ */
10279
+ configure(config: Partial<NetworkConfig>): void;
10280
+ /**
10281
+ * Sends a message through the network.
10282
+ * Subject to packet loss, latency, and partition rules.
10283
+ */
10284
+ send(from: string, to: string, payload: unknown): void;
10285
+ /**
10286
+ * Creates a network partition between two groups.
10287
+ * Nodes in groupA cannot communicate with nodes in groupB.
10288
+ */
10289
+ partition(groupA: string[], groupB: string[]): void;
10290
+ /**
10291
+ * Removes all network partitions.
10292
+ */
10293
+ heal(): void;
10294
+ /**
10295
+ * Delivers all messages scheduled at or before the current time.
10296
+ * @returns Array of delivered messages
10297
+ */
10298
+ tick(): Message[];
10299
+ /**
10300
+ * Returns the number of messages currently in flight.
10301
+ */
10302
+ getPendingCount(): number;
10303
+ /**
10304
+ * Clears all pending messages.
10305
+ */
10306
+ clear(): void;
10307
+ /**
10308
+ * Checks if two nodes are partitioned from each other.
10309
+ */
10310
+ private isPartitioned;
10311
+ /**
10312
+ * Returns all pending messages (useful for debugging).
10313
+ */
10314
+ getPendingMessages(): Message[];
10315
+ }
10316
+
10317
+ /**
10318
+ * Invariant function signature.
10319
+ * Returns true if the invariant holds, false otherwise.
10320
+ */
10321
+ type Invariant<T> = (state: T) => boolean;
10322
+ /**
10323
+ * Result of invariant verification.
10324
+ */
10325
+ interface InvariantResult {
10326
+ passed: boolean;
10327
+ failures: string[];
10328
+ }
10329
+ /**
10330
+ * Checker for property-based invariants.
10331
+ * Used to verify CRDT consistency during simulation.
10332
+ *
10333
+ * Usage:
10334
+ * ```typescript
10335
+ * const checker = new InvariantChecker<MyState>();
10336
+ * checker.addInvariant('no-nulls', (state) => state.value !== null);
10337
+ * const result = checker.verify(state);
10338
+ * if (!result.passed) {
10339
+ * console.log('Failures:', result.failures);
10340
+ * }
10341
+ * ```
10342
+ */
10343
+ declare class InvariantChecker<T> {
10344
+ private invariants;
10345
+ /**
10346
+ * Adds an invariant to be checked.
10347
+ * @param name Unique name for this invariant
10348
+ * @param check Function that returns true if invariant holds
10349
+ */
10350
+ addInvariant(name: string, check: Invariant<T>): void;
10351
+ /**
10352
+ * Removes an invariant by name.
10353
+ */
10354
+ removeInvariant(name: string): boolean;
10355
+ /**
10356
+ * Verifies all invariants against the provided state.
10357
+ * @returns Result with pass/fail status and list of failed invariants
10358
+ */
10359
+ verify(state: T): InvariantResult;
10360
+ /**
10361
+ * Returns the number of registered invariants.
10362
+ */
10363
+ get count(): number;
10364
+ /**
10365
+ * Clears all invariants.
10366
+ */
10367
+ clear(): void;
10368
+ }
10369
+ /**
10370
+ * Predefined CRDT invariants for common testing scenarios.
10371
+ */
10372
+ declare const CRDTInvariants: {
10373
+ /**
10374
+ * Verifies LWW-Map convergence: all maps contain the same values for same keys.
10375
+ */
10376
+ lwwConvergence: <K, V>(maps: LWWMap<K, V>[]) => boolean;
10377
+ /**
10378
+ * Verifies OR-Map convergence: all maps contain the same values for same keys.
10379
+ */
10380
+ orMapConvergence: <K, V>(maps: ORMap<K, V>[]) => boolean;
10381
+ /**
10382
+ * Verifies HLC monotonicity: timestamps are strictly increasing.
10383
+ */
10384
+ hlcMonotonicity: (timestamps: Timestamp[]) => boolean;
10385
+ /**
10386
+ * Verifies Merkle tree consistency: trees with same data have same root hash.
10387
+ */
10388
+ merkleConsistency: (trees: MerkleTree[]) => boolean;
10389
+ };
10390
+
10391
+ /**
10392
+ * Configuration for a simulation scenario.
10393
+ */
10394
+ interface ScenarioConfig {
10395
+ /** Random seed for reproducibility (auto-generated if not provided) */
10396
+ seed?: number;
10397
+ /** List of node identifiers participating in the scenario */
10398
+ nodes: string[];
10399
+ /** Total duration in virtual milliseconds */
10400
+ duration: number;
10401
+ /** Virtual ms to advance per tick (default: 1) */
10402
+ tickInterval?: number;
10403
+ }
10404
+ /**
10405
+ * Result of a scenario execution.
10406
+ */
10407
+ interface ScenarioResult {
10408
+ /** Seed used for this run (for reproduction) */
10409
+ seed: number;
10410
+ /** Whether all invariants passed */
10411
+ passed: boolean;
10412
+ /** Number of ticks executed */
10413
+ ticks: number;
10414
+ /** List of invariant failures */
10415
+ invariantFailures: string[];
10416
+ /** Final state captured at end of scenario */
10417
+ finalStates: Map<string, unknown>;
10418
+ }
10419
+ /**
10420
+ * Orchestrates deterministic simulation scenarios.
10421
+ * Combines virtual clock, seeded RNG, and virtual network for reproducible testing.
10422
+ *
10423
+ * Usage:
10424
+ * ```typescript
10425
+ * const runner = new ScenarioRunner({
10426
+ * seed: 12345,
10427
+ * nodes: ['node-a', 'node-b'],
10428
+ * duration: 1000
10429
+ * });
10430
+ *
10431
+ * const result = runner.run(
10432
+ * (r) => {
10433
+ * // Setup: create CRDTs, configure network
10434
+ * r.getNetwork().configure({ packetLossRate: 0.1 });
10435
+ * },
10436
+ * (r, tick) => {
10437
+ * // Step: simulate operations, deliver messages
10438
+ * if (tick === 500) r.getNetwork().heal();
10439
+ * },
10440
+ * invariants
10441
+ * );
10442
+ *
10443
+ * if (!result.passed) {
10444
+ * console.log(`Failed with seed ${result.seed}`);
10445
+ * }
10446
+ * ```
10447
+ */
10448
+ declare class ScenarioRunner {
10449
+ private readonly config;
10450
+ private readonly clock;
10451
+ private readonly rng;
10452
+ private readonly network;
10453
+ private readonly seed;
10454
+ constructor(config: ScenarioConfig);
10455
+ /**
10456
+ * Returns the seed used for this scenario.
10457
+ */
10458
+ getSeed(): number;
10459
+ /**
10460
+ * Returns the virtual clock instance.
10461
+ */
10462
+ getClock(): VirtualClock;
10463
+ /**
10464
+ * Returns the seeded RNG instance.
10465
+ */
10466
+ getRNG(): SeededRNG;
10467
+ /**
10468
+ * Returns the virtual network instance.
10469
+ */
10470
+ getNetwork(): VirtualNetwork;
10471
+ /**
10472
+ * Returns the list of nodes in this scenario.
10473
+ */
10474
+ getNodes(): string[];
10475
+ /**
10476
+ * Executes the simulation scenario.
10477
+ *
10478
+ * @param setup Called once before simulation starts. Initialize state here.
10479
+ * @param step Called on each tick. Perform operations and message delivery.
10480
+ * @param invariants Checker for verifying correctness throughout execution.
10481
+ * @returns Result with pass/fail status and captured state
10482
+ */
10483
+ run(setup: (runner: ScenarioRunner) => void, step: (runner: ScenarioRunner, tick: number) => void, invariants: InvariantChecker<unknown>): ScenarioResult;
10484
+ /**
10485
+ * Stores state for a node (useful for capturing final state).
10486
+ */
10487
+ setState(nodeId: string, state: unknown): void;
10488
+ }
10489
+
10490
+ export { type Attribute, type AuthAckMessage, AuthAckMessageSchema, type AuthFailMessage, AuthFailMessageSchema, type AuthMessage, AuthMessageSchema, type AuthRequiredMessage, AuthRequiredMessageSchema, type BM25DebugInfo, type BM25Options, BM25Scorer, type BatchMessage, BatchMessageSchema, BuiltInProcessors, BuiltInResolvers, COST_WEIGHTS, CRDTDebugger, CRDTInvariants, type CRDTSnapshot, type ChangeEventType, ChangeEventTypeSchema, type CircuitBreakerConfig, type ClientOp, type ClientOpMessage, 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, type CounterRequest, CounterRequestSchema, type CounterResponse, CounterResponseSchema, type CounterSync, CounterSyncSchema, type CounterUpdate, 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, type DeltaRecord, DeltaRecordSchema, type DistributedCost, ENGLISH_STOPWORDS, type EntryProcessBatchRequest, EntryProcessBatchRequestSchema, type EntryProcessBatchResponse, EntryProcessBatchResponseSchema, type EntryProcessKeyResult, EntryProcessKeyResultSchema, type EntryProcessRequest, EntryProcessRequestSchema, type EntryProcessResponse, EntryProcessResponseSchema, type EntryProcessor, type EntryProcessorDef, EntryProcessorDefSchema, type EntryProcessorFn, type EntryProcessorResult, EntryProcessorSchema, type ErrorMessage, ErrorMessageSchema, 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, type HttpQueryRequest, HttpQueryRequestSchema, type HttpQueryResult, HttpQueryResultSchema, type HttpSearchRequest, HttpSearchRequestSchema, type HttpSearchResult, HttpSearchResultSchema, type HttpSyncError, HttpSyncErrorSchema, type HttpSyncRequest, HttpSyncRequestSchema, type HttpSyncResponse, HttpSyncResponseSchema, 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 LockGrantedMessage, LockGrantedMessageSchema, type LockGrantedPayload, LockGrantedPayloadSchema, type LockRelease, LockReleaseSchema, type LockReleasedMessage, LockReleasedMessageSchema, type LockReleasedPayload, LockReleasedPayloadSchema, type LockRequest, LockRequestSchema, type Logger, type LogicalQueryNode, LowercaseFilter, type MapDelta, MapDeltaSchema, type MatchOptions, MaxLengthFilter, type MergeContext, type MergeKeyResult, type MergeRejectedMessage, MergeRejectedMessageSchema, type MergeRejection, type MergeResult, type MergedResult, type MerkleReqBucketMessage, 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, NodeInfoSchema, type NodeInfoZod, type NodeStatus, type NotOwnerError, type NotStep, ORMap, type ORMapDiffRequest, ORMapDiffRequestSchema, type ORMapDiffResponse, type ORMapDiffResponsePayload, ORMapDiffResponseSchema, type ORMapEntry, ORMapEntrySchema, type ORMapMerkleNode, type ORMapMerkleReqBucket, ORMapMerkleReqBucketSchema, ORMapMerkleTree, type ORMapPushDiff, ORMapPushDiffSchema, type ORMapQueryResult, type ORMapRecord, ORMapRecordSchema, type ORMapSearchResult, type ORMapSnapshot, type ORMapSyncInit, ORMapSyncInitSchema, type ORMapSyncRespBuckets, type ORMapSyncRespBucketsPayload, ORMapSyncRespBucketsSchema, type ORMapSyncRespLeaf, type ORMapSyncRespLeafPayload, ORMapSyncRespLeafSchema, type ORMapSyncRespRoot, type ORMapSyncRespRootPayload, ORMapSyncRespRootSchema, type OpAckMessage, OpAckMessageSchema, type OpBatchMessage, 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, PartitionInfoSchema, type PartitionInfoZod, type PartitionMap, type PartitionMapDeltaMessage, type PartitionMapMessage, PartitionMapMessageSchema, type PartitionMapPayload, PartitionMapPayloadSchema, type PartitionMapRequest, type PartitionMapRequest as 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, type QuerySubMessage, QuerySubMessageSchema, type QueryUnsubMessage, 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, type SyncInitMessage, SyncInitMessageSchema, type SyncMapEntry, SyncMapEntrySchema, type SyncResetRequiredMessage, SyncResetRequiredMessageSchema, type SyncResetRequiredPayload, SyncResetRequiredPayloadSchema, type SyncRespBucketsMessage, SyncRespBucketsMessageSchema, type SyncRespBucketsPayload, type SyncRespLeafMessage, SyncRespLeafMessageSchema, type SyncRespLeafPayload, type SyncRespRootMessage, SyncRespRootMessageSchema, type SyncRespRootPayload, type TermInfo, type Timestamp, TimestampSchema, type TokenFilter, TokenizationPipeline, type TokenizationPipelineOptions, type Tokenizer, type TopicMessageEvent, TopicMessageEventSchema, type TopicPub, TopicPubSchema, type TopicSub, TopicSubSchema, type TopicUnsub, 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, encodeBase64Url, evaluatePredicate, getCRDTDebugger, getHighestWriteConcernLevel, getSearchDebugger, hashORMapEntry, hashORMapRecord, hashObject, hashString, isLogicalQuery, isSimpleQuery, isWriteConcernAchieved, logger, multiAttribute, porterStem, resetCRDTDebugger, resetSearchDebugger, serialize, simpleAttribute, timestampToString, validateProcessorCode, validateResolverCode };