@delali/narsil 0.4.5 → 0.4.6-next.333

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 (131) hide show
  1. package/README.md +1 -1
  2. package/dist/browser/{chunk-VAPCFSMX.mjs → chunk-3PGIOK7Z.mjs} +16 -1
  3. package/dist/browser/{chunk-263ERYKA.mjs → chunk-75MBWQFW.mjs} +71 -27
  4. package/dist/browser/{chunk-VIVG3OXM.mjs → chunk-FBDTHGDR.mjs} +7 -3
  5. package/dist/browser/{chunk-56UNHLAF.mjs → chunk-HIC42RBU.mjs} +1 -1
  6. package/dist/browser/{optional-reads-NQO5DKM4.mjs → optional-reads-4O4CJ7TR.mjs} +1 -1
  7. package/dist/browser/{runtime-OMKE7DF4.mjs → runtime-AMEB4J2D.mjs} +2 -1
  8. package/dist/browser/{segment-codec-leaf-GXSRX5VT.mjs → segment-codec-leaf-NDVBIBJJ.mjs} +3 -0
  9. package/dist/browser/{storage-leaf-42IZEOJJ.mjs → storage-leaf-NCOXQTXQ.mjs} +32 -12
  10. package/dist/{capabilities-DaJKuKlG.d.ts → capabilities-YazdElfW.d.ts} +2 -2
  11. package/dist/{chunk-KGLBLKYF.mjs → chunk-26AKUBDX.mjs} +66 -51
  12. package/dist/{react-native/chunks/chunk-3BEUTRYM.mjs → chunk-2M55WPWK.mjs} +1 -1
  13. package/dist/{chunk-AAH5CD3M.mjs → chunk-34QTB6O7.mjs} +1 -1
  14. package/dist/{chunk-GLPBA2YZ.mjs → chunk-3EFLY5LQ.mjs} +2 -2
  15. package/dist/{chunk-GDCTK5LU.mjs → chunk-3TENTQKL.mjs} +2 -2
  16. package/dist/{chunk-3PO2MOFY.mjs → chunk-3UAYJW6R.mjs} +2 -2
  17. package/dist/{chunk-VV6P6LKJ.mjs → chunk-3WYTRM24.mjs} +80 -78
  18. package/dist/chunk-43UYNPPC.mjs +110 -0
  19. package/dist/{chunk-UDDZVZTV.mjs → chunk-47NXBGQG.mjs} +2 -2
  20. package/dist/{chunk-RXQZ53NV.mjs → chunk-5CYLXJYQ.mjs} +2 -2
  21. package/dist/{chunk-6RNOECOF.mjs → chunk-5E46Y42F.mjs} +2 -2
  22. package/dist/{chunk-FAK7Y3OX.mjs → chunk-6U4C7VAD.mjs} +37 -9
  23. package/dist/{chunk-EY5U4P5V.mjs → chunk-7NMLFP2T.mjs} +17 -2
  24. package/dist/{chunk-BVLR6S5J.mjs → chunk-E6CHNSMY.mjs} +5 -5
  25. package/dist/{chunk-CP4ZQR2X.mjs → chunk-FBGUKBW2.mjs} +15 -9
  26. package/dist/{chunk-ZGGZXRGM.mjs → chunk-GYQKMYPG.mjs} +85 -38
  27. package/dist/{chunk-ICOCO7R4.mjs → chunk-GZ4YU36L.mjs} +1 -1
  28. package/dist/{chunk-3Q6CDT32.mjs → chunk-H2R4BTSO.mjs} +3 -3
  29. package/dist/{chunk-7SMVY4AX.mjs → chunk-HFF2R73P.mjs} +11 -11
  30. package/dist/{chunk-CPAE2QJP.mjs → chunk-HJCYLTVA.mjs} +1 -1
  31. package/dist/{chunk-XX4SKT54.mjs → chunk-KFUHQC6X.mjs} +22 -12
  32. package/dist/{chunk-5SHWA6PE.mjs → chunk-L2GYY6KY.mjs} +1 -1
  33. package/dist/{chunk-DEYEVTFV.mjs → chunk-L2W4FGTD.mjs} +2 -2
  34. package/dist/{chunk-4JLHHEBN.mjs → chunk-M5RYB6FE.mjs} +1 -1
  35. package/dist/{chunk-PBUME456.mjs → chunk-NOEMVUBS.mjs} +1 -1
  36. package/dist/{chunk-UQFWTROO.mjs → chunk-NSMF4OHE.mjs} +3 -3
  37. package/dist/{chunk-C3OQQ3M6.mjs → chunk-OPWZ7PZZ.mjs} +1 -1
  38. package/dist/{chunk-H7IIA2KL.mjs → chunk-PBVLCGCW.mjs} +1 -1
  39. package/dist/{chunk-REM3KDXN.mjs → chunk-U6B3HHTP.mjs} +4 -4
  40. package/dist/{chunk-M2Z5WVWW.mjs → chunk-UGMOBSMD.mjs} +2 -0
  41. package/dist/{chunk-43T3P3BE.mjs → chunk-WW3RDS57.mjs} +1 -1
  42. package/dist/{client-DetSCqP2.d.ts → client-B9YNYYs_.d.ts} +38 -12
  43. package/dist/client.d.ts +8 -8
  44. package/dist/client.mjs +2 -2
  45. package/dist/{config-BB4MRAsB.d.ts → config-DJFXyHMZ.d.ts} +2 -2
  46. package/dist/{config-XEHd4MFx.d.ts → config-DlvP2PSi.d.ts} +2 -2
  47. package/dist/{direct-executor-TWLEPVQO.mjs → direct-executor-2Y3JPVXT.mjs} +3 -3
  48. package/dist/distribution/coordinator/etcd.d.ts +2 -2
  49. package/dist/distribution/coordinator/etcd.mjs +6 -2
  50. package/dist/distribution/coordinator/in-memory.d.ts +2 -2
  51. package/dist/distribution/transport/grpc.mjs +1 -1
  52. package/dist/distribution/transport/tcp.mjs +24 -19
  53. package/dist/distribution.d.ts +14 -9
  54. package/dist/distribution.mjs +808 -646
  55. package/dist/{engine-DGG_yX0p.d.ts → engine-DP4PrdKM.d.ts} +51 -13
  56. package/dist/{index-fX_FbuRT.d.ts → index-CcivYH_R.d.ts} +1 -1
  57. package/dist/index.browser.mjs +3 -3
  58. package/dist/index.d.ts +6 -6
  59. package/dist/index.mjs +3 -3
  60. package/dist/index.react-native.mjs +3 -3
  61. package/dist/{long-query-thread-HK5FP64H.mjs → long-query-thread-6B2HXSBI.mjs} +13 -13
  62. package/dist/{msgpack-leaf-LIT7TKZW.mjs → msgpack-leaf-LTAJ5QGB.mjs} +2 -2
  63. package/dist/{optional-reads-ESDVS225.mjs → optional-reads-5QWIOFOU.mjs} +1 -1
  64. package/dist/{optional-writes-DPWRGFKK.mjs → optional-writes-27NHTIAL.mjs} +5 -5
  65. package/dist/{paged-partition-archive-NITVFYOC.mjs → paged-partition-archive-EFCEC4TD.mjs} +13 -13
  66. package/dist/partial-words.browser.mjs +3 -3
  67. package/dist/partial-words.mjs +3 -3
  68. package/dist/pattern.browser.mjs +2 -2
  69. package/dist/pattern.mjs +2 -2
  70. package/dist/persistence/durability/checkpoint-worker.d.ts +2 -1
  71. package/dist/persistence/durability/checkpoint-worker.mjs +10 -10
  72. package/dist/{query-actions-AA5LE2WV.mjs → query-actions-H6H54EJE.mjs} +3 -3
  73. package/dist/query-suggestions/merge-worker.mjs +6 -6
  74. package/dist/query-suggestions.browser.mjs +3 -3
  75. package/dist/query-suggestions.d.ts +2 -2
  76. package/dist/query-suggestions.mjs +4 -4
  77. package/dist/react-native/chunks/{chunk-6KVWTGEJ.mjs → chunk-7TURQEZZ.mjs} +84 -37
  78. package/dist/react-native/chunks/{chunk-ESVBC3AT.mjs → chunk-BIORJHQZ.mjs} +1 -1
  79. package/dist/react-native/chunks/{chunk-AOLLV37A.mjs → chunk-CBG4EUYD.mjs} +17 -2
  80. package/dist/{chunk-7HVZVD2N.mjs → react-native/chunks/chunk-DYAAQB5R.mjs} +1 -1
  81. package/dist/react-native/chunks/{chunk-HGZNA5A6.mjs → chunk-GCD64RZ2.mjs} +2 -2
  82. package/dist/react-native/chunks/{chunk-OVYLUGEW.mjs → chunk-UTYWL2W6.mjs} +2 -2
  83. package/dist/react-native/chunks/{chunk-ZZQ2RIYZ.mjs → chunk-XCJVLU6J.mjs} +2 -2
  84. package/dist/react-native/chunks/{chunk-574N6ERF.mjs → chunk-YMIPG3VC.mjs} +3 -3
  85. package/dist/react-native/chunks/{chunk-ZF3VSGEI.mjs → chunk-ZSJABTIE.mjs} +1 -1
  86. package/dist/react-native/chunks/{msgpack-leaf-FOUPTT7J.mjs → msgpack-leaf-Q4BPA4G7.mjs} +2 -2
  87. package/dist/react-native/chunks/{optional-reads-TN3PT6M4.mjs → optional-reads-M6F26KFO.mjs} +1 -1
  88. package/dist/react-native/chunks/{optional-writes-UYVKLJU6.mjs → optional-writes-NYFF5NTC.mjs} +4 -4
  89. package/dist/react-native/chunks/{restore-queue-AZIZ5ABX.mjs → restore-queue-4OXFRQ6N.mjs} +6 -6
  90. package/dist/react-native/chunks/{runtime-UOHD2XUJ.mjs → runtime-7UKADH3G.mjs} +2 -1
  91. package/dist/react-native/chunks/{segment-codec-leaf-TYO4LKQ6.mjs → segment-codec-leaf-YKUO5DU6.mjs} +4 -4
  92. package/dist/react-native/chunks/{segment-merge-leaf-KM52IXXQ.mjs → segment-merge-leaf-HIOWV5UN.mjs} +5 -5
  93. package/dist/react-native/chunks/{storage-leaf-HKJBZXIP.mjs → storage-leaf-H64VNQKE.mjs} +40 -20
  94. package/dist/react-native/chunks/{store-leaf-LS5LT25L.mjs → store-leaf-ZG5DR7QA.mjs} +5 -5
  95. package/dist/react-native/chunks/{suggestions-leaf-IJ3Z4EH3.mjs → suggestions-leaf-AJZ3SHZO.mjs} +5 -5
  96. package/dist/react-native/chunks/{worker-copies-VNXZRBVW.mjs → worker-copies-IY4ZIA6W.mjs} +4 -4
  97. package/dist/react-native/partial-words.mjs +3 -3
  98. package/dist/react-native/pattern.mjs +2 -2
  99. package/dist/react-native/query-suggestions.mjs +3 -3
  100. package/dist/react-native/sync.mjs +12 -7
  101. package/dist/react-native/synonyms.mjs +3 -3
  102. package/dist/react.d.ts +9 -9
  103. package/dist/{rerank-X4HOST2N.mjs → rerank-JTIQNROU.mjs} +25 -12
  104. package/dist/{restore-queue-CI72WRAF.mjs → restore-queue-JIJW3XKK.mjs} +6 -6
  105. package/dist/{runtime-USQYKN3I.mjs → runtime-WWFVQOBJ.mjs} +2 -1
  106. package/dist/{schema-CFnQ-WI3.d.ts → schema-CPQUdJTs.d.ts} +6 -0
  107. package/dist/{segment-codec-leaf-7R5H2IYU.mjs → segment-codec-leaf-LTIODLBH.mjs} +4 -4
  108. package/dist/{segment-merge-leaf-IWL4VH7C.mjs → segment-merge-leaf-CXOMXPAP.mjs} +4 -4
  109. package/dist/server.d.ts +22 -11
  110. package/dist/server.mjs +24 -20
  111. package/dist/{storage-leaf-6YCHFH2O.mjs → storage-leaf-VB5OG66O.mjs} +22 -22
  112. package/dist/{store-leaf-V5N2REHF.mjs → store-leaf-RBK3Y2H4.mjs} +5 -5
  113. package/dist/{suggestions-leaf-XFJ4L37A.mjs → suggestions-leaf-27TNMJ37.mjs} +7 -7
  114. package/dist/sync/filesystem.d.ts +3 -3
  115. package/dist/sync/filesystem.mjs +8 -8
  116. package/dist/sync/indexeddb.browser.mjs +1 -1
  117. package/dist/sync/indexeddb.d.ts +3 -3
  118. package/dist/sync/indexeddb.mjs +2 -2
  119. package/dist/sync.browser.mjs +7 -6
  120. package/dist/sync.d.ts +4 -4
  121. package/dist/sync.mjs +12 -7
  122. package/dist/synonyms.browser.mjs +3 -3
  123. package/dist/synonyms.mjs +3 -3
  124. package/dist/{tasks-Bpi5YNZF.d.ts → tasks-4rvZJuoN.d.ts} +8 -4
  125. package/dist/{thread-UQAIJ5CS.mjs → thread-J32AOE3H.mjs} +12 -12
  126. package/dist/{types-DGjk684l.d.ts → types-C3hkFf_3.d.ts} +2 -2
  127. package/dist/vector/search-worker.d.ts +1 -1
  128. package/dist/{worker-copies-44MSY3IU.mjs → worker-copies-F2WVSQQO.mjs} +6 -6
  129. package/dist/workers/entry.mjs +9 -9
  130. package/openapi.json +58 -2
  131. package/package.json +5 -7
