@delali/narsil 0.3.1-next.185 → 0.3.1-next.189
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/adapters/filesystem.mjs +2 -2
- package/dist/adapters/gcs.mjs +2 -2
- package/dist/adapters/indexeddb.mjs +1 -1
- package/dist/adapters/s3.mjs +2 -2
- package/dist/browser/chunk-4E5APHTM.mjs +1459 -0
- package/dist/browser/{chunk-4ZICWS4V.mjs → chunk-QAOVAYAG.mjs} +1 -1
- package/dist/browser/{chunk-CPSHS46N.mjs → chunk-WFQLSNCO.mjs} +27 -22
- package/dist/browser/{chunk-2Q45HI5H.mjs → chunk-YINZFPLT.mjs} +7 -0
- package/dist/browser/{module-XVLHJ7T7.mjs → module-VOTN3Q6X.mjs} +15 -0
- package/dist/browser/{optional-writes-ZTBHYQMN.mjs → optional-writes-J5BHKEQL.mjs} +21 -8
- package/dist/browser/{storage-leaf-4XMCITJ6.mjs → storage-leaf-62LA56U2.mjs} +14558 -13739
- package/dist/{capabilities-DAHXphRn.d.ts → capabilities-CLnQHIqV.d.ts} +51 -9
- package/dist/{chunk-KLVMK3R5.mjs → chunk-2CKDCC65.mjs} +1 -1
- package/dist/{chunk-7WXGUTWK.mjs → chunk-3JRN23HA.mjs} +17 -6
- package/dist/{chunk-5BUEBIXR.mjs → chunk-3OZ2UQJV.mjs} +18 -5
- package/dist/{chunk-VYSWVQCE.mjs → chunk-5HPILB7R.mjs} +2 -2
- package/dist/{chunk-FBQYC5OX.mjs → chunk-6G3VRWH5.mjs} +16 -13
- package/dist/{chunk-QJGDB3WR.mjs → chunk-6GHX35ZM.mjs} +2 -2
- package/dist/{chunk-H4QYQ5DE.mjs → chunk-7NCVV3ST.mjs} +2 -2
- package/dist/{chunk-X5NHWOXT.mjs → chunk-7P5YWDRQ.mjs} +2 -2
- package/dist/{chunk-F4OOBPKA.mjs → chunk-AOYQTX6W.mjs} +1 -1
- package/dist/{chunk-D6FYUTFN.mjs → chunk-ASZLNVWW.mjs} +1 -1
- package/dist/{chunk-DU23J5JG.mjs → chunk-EFS5GVBK.mjs} +6 -6
- package/dist/{chunk-FETZYCH7.mjs → chunk-F6F4G322.mjs} +26 -1
- package/dist/{chunk-IE3Q62QD.mjs → chunk-GR5GMFJJ.mjs} +1 -1
- package/dist/{chunk-Y7QUFIGV.mjs → chunk-GXED6R3Q.mjs} +2 -2
- package/dist/{chunk-LR6JJVML.mjs → chunk-GYLRKKUT.mjs} +764 -699
- package/dist/{react-native/chunks/chunk-ZUFOYZ5P.mjs → chunk-IDWDYS2N.mjs} +1 -1
- package/dist/{chunk-YM2HI5N5.mjs → chunk-IL5DRCNU.mjs} +2 -2
- package/dist/{chunk-BVZWWMOU.mjs → chunk-IWKYAO45.mjs} +2 -2
- package/dist/chunk-JEMK23OY.mjs +602 -0
- package/dist/{chunk-2YWWHMVC.mjs → chunk-JOWXHENJ.mjs} +2 -2
- package/dist/{chunk-SL53DHVE.mjs → chunk-JXDY3ZA3.mjs} +66 -40
- package/dist/{chunk-WLFOLAQI.mjs → chunk-KBU3ZFJN.mjs} +2 -2
- package/dist/{chunk-N3M4NPML.mjs → chunk-M2Z5WVWW.mjs} +1 -1
- package/dist/{chunk-2KCCQK4R.mjs → chunk-NFAWR2O4.mjs} +2 -2
- package/dist/{chunk-EWGIF6FQ.mjs → chunk-NJJN4FMM.mjs} +1 -1
- package/dist/{chunk-MHBG33R5.mjs → chunk-NM2ITITI.mjs} +76 -46
- package/dist/{chunk-WSIU6YXQ.mjs → chunk-NULDX3ID.mjs} +1732 -743
- package/dist/{chunk-II6XF6M4.mjs → chunk-P2IPUYT2.mjs} +6 -6
- package/dist/{chunk-C7YQHCSO.mjs → chunk-P4F4UWLC.mjs} +1 -1
- package/dist/{chunk-A3OAFUZI.mjs → chunk-PLLKT5NU.mjs} +2 -2
- package/dist/{chunk-FCQMZDRI.mjs → chunk-PPD4J2JI.mjs} +3 -3
- package/dist/{chunk-EDEE7ETQ.mjs → chunk-PZYBWMCL.mjs} +3 -3
- package/dist/{chunk-I2WJCRIH.mjs → chunk-R2PJKSNL.mjs} +1 -1
- package/dist/{chunk-M5I64AQW.mjs → chunk-REBDKXAH.mjs} +33 -33
- package/dist/{chunk-6SZQETSC.mjs → chunk-RORNUNXW.mjs} +5 -2
- package/dist/{chunk-CYCVPTTR.mjs → chunk-SCZI7COG.mjs} +2 -2
- package/dist/{chunk-O337MDRJ.mjs → chunk-U5IMECEX.mjs} +38 -13
- package/dist/{chunk-CODGHJVW.mjs → chunk-X2NE4VJI.mjs} +40 -12
- package/dist/{chunk-2GONI5HL.mjs → chunk-YFMM7QOT.mjs} +5 -4
- package/dist/{chunk-JDG6CCXM.mjs → chunk-YQ4RZIIN.mjs} +2 -2
- package/dist/{chunk-G3XRHAJA.mjs → chunk-ZGMCJXY5.mjs} +3 -3
- package/dist/{chunk-Q3ZZH5Z7.mjs → chunk-ZKOQR7EA.mjs} +7 -0
- package/dist/{chunk-CKEOTSF5.mjs → chunk-ZS2YUB2L.mjs} +6 -3
- package/dist/{client-DpqtT2XG.d.ts → client-uB0kp2yT.d.ts} +88 -5
- package/dist/client.d.ts +7 -7
- package/dist/client.mjs +3 -1265
- package/dist/{config-D9WR3MhO.d.ts → config-BvHQ-C7U.d.ts} +3 -3
- package/dist/{config-C687-reW.d.ts → config-PqgNY1H7.d.ts} +1 -1
- package/dist/{core-leaf-NEUM7PU3.mjs → core-leaf-TAR3GJVE.mjs} +3 -3
- package/dist/{direct-executor-37IH3ISS.mjs → direct-executor-QLBSVTEE.mjs} +8 -8
- package/dist/distribution/coordinator/etcd.d.ts +1 -1
- package/dist/distribution/coordinator/etcd.mjs +35 -15
- package/dist/distribution/coordinator/in-memory.d.ts +1 -1
- package/dist/distribution/coordinator/in-memory.mjs +16 -6
- package/dist/distribution/transport/grpc.mjs +2 -2
- package/dist/distribution/transport/tcp.mjs +2 -2
- package/dist/distribution.d.ts +70 -9
- package/dist/distribution.mjs +1694 -679
- package/dist/{durability-config-NWU2G2SJ.mjs → durability-config-VWS2K24E.mjs} +1 -1
- package/dist/{react-native/chunks/embed-4LBSQD7U.mjs → embed-4PHHKGBK.mjs} +1 -1
- package/dist/embeddings/openai.mjs +2 -2
- package/dist/{engine-De6JzTW8.d.ts → engine-qjAxJSKk.d.ts} +206 -7
- package/dist/{index-CBUl4z3E.d.ts → index-BaQIAnk0.d.ts} +137 -111
- package/dist/index.browser.mjs +3 -3
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +8 -8
- package/dist/index.react-native.mjs +9 -9
- package/dist/{long-query-thread-DIPJBMV7.mjs → long-query-thread-IKD4Z37M.mjs} +21 -21
- package/dist/{module-Z3CL4GJ4.mjs → module-NIVZ4SF2.mjs} +22 -10
- package/dist/{msgpack-leaf-7KBYOVTF.mjs → msgpack-leaf-H5ZYW7S7.mjs} +4 -4
- package/dist/{optional-reads-ENKMVQ4Q.mjs → optional-reads-5HFMF2QZ.mjs} +2 -2
- package/dist/{optional-writes-YIVJMQ4D.mjs → optional-writes-DVTVX2XY.mjs} +31 -18
- package/dist/{paged-partition-archive-IZ6U7DVN.mjs → paged-partition-archive-ES4Z5SM4.mjs} +20 -20
- package/dist/partial-words.browser.mjs +3 -3
- package/dist/partial-words.mjs +8 -8
- package/dist/pattern.browser.mjs +2 -2
- package/dist/pattern.mjs +3 -3
- package/dist/persistence/durability/checkpoint-worker.d.ts +7 -0
- package/dist/persistence/durability/checkpoint-worker.mjs +18 -18
- package/dist/{phrase-module-ZY3TLTQA.mjs → phrase-module-EFESWOCR.mjs} +2 -2
- package/dist/{query-actions-7EOKT3WD.mjs → query-actions-IC5UEWZG.mjs} +8 -8
- package/dist/query-suggestions/merge-worker.mjs +11 -11
- package/dist/query-suggestions.browser.mjs +3 -3
- package/dist/query-suggestions.d.ts +1 -1
- package/dist/query-suggestions.mjs +9 -9
- package/dist/react-native/chunks/{chunk-T5HF3FW3.mjs → chunk-3553RYCS.mjs} +3 -3
- package/dist/react-native/chunks/{chunk-TQ26BKBH.mjs → chunk-43R4GCM7.mjs} +7 -0
- package/dist/react-native/chunks/{chunk-BN6FUB7N.mjs → chunk-AN4HKLB4.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-PVMEHBQO.mjs → chunk-CW2ZFXSE.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-ZQPSXN6C.mjs → chunk-FJHZWUCB.mjs} +5 -5
- package/dist/react-native/chunks/{chunk-NLEFMPY3.mjs → chunk-G434H5WG.mjs} +15 -4
- package/dist/react-native/chunks/{chunk-IEY4DARA.mjs → chunk-GXY4R3GA.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-SK3DPAI4.mjs → chunk-HTBY4GON.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-7TPO4FLE.mjs → chunk-JZOHEHBD.mjs} +3 -3
- package/dist/react-native/chunks/{chunk-ZDDJVR7X.mjs → chunk-MRH36RN3.mjs} +2 -2
- package/dist/react-native/chunks/{chunk-YOTP2FPE.mjs → chunk-UO44MA5M.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-WFQ6YQZA.mjs → chunk-UYKIV2KT.mjs} +1 -1
- package/dist/{chunk-4JBTALUC.mjs → react-native/chunks/chunk-VSN76LWE.mjs} +1 -1
- package/dist/react-native/chunks/{chunk-CBU4M3EU.mjs → chunk-XLYQ2ZMC.mjs} +222 -47
- package/dist/react-native/chunks/{chunk-OZ3XEM6D.mjs → chunk-ZUJCUPVS.mjs} +1 -1
- package/dist/react-native/chunks/{core-leaf-TPBRRWVN.mjs → core-leaf-5PVST5PR.mjs} +4 -4
- package/dist/react-native/chunks/{durability-config-RVTWSXPH.mjs → durability-config-FCSD4MXY.mjs} +1 -1
- package/dist/{embed-2QMYCD2Q.mjs → react-native/chunks/embed-HA2I7RCF.mjs} +1 -1
- package/dist/react-native/chunks/{gzip.react-native-DLO4WW27.mjs → gzip.react-native-CVM4NQG2.mjs} +2 -2
- package/dist/react-native/chunks/{module-COLNJNML.mjs → module-TN7HXWJ3.mjs} +21 -6
- package/dist/react-native/chunks/msgpack-leaf-JMNGSTRW.mjs +7 -0
- package/dist/react-native/chunks/{optional-reads-74HYI4DO.mjs → optional-reads-AFPO2FEB.mjs} +3 -3
- package/dist/react-native/chunks/{optional-writes-QETIM6BI.mjs → optional-writes-2UPNQNAN.mjs} +31 -18
- package/dist/react-native/chunks/{phrase-module-UC4YGEBB.mjs → phrase-module-IGYBK7XH.mjs} +3 -3
- package/dist/react-native/chunks/{resolve-vector-text-FU7D4QP5.mjs → resolve-vector-text-GE2CRJKI.mjs} +1 -1
- package/dist/react-native/chunks/{restore-queue-3E2MJIJS.mjs → restore-queue-DEAWTVHW.mjs} +12 -12
- package/dist/react-native/chunks/{segment-codec-leaf-IE4DXUZV.mjs → segment-codec-leaf-3LZ6HZFD.mjs} +10 -10
- package/dist/react-native/chunks/{segment-merge-leaf-62LQ5WZB.mjs → segment-merge-leaf-5OIWAPCI.mjs} +11 -11
- package/dist/react-native/chunks/{storage-leaf-LNOLKWZB.mjs → storage-leaf-LC4RZU3T.mjs} +15614 -14805
- package/dist/react-native/chunks/{store-leaf-Y7CBOPFZ.mjs → store-leaf-LQ6LWM2Q.mjs} +11 -11
- package/dist/react-native/chunks/{suggestions-leaf-PSUGL6MI.mjs → suggestions-leaf-GPNU6I72.mjs} +11 -11
- package/dist/react-native/chunks/{worker-copies-MW5O5U3D.mjs → worker-copies-32TCHOYP.mjs} +10 -10
- package/dist/react-native/partial-words.mjs +9 -9
- package/dist/react-native/pattern.mjs +5 -5
- package/dist/react-native/query-suggestions.mjs +9 -9
- package/dist/react-native/sync.mjs +433 -51
- package/dist/react-native/synonyms.mjs +9 -9
- package/dist/react.d.ts +8 -8
- package/dist/react.mjs +7 -0
- package/dist/{rerank-KTV5L7MZ.mjs → rerank-ELMGHQ3T.mjs} +8 -8
- package/dist/rerankers/http.mjs +2 -2
- package/dist/{resolve-vector-text-SD6BEMKZ.mjs → resolve-vector-text-OD4J3WHF.mjs} +2 -2
- package/dist/{restore-queue-ES7TDJ5V.mjs → restore-queue-6VCVZT5C.mjs} +11 -11
- package/dist/{segment-codec-leaf-DO75VKEV.mjs → segment-codec-leaf-XNMCUIJF.mjs} +9 -9
- package/dist/{segment-merge-leaf-JGND6LG5.mjs → segment-merge-leaf-RA4S7CC6.mjs} +9 -9
- package/dist/server.d.ts +13 -9
- package/dist/server.mjs +875 -348
- package/dist/{storage-leaf-ZI3H2WJY.mjs → storage-leaf-36SAEVV3.mjs} +5243 -5846
- package/dist/{store-leaf-YIH36Y5J.mjs → store-leaf-QAGHHLEK.mjs} +10 -10
- package/dist/{suggestions-leaf-FP5HSTFP.mjs → suggestions-leaf-JG2IP2VQ.mjs} +12 -12
- package/dist/sync/filesystem.d.ts +2 -2
- package/dist/sync/filesystem.mjs +16 -16
- package/dist/sync/indexeddb.browser.mjs +1 -1
- package/dist/sync/indexeddb.d.ts +2 -2
- package/dist/sync/indexeddb.mjs +3 -3
- package/dist/sync.browser.mjs +35 -1108
- package/dist/sync.d.ts +3 -3
- package/dist/sync.mjs +430 -51
- package/dist/synonyms.browser.mjs +3 -3
- package/dist/synonyms.mjs +8 -8
- package/dist/{tasks-X2IJQc8J.d.ts → tasks-C65V7lIr.d.ts} +3 -3
- package/dist/thread-HAE2XXFR.mjs +31 -0
- package/dist/{types-D0YasjoX.d.ts → types-CpCg-Gq-.d.ts} +1 -1
- package/dist/vector/search-worker.mjs +5 -5
- package/dist/{worker-copies-WYPRCNB7.mjs → worker-copies-IXC43Z4Q.mjs} +11 -11
- package/dist/workers/entry.mjs +14 -14
- package/openapi.json +144 -0
- package/package.json +7 -7
- package/dist/chunk-URVH6BLO.mjs +0 -217
- package/dist/react-native/chunks/msgpack-leaf-GTKLF6GJ.mjs +0 -7
- package/dist/thread-NQRNW3IH.mjs +0 -31
- /package/dist/{chunk-CV3Q2EKO.mjs → chunk-S5QMWECL.mjs} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { E as EmbeddingAdapter, R as RerankAdapter } from './adapters-pljAqmrC.js';
|
|
2
|
-
import { C as ClusterNamespace } from './config-
|
|
2
|
+
import { C as ClusterNamespace } from './config-BvHQ-C7U.js';
|
|
3
3
|
import { l as RecordedQuery } from './query-suggestions-CBYkrQ5T.js';
|
|
4
|
-
import { E as ErrorDetail, j as TaskStore } from './tasks-
|
|
4
|
+
import { E as ErrorDetail, j as TaskStore } from './tasks-C65V7lIr.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Context handed to {@link OnRequestHook} for every inbound request, captured
|
|
@@ -37,9 +37,10 @@ interface RequestDenial {
|
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* Returned by an {@link OnRequestHook} to admit a request under a credential
|
|
40
|
-
* that expires. The server closes a device sync feed
|
|
41
|
-
* `expiresAt`, so that
|
|
42
|
-
* it treats the grant on every other route as
|
|
40
|
+
* that expires. The server closes a device sync feed or a change feed with
|
|
41
|
+
* close code 4401 at `expiresAt`, so that the peer has to reconnect with a
|
|
42
|
+
* fresh credential, and it treats the grant on every other route as
|
|
43
|
+
* `undefined`.
|
|
43
44
|
*
|
|
44
45
|
* @public
|
|
45
46
|
*/
|
|
@@ -50,9 +51,10 @@ interface RequestGrant {
|
|
|
50
51
|
/**
|
|
51
52
|
* Runs before every routed request, which is where authentication, rate
|
|
52
53
|
* limiting, and any other admission rule goes. It also runs on the upgrade
|
|
53
|
-
* of a device sync feed, where a browser
|
|
54
|
-
* a `Sec-WebSocket-Protocol` value after `narsil.sync.v1
|
|
55
|
-
* can set no other header on a
|
|
54
|
+
* of a device sync feed or a change feed, where a browser can carry its
|
|
55
|
+
* credential as a `Sec-WebSocket-Protocol` value after `narsil.sync.v1` or
|
|
56
|
+
* `narsil.changes.v1`, because a browser can set no other header on a
|
|
57
|
+
* WebSocket.
|
|
56
58
|
*
|
|
57
59
|
* @param ctx - The request's method, path, headers, and peer address.
|
|
58
60
|
* @returns A {@link RequestDenial} to reject the request, a
|
|
@@ -90,6 +92,35 @@ interface ServerSyncOptions {
|
|
|
90
92
|
*/
|
|
91
93
|
maxBufferedBytes?: number;
|
|
92
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* The settings of the change feed at `GET /indexes/{name}/changes/feed`. Every
|
|
97
|
+
* field has a default, and the server counts the connections and the
|
|
98
|
+
* catch-ups of this feed apart from those of the device sync feed.
|
|
99
|
+
*
|
|
100
|
+
* @public
|
|
101
|
+
*/
|
|
102
|
+
interface ServerChangesOptions {
|
|
103
|
+
/**
|
|
104
|
+
* The server stops sending changes to a subscriber while the changes that
|
|
105
|
+
* it has sent, and that the subscriber has not acknowledged, hold more than
|
|
106
|
+
* this many bytes. It defaults to 8,388,608.
|
|
107
|
+
*/
|
|
108
|
+
windowBytes?: number;
|
|
109
|
+
/** The server holds at most this many change feed connections, and it answers 429 to one more. It defaults to 10,000. */
|
|
110
|
+
maxConnections?: number;
|
|
111
|
+
/**
|
|
112
|
+
* The server reads the history of at most this many change feed
|
|
113
|
+
* connections at once, and it holds any other connection until one of
|
|
114
|
+
* those reads ends. It defaults to 32.
|
|
115
|
+
*/
|
|
116
|
+
maxCatchUps?: number;
|
|
117
|
+
/**
|
|
118
|
+
* The server stops reading changes for every subscriber while its change
|
|
119
|
+
* feed connections hold this many bytes that the network has not yet
|
|
120
|
+
* taken. It defaults to 268,435,456.
|
|
121
|
+
*/
|
|
122
|
+
maxBufferedBytes?: number;
|
|
123
|
+
}
|
|
93
124
|
/**
|
|
94
125
|
* Which cross-origin requests the server accepts.
|
|
95
126
|
*
|
|
@@ -266,6 +297,17 @@ interface ServerOptions {
|
|
|
266
297
|
* settings.
|
|
267
298
|
*/
|
|
268
299
|
sync?: boolean | ServerSyncOptions;
|
|
300
|
+
/**
|
|
301
|
+
* Turns on the change feed, a WebSocket at
|
|
302
|
+
* `GET /indexes/{name}/changes/feed`, which stays off by default. Each index
|
|
303
|
+
* serves it only once a caller turns capture on for it with
|
|
304
|
+
* `updateChanges`. A subscriber receives every document of the index, so
|
|
305
|
+
* the server refuses to start with the feed on and no
|
|
306
|
+
* {@link ServerOptions.onRequest} hook, whatever
|
|
307
|
+
* {@link ServerOptions.allowInsecure} holds. Pass `true` for the default
|
|
308
|
+
* settings.
|
|
309
|
+
*/
|
|
310
|
+
changes?: boolean | ServerChangesOptions;
|
|
269
311
|
/**
|
|
270
312
|
* Lets `POST /indexes/{name}/query-suggestions/record` count searches. The
|
|
271
313
|
* server takes the person and the group from
|
|
@@ -421,4 +463,4 @@ declare const BM25_TUNING_CAPABILITY = "indexes.bm25";
|
|
|
421
463
|
*/
|
|
422
464
|
declare const SERVER_CAPABILITIES: readonly string[];
|
|
423
465
|
|
|
424
|
-
export { ASYNC_IMPORT_CAPABILITY as A, BM25_TUNING_CAPABILITY as B, CHANGE_ANALYSIS_CAPABILITY as C, DOCUMENT_EXPORT_CAPABILITY as D, type ErrorEnvelope as E, INDEX_LIFECYCLE_CAPABILITY as I, type NarsilServer as N, type OnRequestHook as O, type QueryIdentity as Q, REBUILD_ANALYSIS_CAPABILITY as R, SERVER_CAPABILITIES as S, TASK_CANCEL_CAPABILITY as T, SYNONYMS_CAPABILITY as a, TASK_FILTER_CAPABILITY as b, type ServerOptions as c, type CorsOptions as d, type RequestContext as e, type RequestDenial as f, type RequestGrant as g, type
|
|
466
|
+
export { ASYNC_IMPORT_CAPABILITY as A, BM25_TUNING_CAPABILITY as B, CHANGE_ANALYSIS_CAPABILITY as C, DOCUMENT_EXPORT_CAPABILITY as D, type ErrorEnvelope as E, INDEX_LIFECYCLE_CAPABILITY as I, type NarsilServer as N, type OnRequestHook as O, type QueryIdentity as Q, REBUILD_ANALYSIS_CAPABILITY as R, SERVER_CAPABILITIES as S, TASK_CANCEL_CAPABILITY as T, SYNONYMS_CAPABILITY as a, TASK_FILTER_CAPABILITY as b, type ServerOptions as c, type CorsOptions as d, type RequestContext as e, type RequestDenial as f, type RequestGrant as g, type ServerChangesOptions as h, type ServerLimits as i, type ServerQuerySuggestionsOptions as j, type ServerSyncOptions as k };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MAX_DOCUMENT_ENCODING_DEPTH, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, DOCUMENT_REPLY_ENVELOPE_DEPTH } from './chunk-4PY4JYMY.mjs';
|
|
2
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
3
3
|
import { encode, Encoder } from '@msgpack/msgpack';
|
|
4
4
|
|
|
5
5
|
var integerEncoder;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { MAX_SEGMENT_ID, MANIFEST_ENVELOPE_VERSION, EARLIER_SEGMENT_MANIFEST_VERSION, SEGMENT_MANIFEST_VERSION, MAX_SEGMENTS_PER_PARTITION, segmentKey, manifestFileRefs, graphPartKey, vectorFileKey } from './chunk-
|
|
2
|
-
import { VECTOR_FILE_MAX_VECTORS, deadBytesFor } from './chunk-
|
|
3
|
-
import { openChecksummedEnvelope, HEADER_SIZE, QUERY_HISTORY_ARCHIVE_PREFIX, MAX_HISTORY_FILE_BYTES } from './chunk-
|
|
1
|
+
import { MAX_SEGMENT_ID, MANIFEST_ENVELOPE_VERSION, EARLIER_SEGMENT_MANIFEST_VERSION, SEGMENT_MANIFEST_VERSION, MAX_SEGMENTS_PER_PARTITION, segmentKey, manifestFileRefs, graphPartKey, vectorFileKey } from './chunk-NFAWR2O4.mjs';
|
|
2
|
+
import { VECTOR_FILE_MAX_VECTORS, deadBytesFor } from './chunk-KBU3ZFJN.mjs';
|
|
3
|
+
import { openChecksummedEnvelope, HEADER_SIZE, QUERY_HISTORY_ARCHIVE_PREFIX, MAX_HISTORY_FILE_BYTES } from './chunk-PZYBWMCL.mjs';
|
|
4
4
|
import { decode } from './chunk-GXCDWLQI.mjs';
|
|
5
|
-
import { requireValidFieldTypes } from './chunk-
|
|
5
|
+
import { requireValidFieldTypes } from './chunk-7P5YWDRQ.mjs';
|
|
6
6
|
import { MAX_FILE_BYTES } from './chunk-4PY4JYMY.mjs';
|
|
7
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
7
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
8
8
|
|
|
9
9
|
// src/persistence/durability/segment/manifest-fields.ts
|
|
10
10
|
function invalidManifest(message, details) {
|
|
@@ -554,6 +554,17 @@ async function readHistoryEntries(reader, handlers) {
|
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
556
|
|
|
557
|
+
// src/sync/feed/constants.ts
|
|
558
|
+
var DEFAULT_FEED_WINDOW_BYTES = 8388608;
|
|
559
|
+
var ENTRIES_MESSAGE_LIMIT_BYTES = 1048576;
|
|
560
|
+
var DEFAULT_MAX_FEED_CONNECTIONS = 1e4;
|
|
561
|
+
var DEFAULT_MAX_FEED_CATCH_UPS = 32;
|
|
562
|
+
var DEFAULT_MAX_FEED_BUFFERED_BYTES = 268435456;
|
|
563
|
+
var FEED_HEAD_RETRY_MS = 200;
|
|
564
|
+
var TIMER_DELAY_LIMIT_MS = 2147483647;
|
|
565
|
+
var FEED_SOCKET_MAX_PAYLOAD_BYTES = 131072;
|
|
566
|
+
var FEED_SOCKET_MAX_BACKPRESSURE_BYTES = 1073741824;
|
|
567
|
+
|
|
557
568
|
// src/persistence/archive/range-layout.ts
|
|
558
569
|
function archiveLayout(config, manifestBytes, files) {
|
|
559
570
|
const parts = [];
|
|
@@ -624,4 +635,4 @@ async function* archiveRange(layout, start, endExclusive) {
|
|
|
624
635
|
}
|
|
625
636
|
}
|
|
626
637
|
|
|
627
|
-
export { ARCHIVE_CONFIG_ENTRY, ARCHIVE_FILE_CHUNK_BYTES, ARCHIVE_MANIFEST_ENTRY, archiveLayout, archiveRange, decodeManifestPayload, decodeSegmentManifest, estimatedArchiveBytes, invalidManifest, isId, isRecord, isSequenceNumber, isUint32, listedKeysOf, openManifestPayload, readSnapshotArchive, sourceIndexNameOf, tarEnd, tarEntryHeaders, tarPadding };
|
|
638
|
+
export { ARCHIVE_CONFIG_ENTRY, ARCHIVE_FILE_CHUNK_BYTES, ARCHIVE_MANIFEST_ENTRY, DEFAULT_FEED_WINDOW_BYTES, DEFAULT_MAX_FEED_BUFFERED_BYTES, DEFAULT_MAX_FEED_CATCH_UPS, DEFAULT_MAX_FEED_CONNECTIONS, ENTRIES_MESSAGE_LIMIT_BYTES, FEED_HEAD_RETRY_MS, FEED_SOCKET_MAX_BACKPRESSURE_BYTES, FEED_SOCKET_MAX_PAYLOAD_BYTES, TIMER_DELAY_LIMIT_MS, archiveLayout, archiveRange, decodeManifestPayload, decodeSegmentManifest, estimatedArchiveBytes, invalidManifest, isId, isRecord, isSequenceNumber, isUint32, listedKeysOf, openManifestPayload, readSnapshotArchive, sourceIndexNameOf, tarEnd, tarEntryHeaders, tarPadding };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { isValidInteger, isRecord } from './chunk-
|
|
1
|
+
import { isValidInteger, isRecord } from './chunk-X2NE4VJI.mjs';
|
|
2
2
|
import { MAX_REPLICATION_FACTOR, MAX_PARTITION_COUNT } from './chunk-JDDXV6UF.mjs';
|
|
3
|
-
import { openChecksummedEnvelope, packChecksummedEnvelope, MAX_HISTORY_FILE_BYTES } from './chunk-
|
|
3
|
+
import { openChecksummedEnvelope, packChecksummedEnvelope, MAX_HISTORY_FILE_BYTES } from './chunk-PZYBWMCL.mjs';
|
|
4
4
|
import { decode } from './chunk-GXCDWLQI.mjs';
|
|
5
5
|
import { isSyncEpoch } from './chunk-BUMREPLU.mjs';
|
|
6
|
-
import { joinChunks } from './chunk-
|
|
6
|
+
import { joinChunks } from './chunk-GR5GMFJJ.mjs';
|
|
7
7
|
import { MAX_FILE_BYTES } from './chunk-4PY4JYMY.mjs';
|
|
8
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
8
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
9
9
|
import { encode } from '@msgpack/msgpack';
|
|
10
10
|
|
|
11
11
|
// src/narsil/write-blocks.ts
|
|
@@ -21,6 +21,15 @@ function bindEngineWriteBlock(engine, owner) {
|
|
|
21
21
|
if (lookup !== void 0) writeBlockLookups.set(engine, lookup);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
// src/server/changes/serving.ts
|
|
25
|
+
var changesServingSources = /* @__PURE__ */ new WeakMap();
|
|
26
|
+
function bindChangesServing(owner, serving) {
|
|
27
|
+
changesServingSources.set(owner, serving);
|
|
28
|
+
}
|
|
29
|
+
function changesServingSourceOf(owner) {
|
|
30
|
+
return changesServingSources.get(owner);
|
|
31
|
+
}
|
|
32
|
+
|
|
24
33
|
// src/server/sync/serving.ts
|
|
25
34
|
var syncServingSources = /* @__PURE__ */ new WeakMap();
|
|
26
35
|
function bindSyncServing(owner, serving) {
|
|
@@ -144,6 +153,10 @@ function backupKeys(keyPrefix) {
|
|
|
144
153
|
var BACKUP_MANIFEST_ENVELOPE_VERSION = 1;
|
|
145
154
|
var PATH_SEGMENT_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
146
155
|
var SYNC_BACKUP_TAKER = "sync";
|
|
156
|
+
var CHANGES_BACKUP_TAKER = "changes";
|
|
157
|
+
function isBackupTaker(value) {
|
|
158
|
+
return value === SYNC_BACKUP_TAKER || value === CHANGES_BACKUP_TAKER;
|
|
159
|
+
}
|
|
147
160
|
function damaged(backupName, reason) {
|
|
148
161
|
return new NarsilError(ErrorCodes.BACKUP_DAMAGED, `The manifest of backup '${backupName}' ${reason}`, {
|
|
149
162
|
backupName
|
|
@@ -273,4 +286,4 @@ function readRestorePlacement(request) {
|
|
|
273
286
|
return placement;
|
|
274
287
|
}
|
|
275
288
|
|
|
276
|
-
export { BACKUP_DELETES_AT_ONCE, BACKUP_FILES_AT_ONCE, BACKUP_FILE_CHUNK_BYTES, BACKUP_JOBS_KEY, BACKUP_JOB_CAS_ATTEMPTS, BACKUP_JOB_CAS_RETRY_MS, BACKUP_JOB_POLL_INTERVAL_MS, BACKUP_MANIFEST_READS_AT_ONCE, BACKUP_PARTITIONS_AT_ONCE, BACKUP_PARTITION_POLL_INTERVAL_MS, BACKUP_PARTITION_RESULT_RETENTION_MS, BACKUP_PRIMARY_WAIT_MS, BACKUP_PROGRESS_REPORT_INTERVAL_MS, BACKUP_PUBLISH_RETRY_MS, BACKUP_SWEEP_INTERVAL_MS, CLUSTER_UUID_KEY, MAX_CLUSTER_UUID_BYTES, MAX_FINISHED_BACKUP_JOBS, SYNC_BACKUPS_KEPT, SYNC_BACKUP_TAKER, backupKeys, bindEngineWriteBlock, bindIndexReads, bindSyncServing, bindWriteBlockLookup, decodeBackupManifest, encodeBackupManifest, indexReadsOf, isCount, isSha256Hex, readBackupPartition, readRestorePlacement, readStoredFile, storeWithoutSaveIfAbsent, storedFilesOf, syncServingSourceOf, validateBackupConfig, validateBackupName, writeBlockLookupOf };
|
|
289
|
+
export { BACKUP_DELETES_AT_ONCE, BACKUP_FILES_AT_ONCE, BACKUP_FILE_CHUNK_BYTES, BACKUP_JOBS_KEY, BACKUP_JOB_CAS_ATTEMPTS, BACKUP_JOB_CAS_RETRY_MS, BACKUP_JOB_POLL_INTERVAL_MS, BACKUP_MANIFEST_READS_AT_ONCE, BACKUP_PARTITIONS_AT_ONCE, BACKUP_PARTITION_POLL_INTERVAL_MS, BACKUP_PARTITION_RESULT_RETENTION_MS, BACKUP_PRIMARY_WAIT_MS, BACKUP_PROGRESS_REPORT_INTERVAL_MS, BACKUP_PUBLISH_RETRY_MS, BACKUP_SWEEP_INTERVAL_MS, CHANGES_BACKUP_TAKER, CLUSTER_UUID_KEY, MAX_CLUSTER_UUID_BYTES, MAX_FINISHED_BACKUP_JOBS, SYNC_BACKUPS_KEPT, SYNC_BACKUP_TAKER, backupKeys, bindChangesServing, bindEngineWriteBlock, bindIndexReads, bindSyncServing, bindWriteBlockLookup, changesServingSourceOf, decodeBackupManifest, encodeBackupManifest, indexReadsOf, isBackupTaker, isCount, isSha256Hex, readBackupPartition, readRestorePlacement, readStoredFile, storeWithoutSaveIfAbsent, storedFilesOf, syncServingSourceOf, validateBackupConfig, validateBackupName, writeBlockLookupOf };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { boundQuerySuggestionsOf } from './chunk-S2POFTLN.mjs';
|
|
2
|
-
import { engineCoreOf, loadSuggestionsCode, GROUP_PATTERN_SOURCE, GROUP_FORMAT, SUGGESTIONS_INDEX_INFIX } from './chunk-
|
|
3
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
2
|
+
import { engineCoreOf, loadSuggestionsCode, GROUP_PATTERN_SOURCE, GROUP_FORMAT, SUGGESTIONS_INDEX_INFIX } from './chunk-JXDY3ZA3.mjs';
|
|
3
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
4
4
|
|
|
5
5
|
// src/query-suggestions/index.ts
|
|
6
6
|
function querySuggestions(engine) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { responseStopOf, sendRelayed, parseJson, validateQuery, rejectInvalid, refuseRegex, withServerRerankWindow, requestSignal, respondJson, encodeQueryResult, respondError, loadUWebSockets, childAppOf, createRouteRunner, corsHeaderReader, createSharedBodyBudget, createSharedRequestGate, registerFeedRoute, registerServerRoutes, closeWhenTheProcessExits, statusLine, sendError, REQUEST_THREAD_MOVE_AFTER_MS, MAX_LONG_QUERIES_IN_FLIGHT, createDocumentReadHandlers, SERVER_CAPABILITIES, versionReport, serverRoutes, validateSuggest, isMainFeedNote, SEARCH_CLOCK_SAMPLE_UNITS, awaitDepartureConfirmation, departureConfirmation, REQUEST_THREAD_DEPARTURE_DRAIN_MS, departureConfirmed, stopResponse } from './chunk-
|
|
2
|
-
import { SYNC_CLOSE_GOING_AWAY, encodeJson } from './chunk-
|
|
3
|
-
import { importOptionalReads, loadSortingFor, holdsQuotedText, loadQueryCode, executeQuery, lazyQueryBinding, executePreflight, resolveProjection, projectionKeepsField, loadRerankRuntime, setNestedValue } from './chunk-
|
|
4
|
-
import { loadedMessagePack, loadMessagePack, extractVectorFieldsFromSchema } from './chunk-
|
|
5
|
-
import { answerFromOneState } from './chunk-
|
|
6
|
-
import { ServerErrorCodes, ErrorCodes, NarsilError, isNarsilError } from './chunk-
|
|
1
|
+
import { responseStopOf, sendRelayed, parseJson, validateQuery, rejectInvalid, refuseRegex, withServerRerankWindow, requestSignal, respondJson, encodeQueryResult, respondError, loadUWebSockets, childAppOf, createRouteRunner, corsHeaderReader, createSharedBodyBudget, createSharedRequestGate, registerFeedRoute, SYNC_FEED_ROUTE, CHANGES_FEED_ROUTE, registerServerRoutes, closeWhenTheProcessExits, statusLine, sendError, REQUEST_THREAD_MOVE_AFTER_MS, MAX_LONG_QUERIES_IN_FLIGHT, createDocumentReadHandlers, SERVER_CAPABILITIES, versionReport, serverRoutes, validateSuggest, isMainFeedNote, SEARCH_CLOCK_SAMPLE_UNITS, awaitDepartureConfirmation, departureConfirmation, REQUEST_THREAD_DEPARTURE_DRAIN_MS, departureConfirmed, stopResponse } from './chunk-NM2ITITI.mjs';
|
|
2
|
+
import { SYNC_CLOSE_GOING_AWAY, encodeJson } from './chunk-F6F4G322.mjs';
|
|
3
|
+
import { importOptionalReads, loadSortingFor, holdsQuotedText, loadQueryCode, executeQuery, lazyQueryBinding, executePreflight, resolveProjection, projectionKeepsField, loadRerankRuntime, setNestedValue } from './chunk-JXDY3ZA3.mjs';
|
|
4
|
+
import { loadedMessagePack, loadMessagePack, extractVectorFieldsFromSchema } from './chunk-7P5YWDRQ.mjs';
|
|
5
|
+
import { answerFromOneState } from './chunk-RORNUNXW.mjs';
|
|
6
|
+
import { ServerErrorCodes, ErrorCodes, NarsilError, isNarsilError } from './chunk-ZKOQR7EA.mjs';
|
|
7
7
|
|
|
8
8
|
// src/server/request-threads/feed-relay.ts
|
|
9
|
-
function threadFeedGateway(port, relay) {
|
|
9
|
+
function threadFeedGateway(port, relay, feed) {
|
|
10
10
|
const sockets = /* @__PURE__ */ new Map();
|
|
11
11
|
function post(note, transfer = []) {
|
|
12
12
|
try {
|
|
@@ -35,7 +35,7 @@ function threadFeedGateway(port, relay) {
|
|
|
35
35
|
return {
|
|
36
36
|
authorize: (context) => relay.authorize(context),
|
|
37
37
|
async admit(indexName, expiresAt) {
|
|
38
|
-
const reply = await relay.admitFeed(indexName, expiresAt);
|
|
38
|
+
const reply = await relay.admitFeed(feed, indexName, expiresAt);
|
|
39
39
|
const { feedId } = reply;
|
|
40
40
|
if (feedId === null) {
|
|
41
41
|
const error = reply.error;
|
|
@@ -337,8 +337,8 @@ function createRelayClient(port, touchIntervalMs) {
|
|
|
337
337
|
async awaitWrites(indexName, signal) {
|
|
338
338
|
await send((requestId) => ({ type: "await-writes", requestId, indexName }), [], signal);
|
|
339
339
|
},
|
|
340
|
-
async admitFeed(indexName, expiresAt) {
|
|
341
|
-
const reply = await send((requestId) => ({ type: "feed-admit", requestId, indexName, expiresAt }));
|
|
340
|
+
async admitFeed(feed, indexName, expiresAt) {
|
|
341
|
+
const reply = await send((requestId) => ({ type: "feed-admit", requestId, feed, indexName, expiresAt }));
|
|
342
342
|
if (reply.type === "feed-admitted") return reply;
|
|
343
343
|
throw portClosedError();
|
|
344
344
|
},
|
|
@@ -1069,8 +1069,11 @@ async function serveRequests(executor, settings) {
|
|
|
1069
1069
|
track: departure.track
|
|
1070
1070
|
});
|
|
1071
1071
|
const handlers = guardEveryRoute(threadHandlers(local, relay, longQueries, settings), departure);
|
|
1072
|
-
const feeds = settings.
|
|
1073
|
-
|
|
1072
|
+
const feeds = settings.feeds.map((feed) => {
|
|
1073
|
+
const gateway = threadFeedGateway(settings.port, relay, feed);
|
|
1074
|
+
registerFeedRoute(app, gateway, feed === "sync" ? SYNC_FEED_ROUTE : CHANGES_FEED_ROUTE);
|
|
1075
|
+
return gateway;
|
|
1076
|
+
});
|
|
1074
1077
|
registerServerRoutes(app, run, handlers, settings.limits, settings.cors);
|
|
1075
1078
|
servingApp = { app: child, relay, longQueries, feeds };
|
|
1076
1079
|
void closeWhenTheProcessExits(new Int32Array(settings.closeAtExit), closeRequestThread);
|
|
@@ -1081,7 +1084,7 @@ function closeRequestThread() {
|
|
|
1081
1084
|
if (servingApp === null) return;
|
|
1082
1085
|
const { app, relay, longQueries, feeds } = servingApp;
|
|
1083
1086
|
servingApp = null;
|
|
1084
|
-
feeds
|
|
1087
|
+
for (const gateway of feeds) gateway.close();
|
|
1085
1088
|
app.close();
|
|
1086
1089
|
longQueries.close();
|
|
1087
1090
|
relay.close();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isSyncEpoch } from './chunk-BUMREPLU.mjs';
|
|
2
|
-
import { requireLoadedMessagePack } from './chunk-
|
|
3
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
2
|
+
import { requireLoadedMessagePack } from './chunk-7P5YWDRQ.mjs';
|
|
3
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
4
4
|
|
|
5
5
|
// src/sync/device/stores/records.ts
|
|
6
6
|
function damaged(detail) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createNumericIndex, createBooleanIndex, createEnumIndex, createLoadedGeoIndex, rebuildSizeIndexes, requirePatternSearch, patternIndexOf } from './chunk-
|
|
2
|
-
import { getFlatSchema, schemaFieldsOf, getNestedValue } from './chunk-
|
|
1
|
+
import { createNumericIndex, createBooleanIndex, createEnumIndex, createLoadedGeoIndex, rebuildSizeIndexes, requirePatternSearch, patternIndexOf } from './chunk-JXDY3ZA3.mjs';
|
|
2
|
+
import { getFlatSchema, schemaFieldsOf, getNestedValue } from './chunk-7P5YWDRQ.mjs';
|
|
3
3
|
|
|
4
4
|
// src/core/partition/pattern-snapshot.ts
|
|
5
5
|
function serializePatternIndexes(state, schema) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EARLIER_RELEASE_MIN_M, MIN_M, MAX_M } from './chunk-ZXX5GZEX.mjs';
|
|
2
2
|
import { MAX_DOCUMENT_ENCODING_DEPTH, DOCUMENT_REPLY_ENVELOPE_DEPTH, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, BYTE_ORDER_MARK_WALK_BYTES_PER_HEADER } from './chunk-4PY4JYMY.mjs';
|
|
3
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
3
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
4
4
|
import { compareCodePoints, holdsUnpairedSurrogate, exceedsCodePoints } from './chunk-TGPKS2UM.mjs';
|
|
5
5
|
|
|
6
6
|
// src/schema/constants.ts
|
|
@@ -867,7 +867,7 @@ var loaded = null;
|
|
|
867
867
|
var loading = null;
|
|
868
868
|
function loadMessagePack() {
|
|
869
869
|
if (loaded !== null) return Promise.resolve(loaded);
|
|
870
|
-
loading ??= import('./msgpack-leaf-
|
|
870
|
+
loading ??= import('./msgpack-leaf-H5ZYW7S7.mjs').then(
|
|
871
871
|
(code) => {
|
|
872
872
|
code.bindMsgpackHost({
|
|
873
873
|
BYTE_ORDER_MARK_WALK_BYTES_PER_HEADER,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WORKER_YOUNG_GENERATION_MB } from './chunk-
|
|
1
|
+
import { WORKER_YOUNG_GENERATION_MB } from './chunk-RORNUNXW.mjs';
|
|
2
2
|
import { REFUSAL_YOUNG_COLLECTION_MIN_INTERVAL_MS, collectYoungGeneration, collectAndReturnPages, REFUSAL_COLLECTION_MIN_INTERVAL_MS, REFUSAL_COLLECTION_TIME_MULTIPLE } from './chunk-UPDNNOTG.mjs';
|
|
3
3
|
|
|
4
4
|
// src/workers/resource-limits.ts
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { encode, Merger } from './chunk-
|
|
2
|
-
import { DayStore, RestoredHistory, dayOf, sameBytes } from './chunk-
|
|
1
|
+
import { encode, Merger } from './chunk-JOWXHENJ.mjs';
|
|
2
|
+
import { DayStore, RestoredHistory, dayOf, sameBytes } from './chunk-ZGMCJXY5.mjs';
|
|
3
3
|
import { oneSyncChangeAtATime } from './chunk-V6EUBAIT.mjs';
|
|
4
|
-
import { isGroup, invalidSetting, historyFilesOf, buildRecordKey, MIN_KEY_BYTES, resolveSetting, isPerson, acceptedPhrase, removeHistoryFolder, normaliseBan, banListFromInput, validateSetting, withState, packEnvelopeWithChecksum, crc32, openChecksummedEnvelope, SCRAMBLED_ID_BYTES, KEY_FINGERPRINT_LABEL, KEY_FINGERPRINT_BYTES, removeRestoreLeftovers, HISTORY_SWEEP_INTERVAL_MS, SCHEDULE_OFF, parseSchedule, nextMatchAfter, latestMatchAtOrBefore, DAY_MS, listHistoryFolder, historyFileOf, MAX_MANUAL_SUGGESTION_COUNT, MAX_SOURCE_INDEX_NAME_LENGTH, DEFAULT_PREVIEW_LIMIT, MAX_PREVIEW_LIMIT, requireFieldsInSchema, MAX_TIMER_DELAY_MS, BUILD_WRITE_BATCH, BYTES_PER_MIB, MS_PER_SECOND, BUILD_LIST_PAGE, unionOfBans } from './chunk-
|
|
5
|
-
import { GROUP_FORMAT, emitEngineEvent, emitWriteEventAfter, createEngineIndex, withOpenIndex, loadDigest, SUGGESTIONS_INDEX_INFIX } from './chunk-
|
|
4
|
+
import { isGroup, invalidSetting, historyFilesOf, buildRecordKey, MIN_KEY_BYTES, resolveSetting, isPerson, acceptedPhrase, removeHistoryFolder, normaliseBan, banListFromInput, validateSetting, withState, packEnvelopeWithChecksum, crc32, openChecksummedEnvelope, SCRAMBLED_ID_BYTES, KEY_FINGERPRINT_LABEL, KEY_FINGERPRINT_BYTES, removeRestoreLeftovers, HISTORY_SWEEP_INTERVAL_MS, SCHEDULE_OFF, parseSchedule, nextMatchAfter, latestMatchAtOrBefore, DAY_MS, listHistoryFolder, historyFileOf, MAX_MANUAL_SUGGESTION_COUNT, MAX_SOURCE_INDEX_NAME_LENGTH, DEFAULT_PREVIEW_LIMIT, MAX_PREVIEW_LIMIT, requireFieldsInSchema, MAX_TIMER_DELAY_MS, BUILD_WRITE_BATCH, BYTES_PER_MIB, MS_PER_SECOND, BUILD_LIST_PAGE, unionOfBans } from './chunk-PZYBWMCL.mjs';
|
|
5
|
+
import { GROUP_FORMAT, emitEngineEvent, emitWriteEventAfter, createEngineIndex, withOpenIndex, loadDigest, SUGGESTIONS_INDEX_INFIX } from './chunk-JXDY3ZA3.mjs';
|
|
6
6
|
import { decode } from './chunk-GXCDWLQI.mjs';
|
|
7
|
-
import { spawnNodeWorker, resolveWorkerEntry } from './chunk-
|
|
8
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
7
|
+
import { spawnNodeWorker, resolveWorkerEntry } from './chunk-RORNUNXW.mjs';
|
|
8
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
9
9
|
import { compareCodePoints } from './chunk-TGPKS2UM.mjs';
|
|
10
10
|
|
|
11
11
|
// src/query-suggestions/build-record.ts
|
|
@@ -83,4 +83,29 @@ function decodeScore(score) {
|
|
|
83
83
|
return void 0;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
// src/changes/wire.ts
|
|
87
|
+
var CHANGES_SUBPROTOCOL = "narsil.changes.v1";
|
|
88
|
+
var CHANGES_CLOSE_GOING_AWAY = 1001;
|
|
89
|
+
var CHANGES_CLOSE_POLICY = 1008;
|
|
90
|
+
var CHANGES_CLOSE_TOO_LARGE = 1009;
|
|
91
|
+
var CHANGES_CLOSE_SERVER_ERROR = 1011;
|
|
92
|
+
var CHANGES_CLOSE_CREDENTIAL_EXPIRED = 4401;
|
|
93
|
+
var CHANGES_CLOSE_SETTING = 4409;
|
|
94
|
+
var CHANGES_CLOSE_RESYNC = 4410;
|
|
95
|
+
var MAX_SUBSCRIBER_MESSAGE_BYTES = 65536;
|
|
96
|
+
var MAX_CLOSE_REASON_BYTES = 123;
|
|
97
|
+
function closeReasonOf(reason) {
|
|
98
|
+
const encoder = new TextEncoder();
|
|
99
|
+
if (encoder.encode(reason).byteLength <= MAX_CLOSE_REASON_BYTES) return reason;
|
|
100
|
+
let kept = "";
|
|
101
|
+
let bytes = 0;
|
|
102
|
+
for (const character of reason) {
|
|
103
|
+
const width = encoder.encode(character).byteLength;
|
|
104
|
+
if (bytes + width > MAX_CLOSE_REASON_BYTES) break;
|
|
105
|
+
kept += character;
|
|
106
|
+
bytes += width;
|
|
107
|
+
}
|
|
108
|
+
return kept;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export { CHANGES_CLOSE_CREDENTIAL_EXPIRED, CHANGES_CLOSE_GOING_AWAY, CHANGES_CLOSE_POLICY, CHANGES_CLOSE_RESYNC, CHANGES_CLOSE_SERVER_ERROR, CHANGES_CLOSE_SETTING, CHANGES_CLOSE_TOO_LARGE, CHANGES_SUBPROTOCOL, MAX_DEVICE_MESSAGE_BYTES, MAX_SUBSCRIBER_MESSAGE_BYTES, SYNC_CLOSE_CREDENTIAL_EXPIRED, SYNC_CLOSE_GOING_AWAY, SYNC_CLOSE_POLICY, SYNC_CLOSE_RESYNC, SYNC_CLOSE_SERVER_ERROR, SYNC_CLOSE_TOO_LARGE, SYNC_SUBPROTOCOL, closeReasonOf, decodeScore, deviceMessageOf, encodeJson, encodeScore, positionList, positionsByPartition };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MAX_FILE_BYTES } from './chunk-4PY4JYMY.mjs';
|
|
2
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
2
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
3
3
|
|
|
4
4
|
// src/persistence/object-store.ts
|
|
5
5
|
function objectKeyPrefix(prefix, adapter) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_LINEAR_ALPHA, DEFAULT_RANK_CONSTANT, FUSION_TIE_INSERTION_LIMIT, MIN_LINEAR_ALPHA, MAX_LINEAR_ALPHA, MIN_RANK_CONSTANT } from './chunk-3ECIRFS5.mjs';
|
|
2
|
-
import { nativeSearchCoreIsEnabled, loadNativeCore, noteFallback } from './chunk-
|
|
3
|
-
import { NarsilError, ErrorCodes } from './chunk-
|
|
2
|
+
import { nativeSearchCoreIsEnabled, loadNativeCore, noteFallback } from './chunk-ASZLNVWW.mjs';
|
|
3
|
+
import { NarsilError, ErrorCodes } from './chunk-ZKOQR7EA.mjs';
|
|
4
4
|
import { compareCodePoints } from './chunk-TGPKS2UM.mjs';
|
|
5
5
|
|
|
6
6
|
// src/search/fusion-core.native.ts
|