@delali/narsil 0.3.0 → 0.3.1-next.101

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 (165) hide show
  1. package/README.md +9 -8
  2. package/dist/adapters/filesystem.d.ts +1 -1
  3. package/dist/adapters/filesystem.mjs +1 -1
  4. package/dist/adapters/indexeddb.d.ts +1 -1
  5. package/dist/adapters/indexeddb.mjs +1 -1
  6. package/dist/adapters/memory.d.ts +1 -1
  7. package/dist/{adapters-79OIa4xm.d.ts → adapters-BQFQ4PRz.d.ts} +27 -1
  8. package/dist/browser/chunk-BDOSMEEP.mjs +493 -0
  9. package/dist/browser/chunk-EJDUFWSO.mjs +602 -0
  10. package/dist/browser/chunk-HOZW3PKP.mjs +9 -0
  11. package/dist/browser/chunk-JOVZ6HMT.mjs +4358 -0
  12. package/dist/browser/chunk-JPTQZWJQ.mjs +10 -0
  13. package/dist/browser/chunk-KPJMDPHG.mjs +24558 -0
  14. package/dist/browser/chunk-PGIM3HIM.mjs +2743 -0
  15. package/dist/browser/chunk-RHG4O77A.mjs +206 -0
  16. package/dist/browser/chunk-RIJSLY2I.mjs +360 -0
  17. package/dist/browser/durability-wiring-SRUYT3VV.mjs +3875 -0
  18. package/dist/browser/module-CBB2ETYP.mjs +3111 -0
  19. package/dist/browser/release-76MXRPGV.mjs +33 -0
  20. package/dist/browser/replace-RURXTGVG.mjs +57 -0
  21. package/dist/browser/restore-queue-EEZQO6RF.mjs +35 -0
  22. package/dist/browser/runtime-7ZAHCHWR.mjs +557 -0
  23. package/dist/browser/snapshot-OAAA5UJ7.mjs +1210 -0
  24. package/dist/browser/write-7D6VIK6O.mjs +208 -0
  25. package/dist/{capabilities-DSsOGz6F.d.ts → capabilities-DiGlB6Sr.d.ts} +68 -7
  26. package/dist/chunk-2RIRGOUL.mjs +113 -0
  27. package/dist/chunk-37CD3OKS.mjs +87 -0
  28. package/dist/chunk-44W3CBNG.mjs +7 -0
  29. package/dist/chunk-46D6JQIG.mjs +426 -0
  30. package/dist/{chunk-VMRR3DQU.mjs → chunk-5JNA5SKS.mjs} +546 -35
  31. package/dist/chunk-747OHOUA.mjs +11 -0
  32. package/dist/chunk-75XIEF6H.mjs +126 -0
  33. package/dist/chunk-7X5JST5L.mjs +114 -0
  34. package/dist/chunk-BOFBLJFZ.mjs +209 -0
  35. package/dist/{chunk-USKFU7J5.mjs → chunk-BWJVNZPR.mjs} +8 -1
  36. package/dist/chunk-C7SLA6CM.mjs +19 -0
  37. package/dist/{chunk-POWOTUKJ.mjs → chunk-CQUMNIIG.mjs} +3 -6
  38. package/dist/chunk-CVXLLEQ3.mjs +1011 -0
  39. package/dist/chunk-DJHHF2L5.mjs +17 -0
  40. package/dist/chunk-E74YLAIG.mjs +24 -0
  41. package/dist/{chunk-UXNWQZST.mjs → chunk-EMRMGYRE.mjs} +236 -18
  42. package/dist/chunk-EWZLIYHV.mjs +57 -0
  43. package/dist/chunk-GBEEG5AN.mjs +35 -0
  44. package/dist/chunk-GES7U2PM.mjs +68 -0
  45. package/dist/chunk-HJSN7UYG.mjs +10 -0
  46. package/dist/chunk-HLPRHOSO.mjs +17 -0
  47. package/dist/chunk-HMFNFVP7.mjs +14 -0
  48. package/dist/chunk-J5QP52HA.mjs +1751 -0
  49. package/dist/{chunk-YNVIUGF5.mjs → chunk-JZVARCRZ.mjs} +3 -28
  50. package/dist/chunk-KOKM4PQN.mjs +52 -0
  51. package/dist/{chunk-B2TFROFX.mjs → chunk-KWTW6VTG.mjs} +465 -250
  52. package/dist/chunk-KZ3NX2P7.mjs +21 -0
  53. package/dist/chunk-L5ORED7V.mjs +25 -0
  54. package/dist/{chunk-THYRHHO2.mjs → chunk-LGAMKHA2.mjs} +2009 -2351
  55. package/dist/chunk-LKOB5COA.mjs +117 -0
  56. package/dist/chunk-LPQOEU5M.mjs +96 -0
  57. package/dist/{chunk-3LHGNRYE.mjs → chunk-LXWDQLTW.mjs} +7 -2
  58. package/dist/{chunk-L6TNPLAR.mjs → chunk-OEYI3KRB.mjs} +270 -108
  59. package/dist/chunk-OM362BRO.mjs +948 -0
  60. package/dist/chunk-OZDFA4WC.mjs +67 -0
  61. package/dist/chunk-P36MUFEJ.mjs +10 -0
  62. package/dist/chunk-PC2G76VW.mjs +2540 -0
  63. package/dist/{chunk-GCM3JFVA.mjs → chunk-PNEYIHA4.mjs} +11 -2
  64. package/dist/chunk-PNFKUCG3.mjs +1130 -0
  65. package/dist/chunk-Q6XWVUZX.mjs +44 -0
  66. package/dist/chunk-R27EMH5M.mjs +617 -0
  67. package/dist/{chunk-YMZCMH5M.mjs → chunk-R6A773WK.mjs} +19 -24
  68. package/dist/chunk-RF7PLG43.mjs +106 -0
  69. package/dist/chunk-RFBLQLLZ.mjs +16 -0
  70. package/dist/{chunk-Y3L5MDRV.mjs → chunk-RFVUDM5E.mjs} +17 -2
  71. package/dist/chunk-S7FL6UAH.mjs +521 -0
  72. package/dist/chunk-S7GNDRPS.mjs +651 -0
  73. package/dist/chunk-SP3NM3ZG.mjs +3537 -0
  74. package/dist/chunk-U476IXKQ.mjs +10 -0
  75. package/dist/chunk-UA3AUGNV.mjs +462 -0
  76. package/dist/chunk-UTG5YNXV.mjs +507 -0
  77. package/dist/chunk-VI4R6W25.mjs +8484 -0
  78. package/dist/chunk-WQBCBKY3.mjs +8 -0
  79. package/dist/{chunk-24RXHMEL.mjs → chunk-WVCOCKBU.mjs} +3794 -7570
  80. package/dist/chunk-X5CV2E2B.mjs +1 -0
  81. package/dist/chunk-XADZPPZI.mjs +614 -0
  82. package/dist/chunk-YEEQHT4V.mjs +212 -0
  83. package/dist/chunk-YTJCGKM4.mjs +56 -0
  84. package/dist/chunk-YYQIODMF.mjs +275 -0
  85. package/dist/chunk-ZI34TVOA.mjs +144 -0
  86. package/dist/{chunk-OOSIDHA3.mjs → chunk-ZKWYWW4Y.mjs} +1 -1
  87. package/dist/chunk-ZM7KU4YW.mjs +35 -0
  88. package/dist/{client-BQK6Tf6A.d.ts → client-BOStAkc5.d.ts} +160 -37
  89. package/dist/client.d.ts +11 -10
  90. package/dist/client.mjs +209 -45
  91. package/dist/{config-DmXULPa-.d.ts → config-Cjvzbs_j.d.ts} +51 -3
  92. package/dist/config-DffQlmRq.d.ts +421 -0
  93. package/dist/direct-executor-ZD64PPEZ.mjs +24 -0
  94. package/dist/distribution/coordinator/etcd.d.ts +79 -18
  95. package/dist/distribution/coordinator/etcd.mjs +553 -109
  96. package/dist/distribution/coordinator/in-memory.d.ts +4 -3
  97. package/dist/distribution/coordinator/in-memory.mjs +22 -3
  98. package/dist/distribution/transport/grpc.d.ts +2 -2
  99. package/dist/distribution/transport/grpc.mjs +79 -14
  100. package/dist/distribution/transport/in-memory.d.ts +2 -2
  101. package/dist/distribution/transport/in-memory.mjs +12 -7
  102. package/dist/distribution/transport/tcp.d.ts +2 -2
  103. package/dist/distribution/transport/tcp.mjs +50 -28
  104. package/dist/distribution.d.ts +144 -23
  105. package/dist/distribution.mjs +14479 -8173
  106. package/dist/durability-wiring-FEUBR5BT.mjs +3330 -0
  107. package/dist/embeddings/openai.d.ts +2 -2
  108. package/dist/embeddings/openai.mjs +22 -133
  109. package/dist/{engine-CIOyFozK.d.ts → engine-rC0vjjY-.d.ts} +165 -141
  110. package/dist/{memory-yFaVn2xZ.d.ts → events-DqOIg5xa.d.ts} +645 -136
  111. package/dist/{types-DAK7mnUZ.d.ts → index-Bkdt8nDw.d.ts} +182 -45
  112. package/dist/index.browser.mjs +4 -32180
  113. package/dist/index.d.ts +91 -20
  114. package/dist/index.mjs +33 -16
  115. package/dist/invalidation/broadcast-channel.d.ts +1 -1
  116. package/dist/invalidation/filesystem.d.ts +1 -1
  117. package/dist/invalidation/filesystem.mjs +2 -1
  118. package/dist/invalidation/noop.d.ts +1 -1
  119. package/dist/module-3S65MVCM.mjs +2151 -0
  120. package/dist/partial-words-DTIHO8G4.d.ts +19 -0
  121. package/dist/partial-words.d.ts +22 -0
  122. package/dist/partial-words.mjs +17 -0
  123. package/dist/pattern-Cledccbl.d.ts +18 -0
  124. package/dist/pattern.d.ts +22 -0
  125. package/dist/pattern.mjs +12 -0
  126. package/dist/persistence/durability/checkpoint-worker.d.ts +119 -72
  127. package/dist/persistence/durability/checkpoint-worker.mjs +51 -18
  128. package/dist/react.d.ts +279 -183
  129. package/dist/react.mjs +201 -48
  130. package/dist/release-BH3DKW3T.mjs +33 -0
  131. package/dist/replace-CEO5KJJ3.mjs +57 -0
  132. package/dist/rerank-K7C4WZFG.mjs +60 -0
  133. package/dist/rerankers/http.d.ts +50 -0
  134. package/dist/rerankers/http.mjs +104 -0
  135. package/dist/restore-queue-KQHA7ZV2.mjs +35 -0
  136. package/dist/runtime-6Y4ZYXOG.mjs +177 -0
  137. package/dist/{schema-d5Afu03A.d.ts → schema-4W_7tk1f.d.ts} +81 -11
  138. package/dist/server.d.ts +13 -12
  139. package/dist/server.mjs +611 -80
  140. package/dist/snapshot-QGZPODM5.mjs +799 -0
  141. package/dist/synonyms-CpOAHPa-.d.ts +52 -0
  142. package/dist/synonyms.d.ts +22 -0
  143. package/dist/synonyms.mjs +12 -0
  144. package/dist/{tasks-CH2Dod8w.d.ts → tasks-CwPTz-tP.d.ts} +10 -3
  145. package/dist/thread-N3IUGUS3.mjs +697 -0
  146. package/dist/{types-BQDlIvfS.d.ts → types-2qoitTXg.d.ts} +1 -1
  147. package/dist/{types-D5OwhtsQ.d.ts → types-Cz5okLml.d.ts} +2 -2
  148. package/dist/vector/search-worker.d.ts +46 -4
  149. package/dist/vector/search-worker.mjs +21 -11
  150. package/dist/workers/entry.mjs +9 -6
  151. package/dist/write-U5RI7MAX.mjs +241 -0
  152. package/package.json +55 -9
  153. package/dist/chunk-3L4U6EJQ.mjs +0 -49
  154. package/dist/chunk-IFBKLBGB.mjs +0 -7
  155. package/dist/chunk-ORBLD3EL.mjs +0 -6
  156. package/dist/chunk-U7KYW4BA.mjs +0 -135
  157. package/dist/chunk-ZJ4CSAB2.mjs +0 -13
  158. package/dist/chunk-ZNZBXMP5.mjs +0 -2117
  159. package/dist/chunk-ZZT3EAUC.mjs +0 -11168
  160. package/dist/config-BhldZgaK.d.ts +0 -194
  161. package/dist/direct-executor-ALAVE7FC.mjs +0 -12
  162. package/dist/serialization/crc32-worker.d.ts +0 -20
  163. package/dist/serialization/crc32-worker.mjs +0 -62
  164. package/dist/simd-DW5AtJ6B.d.ts +0 -41
  165. package/dist/thread-DYHEQRVY.mjs +0 -402
