@delali/narsil 0.3.1-next.90 → 0.3.1-next.94

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 (104) hide show
  1. package/dist/adapters/filesystem.mjs +1 -1
  2. package/dist/adapters/indexeddb.mjs +1 -1
  3. package/dist/browser/{chunk-3GZQKGVQ.mjs → chunk-4JTBL63P.mjs} +13 -5
  4. package/dist/browser/{chunk-3ZRMZIH4.mjs → chunk-5S74HQRT.mjs} +208 -78
  5. package/dist/browser/{chunk-FHFFWLEK.mjs → chunk-HARBSUWP.mjs} +3 -4
  6. package/dist/browser/{chunk-RAHUQOJL.mjs → chunk-HC6DMR4T.mjs} +2445 -2107
  7. package/dist/browser/{chunk-JACCR3BJ.mjs → chunk-PP6N5CCS.mjs} +2 -2
  8. package/dist/browser/{chunk-NQW2YXEX.mjs → chunk-WKPJ4E73.mjs} +1 -1
  9. package/dist/browser/{durability-wiring-VSUBLUDK.mjs → durability-wiring-7DKYHKT5.mjs} +498 -71
  10. package/dist/browser/{module-E25UDADM.mjs → module-O5WH32EL.mjs} +102 -54
  11. package/dist/browser/release-76MXRPGV.mjs +33 -0
  12. package/dist/browser/replace-RURXTGVG.mjs +57 -0
  13. package/dist/browser/restore-queue-Z7FZZNKH.mjs +35 -0
  14. package/dist/browser/{snapshot-5MXBEDXF.mjs → snapshot-PPTZ565G.mjs} +368 -103
  15. package/dist/browser/{write-6SBYTS62.mjs → write-2ZAA7UDH.mjs} +4 -4
  16. package/dist/{capabilities-SJPttcgQ.d.ts → capabilities-xsJfdFoQ.d.ts} +11 -3
  17. package/dist/chunk-2GZGBOQI.mjs +426 -0
  18. package/dist/{chunk-CVQWQVFX.mjs → chunk-4ZJWRETC.mjs} +2 -2
  19. package/dist/chunk-7KC56574.mjs +507 -0
  20. package/dist/{chunk-MXS5HWIH.mjs → chunk-7VALMHZF.mjs} +89 -17
  21. package/dist/chunk-7X5JST5L.mjs +114 -0
  22. package/dist/{chunk-UKSUENHK.mjs → chunk-AF2CIKYC.mjs} +40 -26
  23. package/dist/{chunk-BVOJIYRV.mjs → chunk-BB7MASRQ.mjs} +1 -1
  24. package/dist/{chunk-R6BMMQXH.mjs → chunk-C45FUYPI.mjs} +193 -79
  25. package/dist/{chunk-EMXAYPTQ.mjs → chunk-CHOGQSHK.mjs} +2326 -3503
  26. package/dist/{chunk-QZN3MIJ3.mjs → chunk-ES33L3HO.mjs} +2 -2
  27. package/dist/{chunk-VY4DXZ5P.mjs → chunk-EWBXO45L.mjs} +3 -3
  28. package/dist/{chunk-QAMUC2BJ.mjs → chunk-EX62BQT6.mjs} +10 -9
  29. package/dist/{chunk-MWJIAREY.mjs → chunk-EZD4MWOU.mjs} +4 -4
  30. package/dist/{chunk-YCJLVNWR.mjs → chunk-F52QGNZ2.mjs} +1 -1
  31. package/dist/{chunk-URGLSNKR.mjs → chunk-GJZHU4FC.mjs} +202 -16
  32. package/dist/{chunk-S4LQDSUL.mjs → chunk-J53IHLG7.mjs} +7 -7
  33. package/dist/{chunk-R7OSDAFK.mjs → chunk-K6A4FCVR.mjs} +1 -1
  34. package/dist/chunk-KOKM4PQN.mjs +52 -0
  35. package/dist/{chunk-GCM3JFVA.mjs → chunk-OHP7QR33.mjs} +2 -1
  36. package/dist/{chunk-T6CNO72J.mjs → chunk-QM3VPX4Z.mjs} +2 -2
  37. package/dist/{chunk-V7YUSKKZ.mjs → chunk-QWWCLRXX.mjs} +10 -6
  38. package/dist/chunk-QY7GC2MW.mjs +33 -0
  39. package/dist/{chunk-DCK4P5BI.mjs → chunk-R36MIGBU.mjs} +100 -59
  40. package/dist/{chunk-YRX6XMOQ.mjs → chunk-R6PR4WYZ.mjs} +1 -0
  41. package/dist/{chunk-RVM7AODE.mjs → chunk-RDJKYKMQ.mjs} +2 -2
  42. package/dist/{chunk-OOSIDHA3.mjs → chunk-RSRVGAIQ.mjs} +1 -1
  43. package/dist/{chunk-XSZVS4S3.mjs → chunk-RUIXODYU.mjs} +9 -4
  44. package/dist/{chunk-A3UB2MXL.mjs → chunk-SBCEHIPL.mjs} +4 -507
  45. package/dist/{chunk-TPJU7NDJ.mjs → chunk-SYWGORQB.mjs} +1 -0
  46. package/dist/chunk-UAUZGXJP.mjs +3591 -0
  47. package/dist/{chunk-CL4OM7GB.mjs → chunk-WBS3EYC4.mjs} +12 -8
  48. package/dist/{chunk-J2BPXTD7.mjs → chunk-WLOF6HSP.mjs} +3 -3
  49. package/dist/chunk-X5CV2E2B.mjs +1 -0
  50. package/dist/{chunk-ULRPNYAG.mjs → chunk-Z3MOCHG5.mjs} +120 -62
  51. package/dist/chunk-ZHS44YKF.mjs +35 -0
  52. package/dist/{client-BMK53IR2.d.ts → client-CgayPw2R.d.ts} +27 -3
  53. package/dist/client.d.ts +9 -8
  54. package/dist/client.mjs +16 -2
  55. package/dist/{config-UJx1dyX1.d.ts → config-3kBsQ0Pi.d.ts} +2 -2
  56. package/dist/{config-BUR-7eVQ.d.ts → config-B-RnO6dr.d.ts} +2 -2
  57. package/dist/direct-executor-IJTRU3YN.mjs +22 -0
  58. package/dist/distribution/coordinator/etcd.d.ts +3 -2
  59. package/dist/distribution/coordinator/etcd.mjs +5 -1
  60. package/dist/distribution/coordinator/in-memory.d.ts +3 -2
  61. package/dist/distribution/coordinator/in-memory.mjs +4 -0
  62. package/dist/distribution/transport/grpc.mjs +3 -3
  63. package/dist/distribution/transport/in-memory.mjs +1 -1
  64. package/dist/distribution/transport/tcp.mjs +2 -2
  65. package/dist/distribution.d.ts +43 -9
  66. package/dist/distribution.mjs +4620 -4293
  67. package/dist/{durability-wiring-ZLRQU6FG.mjs → durability-wiring-Y55SCPFC.mjs} +524 -93
  68. package/dist/embeddings/openai.mjs +1 -1
  69. package/dist/{engine-9X6W5naj.d.ts → engine-DSUfY2F0.d.ts} +53 -17
  70. package/dist/{index-vCMu8OeQ.d.ts → index-ONAEaqtx.d.ts} +8 -1
  71. package/dist/index.browser.mjs +2 -2
  72. package/dist/index.d.ts +44 -25
  73. package/dist/index.mjs +22 -18
  74. package/dist/{memory-CV9NAxLY.d.ts → memory-wuXcYOD1.d.ts} +99 -79
  75. package/dist/{module-WIDYIJLY.mjs → module-VITS4ZR5.mjs} +72 -38
  76. package/dist/partial-words.mjs +5 -4
  77. package/dist/pattern.mjs +3 -3
  78. package/dist/persistence/durability/checkpoint-worker.d.ts +60 -58
  79. package/dist/persistence/durability/checkpoint-worker.mjs +27 -23
  80. package/dist/react.d.ts +8 -7
  81. package/dist/react.mjs +1 -0
  82. package/dist/release-BH3DKW3T.mjs +33 -0
  83. package/dist/replace-CEO5KJJ3.mjs +57 -0
  84. package/dist/restore-queue-4SG45BLF.mjs +35 -0
  85. package/dist/{schema-DtsgmNfU.d.ts → schema-DttzM-ln.d.ts} +12 -0
  86. package/dist/server.d.ts +11 -10
  87. package/dist/server.mjs +38 -11
  88. package/dist/snapshot-XBKE7PUG.mjs +738 -0
  89. package/dist/synonyms-CpOAHPa-.d.ts +52 -0
  90. package/dist/synonyms.d.ts +22 -0
  91. package/dist/synonyms.mjs +12 -0
  92. package/dist/{tasks-BGaZJyoY.d.ts → tasks-Bj9WBlFG.d.ts} +4 -1
  93. package/dist/{thread-ZP3UMIZT.mjs → thread-U7XYJWGG.mjs} +17 -12
  94. package/dist/vector/search-worker.d.ts +2 -1
  95. package/dist/vector/search-worker.mjs +6 -6
  96. package/dist/workers/entry.mjs +6 -6
  97. package/dist/{write-PXDKPG2R.mjs → write-BMNV7P2H.mjs} +24 -20
  98. package/package.json +15 -7
  99. package/dist/chunk-PR4O7CAP.mjs +0 -18
  100. package/dist/chunk-X4SEXL4U.mjs +0 -2310
  101. package/dist/chunk-Y2F66IQJ.mjs +0 -74
  102. package/dist/chunk-ZJ4CSAB2.mjs +0 -13
  103. package/dist/direct-executor-EGESD26S.mjs +0 -18
  104. package/dist/snapshot-22CUEYYW.mjs +0 -469