@@ -1,8 +1,8 @@
1
- import { P as PartitionConfig, B as BM25Params, A as AnyDocument, a as InsertOptions, W as WriteOptions } from './schema-CFnQ-WI3.js';
2
- import { o as SnapshotOptions, V as VectorMaintenanceResult, B as BatchResult, L as ListParams, v as ListResult, F as FollowChangesOptions, d as ChangesEvent, a as ChangePosition, h as ChangesStatus, g as ChangesSetting, I as IndexInfo, z as IndexStats, P as PartitionStatsResult, Q as QueryParams, t as QueryResult, y as PreflightResult, w as SuggestParams, x as SuggestResult, q as SyncStatus, p as SyncSetting } from './engine-DGG_yX0p.js';
1
+ import { P as PartitionConfig, B as BM25Params, A as AnyDocument, a as InsertOptions, W as WriteOptions } from './schema-CPQUdJTs.js';
2
+ import { o as SnapshotOptions, V as VectorMaintenanceResult, B as BatchResult, D as DocumentProjection, L as ListParams, v as ListResult, F as FollowChangesOptions, d as ChangesEvent, a as ChangePosition, h as ChangesStatus, g as ChangesSetting, I as IndexInfo, z as IndexStats, P as PartitionStatsResult, Q as QueryParams, t as QueryResult, y as PreflightResult, w as SuggestParams, x as SuggestResult, q as SyncStatus, p as SyncSetting } from './engine-DP4PrdKM.js';
3
3
  import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