@@ -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-46D6JQIG.mjs';
2
+ import './chunk-X5CV2E2B.mjs';
3
+ import './chunk-7X5JST5L.mjs';
4
+ import './chunk-UTG5YNXV.mjs';
5
+ import './chunk-R6A773WK.mjs';
6
+ import './chunk-YTJCGKM4.mjs';
7
+ import './chunk-BWJVNZPR.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-yFaVn2xZ.js';
1
+ import { M as MemoryStats } from './events-DqOIg5xa.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
@@ -68,6 +69,10 @@ interface HttpIndexConfig {
68
69
  embedding?: CreateIndexEmbedding;
69
70
  /** The server rejects a document that omits any of these fields. */
70
71
  required?: string[];
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. */
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[];
71
76
  }
72
77
  /**
73
78
  * One record an import refused, naming the line it came from and why the
@@ -84,6 +89,8 @@ interface ImportError {
84
89
  code: string;
85
90
  /** This describes the failure, for a log or a person. */
86
91
  message: string;
92
+ /** The server puts the facts that explain the failure here where it has any, such as the `reason` for a line that it refused to parse because parsing the line could fill the heap. */
93
+ details?: Record<string, unknown>;
87
94
  }
88
95
  /**
89
96
  * What one import produced.
@@ -140,7 +147,7 @@ interface MemoryStatsResponse extends MemoryStats {
140
147
  *
141
148
  * @public
142
149
  */
143
- type TaskType = 'optimizeVectors' | 'rebalance' | 'restore' | 'import' | 'rebuildAnalysis';
150
+ type TaskType = 'optimizeVectors' | 'rebalance' | 'restore' | 'import' | 'importExport' | 'rebuildAnalysis';
144
151
  /**
145
152
  * Where a long-running operation stands.
146
153
  *
@@ -205,7 +212,7 @@ interface TaskRecord {
205
212
  cancelRequestedAt?: number;
206
213
  /** How far the work has gone, which an import reports and other task types omit. */
207
214
  progress?: TaskProgress;
208
- /** What the work produced, which an import reports once it finishes. */
215
+ /** What the work produced, which an `import` or `importExport` task reports once it finishes. */
209
216
  result?: ImportResult;
210
217
  /** This says why the task failed, and a failed task alone carries it. */
211
218
  error?: {