@@ -0,0 +1,52 @@
1
+ /**
2
+ * A two-way rule makes every word in `words` a synonym of every other word in
3
+ * the rule, so a search for any one of them also matches documents that hold
4
+ * the others.
5
+ *
6
+ * @public
7
+ */
8
+ interface TwoWaySynonymRule {
9
+ /** The rule holds from 2 to 100 words, and each word must analyse to exactly one token. */
10
+ words: string[];
11
+ }
12
+ /**
13
+ * A one-way rule adds each word in `synonyms` to a search for `word`, while a
14
+ * search for one of those synonyms gains nothing from the rule.
15
+ *
16
+ * @public
17
+ */
18
+ interface OneWaySynonymRule {
19
+ /** A search for this word also matches the words in `synonyms`. */
20
+ word: string;
21
+ /** The rule holds from 1 to 99 synonyms, and each one must analyse to exactly one token. */
22
+ synonyms: string[];
23
+ }
24
+ /**
25
+ * One rule of a synonym set, which {@link IndexConfig.synonyms} and
26
+ * {@link SynonymOperations.updateSynonyms} take as a list.
27
+ *
28
+ * The engine analyses every word with the language, the tokeniser, and the
29
+ * stop words of the index, so a rule that says `jackets` also matches
30
+ * `jacket` wherever the index stems the two alike. A set can hold up to
31
+ * 100,000 rules, 500,000 words, and 4,194,304 bytes of words in UTF-8.
32
+ *
33
+ * @public
34
+ */
35
+ type SynonymRule = TwoWaySynonymRule | OneWaySynonymRule;
36
+ /**
37
+ * An app passes an object of this type to {@link registerSynonyms} to give the
38
+ * engine its synonym code, which a search uses to expand each query word with
39
+ * the synonyms that the index's set holds for it.
40
+ *
41
+ * A Node process loads this code by itself. A browser bundle contains it only
42
+ * when the app imports `synonyms` from `@delali/narsil/synonyms`, so a bundler
43
+ * can leave it out of an app whose indexes hold no synonym set.
44
+ *
45
+ * @public
46
+ */
47
+ interface SynonymSearch {
48
+ /** The engine checks that this name is `'synonyms'` when an app registers the object. */
49
+ readonly name: 'synonyms';
50
+ }
51
+
52
+ export type { OneWaySynonymRule as O, SynonymSearch as S, TwoWaySynonymRule as T, SynonymRule as a };
@@ -0,0 +1,22 @@
1
+ import { S as SynonymSearch } from './synonyms-CpOAHPa-.js';
2
+
3
+ /**
4
+ * This object contains the synonym code. A browser app has to pass it to
5
+ * {@link registerSynonyms} before the app creates or loads an index that
6
+ * holds a synonym set.
7
+ *
8
+ * ```ts
9
+ * import { registerSynonyms } from '@delali/narsil'
10
+ * import { synonyms } from '@delali/narsil/synonyms'
11
+ *
12
+ * registerSynonyms(synonyms)
13
+ * ```
14
+ *
15
+ * A Node process loads that code by itself, so only a browser app has to make
16
+ * this call.
17
+ *
18
+ * @public
19
+ */
20
+ declare const synonyms: SynonymSearch;
21
+
22
+ export { SynonymSearch, synonyms };
@@ -0,0 +1,12 @@
1
+ import { synonymSearchModule } from './chunk-2GZGBOQI.mjs';
2
+ import './chunk-X5CV2E2B.mjs';
3
+ import './chunk-7X5JST5L.mjs';
4
+ import './chunk-7KC56574.mjs';
5
+ import './chunk-R6A773WK.mjs';
6
+ import './chunk-YTJCGKM4.mjs';
7
+ import './chunk-SYWGORQB.mjs';
8
+
9
+ // src/synonyms/index.ts
10
+ var synonyms = synonymSearchModule;
11
+
12
+ export { synonyms };
@@ -1,4 +1,5 @@
1
- import { M as MemoryStats } from './memory-CV9NAxLY.js';
1
+ import { M as MemoryStats } from './memory-wuXcYOD1.js';
2
+ import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
2
3
 