4
- import { f as TaskRecord, a as ChangeAnalysisBody, M as MemoryStatsResponse, m as CreateBackupBody, R as RestoreBackupBody, c as ImportResult, H as HttpIndexConfig, d as TaskListQuery, T as TaskListPage } from './tasks-Bpi5YNZF.js';
5
- import { B as BackupListing } from './config-XEHd4MFx.js';
4
+ import { f as TaskRecord, a as ChangeAnalysisBody, M as MemoryStatsResponse, m as CreateBackupBody, R as RestoreBackupBody, c as ImportResult, H as HttpIndexConfig, d as TaskListQuery, T as TaskListPage } from './tasks-4rvZJuoN.js';
5
+ import { B as BackupListing } from './config-DlvP2PSi.js';
6
6
  import { d as QuerySuggestionsSetting, e as QuerySuggestionsStatus, f as RecordQueryResult, c as QuerySuggestionsPreview, M as ManualQuerySuggestion } from './query-suggestions-CBYkrQ5T.js';
7
7
 
8
8
  /**
@@ -425,6 +425,15 @@ interface BackupOperations {
425
425
  deleteBackup(backupName: string, options?: RequestOptions): Promise<TaskRecord>;
426
426
  }
427
427
 
428
+ /**
429
+ * These options shape one {@link BulkOperations.getMultiple} request.
430
+ *
431
+ * @public
432
+ */
433
+ interface GetMultipleOptions extends RequestOptions {
434
+ /** This chooses how much of each document comes back. Every field apart from the vector fields comes back by default. */
435
+ document?: DocumentProjection;
436
+ }
428
437
  /**
429
438
  * This is a corpus, in whichever form you already hold it.
430
439
  *
@@ -496,13 +505,16 @@ interface BulkOperations {
496
505
  * The result leaves out an id the index does not hold while the call still
497
506
  * succeeds, so compare the size against what you asked for.
498
507
  *
508
+ * Each document comes back without its vector fields unless
509
+ * `options.document` or the index's `returnVectors` setting asks for them.
510
+ *
499
511
  * @param indexName - This names the index holding the documents.
500
512
  * @param docIds - These are the ids to read.
501
- * @param options - This sets the signal, the deadline, and the headers for
502
- * this request.
513
+ * @param options - This chooses which fields come back, and sets the signal,
514
+ * the deadline, and the headers for this request.
503
515
  * @returns The map holds every document found, keyed by id.
504
516
  */
