@delali/narsil 0.3.1-next.131 → 0.3.1-next.141

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.
Files changed (139) hide show
  1. package/dist/adapters/filesystem.mjs +1 -1
  2. package/dist/adapters/indexeddb.mjs +1 -1
  3. package/dist/analysis-change-HQUT2Z3I.mjs +43 -0
  4. package/dist/analysis-change-entry-TZTG4AZB.mjs +1 -0
  5. package/dist/browser/analysis-change-JPV775LR.mjs +900 -0
  6. package/dist/browser/analysis-change-entry-7HR4LWL3.mjs +1 -0
  7. package/dist/browser/{chunk-UDGB2MWT.mjs → chunk-35B42UFM.mjs} +4 -0
  8. package/dist/browser/chunk-3ZBJYAS4.mjs +19 -0
  9. package/dist/browser/{chunk-2Y3CO4EQ.mjs → chunk-5DB2VDGI.mjs} +1149 -1853
  10. package/dist/browser/chunk-6RHTAVZX.mjs +656 -0
  11. package/dist/browser/chunk-CCOAOO73.mjs +86 -0
  12. package/dist/browser/{chunk-AIIJDWMG.mjs → chunk-D33A5VMU.mjs} +16 -16
  13. package/dist/browser/{chunk-VBBLTD7O.mjs → chunk-HKX2G6WH.mjs} +1520 -2159
  14. package/dist/browser/{chunk-NSCSR6MA.mjs → chunk-KTOK275N.mjs} +606 -830
  15. package/dist/browser/{chunk-D7WQF6DV.mjs → chunk-LVY2LI35.mjs} +2 -2
  16. package/dist/browser/chunk-MVM33ZUL.mjs +993 -0
  17. package/dist/browser/chunk-MWUK3DA5.mjs +2634 -0
  18. package/dist/browser/{chunk-VEGHFP2P.mjs → chunk-MZI3TEOW.mjs} +4 -2
  19. package/dist/browser/chunk-OIZS5KIX.mjs +6 -0
  20. package/dist/browser/chunk-R4WUDZQV.mjs +176 -0
  21. package/dist/browser/{chunk-M5UAAXGU.mjs → chunk-TCLEOZ4P.mjs} +3 -3
  22. package/dist/browser/chunk-VFYMPCOV.mjs +212 -0
  23. package/dist/browser/chunk-WCFCHIBB.mjs +177 -0
  24. package/dist/browser/chunk-XNWPP5NS.mjs +21 -0
  25. package/dist/browser/chunk-ZEV26AQ6.mjs +270 -0
  26. package/dist/browser/cold-module-MJMKNUYJ.mjs +745 -0
  27. package/dist/browser/{durability-wiring-FNZSRH4N.mjs → durability-wiring-SNOWIT6Z.mjs} +370 -95
  28. package/dist/browser/import-TLB2A5LJ.mjs +9 -0
  29. package/dist/browser/module-BUFNZMEU.mjs +12 -0
  30. package/dist/browser/{module-4HIMOQM5.mjs → module-BVP4TKZU.mjs} +397 -109
  31. package/dist/browser/{phrase-module-WESYVU7K.mjs → phrase-module-HGVBO24W.mjs} +1 -1
  32. package/dist/{restore-queue-JAMNRC6T.mjs → browser/restore-queue-ONYNYUDE.mjs} +8 -2
  33. package/dist/browser/{runtime-3X7ZJ5T3.mjs → runtime-VEUH674B.mjs} +2 -2
  34. package/dist/browser/{snapshot-V7VF6BN6.mjs → snapshot-QXBKHJAG.mjs} +135 -183
  35. package/dist/browser/{write-YIC2MKRY.mjs → write-WHFBDWQS.mjs} +64 -90
  36. package/dist/{capabilities-B6WxrWxt.d.ts → capabilities-BCdUwK_L.d.ts} +10 -3
  37. package/dist/chunk-46NZOPHS.mjs +21 -0
  38. package/dist/{chunk-JT3YZGCE.mjs → chunk-5WYVUPGD.mjs} +3 -188
  39. package/dist/chunk-6SNBQESJ.mjs +214 -0
  40. package/dist/{chunk-2C3WXBQS.mjs → chunk-74XB2SXI.mjs} +1 -1
  41. package/dist/chunk-7AUASRE7.mjs +653 -0
  42. package/dist/{chunk-NMXRXFGZ.mjs → chunk-AST3SHFA.mjs} +27 -25
  43. package/dist/chunk-BOJZGUS6.mjs +177 -0
  44. package/dist/{chunk-T4OFG4IQ.mjs → chunk-BRUUBXCB.mjs} +92 -17
  45. package/dist/{chunk-5LX6MOIB.mjs → chunk-C3YDYX6C.mjs} +1 -1
  46. package/dist/chunk-CZQ33DLW.mjs +78 -0
  47. package/dist/{chunk-4GDLFDPZ.mjs → chunk-DD2673TX.mjs} +3 -2
  48. package/dist/{chunk-EUCX5K74.mjs → chunk-DQNKVOJ2.mjs} +65 -65
  49. package/dist/{chunk-RNSC4NFI.mjs → chunk-EEBCDP36.mjs} +3 -1
  50. package/dist/chunk-FOCV4CBZ.mjs +87 -0
  51. package/dist/{chunk-HCGJKDZV.mjs → chunk-GLZHNSGB.mjs} +1 -1
  52. package/dist/chunk-GWOS5DYC.mjs +2637 -0
  53. package/dist/{chunk-PATMDIMN.mjs → chunk-HJJWY6PT.mjs} +1 -1
  54. package/dist/{chunk-CZ7ISLXA.mjs → chunk-HNHCNTVG.mjs} +4 -0
  55. package/dist/{chunk-Y2U5VVWX.mjs → chunk-ICW45TTU.mjs} +1 -1
  56. package/dist/{chunk-TGHNXN7W.mjs → chunk-IO5F7ZBE.mjs} +261 -948
  57. package/dist/{chunk-P36MUFEJ.mjs → chunk-JDDXV6UF.mjs} +2 -1
  58. package/dist/{chunk-7OIQ2SIO.mjs → chunk-KEIYVZUX.mjs} +5 -5
  59. package/dist/{chunk-PU6SKH7O.mjs → chunk-KGOXHLLZ.mjs} +7 -3
  60. package/dist/{chunk-WVRDRLIC.mjs → chunk-KZL72VTC.mjs} +70 -18
  61. package/dist/chunk-L76W3IZJ.mjs +193 -0
  62. package/dist/{chunk-2JWNJSNE.mjs → chunk-LA4WNDHL.mjs} +88 -801
  63. package/dist/{chunk-ZR4VM4A6.mjs → chunk-N37VMC62.mjs} +1 -18
  64. package/dist/{chunk-JJ6EUMXB.mjs → chunk-NJJCPFXN.mjs} +2 -2
  65. package/dist/chunk-NN33CZRE.mjs +86 -0
  66. package/dist/{chunk-2WBY4Y4M.mjs → chunk-NOT5QOHU.mjs} +1 -1
  67. package/dist/{chunk-D5TFRB5G.mjs → chunk-NPNK57CA.mjs} +1 -1
  68. package/dist/chunk-NRUXBYPH.mjs +121 -0
  69. package/dist/{chunk-6SSVIW7Y.mjs → chunk-O4LJQI4G.mjs} +31 -5
  70. package/dist/{chunk-UJWGQIXU.mjs → chunk-QHPYS427.mjs} +1 -0
  71. package/dist/{chunk-F6AAXI7T.mjs → chunk-RHKRTYGO.mjs} +13 -4
  72. package/dist/{chunk-2SEL6SBS.mjs → chunk-RKAVHNRW.mjs} +2 -2
  73. package/dist/{chunk-RCMNL7RI.mjs → chunk-SBMAWTRG.mjs} +41 -4
  74. package/dist/chunk-SRJBFG2T.mjs +881 -0
  75. package/dist/{chunk-X5CNUKD5.mjs → chunk-TNBIK2LQ.mjs} +1663 -1652
  76. package/dist/{chunk-NNO7CO3A.mjs → chunk-UIKN2OTQ.mjs} +1 -1
  77. package/dist/chunk-UUZCQQG2.mjs +209 -0
  78. package/dist/{chunk-6M6SDH3S.mjs → chunk-VEFN6X6Q.mjs} +8 -8
  79. package/dist/chunk-VJEGOELZ.mjs +177 -0
  80. package/dist/chunk-W2COJ5AH.mjs +148 -0
  81. package/dist/{chunk-RWESFSJI.mjs → chunk-WJGO5PGV.mjs} +317 -174
  82. package/dist/{chunk-7X5JST5L.mjs → chunk-WNBRW4Q2.mjs} +16 -2
  83. package/dist/{chunk-SZGRYEIC.mjs → chunk-XS2VM7UE.mjs} +3 -3
  84. package/dist/{chunk-Y4BVTQ53.mjs → chunk-XZ3SRNDJ.mjs} +25 -64
  85. package/dist/{chunk-K77FJXKS.mjs → chunk-YHUTF6EA.mjs} +474 -93
  86. package/dist/{chunk-OGLV4I3L.mjs → chunk-YLNSJQLX.mjs} +12 -7
  87. package/dist/{chunk-SOHMMNCH.mjs → chunk-Z4HFMYNX.mjs} +32 -27
  88. package/dist/{chunk-5W7AEVTH.mjs → chunk-ZMBFWQXN.mjs} +2 -2
  89. package/dist/{chunk-2MKX2SCO.mjs → chunk-ZPWS2SKJ.mjs} +297 -274
  90. package/dist/{chunk-7XY6VD7B.mjs → chunk-ZSWHPKGM.mjs} +1 -1
  91. package/dist/{client-gNAfaHcE.d.ts → client-B12YFALP.d.ts} +18 -3
  92. package/dist/client.d.ts +7 -7
  93. package/dist/client.mjs +11 -1
  94. package/dist/cold-module-4X7WJCFM.mjs +783 -0
  95. package/dist/{config-D1cDv3sE.d.ts → config-BhZxIeb1.d.ts} +10 -1
  96. package/dist/{config-CmYJO34X.d.ts → config-CIG5yDyg.d.ts} +2 -2
  97. package/dist/{direct-executor-HQ4QVDX7.mjs → direct-executor-7XOQ7VQP.mjs} +14 -14
  98. package/dist/distribution/coordinator/etcd.d.ts +2 -2
  99. package/dist/distribution/coordinator/etcd.mjs +1 -1
  100. package/dist/distribution/coordinator/in-memory.d.ts +2 -2
  101. package/dist/distribution/transport/grpc.mjs +1 -1
  102. package/dist/distribution.d.ts +24 -8
  103. package/dist/distribution.mjs +982 -211
  104. package/dist/{durability-wiring-S7OX2MAI.mjs → durability-wiring-324D2DDD.mjs} +362 -94
  105. package/dist/embeddings/openai.mjs +2 -2
  106. package/dist/{engine-m_Ddr1bz.d.ts → engine-CtzbHOmG.d.ts} +64 -7
  107. package/dist/import-OOBUW3RR.mjs +44 -0
  108. package/dist/{index-HYnqS1SE.d.ts → index-DsEurhSl.d.ts} +1 -1
  109. package/dist/index.browser.mjs +5 -5
  110. package/dist/index.d.ts +6 -6
  111. package/dist/index.mjs +22 -22
  112. package/dist/{long-query-thread-BSL25PD6.mjs → long-query-thread-4SW7RWDE.mjs} +15 -15
  113. package/dist/{module-2E4XYSGT.mjs → module-DXSJ5LT2.mjs} +378 -87
  114. package/dist/module-IYPLWHGC.mjs +48 -0
  115. package/dist/paged-partition-archive-HFP45PLU.mjs +269 -0
  116. package/dist/partial-words.mjs +5 -5
  117. package/dist/pattern.mjs +3 -3
  118. package/dist/persistence/durability/checkpoint-worker.d.ts +16 -1
  119. package/dist/persistence/durability/checkpoint-worker.mjs +28 -26
  120. package/dist/{phrase-module-JERF2IDG.mjs → phrase-module-5QHBD2VJ.mjs} +1 -1
  121. package/dist/react.d.ts +9 -9
  122. package/dist/react.mjs +4 -0
  123. package/dist/{rerank-DMMT4FZA.mjs → rerank-KTLC3E6N.mjs} +5 -5
  124. package/dist/rerankers/http.mjs +2 -2
  125. package/dist/{browser/restore-queue-GEZ54CA5.mjs → restore-queue-FEYAC4SB.mjs} +8 -2
  126. package/dist/{runtime-7MLQ7J64.mjs → runtime-DYV75DCB.mjs} +6 -6
  127. package/dist/{schema-BTXbHCqA.d.ts → schema-B-Runv0n.d.ts} +7 -0
  128. package/dist/server.d.ts +12 -10
  129. package/dist/server.mjs +54 -21
  130. package/dist/{snapshot-DOQLGGEX.mjs → snapshot-CGM65VCD.mjs} +101 -197
  131. package/dist/synonyms.mjs +6 -4
  132. package/dist/{tasks-Co8HfRD7.d.ts → tasks-CjRJRGTb.d.ts} +26 -8
  133. package/dist/{thread-SKO7CN3R.mjs → thread-KGNAIKPD.mjs} +14 -14
  134. package/dist/vector/search-worker.d.ts +1 -1
  135. package/dist/vector/search-worker.mjs +6 -5
  136. package/dist/workers/entry.mjs +8 -8
  137. package/dist/{write-ZKR7SNRT.mjs → write-2DZPEQL2.mjs} +82 -107
  138. package/openapi.json +114 -6
  139. package/package.json +12 -8