3
4
  /** Declarative index configuration accepted over HTTP. Function-valued engine
4
5
  * options (custom tokenizer, stopWords-as-function, group reducer, embedding
@@ -70,6 +71,8 @@ interface HttpIndexConfig {
70
71
  required?: string[];
71
72
  /** The server returns a `DOC_VALIDATION_FAILED` error for a document whose value in a `verbatim` field, or in a field whose type includes `pattern`, is longer than this many code points. Set a whole number from 1 to 65,536, or leave this unset for a limit of 8,192. */
72
73
  patternValueLimit?: number;
74
+ /** A search for a word in one of these rules also matches its synonyms, and the server refuses a set beyond 100,000 rules, 500,000 words, or 4,194,304 bytes of words in UTF-8 with `CONFIG_INVALID`. */
75
+ synonyms?: SynonymRule[];
73
76
  }
74
77
  /**
75
78
  * One record an import refused, naming the line it came from and why the
@@ -1,22 +1,24 @@
1
- import { loadUWebSockets, childAppOf, createRouteRunner, corsHeaderReader, createSharedRequestGate, registerServerRoutes, sendRelayed, createDocumentReadHandlers, respondJson, SERVER_CAPABILITIES, versionReport, statusLine, sendError, serverRoutes, parseJson, validateSuggest, rejectInvalid, respondError, validateQuery, refuseRegex, awaitDepartureConfirmation, departureConfirmation, REQUEST_THREAD_DEPARTURE_DRAIN_MS, departureConfirmed, encodeJson } from './chunk-XSZVS4S3.mjs';
1
+ import { loadUWebSockets, childAppOf, createRouteRunner, corsHeaderReader, createSharedRequestGate, registerServerRoutes, sendRelayed, createDocumentReadHandlers, respondJson, SERVER_CAPABILITIES, versionReport, statusLine, sendError, serverRoutes, parseJson, validateSuggest, rejectInvalid, respondError, validateQuery, refuseRegex, awaitDepartureConfirmation, departureConfirmation, REQUEST_THREAD_DEPARTURE_DRAIN_MS, departureConfirmed, encodeJson } from './chunk-RUIXODYU.mjs';
2
2
  import './chunk-DJHHF2L5.mjs';
3
- import { executeListDocuments, executeSuggest, executePreflight, queryBindingOf, executeQuery } from './chunk-DCK4P5BI.mjs';
4
- import { resolveProjection, projectionKeepsField, setNestedValue } from './chunk-X4SEXL4U.mjs';
3
+ import { executeListDocuments, executeSuggest, executePreflight, queryBindingOf, executeQuery } from './chunk-R36MIGBU.mjs';
4
+ import { resolveProjection, projectionKeepsField, setNestedValue } from './chunk-CHOGQSHK.mjs';
5
5
  import './chunk-Q5DC6WAB.mjs';
6
- import './chunk-ZJ4CSAB2.mjs';
7
- import './chunk-QZN3MIJ3.mjs';
8
- import './chunk-T6CNO72J.mjs';
6
+ import './chunk-QY7GC2MW.mjs';
7
+ import './chunk-ES33L3HO.mjs';
8
+ import './chunk-QM3VPX4Z.mjs';
9
9
  import './chunk-WQBCBKY3.mjs';
10
- import './chunk-A3UB2MXL.mjs';
11
- import { extractVectorFieldsFromSchema } from './chunk-CVQWQVFX.mjs';
10
+ import './chunk-SBCEHIPL.mjs';
11
+ import { extractVectorFieldsFromSchema } from './chunk-4ZJWRETC.mjs';
12
12
  import './chunk-FGMGUDHX.mjs';
13
13
  import './chunk-KEHK2O6P.mjs';
14
14
  import './chunk-GES7U2PM.mjs';
15
- import './chunk-BVOJIYRV.mjs';
15
+ import './chunk-BB7MASRQ.mjs';
16
+ import './chunk-X5CV2E2B.mjs';
17
+ import './chunk-7KC56574.mjs';
16
18
  import './chunk-R6A773WK.mjs';
17
19
  import './chunk-YTJCGKM4.mjs';
18
20
  import './chunk-L5ORED7V.mjs';
19
- import { ServerErrorCodes, ErrorCodes, NarsilError } from './chunk-TPJU7NDJ.mjs';
21
+ import { ServerErrorCodes, ErrorCodes, NarsilError, isNarsilError } from './chunk-SYWGORQB.mjs';
20
22
 
21
23
  // src/server/request-threads/held-vectors.ts
22
24
  function managerWithHeldVectors(manager, fieldPaths, vectorOf) {
@@ -511,7 +513,7 @@ function watchForDeparture(options) {
511
513
  (indexName, fieldName, docId) => executor.heldVectorOf(indexName, fieldName, docId)
512
514
  ),
513
515
  createIndex: refusingOnceDeparting(
514
- (indexName, config, language, analysisStale) => executor.createIndex(indexName, config, language, analysisStale)
516
+ (indexName, config, language, analysisStale, synonyms) => executor.createIndex(indexName, config, language, analysisStale, synonyms)
515
517
  ),
516
518
  dropIndex: refusingOnceDeparting((indexName) => executor.dropIndex(indexName)),
517
519
  listIndexes: refusingOnceDeparting(() => executor.listIndexes())
@@ -541,6 +543,9 @@ function onHeldIndex(local, handler, fallback) {
541
543
  function onWholeDocuments(local, handler, fallback) {
542
544
  return (ctx) => local.holdsDocumentsOf(ctx.params[0]) ? handler(ctx) : fallback(ctx);
543
545
  }
546
+ function mainThreadAnswersInstead(err) {
547
+ return isNarsilError(err) && err.code === ErrorCodes.WORKER_BUSY;
548
+ }
544
549
  function searchHandler(options) {
545
550
  const { fallback, maxResultWindow, allowRegex, staysOnThread, answer } = options;
546
551
  return async (ctx) => {
@@ -559,7 +564,7 @@ function searchHandler(options) {
559
564
  try {
560
565
  respondJson(ctx, await answer(ctx.params[0], params));
561
566
  } catch (err) {
562
- if (staysOnThread(ctx.params[0], params)) respondError(ctx, err);
567
+ if (staysOnThread(ctx.params[0], params) && !mainThreadAnswersInstead(err)) respondError(ctx, err);
563
568
  else await fallback(ctx);
564
569
  }
565
570
  };
@@ -1,5 +1,6 @@
1
- import { e as VectorQuantizationMode } from '../schema-DtsgmNfU.js';
1
+ import { e as VectorQuantizationMode } from '../schema-DttzM-ln.js';
2
2
  import '../adapters-79OIa4xm.js';
3
+ import '../synonyms-CpOAHPa-.js';
3
4
 
4
5
  /**
5
6
  * Similarity metric a vector search ranks by.
@@ -1,14 +1,14 @@
1
- import { openSharedVectorField, createVectorStore } from '../chunk-UKSUENHK.mjs';
2
- import { osqBitsOf, createHNSWIndex, createOsqQuantizer } from '../chunk-ULRPNYAG.mjs';
1
+ import { openSharedVectorField, createVectorStore } from '../chunk-AF2CIKYC.mjs';
2
+ import { osqBitsOf, createHNSWIndex, createOsqQuantizer } from '../chunk-Z3MOCHG5.mjs';
3
3
  import { osqRecordBytes } from '../chunk-37CD3OKS.mjs';
4
4
  import '../chunk-DJHHF2L5.mjs';
5
- import { MAX_WORKER_COPIES } from '../chunk-Y2F66IQJ.mjs';
6
- import '../chunk-ZJ4CSAB2.mjs';
7
- import '../chunk-QZN3MIJ3.mjs';
5
+ import '../chunk-KOKM4PQN.mjs';
6
+ import { MAX_WORKER_COPIES } from '../chunk-QY7GC2MW.mjs';
7
+ import '../chunk-ES33L3HO.mjs';
8
8
  import '../chunk-KEHK2O6P.mjs';
9
9
  import '../chunk-R6A773WK.mjs';
10
10
  import '../chunk-YTJCGKM4.mjs';
11
- import '../chunk-TPJU7NDJ.mjs';
11
+ import '../chunk-SYWGORQB.mjs';
12
12
 
13
13
  // src/vector/worker-copy.ts
14
14
  function restoreQuantizer(snapshot, store) {
@@ -1,8 +1,8 @@
1
1
  import { startIdleHeapCleanup } from '../chunk-5XNIRLFC.mjs';
2
- import { threadSlotOfWorker, isValidWorkerAction } from '../chunk-YRX6XMOQ.mjs';
3
- import { loadVectorCode } from '../chunk-R7OSDAFK.mjs';
2
+ import { threadSlotOfWorker, isValidWorkerAction } from '../chunk-R6PR4WYZ.mjs';
3
+ import { loadVectorCode } from '../chunk-K6A4FCVR.mjs';
4
4
  import '../chunk-L5ORED7V.mjs';
5
- import { ErrorCodes, NarsilError, isNarsilError } from '../chunk-TPJU7NDJ.mjs';
5
+ import { ErrorCodes, NarsilError, isNarsilError } from '../chunk-SYWGORQB.mjs';
6
6
 
7
7
  // src/workers/action-handler.ts
8
8
  function buildErrorResponse(requestId, code, message, details) {
@@ -20,7 +20,7 @@ async function importBootstrapModule(moduleUrl) {
20
20
  await import(moduleUrl);
21
21
  }
22
22
  async function stopServingRequests() {
23
- const { closeRequestThread } = await import('../thread-ZP3UMIZT.mjs');
23
+ const { closeRequestThread } = await import('../thread-U7XYJWGG.mjs');
24
24
  closeRequestThread();
25
25
  }
26
26
  function holdsCopies(executor) {
@@ -51,7 +51,7 @@ function createActionHandler(executor) {
51
51
  if (!holdsCopies(executor)) {
52
52
  throw new NarsilError(ErrorCodes.CONFIG_INVALID, "This executor holds no copies to answer requests from");
53
53
  }
54
- const starting = import('../thread-ZP3UMIZT.mjs').then(
54
+ const starting = import('../thread-U7XYJWGG.mjs').then(
55
55
  ({ serveRequests }) => serveRequests(executor, action.settings)
56
56
  );
57
57
  serving.start = starting.then(
@@ -104,7 +104,7 @@ async function setup() {
104
104
  } catch {
105
105
  parentPort = null;
106
106
  }
107
- const [{ createDirectExecutor }] = await Promise.all([import('../direct-executor-EGESD26S.mjs'), loadVectorCode()]);
107
+ const [{ createDirectExecutor }] = await Promise.all([import('../direct-executor-IJTRU3YN.mjs'), loadVectorCode()]);
108
108
  const handleAction = createActionHandler(createDirectExecutor({ threadSlot }));
109
109
  if (parentPort) {
110
110
  const port = parentPort;
@@ -1,34 +1,38 @@
1
- import { decodeVectorFilePayload, isDead, bytesToVectors } from './chunk-YCJLVNWR.mjs';
1
+ import { decodeVectorFilePayload, isDead, bytesToVectors } from './chunk-F52QGNZ2.mjs';
2
2
  import './chunk-37CD3OKS.mjs';
3
- import { setNestedValue, KEYWORD_SEGMENT_ENVELOPE_VERSION, decodeKeywordSegment } from './chunk-MWJIAREY.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-R6BMMQXH.mjs';
5
- import { decodeStoredDocument } from './chunk-EMXAYPTQ.mjs';
6
- import './chunk-DCK4P5BI.mjs';
7
- import './chunk-X4SEXL4U.mjs';
8
- import './chunk-J2BPXTD7.mjs';
9
- import './chunk-PR4O7CAP.mjs';
10
- import './chunk-RVM7AODE.mjs';
3
+ import { setNestedValue, KEYWORD_SEGMENT_ENVELOPE_VERSION, decodeKeywordSegment } from './chunk-EZD4MWOU.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-C45FUYPI.mjs';
5
+ import './chunk-R36MIGBU.mjs';
6
+ import './chunk-RDJKYKMQ.mjs';
7
+ import { decodeStoredDocument } from './chunk-UAUZGXJP.mjs';
8
+ import './chunk-CHOGQSHK.mjs';
9
+ import './chunk-WLOF6HSP.mjs';
11
10
  import './chunk-AV4IJKD2.mjs';
12
11
  import { EXPORT_CHUNK_BYTES } from './chunk-Q5DC6WAB.mjs';
12
+ import './chunk-ZHS44YKF.mjs';
13
13
  import './chunk-TGP5M5R7.mjs';
14
- import './chunk-Y2F66IQJ.mjs';
15
- import './chunk-ZJ4CSAB2.mjs';
16
- import './chunk-QZN3MIJ3.mjs';
17
- import './chunk-T6CNO72J.mjs';
14
+ import './chunk-U2BKYEC7.mjs';
15
+ import './chunk-KOKM4PQN.mjs';
16
+ import './chunk-QY7GC2MW.mjs';
17
+ import './chunk-ES33L3HO.mjs';
18
+ import './chunk-QM3VPX4Z.mjs';
18
19
  import './chunk-WQBCBKY3.mjs';
19
- import './chunk-A3UB2MXL.mjs';
20
- import './chunk-CVQWQVFX.mjs';
20
+ import './chunk-SBCEHIPL.mjs';
21
+ import './chunk-4ZJWRETC.mjs';
21
22
  import './chunk-FGMGUDHX.mjs';
22
23
  import './chunk-KEHK2O6P.mjs';
23
24
  import './chunk-GES7U2PM.mjs';
24
- import './chunk-BVOJIYRV.mjs';
25
- import './chunk-U2BKYEC7.mjs';
25
+ import './chunk-BB7MASRQ.mjs';
26
+ import './chunk-2GZGBOQI.mjs';
27
+ import './chunk-X5CV2E2B.mjs';
28
+ import './chunk-7X5JST5L.mjs';
29
+ import './chunk-7KC56574.mjs';
26
30
  import './chunk-R6A773WK.mjs';
27
31
  import './chunk-YTJCGKM4.mjs';
28
- import './chunk-YRX6XMOQ.mjs';
29
- import './chunk-R7OSDAFK.mjs';
32
+ import './chunk-R6PR4WYZ.mjs';
33
+ import './chunk-K6A4FCVR.mjs';
30
34
  import './chunk-L5ORED7V.mjs';
31
- import { NarsilError, ErrorCodes } from './chunk-TPJU7NDJ.mjs';
35
+ import { NarsilError, ErrorCodes } from './chunk-SYWGORQB.mjs';
32
36
  import { decode } from '@msgpack/msgpack';
33
37
 
34
38
  // src/engine/export/json-line.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delali/narsil",
3
- "version": "0.3.1-next.90",
3
+ "version": "0.3.1-next.94",
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)",
@@ -70,6 +70,10 @@
70
70
  "#platform/partial-word-search": {
71
71
  "browser": "./src/core/partition/partial-words/platform.browser.ts",
72
72
  "default": "./src/core/partition/partial-words/platform.ts"
73
+ },
74
+ "#platform/synonym-search": {
75
+ "browser": "./src/core/synonyms/platform.browser.ts",
76
+ "default": "./src/core/synonyms/platform.ts"
73
77
  }
74
78
  },
75
79
  "sideEffects": false,
@@ -161,6 +165,10 @@
161
165
  "import": "./dist/partial-words.mjs",
162
166
  "types": "./dist/partial-words.d.ts"
163
167
  },
168
+ "./synonyms": {
169
+ "import": "./dist/synonyms.mjs",
170
+ "types": "./dist/synonyms.d.ts"
171
+ },
164
172
  "./languages/*": {
165
173
  "import": "./dist/languages/*.mjs",
166
174
  "types": "./dist/languages/*.d.ts"
@@ -255,11 +263,11 @@
255
263
  }
256
264
  },
257
265
  "optionalDependencies": {
258
- "@delali/narsil-native-darwin-arm64": "0.3.1-next.90",
259
- "@delali/narsil-native-darwin-x64": "0.3.1-next.90",
260
- "@delali/narsil-native-linux-arm64": "0.3.1-next.90",
261
- "@delali/narsil-native-linux-x64": "0.3.1-next.90",
262
- "@delali/narsil-native-win32-arm64": "0.3.1-next.90",
263
- "@delali/narsil-native-win32-x64": "0.3.1-next.90"
266
+ "@delali/narsil-native-darwin-arm64": "0.3.1-next.94",
267
+ "@delali/narsil-native-darwin-x64": "0.3.1-next.94",
268
+ "@delali/narsil-native-linux-arm64": "0.3.1-next.94",
269
+ "@delali/narsil-native-linux-x64": "0.3.1-next.94",
270
+ "@delali/narsil-native-win32-arm64": "0.3.1-next.94",
271
+ "@delali/narsil-native-win32-x64": "0.3.1-next.94"
264
272
  }
265
273
  }
@@ -1,18 +0,0 @@
1
- import { english } from './chunk-TGP5M5R7.mjs';
2
- import { NarsilError, ErrorCodes } from './chunk-TPJU7NDJ.mjs';
3
-
4
- // src/languages/registry.ts
5
- var languages = /* @__PURE__ */ new Map();
6
- languages.set("english", english);
7
- function registerLanguage(module) {
8
- languages.set(module.name, module);
9
- }
10
- function getLanguage(name) {
11
- const lang = languages.get(name);
12
- if (!lang) {
13
- throw new NarsilError(ErrorCodes.LANGUAGE_NOT_SUPPORTED, `Language "${name}" is not registered`, { language: name });
14
- }
15
- return lang;
16
- }
17
-
18
- export { getLanguage, registerLanguage };