505
- getMultiple(indexName: string, docIds: string[], options?: RequestOptions): Promise<Map<string, AnyDocument>>;
517
+ getMultiple(indexName: string, docIds: string[], options?: GetMultipleOptions): Promise<Map<string, AnyDocument>>;
506
518
  /**
507
519
  * Pages through the stored documents without searching, in document-id order
508
520
  * until the parameters name a sort.
@@ -658,6 +670,19 @@ interface PutResult {
658
670
  /** This is true when the id held nothing before, and false when the write replaced a document. */
659
671
  created: boolean;
660
672
  }
673
+ /**
674
+ * These options shape one {@link DocumentOperations.get} request.
675
+ *
676
+ * @public
677
+ */
678
+ interface GetDocumentOptions extends RequestOptions {
679
+ /**
680
+ * Setting this to true returns the vector fields, and false leaves them out
681
+ * even on an index that sets `returnVectors`. The server leaves them out by
682
+ * default.
683
+ */
684
+ vectors?: boolean;
685
+ }
661
686
  /**
662
687
  * These methods write and read one document at a time over HTTP.
663
688
  *
@@ -686,17 +711,18 @@ interface DocumentOperations {
686
711
  */
687
712
  insert(indexName: string, document: AnyDocument, docId?: string, insertOptions?: InsertOptions, options?: RequestOptions): Promise<string>;
688
713
  /**
689
- * Reads one stored document back.
714
+ * Reads one stored document back, without its vector fields unless
715
+ * `options.vectors` or the index's `returnVectors` setting asks for them.
690
716
  *
691
717
  * @param indexName - This names the index holding the document.
692
718
  * @param docId - This names the document to read.
693
- * @param options - This sets the signal, the deadline, and the headers for
694
- * this request.
719
+ * @param options - This chooses whether the vector fields come back, and sets
720
+ * the signal, the deadline, and the headers for this request.
695
721
  * @returns The stored document comes back, and `undefined` says the index
696
722
  * holds no such id.
697
723
  * @throws A `NarsilError` with `INDEX_NOT_FOUND` for an unknown index.
698
724
  */
699
- get(indexName: string, docId: string, options?: RequestOptions): Promise<AnyDocument | undefined>;
725
+ get(indexName: string, docId: string, options?: GetDocumentOptions): Promise<AnyDocument | undefined>;
700
726
  /**
701
727
  * Reports whether an index holds a document under an id, without returning
702
728
  * the document itself.
@@ -1341,4 +1367,4 @@ interface NarsilClient extends IndexOperations, DocumentOperations, BulkOperatio
1341
1367
  */
1342
1368
  declare function createNarsilClient(options: NarsilClientOptions): NarsilClient;
1343
1369
 