@@ -1,33 +1,33 @@
1
- export { closeRequestThread, searchHandler, serveRequests } from './chunk-OGLV4I3L.mjs';
2
- import './chunk-RCMNL7RI.mjs';
1
+ export { closeRequestThread, searchHandler, serveRequests } from './chunk-YLNSJQLX.mjs';
3
2
  import './chunk-KZ3NX2P7.mjs';
4
- import './chunk-4GDLFDPZ.mjs';
3
+ import './chunk-SBMAWTRG.mjs';
4
+ import './chunk-DD2673TX.mjs';
5
5
  import './chunk-IWVEG5CX.mjs';
6
6
  import './chunk-DJHHF2L5.mjs';
7
- import './chunk-6M6SDH3S.mjs';
8
- import './chunk-2MKX2SCO.mjs';
7
+ import './chunk-VEFN6X6Q.mjs';
8
+ import './chunk-HJSN7UYG.mjs';
9
+ import './chunk-EEBCDP36.mjs';
10
+ import './chunk-ZPWS2SKJ.mjs';
9
11
  import './chunk-ZATRDAYU.mjs';
10
12
  import './chunk-EBIHRL7B.mjs';
11
- import './chunk-HJSN7UYG.mjs';
12
- import './chunk-RNSC4NFI.mjs';
13
13
  import './chunk-QSK35UC2.mjs';