1344
- export { type AdminOperations as A, type BackupOperations as B, type ChangeFeedOptions as C, type DocumentOperations as D, type FetchFunction as F, type ImportSource as I, type NarsilClient as N, type PutResult as P, type QuerySuggestionOperations as Q, type RequestOptions as R, type SearchOperations as S, type TaskOperations as T, type WaitForTaskOptions as W, type BulkOperations as a, type ChangeSubscription as b, type ChangesClientOperations as c, type IndexOperations as d, type NarsilClientOptions as e, type ServerOperations as f, type ServerVersion as g, type SyncSettingOperations as h, type SyncSnapshotDownload as i, type SyncSnapshotResume as j, createNarsilClient as k };
1370
+ export { type AdminOperations as A, type BackupOperations as B, type ChangeFeedOptions as C, type DocumentOperations as D, type FetchFunction as F, type GetDocumentOptions as G, type ImportSource as I, type NarsilClient as N, type PutResult as P, type QuerySuggestionOperations as Q, type RequestOptions as R, type SearchOperations as S, type TaskOperations as T, type WaitForTaskOptions as W, type BulkOperations as a, type ChangeSubscription as b, type ChangesClientOperations as c, type GetMultipleOptions as d, type IndexOperations as e, type NarsilClientOptions as f, type ServerOperations as g, type ServerVersion as h, type SyncSettingOperations as i, type SyncSnapshotDownload as j, type SyncSnapshotResume as k, createNarsilClient as l };
package/dist/client.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- export { B as BackupListing, a as BackupSummary, D as DamagedBackup } from './config-XEHd4MFx.js';
2
- export { C as Change, a as ChangePosition, b as ChangeType, c as ChangesBatch, d as ChangesEvent, e as ChangesOperations, f as ChangesResync, g as ChangesSetting, h as ChangesStatus, i as ChangesSubscribed, j as ClientErrorCode, k as ClientErrorCodes, E as ErrorCode, l as ErrorCodes, F as FollowChangesOptions, N as NarsilError, m as NarsilErrorCode, S as ServerErrorCode, n as ServerErrorCodes, o as SnapshotOptions, p as SyncSetting, q as SyncStatus, r as isNarsilError } from './engine-DGG_yX0p.js';
3
- export { A as ASYNC_IMPORT_CAPABILITY, B as BM25_TUNING_CAPABILITY, C as CHANGE_ANALYSIS_CAPABILITY, D as DOCUMENT_EXPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, R as REBUILD_ANALYSIS_CAPABILITY, S as SERVER_CAPABILITIES, a as SYNONYMS_CAPABILITY, T as TASK_CANCEL_CAPABILITY, b as TASK_FILTER_CAPABILITY } from './capabilities-DaJKuKlG.js';
4
- export { B as BackupListResponse, C as CapabilitiesResponse, a as ChangeAnalysisBody, b as CreateIndexEmbedding, E as ErrorDetail, H as HttpIndexConfig, I as ImportError, c as ImportResult, M as MemoryStatsResponse, R as RestoreBackupBody, T as TaskListPage, d as TaskListQuery, e as TaskProgress, f as TaskRecord, g as TaskStatus, h as TaskStepProgress, i as TaskType } from './tasks-Bpi5YNZF.js';
1
+ export { B as BackupListing, a as BackupSummary, D as DamagedBackup } from './config-DlvP2PSi.js';
2
+ export { C as Change, a as ChangePosition, b as ChangeType, c as ChangesBatch, d as ChangesEvent, e as ChangesOperations, f as ChangesResync, g as ChangesSetting, h as ChangesStatus, i as ChangesSubscribed, j as ClientErrorCode, k as ClientErrorCodes, E as ErrorCode, l as ErrorCodes, F as FollowChangesOptions, N as NarsilError, m as NarsilErrorCode, S as ServerErrorCode, n as ServerErrorCodes, o as SnapshotOptions, p as SyncSetting, q as SyncStatus, r as isNarsilError } from './engine-DP4PrdKM.js';
3
+ export { A as ASYNC_IMPORT_CAPABILITY, B as BM25_TUNING_CAPABILITY, C as CHANGE_ANALYSIS_CAPABILITY, D as DOCUMENT_EXPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, R as REBUILD_ANALYSIS_CAPABILITY, S as SERVER_CAPABILITIES, a as SYNONYMS_CAPABILITY, T as TASK_CANCEL_CAPABILITY, b as TASK_FILTER_CAPABILITY } from './capabilities-YazdElfW.js';
4
+ export { B as BackupListResponse, C as CapabilitiesResponse, a as ChangeAnalysisBody, b as CreateIndexEmbedding, E as ErrorDetail, H as HttpIndexConfig, I as ImportError, c as ImportResult, M as MemoryStatsResponse, R as RestoreBackupBody, T as TaskListPage, d as TaskListQuery, e as TaskProgress, f as TaskRecord, g as TaskStatus, h as TaskStepProgress, i as TaskType } from './tasks-4rvZJuoN.js';
5
5
  export { M as ManualQuerySuggestion, Q as QuerySuggestionPreviewEntry, a as QuerySuggestionsBuild, b as QuerySuggestionsBuildTrigger, c as QuerySuggestionsPreview, d as QuerySuggestionsSetting, e as QuerySuggestionsStatus, R as RecordQueryOutcome, f as RecordQueryResult } from './query-suggestions-CBYkrQ5T.js';
6
- export { A as AdminOperations, B as BackupOperations, a as BulkOperations, C as ChangeFeedOptions, b as ChangeSubscription, c as ChangesClientOperations, D as DocumentOperations, F as FetchFunction, I as ImportSource, d as IndexOperations, N as NarsilClient, e as NarsilClientOptions, P as PutResult, Q as QuerySuggestionOperations, R as RequestOptions, S as SearchOperations, f as ServerOperations, g as ServerVersion, h as SyncSettingOperations, i as SyncSnapshotDownload, j as SyncSnapshotResume, T as TaskOperations, W as WaitForTaskOptions, k as createNarsilClient } from './client-DetSCqP2.js';
7
- import './config-BB4MRAsB.js';
6
+ export { A as AdminOperations, B as BackupOperations, a as BulkOperations, C as ChangeFeedOptions, b as ChangeSubscription, c as ChangesClientOperations, D as DocumentOperations, F as FetchFunction, G as GetDocumentOptions, d as GetMultipleOptions, I as ImportSource, e as IndexOperations, N as NarsilClient, f as NarsilClientOptions, P as PutResult, Q as QuerySuggestionOperations, R as RequestOptions, S as SearchOperations, g as ServerOperations, h as ServerVersion, i as SyncSettingOperations, j as SyncSnapshotDownload, k as SyncSnapshotResume, T as TaskOperations, W as WaitForTaskOptions, l as createNarsilClient } from './client-B9YNYYs_.js';
7
+ import './config-DJFXyHMZ.js';
8
8
  import './adapters-8LcdNB77.js';
9
- import './schema-CFnQ-WI3.js';
9
+ import './schema-CPQUdJTs.js';
10
10
  import './synonyms-CpOAHPa-.js';
11
- import './index-fX_FbuRT.js';
11
+ import './index-CcivYH_R.js';
12
12
  import './types-DvncmvuQ.js';