14
- import './chunk-2C3WXBQS.mjs';
15
- import './chunk-2SEL6SBS.mjs';
14
+ import './chunk-74XB2SXI.mjs';
15
+ import './chunk-RKAVHNRW.mjs';
16
16
  import './chunk-WQBCBKY3.mjs';
17
17
  import './chunk-JUKYYXSP.mjs';
18
- import './chunk-EUCX5K74.mjs';
19
- import './chunk-PU6SKH7O.mjs';
18
+ import './chunk-DQNKVOJ2.mjs';
19
+ import './chunk-KGOXHLLZ.mjs';
20
20
  import './chunk-U476IXKQ.mjs';
21
21
  import './chunk-FQBFZAWG.mjs';
22
22
  import './chunk-VJS4JFBQ.mjs';
23
23
  import './chunk-GES7U2PM.mjs';
24
- import './chunk-7XY6VD7B.mjs';
24
+ import './chunk-ZSWHPKGM.mjs';
25
25
  import './chunk-X5CV2E2B.mjs';
26
- import './chunk-D5TFRB5G.mjs';
26
+ import './chunk-NPNK57CA.mjs';
27
27
  import './chunk-4UMZ7KQL.mjs';
28
28
  import './chunk-R6A773WK.mjs';
29
29
  import './chunk-YTJCGKM4.mjs';
30
30
  import './chunk-RIIUZJQ3.mjs';
31
31
  import './chunk-22YPZVMG.mjs';
32
32
  import './chunk-L5ORED7V.mjs';
33
- import './chunk-CZ7ISLXA.mjs';
33
+ import './chunk-HNHCNTVG.mjs';
@@ -1,4 +1,4 @@
1
- import { f as VectorQuantizationMode } from '../schema-BTXbHCqA.js';
1
+ import { f as VectorQuantizationMode } from '../schema-B-Runv0n.js';
2
2
  import '../adapters-BQFQ4PRz.js';
3
3
  import '../synonyms-CpOAHPa-.js';
4
4
 
@@ -1,15 +1,16 @@
1
- import { openSharedVectorField, createVectorStore } from '../chunk-Y4BVTQ53.mjs';
2
- import { osqBitsOf, createHNSWIndex, createOsqQuantizer } from '../chunk-X5CNUKD5.mjs';
3
- import '../chunk-DJHHF2L5.mjs';
1
+ import { openSharedVectorField, createVectorStore } from '../chunk-XZ3SRNDJ.mjs';
2
+ import '../chunk-FOCV4CBZ.mjs';
3
+ import { osqBitsOf, createHNSWIndex, createOsqQuantizer } from '../chunk-TNBIK2LQ.mjs';
4
4
  import { osqRecordBytes } from '../chunk-37CD3OKS.mjs';
5
+ import '../chunk-DJHHF2L5.mjs';
5
6
  import '../chunk-KOKM4PQN.mjs';
6
7
  import { MAX_WORKER_COPIES } from '../chunk-QSK35UC2.mjs';
7
- import '../chunk-2C3WXBQS.mjs';
8
+ import '../chunk-74XB2SXI.mjs';
8
9
  import '../chunk-VJS4JFBQ.mjs';
9
10
  import '../chunk-R6A773WK.mjs';
10
11
  import '../chunk-YTJCGKM4.mjs';
11
12
  import '../chunk-RFBLQLLZ.mjs';
12
- import '../chunk-CZ7ISLXA.mjs';
13
+ import '../chunk-HNHCNTVG.mjs';
13
14
 
14
15
  // src/vector/worker-copy.ts