package/dist/client.mjs CHANGED
@@ -1,5 +1,5 @@
1
- export { createNarsilClient } from './browser/chunk-VIVG3OXM.mjs';
2
- export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './browser/chunk-VAPCFSMX.mjs';
1
+ export { createNarsilClient } from './browser/chunk-FBDTHGDR.mjs';
2
+ export { ClientErrorCodes, ErrorCodes, NarsilError, ServerErrorCodes, isNarsilError } from './browser/chunk-3PGIOK7Z.mjs';
3
3
 
4
4
  // src/server/capabilities.ts
5
5
  var ASYNC_IMPORT_CAPABILITY = "documents.import.async";
@@ -1,6 +1,6 @@
1
1
  import { P as PersistenceAdapter, I as InvalidationAdapter, E as EmbeddingAdapter, R as RerankAdapter } from './adapters-8LcdNB77.js';
2
- import { Q as QueryParams, t as QueryResult, u as NarsilEventHandlers } from './engine-DGG_yX0p.js';
3
- import { I as IndexConfig, A as AnyDocument } from './schema-CFnQ-WI3.js';
2
+ import { Q as QueryParams, t as QueryResult, u as NarsilEventHandlers } from './engine-DP4PrdKM.js';
3
+ import { I as IndexConfig, A as AnyDocument } from './schema-CPQUdJTs.js';
4
4
 