15
16
  function restoreQuantizer(snapshot, store) {
@@ -1,10 +1,10 @@
1
1
  import { startIdleHeapCleanup } from '../chunk-RIIUZJQ3.mjs';
2
- import { isValidWorkerAction } from '../chunk-UJWGQIXU.mjs';
3
- import { loadVectorCode } from '../chunk-HCGJKDZV.mjs';
2
+ import { isValidWorkerAction } from '../chunk-QHPYS427.mjs';
3
+ import { loadVectorCode } from '../chunk-GLZHNSGB.mjs';
4
4
  import '../chunk-22YPZVMG.mjs';
5
5
  import { threadSlotOfWorker } from '../chunk-RFBLQLLZ.mjs';
6
6
  import '../chunk-L5ORED7V.mjs';
7
- import { ErrorCodes, NarsilError, isNarsilError } from '../chunk-CZ7ISLXA.mjs';
7
+ import { ErrorCodes, NarsilError, isNarsilError } from '../chunk-HNHCNTVG.mjs';
8
8
 
9
9
  // src/workers/action-handler.ts
10
10
  function buildErrorResponse(requestId, code, message, details) {
@@ -22,9 +22,9 @@ async function importBootstrapModule(moduleUrl) {
22
22
  await import(moduleUrl);
23
23
  }
24
24
  async function stopServingRequests() {
25
- const { closeRequestThread } = await import('../thread-SKO7CN3R.mjs');
25
+ const { closeRequestThread } = await import('../thread-KGNAIKPD.mjs');
26
26
  closeRequestThread();
27
- const { closeLongQueryThread } = await import('../long-query-thread-BSL25PD6.mjs');
27
+ const { closeLongQueryThread } = await import('../long-query-thread-4SW7RWDE.mjs');
28
28
  closeLongQueryThread();
29
29
  }
30
30
  function holdsCopies(executor) {
@@ -55,7 +55,7 @@ function createActionHandler(executor) {
55
55
  if (!holdsCopies(executor)) {
56
56
  throw new NarsilError(ErrorCodes.CONFIG_INVALID, "This executor holds no copies to answer requests from");
57
57
  }
58
- const starting = import('../thread-SKO7CN3R.mjs').then(
58
+ const starting = import('../thread-KGNAIKPD.mjs').then(
59
59
  ({ serveRequests }) => serveRequests(executor, action.settings)
60
60
  );
61
61
  serving.start = starting.then(
@@ -72,7 +72,7 @@ function createActionHandler(executor) {
72
72
  if (!holdsCopies(executor)) {
73
73
  throw new NarsilError(ErrorCodes.CONFIG_INVALID, "This executor holds no copies to answer long queries from");
74
74
  }
75
- const { serveLongQueries } = await import('../long-query-thread-BSL25PD6.mjs');
75
+ const { serveLongQueries } = await import('../long-query-thread-4SW7RWDE.mjs');
76
76
  serveLongQueries(executor, action.settings);
77
77
  servingRequests = true;
78
78
  post(buildSuccessResponse(action.requestId, void 0));
@@ -118,7 +118,7 @@ async function setup() {
118
118
  } catch {
119
119
  parentPort = null;
120
120
  }
121
- const [{ createDirectExecutor }] = await Promise.all([import('../direct-executor-HQ4QVDX7.mjs'), loadVectorCode()]);
121
+ const [{ createDirectExecutor }] = await Promise.all([import('../direct-executor-7XOQ7VQP.mjs'), loadVectorCode()]);
122
122
  const handleAction = createActionHandler(createDirectExecutor({ threadSlot }));
123
123
  if (parentPort) {
124
124
  const port = parentPort;
@@ -1,133 +1,56 @@
1
- import { decodeVectorFilePayload, isDead, bytesToVectors } from './chunk-Y2U5VVWX.mjs';
1
+ import { DOCUMENT_EXPORT_VERSION, DOCUMENT_EXPORT_FORMAT } from './chunk-6SNBQESJ.mjs';
2
+ import { encodeExactJson, encodeDocumentJson } from './chunk-NN33CZRE.mjs';
3
+ import './chunk-BOJZGUS6.mjs';
4
+ import './chunk-CZQ33DLW.mjs';
5
+ import './chunk-L76W3IZJ.mjs';
6
+ import { decodeVectorFilePayload, isDead, bytesToVectors } from './chunk-ICW45TTU.mjs';
2
7
  import './chunk-37CD3OKS.mjs';
3
- import { setNestedValue, KEYWORD_SEGMENT_ENVELOPE_VERSION, decodeKeywordSegment } from './chunk-7OIQ2SIO.mjs';
4
- import { openChecksummedEnvelope, NUMBER_TAG, DATE_TAG, BYTES_TAG, encodeBase64, startsWithTagPrefix, OBJECT_TAG, MILLISECONDS_PER_SECOND, NANOSECONDS_PER_MILLISECOND, DOCUMENT_EXPORT_VERSION, DOCUMENT_EXPORT_FORMAT } from './chunk-TGHNXN7W.mjs';
5
- import './chunk-6M6SDH3S.mjs';
6
- import './chunk-JT3YZGCE.mjs';
7
- import './chunk-NNO7CO3A.mjs';
8
+ import { setNestedValue, KEYWORD_SEGMENT_ENVELOPE_VERSION, decodeKeywordSegment } from './chunk-KEIYVZUX.mjs';
9
+ import { openChecksummedEnvelope } from './chunk-IO5F7ZBE.mjs';
10
+ import './chunk-VEFN6X6Q.mjs';
11
+ import './chunk-5WYVUPGD.mjs';
12
+ import './chunk-HJSN7UYG.mjs';
13
+ import './chunk-UIKN2OTQ.mjs';
8
14
  import './chunk-AV4IJKD2.mjs';
9
- import { decodeStoredDocument } from './chunk-RWESFSJI.mjs';
10
- import './chunk-2MKX2SCO.mjs';
11
- import './chunk-ZR4VM4A6.mjs';
15
+ import { EXPORT_CHUNK_BYTES } from './chunk-EEBCDP36.mjs';
16
+ import { decodeStoredDocument } from './chunk-WJGO5PGV.mjs';
17
+ import './chunk-ZPWS2SKJ.mjs';
18
+ import './chunk-N37VMC62.mjs';
12
19
  import './chunk-ZATRDAYU.mjs';
13
20
  import './chunk-EBIHRL7B.mjs';
14
- import './chunk-HJSN7UYG.mjs';
15
- import { EXPORT_CHUNK_BYTES } from './chunk-RNSC4NFI.mjs';
16
- import './chunk-TGP5M5R7.mjs';
17
- import './chunk-U2BKYEC7.mjs';
18
21
  import './chunk-KOKM4PQN.mjs';
19
22
  import './chunk-QSK35UC2.mjs';
20
- import './chunk-2C3WXBQS.mjs';
21
- import './chunk-2SEL6SBS.mjs';
23
+ import './chunk-74XB2SXI.mjs';
24
+ import './chunk-RKAVHNRW.mjs';
22
25
  import './chunk-WQBCBKY3.mjs';
23
26
  import './chunk-JUKYYXSP.mjs';
24
- import './chunk-EUCX5K74.mjs';
25
- import './chunk-PU6SKH7O.mjs';
27
+ import './chunk-DQNKVOJ2.mjs';
28
+ import './chunk-KGOXHLLZ.mjs';
26
29
  import './chunk-U476IXKQ.mjs';
27
30
  import './chunk-FQBFZAWG.mjs';
28
31
  import './chunk-VJS4JFBQ.mjs';
29
32
  import './chunk-GES7U2PM.mjs';
30
- import './chunk-7XY6VD7B.mjs';
31
- import './chunk-6SSVIW7Y.mjs';
33
+ import './chunk-ZSWHPKGM.mjs';
34
+ import './chunk-O4LJQI4G.mjs';
32
35
  import './chunk-X5CV2E2B.mjs';
33
- import './chunk-7X5JST5L.mjs';
34
- import './chunk-D5TFRB5G.mjs';
36
+ import './chunk-WNBRW4Q2.mjs';
37
+ import './chunk-TGP5M5R7.mjs';
38
+ import './chunk-U2BKYEC7.mjs';
39
+ import './chunk-NPNK57CA.mjs';
35
40
  import './chunk-4UMZ7KQL.mjs';
36
41
  import './chunk-R6A773WK.mjs';
37
42
  import './chunk-YTJCGKM4.mjs';
38
- import './chunk-UJWGQIXU.mjs';
39
- import './chunk-HCGJKDZV.mjs';
43
+ import './chunk-QHPYS427.mjs';
44
+ import './chunk-GLZHNSGB.mjs';
40
45
  import './chunk-22YPZVMG.mjs';
41
46
  import './chunk-RFBLQLLZ.mjs';
42
47
  import './chunk-L5ORED7V.mjs';
43
- import { NarsilError, ErrorCodes } from './chunk-CZ7ISLXA.mjs';
48
+ import './chunk-HNHCNTVG.mjs';
44
49
  import { decode } from '@msgpack/msgpack';
45
50
 
46
- // src/engine/export/json-line.ts
47
- function refuse(path, kind, docId) {
48
- throw new NarsilError(
49
- ErrorCodes.DOC_VALIDATION_FAILED,
50
- `Document "${docId}" holds ${kind} at "${path || "(document)"}", which a document export cannot carry as JSON`,
51
- { docId, field: path }
52
- );
53
- }
54
- function encodeNumber(value, path, target) {
55
- if (Number.isFinite(value)) return Object.is(value, -0) ? "-0" : JSON.stringify(value);
56
- if (!target.tagged) refuse(path, String(value), target.docId);
57
- return `{"${NUMBER_TAG}":"${String(value)}"}`;
58
- }
59
- function encodeDate(value, path, target) {
60
- const milliseconds = value.getTime();
61
- if (!target.tagged || Number.isNaN(milliseconds)) refuse(path, "a date", target.docId);
62
- const seconds = Math.floor(milliseconds / MILLISECONDS_PER_SECOND);
63
- const nanoseconds = (milliseconds - seconds * MILLISECONDS_PER_SECOND) * NANOSECONDS_PER_MILLISECOND;
64
- return `{"${DATE_TAG}":[${seconds},${nanoseconds}]}`;
65
- }
66
- function encodeBytes(value, path, target) {
67
- if (!target.tagged) refuse(path, "bytes", target.docId);
68
- return `{"${BYTES_TAG}":"${encodeBase64(value)}"}`;
69
- }
70
- function encodeList(value, path, target) {
71
- target.parts.push("[");
72
- for (let at = 0; at < value.length; at++) {
73
- if (at > 0) target.parts.push(",");
74
- encodeValue(value[at], `${path}[${at}]`, target);
75
- }
76
- target.parts.push("]");
77
- }
78
- function encodeMap(value, path, target) {
79
- const proto = Object.getPrototypeOf(value);
80
- if (proto !== Object.prototype && proto !== null) refuse(path, "a value other than a plain object", target.docId);
81
- const entries = Object.entries(value).filter(([, entry]) => entry !== void 0);
82
- const wrapped = target.tagged && entries.length === 1 && startsWithTagPrefix(entries[0][0]);
83
- target.parts.push(wrapped ? `{"${OBJECT_TAG}":{` : "{");
84
- for (let at = 0; at < entries.length; at++) {
85
- const [key, entry] = entries[at];
86
- if (at > 0) target.parts.push(",");
87
- target.parts.push(JSON.stringify(key), ":");
88
- encodeValue(entry, path === "" ? key : `${path}.${key}`, target);
89
- }
90
- target.parts.push(wrapped ? "}}" : "}");
91
- }
92
- function encodeValue(value, path, target) {
93
- if (value === null) {
94
- target.parts.push("null");
95
- return;
96
- }
97
- switch (typeof value) {
98
- case "string":
99
- target.parts.push(JSON.stringify(value));
100
- return;
101
- case "boolean":
102
- target.parts.push(value ? "true" : "false");
103
- return;
104
- case "number":
105
- target.parts.push(encodeNumber(value, path, target));
106
- return;
107
- case "object":
108
- break;
109
- default:
110
- refuse(path, `a ${typeof value}`, target.docId);
111
- }
112
- if (Array.isArray(value)) encodeList(value, path, target);
113
- else if (value instanceof Date) target.parts.push(encodeDate(value, path, target));
114
- else if (value instanceof Uint8Array) target.parts.push(encodeBytes(value, path, target));
115
- else encodeMap(value, path, target);
116
- }
117
- function encodeExactJson(value, docId) {
118
- const target = { docId, tagged: false, parts: [] };
119
- encodeValue(value, "", target);
120
- return target.parts.join("");
121
- }
122
- function encodeDocumentJson(document, docId) {
123
- const target = { docId, tagged: true, parts: [] };
124
- encodeValue(document, "", target);
125
- return target.parts.join("");
126
- }
127
-
128
- // src/engine/export/write.ts
129
51
  var VECTOR_FILE_ENVELOPE_VERSION = 2;
130
52
  var FLOAT32_BYTES = 4;
53
+ var ENVELOPE_VERSION_OFFSET = 4;
131
54
  async function locateVectors(checkpoint) {
132
55
  const located = /* @__PURE__ */ new Map();
133
56
  for (const field of checkpoint.manifest.vectors) {
@@ -175,7 +98,59 @@ async function winnersOf(checkpoint, partition) {
175
98
  }
176
99
  return winners;
177
100
  }
101
+ async function wholeSegmentScan(checkpoint, ref) {
102
+ const contents = await readSegment(checkpoint, ref);
103
+ const table = contents.arrays.documentTable;
104
+ const ids = /* @__PURE__ */ new Set();
105
+ for (let ordinal = 0; ordinal < contents.arrays.documentCount; ordinal++) ids.add(idAt(contents, ordinal));
106
+ return {
107
+ count: contents.arrays.documentCount,
108
+ schema: contents.schema,
109
+ tombstones: new Set(contents.tombstones),
110
+ idAt: (ordinal) => idAt(contents, ordinal),
111
+ holds: (docId) => ids.has(docId),
112
+ storedDocumentAt: (ordinal) => decodeStoredDocument(
113
+ table.blob.subarray(table.offsets[ordinal], table.offsets[ordinal + 1]),
114
+ table.discardedFields
115
+ ),
116
+ close: () => void 0
117
+ };
118
+ }
119
+ async function wholeFileVectorReads(checkpoint) {
120
+ const located = await locateVectors(checkpoint);
121
+ return {
122
+ async vectorOf(fieldPath, docId) {
123
+ const location = located.get(fieldPath)?.get(docId);
124
+ return location === void 0 ? null : readVector(checkpoint, location);
125
+ },
126
+ close: () => located.clear()
127
+ };
128
+ }
129
+ async function* pagedDocumentLines(checkpoint) {
130
+ const { openFileVectorReads, pagedPartitionLines } = await import('./module-IYPLWHGC.mjs');
131
+ const vectors = await openFileVectorReads(checkpoint, () => wholeFileVectorReads(checkpoint));
132
+ try {
133
+ for (const partition of checkpoint.manifest.partitions) {
134
+ yield* pagedPartitionLines(checkpoint, partition, vectors, (ref) => wholeSegmentScan(checkpoint, ref));
135
+ }
136
+ } finally {
137
+ vectors.close();
138
+ }
139
+ }
140
+ async function anyPartitionIsPaged(checkpoint) {
141
+ for (const partition of checkpoint.manifest.partitions) {
142
+ for (const ref of partition.segments) {
143
+ const [version] = await checkpoint.readRange(ref, ENVELOPE_VERSION_OFFSET, 1);
144
+ if (version !== KEYWORD_SEGMENT_ENVELOPE_VERSION) return true;
145
+ }
146
+ }
147
+ return false;
148
+ }
178
149
  async function* documentLines(checkpoint) {
150
+ if (await anyPartitionIsPaged(checkpoint)) {
151
+ yield* pagedDocumentLines(checkpoint);
152
+ return;
153
+ }
179
154
  const vectors = await locateVectors(checkpoint);
180
155
  for (const partition of checkpoint.manifest.partitions) {
181
156
  const winners = await winnersOf(checkpoint, partition);
package/openapi.json CHANGED
@@ -1552,6 +1552,51 @@
1552
1552
  }
1553
1553
  }
1554
1554
  },
1555
+ "/indexes/{name}/_change-analysis": {
1556
+ "post": {
1557
+ "operationId": "changeAnalysis",
1558
+ "summary": "Change the language, stop words, or tokeniser of an index, as a task",
1559
+ "tags": [
1560
+ "Maintenance"
1561
+ ],
1562
+ "parameters": [
1563
+ {
1564
+ "name": "name",
1565
+ "in": "path",
1566
+ "required": true,
1567
+ "description": "The name of the index.",
1568
+ "schema": {
1569
+ "type": "string"
1570
+ }
1571
+ }
1572
+ ],
1573
+ "requestBody": {
1574
+ "required": false,
1575
+ "content": {
1576
+ "application/json": {
1577
+ "schema": {
1578
+ "$ref": "#/components/schemas/ChangeAnalysisBody"
1579
+ }
1580
+ }
1581
+ }
1582
+ },
1583
+ "responses": {
1584
+ "202": {
1585
+ "description": "The server accepted the work and started a task.",
1586
+ "content": {
1587
+ "application/json": {
1588
+ "schema": {
1589
+ "$ref": "#/components/schemas/TaskRecord"
1590
+ }
1591
+ }
1592
+ }
1593
+ },
1594
+ "default": {
1595
+ "$ref": "#/components/responses/Error"
1596
+ }
1597
+ }
1598
+ }
1599
+ },
1555
1600
  "/indexes/{name}/snapshot": {
1556
1601
  "get": {
1557
1602
  "operationId": "snapshot",
@@ -2259,6 +2304,44 @@
2259
2304
  ],
2260
2305
  "description": "What a server announces at `/capabilities`, which is how a client finds out whether an optional route or mode is available before it sends a request. A server that answers 404 here predates the endpoint, so treat every optional capability as absent."
2261
2306
  },
2307
+ "ChangeAnalysisBody": {
2308
+ "type": "object",
2309
+ "properties": {
2310
+ "language": {
2311
+ "type": "string",
2312
+ "description": "This is the name of a language registered on the server."
2313
+ },
2314
+ "tokenizer": {
2315
+ "anyOf": [
2316
+ {
2317
+ "type": "null"
2318
+ },
2319
+ {
2320
+ "type": "string"
2321
+ }
2322
+ ],
2323
+ "description": "This is a name registered on the server, or `null` for the language default."
2324
+ },
2325
+ "stopWords": {
2326
+ "anyOf": [
2327
+ {
2328
+ "type": "null"
2329
+ },
2330
+ {
2331
+ "type": "string"
2332
+ },
2333
+ {
2334
+ "type": "array",
2335
+ "items": {
2336
+ "type": "string"
2337
+ }
2338
+ }
2339
+ ],
2340
+ "description": "This is a name registered on the server, a list of words, or `null` for the language default."
2341
+ }
2342
+ },
2343
+ "description": "The body of `POST /indexes/{name}/_change-analysis`, where a key that you leave out keeps its current value."
2344
+ },
2262
2345
  "ClusterAllocationResponse": {
2263
2346
  "type": "object",
2264
2347
  "properties": {
@@ -3123,17 +3206,36 @@
3123
3206
  ],
3124
3207
  "description": "A query scores this way unless it asks for another mode."
3125
3208
  },
3209
+ "tokenizer": {
3210
+ "type": "string",
3211
+ "description": "This is the name of a tokeniser registered on the server, which then splits text in place of the language's own rules."
3212
+ },
3126
3213
  "stopWords": {
3127
- "type": "array",
3128
- "items": {
3129
- "type": "string"
3130
- },
3131
- "description": "This list replaces the language's stop words."
3214
+ "anyOf": [
3215
+ {
3216
+ "type": "string"
3217
+ },
3218
+ {
3219
+ "type": "array",
3220
+ "items": {
3221
+ "type": "string"
3222
+ }
3223
+ }
3224
+ ],
3225
+ "description": "This name of a stop word set registered on the server, or this list, replaces the language's stop words."
3132
3226
  },
3133
3227
  "trackPositions": {
3134
3228
  "type": "boolean",
3135
3229
  "description": "Setting this records term positions in each posting, which the `.nrsl` format carries for readers that match phrases. Highlighting works without it."
3136
3230
  },
3231
+ "textStorage": {
3232
+ "type": "string",
3233
+ "enum": [
3234
+ "memory",
3235
+ "disk"
3236
+ ],
3237
+ "description": "Setting this to `disk` lets the index answer from segment files that the server reads by position, which needs filesystem durability. The default is `memory`."
3238
+ },
3137
3239
  "surfaceForms": {
3138
3240
  "type": "boolean",
3139
3241
  "description": "Setting this to false returns index stems from suggestions and prefix expansion, instead of the words users typed."
@@ -4918,7 +5020,8 @@
4918
5020
  "restore",
4919
5021
  "import",
4920
5022
  "importExport",
4921
- "rebuildAnalysis"
5023
+ "rebuildAnalysis",
5024
+ "changeAnalysis"
4922
5025
  ],
4923
5026
  "description": "Which long-running operation a task record tracks."
4924
5027
  },
@@ -5047,6 +5150,10 @@
5047
5150
  "type": "boolean",
5048
5151
  "description": "This turns true while a rebuild that keeps recall up waits for the node to have room for a second graph beside the one it serves, and false once it starts."
5049
5152
  },
5153
+ "loadingFromFiles": {
5154
+ "type": "boolean",
5155
+ "description": "This stays true after a restart while a field kept on disk loads its codes and graph in the background, during which a search reads them from the field's files."
5156
+ },
5050
5157
  "estimatedCompactMs": {
5051
5158
  "type": "number",
5052
5159
  "description": "Narsil.compactVectors would take about this many milliseconds."
@@ -5063,6 +5170,7 @@
5063
5170
  "bufferSize",
5064
5171
  "building",
5065
5172
  "waitingForMemory",
5173
+ "loadingFromFiles",
5066
5174
  "estimatedCompactMs",
5067
5175
  "estimatedOptimizeMs"
5068
5176
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delali/narsil",
3
- "version": "0.3.1-next.131",
3
+ "version": "0.3.1-next.141",
4
4
  "type": "module",
5
5
  "description": "Distributed search engine with full-text, vector, hybrid, and geosearch. One engine, embedded or on a server, with a cross-language .nrsl format.",
6
6
  "author": "Delali (https://sondelali.com)",
@@ -51,6 +51,10 @@
51
51
  "browser": "./src/vector/vector-store/vector-file.browser.ts",
52
52
  "default": "./src/vector/vector-store/vector-file.ts"
53
53
  },
54
+ "#platform/raw-deflate": {
55
+ "browser": "./src/persistence/paged/raw-deflate.browser.ts",
56
+ "default": "./src/persistence/paged/raw-deflate.ts"
57
+ },
54
58
  "#platform/native-core": {
55
59
  "browser": "./src/vector/native/loader.browser.ts",
56
60
  "default": "./src/vector/native/loader.ts"
@@ -90,7 +94,7 @@
90
94
  "node": ">=22"
91
95
  },
92
96
  "scripts": {
93
- "build": "rm -rf dist && tsup && node scripts/check-browser-bundle.mjs && tsx scripts/api-surface.ts",
97
+ "build": "rm -rf dist && tsup && node scripts/check-browser-bundle.mjs && node scripts/check-vector-chunk.mjs && tsx scripts/api-surface.ts",
94
98
  "build:code": "rm -rf dist && NARSIL_BUILD_CODE_ONLY=1 tsup",
95
99
  "test": "vitest run --exclude='**/vector/recall.test.ts' --exclude='**/e2e/cluster-memory/**' --exclude='**/e2e/cluster-faults/**' --exclude='**/frozen-removal-memory/container-removes.test.ts'",
96
100
  "test:native": "vitest run src/__tests__/vector/native src/__tests__/integration/filtered-vector-recall/native src/__tests__/integration/filtered-vectors/mutations-native src/__tests__/integration/removed-vectors/main-thread",
@@ -279,11 +283,11 @@
279
283
  }
280
284
  },
281
285
  "optionalDependencies": {
282
- "@delali/narsil-native-darwin-arm64": "0.3.1-next.131",
283
- "@delali/narsil-native-darwin-x64": "0.3.1-next.131",
284
- "@delali/narsil-native-linux-arm64": "0.3.1-next.131",
285
- "@delali/narsil-native-linux-x64": "0.3.1-next.131",
286
- "@delali/narsil-native-win32-arm64": "0.3.1-next.131",
287
- "@delali/narsil-native-win32-x64": "0.3.1-next.131"
286
+ "@delali/narsil-native-darwin-arm64": "0.3.1-next.141",
287
+ "@delali/narsil-native-darwin-x64": "0.3.1-next.141",
288
+ "@delali/narsil-native-linux-arm64": "0.3.1-next.141",
289
+ "@delali/narsil-native-linux-x64": "0.3.1-next.141",
290
+ "@delali/narsil-native-win32-arm64": "0.3.1-next.141",
291
+ "@delali/narsil-native-win32-x64": "0.3.1-next.141"
288
292
  }
289
293
  }