5
5
  /**
6
6
  * Hooks that the engine calls alongside its own work, so that an application
@@ -1,6 +1,6 @@
1
- import { N as NarsilConfig } from './config-BB4MRAsB.js';
1
+ import { N as NarsilConfig } from './config-DJFXyHMZ.js';
2
2
  import { P as PersistenceAdapter } from './adapters-8LcdNB77.js';
3
- import { A as AllocationConstraints, a as AllocationTable, N as NodeRole, b as NodeRegistration, C as ClusterCoordinator, c as NodeCapacity } from './index-fX_FbuRT.js';
3
+ import { A as AllocationConstraints, a as AllocationTable, N as NodeRole, b as NodeRegistration, C as ClusterCoordinator, c as NodeCapacity } from './index-CcivYH_R.js';
4
4
  import { N as NodeTransport } from './types-DvncmvuQ.js';
5
5
 
6
6
  /**
@@ -1,11 +1,11 @@
1
- export { createDirectExecutor } from './chunk-ZGGZXRGM.mjs';
1
+ export { createDirectExecutor } from './chunk-GYQKMYPG.mjs';
2
2
  import './chunk-2CKDCC65.mjs';
3
3
  import './chunk-BRTABNC7.mjs';
4
4
  import './chunk-Y7GXGJFZ.mjs';
5
5
  import './chunk-BUMREPLU.mjs';
6
6
  import './chunk-7T4LAYT4.mjs';
7
- import './chunk-4JLHHEBN.mjs';
8
- import './chunk-EY5U4P5V.mjs';
7
+ import './chunk-M5RYB6FE.mjs';
8
+ import './chunk-7NMLFP2T.mjs';
9
9
  import './chunk-U2BKYEC7.mjs';
10
10
  import './chunk-PSZEGK6W.mjs';
11
11
  import './chunk-5EI5CXO6.mjs';
@@ -1,5 +1,5 @@
1
- import { C as ClusterCoordinator } from '../../index-fX_FbuRT.js';
2
- import '../../schema-CFnQ-WI3.js';
1
+ import { C as ClusterCoordinator } from '../../index-CcivYH_R.js';
2
+ import '../../schema-CPQUdJTs.js';
3
3
  import '../../adapters-8LcdNB77.js';
4
4
  import '../../synonyms-CpOAHPa-.js';
5
5
 
@@ -1,7 +1,7 @@
1
1
  import { INDEX_METADATA_KEY_PREFIX, indexNameOfMetadataSuffix } from '../../chunk-Q2AP2FSN.mjs';
2
2
  import { MAX_NODE_ID_LENGTH, CONTROLLER_LEASE_KEY, MAX_WATCHERS } from '../../chunk-44W3CBNG.mjs';
3
3
  import { decode } from '../../chunk-Y7GXGJFZ.mjs';
4
- import '../../chunk-EY5U4P5V.mjs';
4
+ import '../../chunk-7NMLFP2T.mjs';
5
5
  import '../../chunk-ZXX5GZEX.mjs';
6
6
  import '../../chunk-4PY4JYMY.mjs';
7
7
  import { NarsilError, ErrorCodes, describeError } from '../../chunk-ZKOQR7EA.mjs';
@@ -594,7 +594,11 @@ function normaliseAssignments(entries) {
594
594
  const storedCommitPoint = candidate.commitPoint;
595
595
  const commitPoint = typeof storedCommitPoint === "number" && Number.isSafeInteger(storedCommitPoint) && storedCommitPoint >= 0 ? storedCommitPoint : 0;
596
596
  const lastHolders = normaliseLastHolders(candidate);
597
- const normalised = { ...assignment, commitPoint };
597
+ const normalised = {
598
+ ...assignment,
599
+ primary: candidate.primary ?? null,
600
+ commitPoint
601
+ };
598
602
  if (lastHolders.length > 0) {
599
603
  normalised.lastHolders = lastHolders;
600
604
  } else {
@@ -1,5 +1,5 @@
1
- import { C as ClusterCoordinator } from '../../index-fX_FbuRT.js';
2
- import '../../schema-CFnQ-WI3.js';
1
+ import { C as ClusterCoordinator } from '../../index-CcivYH_R.js';
2
+ import '../../schema-CPQUdJTs.js';
3
3
  import '../../adapters-8LcdNB77.js';
4
4
  import '../../synonyms-CpOAHPa-.js';
5
5
 
@@ -3,7 +3,7 @@ import { timeoutsOf, replyDeadlineMs } from '../../chunk-OIJ64LGT.mjs';
3
3
  import { MAX_MESSAGE_SIZE_BYTES, GRPC_KEEPALIVE_TIMEOUT_MS, GRPC_KEEPALIVE_TIME_MS, GRPC_ENVELOPE_OVERHEAD_BYTES } from '../../chunk-HZ3OAUTL.mjs';
4
4
  import { TransportError, TransportErrorCodes } from '../../chunk-5FLRXF73.mjs';
5
5
  import '../../chunk-Y7GXGJFZ.mjs';
6
- import '../../chunk-EY5U4P5V.mjs';
6
+ import '../../chunk-7NMLFP2T.mjs';
7
7
  import '../../chunk-ZXX5GZEX.mjs';
8
8
  import '../../chunk-4PY4JYMY.mjs';
9
9
  import { NarsilError, ErrorCodes } from '../../chunk-ZKOQR7EA.mjs';
@@ -3,7 +3,7 @@ import { timeoutsOf, replyDeadlineMs } from '../../chunk-OIJ64LGT.mjs';
3
3
  import { MAX_MESSAGE_SIZE_BYTES, UNADDRESSABLE_TARGET_DETAIL } from '../../chunk-HZ3OAUTL.mjs';
4
4
  import { TransportError, TransportErrorCodes } from '../../chunk-5FLRXF73.mjs';
5
5
  import '../../chunk-Y7GXGJFZ.mjs';
6
- import '../../chunk-EY5U4P5V.mjs';
6
+ import '../../chunk-7NMLFP2T.mjs';
7
7
  import '../../chunk-ZXX5GZEX.mjs';
8
8
  import '../../chunk-4PY4JYMY.mjs';
9
9
  import '../../chunk-ZKOQR7EA.mjs';
@@ -12,25 +12,30 @@ import { connect as connect$1, createServer as createServer$1 } from 'net';
12
12
  import { connect, createServer } from 'tls';
13
13
 
14
14
  // src/distribution/transport/tcp/parse-address.ts
15
- function parseAddress(address) {
15
+ function unaddressable(address, message) {
16
+ return new TransportError(TransportErrorCodes.CONNECT_FAILED, message, {
17
+ address,
18
+ [UNADDRESSABLE_TARGET_DETAIL]: true
19
+ });
20
+ }
21
+ function splitHostAndPort(address) {
22
+ if (address.startsWith("[")) {
23
+ const closing = address.indexOf("]:");
24
+ if (closing === -1) {
25
+ throw unaddressable(address, `Invalid address format '${address}', expected [IPv6 address]:port`);
26
+ }
27
+ return [address.slice(1, closing), address.slice(closing + 2)];
28
+ }
16
29
  const lastColon = address.lastIndexOf(":");
17
30
  if (lastColon === -1) {
18
- throw new TransportError(
19
- TransportErrorCodes.CONNECT_FAILED,
20
- `Invalid address format '${address}', expected host:port`,
21
- {
22
- address,
23
- [UNADDRESSABLE_TARGET_DETAIL]: true
24
- }
25
- );
31
+ throw unaddressable(address, `Invalid address format '${address}', expected host:port`);
26
32
  }
27
- const host = address.slice(0, lastColon);
28
- const port = address.slice(lastColon + 1);
29
- if (host.length === 0 || host.includes("\0")) {
30
- throw new TransportError(TransportErrorCodes.CONNECT_FAILED, `Invalid host in address '${address}'`, {
31
- address,
32
- [UNADDRESSABLE_TARGET_DETAIL]: true
33
- });
33
+ return [address.slice(0, lastColon), address.slice(lastColon + 1)];
34
+ }
35
+ function parseAddress(address) {
36
+ const [host, port] = splitHostAndPort(address);
37
+ if (host.length === 0 || host.includes("\0") || host.includes("[") || host.includes("]")) {
38
+ throw unaddressable(address, `Invalid host in address '${address}'`);
34
39
  }
35
40
  return [host, port];
36
41
  }
@@ -189,8 +194,8 @@ var TcpConnectionPool = class {
189
194
  socket.destroy();
190
195
  reject(
191
196
  new TransportError(
192
- TransportErrorCodes.TIMEOUT,
193
- `Connection to '${target}' timed out after ${this.config.connectTimeout}ms`,
197
+ TransportErrorCodes.CONNECT_FAILED,
198
+ `Failed to connect to '${target}': no connection was ready within ${this.config.connectTimeout}ms`,
194
199
  { target, timeoutMs: this.config.connectTimeout }
195
200
  )
196
201
  );
@@ -1,13 +1,13 @@
1
- import { c as CreateIndexOptions, C as ClusterNamespace, d as ClusterNodeConfig } from './config-XEHd4MFx.js';
2
- export { B as BackupListing, e as BackupOperationOptions, f as BackupProgress, a as BackupSummary, g as ClusterBackupConfig, h as ClusterControllerConfig, i as ClusterHealth, j as ClusterHealthStatus, k as ClusterMemoryConfig, l as ClusterMetrics, b as ClusterNodeInfo, m as ClusterQueryConfig, n as CommitPointFigure, o as CoordinatorRequestFigure, p as CreateBackupOptions, D as DamagedBackup, I as IndexHealth, N as NodeReadiness, P as PartitionReplicationFigure, R as ReplicaLagFigure, q as ReplicationConfig, r as RestoreBackupOptions, V as VectorRebuildWaitFigure } from './config-XEHd4MFx.js';
1
+ import { c as CreateIndexOptions, C as ClusterNamespace, d as ClusterNodeConfig } from './config-DlvP2PSi.js';
2
+ export { B as BackupListing, e as BackupOperationOptions, f as BackupProgress, a as BackupSummary, g as ClusterBackupConfig, h as ClusterControllerConfig, i as ClusterHealth, j as ClusterHealthStatus, k as ClusterMemoryConfig, l as ClusterMetrics, b as ClusterNodeInfo, m as ClusterQueryConfig, n as CommitPointFigure, o as CoordinatorRequestFigure, p as CreateBackupOptions, D as DamagedBackup, I as IndexHealth, N as NodeReadiness, P as PartitionReplicationFigure, R as ReplicaLagFigure, q as ReplicationConfig, r as RestoreBackupOptions, V as VectorRebuildWaitFigure } from './config-DlvP2PSi.js';
3
3
  import { R as RerankAdapter } from './adapters-8LcdNB77.js';
4
- import { g as ChangesSetting, h as ChangesStatus, F as FollowChangesOptions, d as ChangesEvent, p as SyncSetting, q as SyncStatus, B as BatchResult, L as ListParams, v as ListResult, w as SuggestParams, x as SuggestResult, Q as QueryParams, y as PreflightResult, I as IndexInfo, A as AnalysisChange, z as IndexStats, P as PartitionStatsResult, M as MemoryStats, D as NarsilEventMap, t as QueryResult, s as Narsil } from './engine-DGG_yX0p.js';
5
- import { B as BM25Params, I as IndexConfig, A as AnyDocument, a as InsertOptions } from './schema-CFnQ-WI3.js';
6
- import { c as NodeCapacity, N as NodeRole } from './index-fX_FbuRT.js';
7
- export { A as AllocationConstraints, e as AllocationEvent, a as AllocationTable, C as ClusterCoordinator, E as ExpectedReplicaRegistration, I as IndexMetadataEvent, f as IndexMetadataWatch, g as IndexPartitionBytes, h as NodeEvent, d as NodeMemoryReport, b as NodeRegistration, P as PartitionAssignment, i as PartitionState, R as RegistrationLease, S as SchemaEvent, U as UnassignedReason } from './index-fX_FbuRT.js';
4
+ import { g as ChangesSetting, h as ChangesStatus, F as FollowChangesOptions, d as ChangesEvent, p as SyncSetting, q as SyncStatus, B as BatchResult, L as ListParams, v as ListResult, w as SuggestParams, x as SuggestResult, Q as QueryParams, y as PreflightResult, I as IndexInfo, A as AnalysisChange, z as IndexStats, P as PartitionStatsResult, M as MemoryStats, G as NarsilEventMap, t as QueryResult, H as GetOptions, s as Narsil } from './engine-DP4PrdKM.js';
5
+ import { B as BM25Params, I as IndexConfig, A as AnyDocument, a as InsertOptions } from './schema-CPQUdJTs.js';
6
+ import { c as NodeCapacity, N as NodeRole } from './index-CcivYH_R.js';
7
+ export { A as AllocationConstraints, e as AllocationEvent, a as AllocationTable, C as ClusterCoordinator, E as ExpectedReplicaRegistration, I as IndexMetadataEvent, f as IndexMetadataWatch, g as IndexPartitionBytes, h as NodeEvent, d as NodeMemoryReport, b as NodeRegistration, P as PartitionAssignment, i as PartitionState, R as RegistrationLease, S as SchemaEvent, U as UnassignedReason } from './index-CcivYH_R.js';
8
8
  import { a as SynonymRule } from './synonyms-CpOAHPa-.js';
9
9
  export { L as ListenHandler, N as NodeTransport, R as RespondFn, T as TransportConfig, a as TransportMessage } from './types-DvncmvuQ.js';
10
- import './config-BB4MRAsB.js';
10
+ import './config-DJFXyHMZ.js';
11
11
  import './query-suggestions-CBYkrQ5T.js';
12
12
 
13
13
  /**
@@ -496,10 +496,13 @@ interface ClusterNode extends ClusterNodeSearchSettings, ClusterNodeSyncSettings
496
496
  *
497
497
  * @param indexName - The index holding the document.
498
498
  * @param docId - The document to read.
499
+ * @param options - The shape of the returned document. The read leaves
500
+ * vector fields out unless `document.vectors` is true, an `include` path
501
+ * equals the field's path, or the index sets `returnVectors`.
499
502
  * @returns The document, or `undefined` when the partition holds no
500
503
  * document under this id.
501
504
  */
502
- get(indexName: string, docId: string): Promise<AnyDocument | undefined>;
505
+ get(indexName: string, docId: string, options?: GetOptions): Promise<AnyDocument | undefined>;
503
506
  /**
504
507
  * Reads many documents, grouping the ids by the node that serves each
505
508
  * partition and fetching every group in one round trip.
@@ -509,10 +512,12 @@ interface ClusterNode extends ClusterNodeSearchSettings, ClusterNodeSyncSettings
509
512
  *
510
513
  * @param indexName - The index holding the documents.
511
514
  * @param docIds - The documents to read.
515
+ * @param options - The shape of each returned document, which follows the
516
+ * same rules as {@link ClusterNode.get}.
512
517
  * @returns The documents found, keyed by id; an id nothing is stored under
513
518
  * is absent.
514
519
  */
515
- getMultiple(indexName: string, docIds: string[]): Promise<Map<string, AnyDocument>>;
520
+ getMultiple(indexName: string, docIds: string[], options?: GetOptions): Promise<Map<string, AnyDocument>>;
516
521
  /**
517
522
  * Reports whether a document exists, reading through the same routing as
518
523
  * {@link ClusterNode.get}.