@delali/narsil 0.3.1-next.78 → 0.3.1-next.80

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 (48) hide show
  1. package/README.md +3 -3
  2. package/dist/{capabilities-1lEYL3WK.d.ts → capabilities-CcTDWh_P.d.ts} +2 -2
  3. package/dist/{chunk-AMGDG4ZJ.mjs → chunk-23HJ5QXQ.mjs} +1 -1
  4. package/dist/{chunk-R6WBLBTC.mjs → chunk-4QDQEJDV.mjs} +9 -45
  5. package/dist/chunk-DQABW5UQ.mjs +140 -0
  6. package/dist/chunk-GG2FBGVZ.mjs +30 -0
  7. package/dist/{chunk-XSZTF4ZQ.mjs → chunk-HJASKX4F.mjs} +1 -1
  8. package/dist/{chunk-DFW3U5UW.mjs → chunk-K4FZ55Q2.mjs} +21 -192
  9. package/dist/{chunk-PJWG547Z.mjs → chunk-MEOOYKWL.mjs} +3 -3
  10. package/dist/{chunk-55WEJKWT.mjs → chunk-NSXQCE4K.mjs} +17 -63
  11. package/dist/{chunk-PXDQFYD5.mjs → chunk-OSF3SGJV.mjs} +23 -139
  12. package/dist/{chunk-RTR44V2A.mjs → chunk-P2PYEZZE.mjs} +586 -4
  13. package/dist/{chunk-Z3BXCZXS.mjs → chunk-QPYV22XH.mjs} +2 -1
  14. package/dist/{chunk-4344I4MR.mjs → chunk-R2XCJIO7.mjs} +335 -12
  15. package/dist/{chunk-IBR6634K.mjs → chunk-R6A773WK.mjs} +2 -69
  16. package/dist/chunk-WQBCBKY3.mjs +8 -0
  17. package/dist/{chunk-P2BEMMOD.mjs → chunk-YGLSR7BC.mjs} +150 -203
  18. package/dist/chunk-YTJCGKM4.mjs +56 -0
  19. package/dist/{client-ZXcbSViH.d.ts → client-CsybN673.d.ts} +2 -2
  20. package/dist/client.d.ts +6 -6
  21. package/dist/{config-DTe5EbWW.d.ts → config-BCNQtszf.d.ts} +1 -1
  22. package/dist/{config-DHL2KsfD.d.ts → config-CFonR_gY.d.ts} +1 -1
  23. package/dist/direct-executor-VNMQ6NIH.mjs +19 -0
  24. package/dist/distribution/coordinator/etcd.mjs +2 -1
  25. package/dist/distribution/coordinator/in-memory.mjs +2 -1
  26. package/dist/distribution.d.ts +5 -5
  27. package/dist/distribution.mjs +15 -13
  28. package/dist/{engine-BjPBzWkA.d.ts → engine-B0oIF1_r.d.ts} +1 -1
  29. package/dist/index.browser.mjs +113 -516
  30. package/dist/index.d.ts +5 -5
  31. package/dist/index.mjs +14 -12
  32. package/dist/invalidation/filesystem.mjs +2 -1
  33. package/dist/{memory-DW3OJ0im.d.ts → memory-B6SBOKlS.d.ts} +1287 -1287
  34. package/dist/partial-words.mjs +5 -4
  35. package/dist/pattern.mjs +4 -1
  36. package/dist/persistence/durability/checkpoint-worker.d.ts +7 -7
  37. package/dist/persistence/durability/checkpoint-worker.mjs +14 -12
  38. package/dist/react.d.ts +6 -6
  39. package/dist/server.d.ts +8 -8
  40. package/dist/server.mjs +10 -7
  41. package/dist/{tasks-BTbwBqar.d.ts → tasks-CYAQe6qd.d.ts} +1 -1
  42. package/dist/{thread-XBDVXKUE.mjs → thread-P6QJ2Q5O.mjs} +11 -8
  43. package/dist/vector/search-worker.mjs +3 -2
  44. package/dist/workers/entry.mjs +3 -3
  45. package/package.json +9 -7
  46. package/dist/chunk-IOZPBNSG.mjs +0 -55
  47. package/dist/chunk-WFVOBZS4.mjs +0 -485
  48. package/dist/direct-executor-WB2HKU4N.mjs +0 -17
@@ -1,20 +1,139 @@
1
- import { MAX_FILTER_ARRAY_SIZE, GEO_UNIT_METRES, MAX_SORT_FIELDS, MAX_SORT_FIELD_NAME_LENGTH, MAX_CURSOR_LENGTH, MAX_CURSOR_ANCHOR_CODE_POINTS, RESULT_WINDOW, DEFAULT_FUZZY_PREFIX_LENGTH, MAX_FILTER_DEPTH, DEFAULT_PAGE_SIZE, MAX_FILTER_TESTS, PREFIX_MAX_EXPANSIONS, PARTIAL_WORD_MIN_CODE_POINTS, PARTIAL_WORDS_ADDED_PER_QUERY, FILTER_OPERAND_COPY_DEPTH } from './chunk-IOZPBNSG.mjs';
2
- import { PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, MAX_PATTERN_POSITIONS, isPatternTolerance, foldTypoText, typoRunsNeeded, distinctTypoRunCount, MAX_PATTERN_TEXT_CODE_POINTS, patternSearchModule, DEFAULT_PATTERN_WORK_CAP, bitsetIsEmpty, createBitSet, bitsetSet, PATTERN_WORK_FLUSH_UNITS, MATCHER_STATE_BUDGET_BYTES } from './chunk-4344I4MR.mjs';
3
- import { getFlatSchema, tokenize, getFieldValueByInternalId, getFieldValueForDoc } from './chunk-WFVOBZS4.mjs';
4
- import { parsedTypeOf, isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, schemaFieldsOf, flattenSchema, isStringValuedBase, withSortableOption, isGeopointOrVectorType, EARTH_RADIUS_METERS, RADIUS_BOX_MARGIN_RATIO, RADIUS_BOX_MARGIN_RADIANS, FULL_TURN_DEGREES, ANTIMERIDIAN_SPAN_DEGREES, PROTOTYPE_POLLUTION_KEYS, DEG_TO_RAD, LOCATION_CODE_BITS_PER_AXIS, isWordIndexedFieldType, partialFieldsOf, MAX_COVERING_CELLS } from './chunk-PXDQFYD5.mjs';
1
+ import { PATTERN_EXPRESSION_OPERATORS, PATTERN_TEST_OPERATORS, PATTERN_ELEMENT_OPERATORS, requireTextRangeField, isFiniteNumber, invalid, requireFieldKind, kindOfValue, requireListLength, isObjectRecord, patternSearchModule, DEFAULT_PATTERN_WORK_CAP, bitsetIsEmpty, createBitSet, bitsetSet, PATTERN_WORK_FLUSH_UNITS, MATCHER_STATE_BUDGET_BYTES } from './chunk-R2XCJIO7.mjs';
2
+ import { GEO_UNIT_METRES, MAX_FILTER_DEPTH, MAX_FILTER_TESTS, FILTER_OPERAND_COPY_DEPTH } from './chunk-WQBCBKY3.mjs';
3
+ import { getFlatSchema, tokenize, partialWordSearchModule, getFieldValueByInternalId, getFieldValueForDoc } from './chunk-P2PYEZZE.mjs';
4
+ import { isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, partialFieldsOf, schemaFieldsOf, flattenSchema, MAX_SORT_FIELDS, MAX_SORT_FIELD_NAME_LENGTH, MAX_CURSOR_LENGTH, MAX_CURSOR_ANCHOR_CODE_POINTS, RESULT_WINDOW, DEFAULT_FUZZY_PREFIX_LENGTH, EARTH_RADIUS_METERS, RADIUS_BOX_MARGIN_RATIO, RADIUS_BOX_MARGIN_RADIANS, FULL_TURN_DEGREES, ANTIMERIDIAN_SPAN_DEGREES, DEFAULT_PAGE_SIZE, DEG_TO_RAD, LOCATION_CODE_BITS_PER_AXIS, PREFIX_MAX_EXPANSIONS, MAX_COVERING_CELLS } from './chunk-OSF3SGJV.mjs';
5
5
  import { fuzzyTermMatches } from './chunk-GES7U2PM.mjs';
6
- import { appendFoldedCodePoint, foldedCodePointCount, exceedsCodePoints, singleFoldTable, compareCodePoints, sortModeOf, defaultSortMode, SORT_VALUE_MAX_CODE_POINTS, toReducedSortValue, readSortField, compareComparableKeys, toComparableSortValue, isSortMode, SORT_MODES, compareSortValues, codePointCount, holdsUnpairedSurrogate } from './chunk-IBR6634K.mjs';
6
+ import { parsedTypeOf, isStringValuedBase, withSortableOption, isGeopointOrVectorType, PROTOTYPE_POLLUTION_KEYS, isWordIndexedFieldType } from './chunk-DQABW5UQ.mjs';
7
+ import { singleFoldTable, appendFoldedCodePoint, sortModeOf, defaultSortMode, SORT_VALUE_MAX_CODE_POINTS, toReducedSortValue, readSortField, compareComparableKeys, toComparableSortValue, isSortMode, SORT_MODES, compareSortValues } from './chunk-R6A773WK.mjs';
8
+ import { compareCodePoints, exceedsCodePoints, codePointCount, holdsUnpairedSurrogate } from './chunk-YTJCGKM4.mjs';
7
9
  import { NarsilError, ErrorCodes } from './chunk-I64LXKO3.mjs';
8
10
 
11
+ // src/core/partition/partial-words/platform.ts
12
+ function platformPartialWordSearch() {
13
+ return partialWordSearchModule;
14
+ }
15
+
16
+ // src/core/partition/partial-words/registry.ts
17
+ var registered = null;
18
+ var MODULE_FUNCTIONS = [
19
+ "createGrowingSlot",
20
+ "createFrozenSlot",
21
+ "buildTable",
22
+ "expand",
23
+ "countSpelling",
24
+ "encodeSpellings",
25
+ "spellingCountsOf",
26
+ "highlightMatcher",
27
+ "addTermMembers",
28
+ "highlightWords"
29
+ ];
30
+ function isPartialWordSearchModule(value) {
31
+ if (value === null || typeof value !== "object" || value.name !== "partialWords") return false;
32
+ return MODULE_FUNCTIONS.every((name) => typeof Reflect.get(value, name) === "function");
33
+ }
34
+ function registerPartialWordSearch(module) {
35
+ if (!isPartialWordSearchModule(module)) {
36
+ throw new NarsilError(
37
+ ErrorCodes.CONFIG_INVALID,
38
+ 'Pass registerPartialWordSearch the partialWordSearch object that "@delali/narsil/partial-words" exports'
39
+ );
40
+ }
41
+ registered = module;
42
+ }
43
+ function availablePartialWordSearch() {
44
+ return registered ?? platformPartialWordSearch();
45
+ }
46
+ var PARTIAL_WORD_IMPORT_ADVICE = `Add import { partialWordSearch } from '@delali/narsil/partial-words', then call registerPartialWordSearch(partialWordSearch) before you create or load an index with a partial field`;
47
+ function partialWordModule() {
48
+ const module = availablePartialWordSearch();
49
+ if (module !== null) return module;
50
+ throw new NarsilError(
51
+ ErrorCodes.CONFIG_INVALID,
52
+ `This bundle contains no partial-word search code. ${PARTIAL_WORD_IMPORT_ADVICE}`
53
+ );
54
+ }
55
+ function requirePartialWordSearchFor(schema) {
56
+ const fields = partialFieldsOf(schema);
57
+ if (fields.length === 0 || availablePartialWordSearch() !== null) return;
58
+ throw new NarsilError(
59
+ ErrorCodes.CONFIG_INVALID,
60
+ `The type of field "${fields[0]}" includes "partial", but this bundle contains no partial-word search code. ${PARTIAL_WORD_IMPORT_ADVICE}`,
61
+ { field: fields[0] }
62
+ );
63
+ }
64
+ var EMPTY_GROWING_SLOT = {
65
+ readerFor: () => null,
66
+ spellings: () => null,
67
+ bytes: () => 0,
68
+ afterDocument: () => void 0,
69
+ afterMerge: () => void 0,
70
+ forgetSpellings: () => void 0,
71
+ clear: () => void 0
72
+ };
73
+ var EMPTY_FROZEN_SLOT = {
74
+ readerFor: () => null,
75
+ spellings: () => null,
76
+ bytes: () => 0,
77
+ afterRemoval: () => void 0,
78
+ tableOfEveryDocument: () => null,
79
+ countKeptSpellings: () => void 0
80
+ };
81
+ function createGrowingPartialWords(view) {
82
+ return availablePartialWordSearch()?.createGrowingSlot(view) ?? EMPTY_GROWING_SLOT;
83
+ }
84
+ function createFrozenPartialWords(initial, tokenTable, documents) {
85
+ return availablePartialWordSearch()?.createFrozenSlot(initial, tokenTable, documents) ?? EMPTY_FROZEN_SLOT;
86
+ }
87
+ function buildPartialWordTableFrom(source, tokenTable) {
88
+ return availablePartialWordSearch()?.buildTable(source, tokenTable) ?? null;
89
+ }
90
+ function expandPartialWords(subs, analysis, requests) {
91
+ const module = availablePartialWordSearch();
92
+ return module === null ? requests.map(() => []) : module.expand(subs, analysis, requests);
93
+ }
94
+ function countPartialSpelling(counts, token, spelling, change) {
95
+ partialWordModule().countSpelling(counts, token, spelling, change);
96
+ }
97
+ function encodePartialSpellingsOf(fields, counts) {
98
+ return partialWordModule().encodeSpellings(fields, counts);
99
+ }
100
+ function partialSpellingsOfDocuments(documents, analysis) {
101
+ const module = partialWordModule();
102
+ return module.encodeSpellings(analysis.fields, module.spellingCountsOf(documents, analysis));
103
+ }
104
+ function partialWordHighlighter(text, language, partial) {
105
+ return partialWordModule().highlightMatcher(text, language, partial);
106
+ }
107
+ function addPartialWordMembers(query, expand, groupOf) {
108
+ partialWordModule().addTermMembers(query, expand, groupOf);
109
+ }
110
+ function partialWordsToHighlight(queryTokens, written) {
111
+ return partialWordModule().highlightWords(queryTokens, written);
112
+ }
113
+
9
114
  // src/core/pattern-index/platform.ts
10
115
  function platformPatternSearch() {
11
116
  return patternSearchModule;
12
117
  }
13
118
 
14
119
  // src/core/pattern-index/registry.ts
15
- var registered = null;
120
+ var registered2 = null;
121
+ var MODULE_FUNCTIONS2 = [
122
+ "createIndex",
123
+ "readArrays",
124
+ "mergeArrays",
125
+ "matchInto",
126
+ "checkExpression",
127
+ "expressionFootprint",
128
+ "largestFootprint",
129
+ "checkOperands",
130
+ "evaluateTests",
131
+ "serializeIndex",
132
+ "decodeIndex"
133
+ ];
16
134
  function isPatternSearchModule(value) {
17
- return value !== null && typeof value === "object" && value.name === "pattern" && "createIndex" in value && typeof value.createIndex === "function" && "readArrays" in value && typeof value.readArrays === "function" && "mergeArrays" in value && typeof value.mergeArrays === "function" && "matchInto" in value && typeof value.matchInto === "function" && "checkExpression" in value && typeof value.checkExpression === "function" && "expressionFootprint" in value && typeof value.expressionFootprint === "function";
135
+ if (value === null || typeof value !== "object" || value.name !== "pattern") return false;
136
+ return MODULE_FUNCTIONS2.every((name) => typeof Reflect.get(value, name) === "function");
18
137
  }
19
138
  function registerPatternSearch(module) {
20
139
  if (!isPatternSearchModule(module)) {
@@ -23,10 +142,10 @@ function registerPatternSearch(module) {
23
142
  'registerPatternSearch takes the patternSearch object that "@delali/narsil/pattern" exports'
24
143
  );
25
144
  }
26
- registered = module;
145
+ registered2 = module;
27
146
  }
28
147
  function availablePatternSearch() {
29
- return registered ?? platformPatternSearch();
148
+ return registered2 ?? platformPatternSearch();
30
149
  }
31
150
  function requirePatternSearchFor(schema) {
32
151
  for (const { path, pattern } of schemaFieldsOf(schema)) {
@@ -597,58 +716,6 @@ var FIELD_FILTER_OPERATORS = [
597
716
  "polygon"
598
717
  ];
599
718
 
600
- // src/filters/operands/checks.ts
601
- function operandKindOf(type) {
602
- if (type === void 0) return void 0;
603
- if (type === "number" || type === "number[]") return "number";
604
- if (type === "boolean" || type === "boolean[]") return "boolean";
605
- if (type === "geopoint") return "geopoint";
606
- if (type.startsWith("vector[")) return "vector";
607
- return "text";
608
- }
609
- function isFiniteNumber(value) {
610
- return typeof value === "number" && Number.isFinite(value);
611
- }
612
- function kindOfValue(value) {
613
- if (isFiniteNumber(value)) return "number";
614
- if (typeof value === "boolean") return "boolean";
615
- if (typeof value === "string") return "text";
616
- return void 0;
617
- }
618
- function isObjectRecord(value) {
619
- return value !== null && typeof value === "object" && !Array.isArray(value);
620
- }
621
- function invalid(message, fieldPath, operator) {
622
- throw new NarsilError(ErrorCodes.SEARCH_INVALID_FILTER, message, { fieldPath, operator });
623
- }
624
- function requireFieldKind(fieldPath, operator, type, accepted) {
625
- const kind = operandKindOf(type);
626
- if (kind === void 0 || accepted.includes(kind)) return;
627
- invalid(
628
- `The engine applies "${operator}" to ${accepted.join(" or ")} fields alone, and the schema declares field "${fieldPath}" as "${type}"`,
629
- fieldPath,
630
- operator
631
- );
632
- }
633
- function requireTextRangeField(fieldPath, operator, type) {
634
- const parsed = parsedTypeOf(type);
635
- if (parsed?.sortable && (parsed.base === "string" || parsed.base === "verbatim")) return;
636
- const declared = type === void 0 ? `the schema has no field "${fieldPath}"` : `field "${fieldPath}" has type "${type}"`;
637
- invalid(
638
- `The engine applies "${operator}" with a text bound to a "string" or "verbatim" field whose type includes "sortable", but ${declared}`,
639
- fieldPath,
640
- operator
641
- );
642
- }
643
- function requireListLength(fieldPath, operator, values) {
644
- if (values.length <= MAX_FILTER_ARRAY_SIZE) return;
645
- invalid(
646
- `"${operator}" on field "${fieldPath}" holds ${values.length} values, while a filter list holds at most ${MAX_FILTER_ARRAY_SIZE}`,
647
- fieldPath,
648
- operator
649
- );
650
- }
651
-
652
719
  // src/geo/cells.ts
653
720
  var AXIS_CELLS = 2 ** LOCATION_CODE_BITS_PER_AXIS;
654
721
  function axisCell(value, lowest, span) {
@@ -1028,24 +1095,7 @@ function requireSizeOperands(fieldPath, filter, type) {
1028
1095
  }
1029
1096
 
1030
1097
  // src/core/pattern-index/host.ts
1031
- var NO_SOURCES = [];
1032
- var foldSources = null;
1033
- function sourcesByFold() {
1034
- if (foldSources !== null) return foldSources;
1035
- const sources = /* @__PURE__ */ new Map();
1036
- const add = (source, folded) => {
1037
- const known = sources.get(folded);
1038
- if (known === void 0) sources.set(folded, [source]);
1039
- else known.push(source);
1040
- };
1041
- for (const [source, folded] of singleFoldTable()) add(source, folded);
1042
- foldSources = sources;
1043
- return sources;
1044
- }
1045
- function singleFoldSources(folded) {
1046
- return sourcesByFold().get(folded) ?? NO_SOURCES;
1047
- }
1048
- var PATTERN_HOST = { appendFoldedCodePoint, singleFoldSources };
1098
+ var PATTERN_HOST = { appendFoldedCodePoint, singleFolds: singleFoldTable };
1049
1099
  function patternIndexOf(indexes, fieldPath) {
1050
1100
  let index = indexes.get(fieldPath);
1051
1101
  if (index === void 0) {
@@ -1065,50 +1115,14 @@ function requirePatternField(fieldPath, operator, type) {
1065
1115
  operator
1066
1116
  );
1067
1117
  }
1068
- function requireTextLength(fieldPath, operator, text) {
1069
- if (!exceedsCodePoints(text, MAX_PATTERN_TEXT_CODE_POINTS)) return;
1070
- invalid(
1071
- `The text of "${operator}" on pattern field "${fieldPath}" holds more than ${MAX_PATTERN_TEXT_CODE_POINTS} code points`,
1072
- fieldPath,
1073
- operator
1074
- );
1075
- }
1076
- function requirePatternText(fieldPath, operator, text, caseFold) {
1077
- requireTextLength(fieldPath, operator, text);
1078
- if (caseFold && foldedCodePointCount(text) > MAX_PATTERN_POSITIONS) {
1079
- invalid(
1080
- `The text of "${operator}" on pattern field "${fieldPath}" has a case fold of more than ${MAX_PATTERN_POSITIONS} code points, while a pattern holds at most ${MAX_PATTERN_POSITIONS} positions`,
1081
- fieldPath,
1082
- operator
1083
- );
1084
- }
1085
- }
1086
- var ELEMENT_OPERATORS2 = ["matchesAny", "containsAll"];
1087
1118
  var PATTERN_OPERAND_KEYS = [
1088
1119
  "contains",
1089
1120
  "caseFold",
1090
1121
  "tolerance",
1091
1122
  ...PATTERN_EXPRESSION_OPERATORS,
1092
1123
  ...PATTERN_TEST_OPERATORS,
1093
- ...ELEMENT_OPERATORS2
1124
+ ...PATTERN_ELEMENT_OPERATORS
1094
1125
  ];
1095
- function requireExpressions(fieldPath, filter, type) {
1096
- for (const operator of PATTERN_EXPRESSION_OPERATORS) {
1097
- const pattern = filter[operator];
1098
- if (pattern === void 0) continue;
1099
- if (typeof pattern !== "string")
1100
- invalid(`"${operator}" on field "${fieldPath}" must be a string`, fieldPath, operator);
1101
- requirePatternField(fieldPath, operator, type);
1102
- requireTextLength(fieldPath, operator, pattern);
1103
- requirePatternSearch(fieldPath).checkExpression(
1104
- operator,
1105
- pattern,
1106
- filter.caseFold === true,
1107
- fieldPath,
1108
- PATTERN_HOST
1109
- );
1110
- }
1111
- }
1112
1126
  function requirePatternOperands(fieldPath, filter, type) {
1113
1127
  if (filter.contains !== void 0) {
1114
1128
  if (typeof filter.contains !== "string") {
@@ -1122,50 +1136,16 @@ function requirePatternOperands(fieldPath, filter, type) {
1122
1136
  }
1123
1137
  requirePatternField(fieldPath, "caseFold", type);
1124
1138
  }
1125
- requireExpressions(fieldPath, filter, type);
1139
+ for (const operator of PATTERN_EXPRESSION_OPERATORS) {
1140
+ const pattern = filter[operator];
1141
+ if (pattern === void 0) continue;
1142
+ if (typeof pattern !== "string")
1143
+ invalid(`"${operator}" on field "${fieldPath}" must be a string`, fieldPath, operator);
1144
+ requirePatternField(fieldPath, operator, type);
1145
+ }
1126
1146
  if (filter.tolerance !== void 0) requirePatternField(fieldPath, "tolerance", type);
1127
1147
  if (parsedTypeOf(type)?.pattern !== true) return;
1128
- const caseFold = filter.caseFold === true;
1129
- for (const operator of PATTERN_TEST_OPERATORS) {
1130
- const operand = filter[operator];
1131
- if (typeof operand === "string") requirePatternText(fieldPath, operator, operand, caseFold);
1132
- if (!Array.isArray(operand)) continue;
1133
- for (const text of operand) {
1134
- if (typeof text === "string") requirePatternText(fieldPath, operator, text, caseFold);
1135
- }
1136
- }
1137
- for (const operator of ELEMENT_OPERATORS2) {
1138
- const operand = filter[operator];
1139
- if (!Array.isArray(operand)) continue;
1140
- for (const text of operand) {
1141
- if (typeof text === "string") requirePatternText(fieldPath, operator, text, false);
1142
- }
1143
- }
1144
- requireTolerance(fieldPath, filter);
1145
- }
1146
- function requireTolerance(fieldPath, filter) {
1147
- const { tolerance, eq } = filter;
1148
- if (tolerance === void 0) return;
1149
- if (!isPatternTolerance(tolerance)) {
1150
- invalid(`"tolerance" on field "${fieldPath}" must be 0, 1, 2, or "auto"`, fieldPath, "tolerance");
1151
- }
1152
- if (typeof eq !== "string") {
1153
- invalid(
1154
- `"tolerance" applies only to an "eq" test, while the filter on field "${fieldPath}" sets no "eq" with text`,
1155
- fieldPath,
1156
- "tolerance"
1157
- );
1158
- }
1159
- if (tolerance === 0 || tolerance === "auto") return;
1160
- const text = foldTypoText(eq, PATTERN_HOST);
1161
- const requiredRuns = typoRunsNeeded(tolerance, text.longestFold);
1162
- const distinctRuns = distinctTypoRunCount(text, requiredRuns);
1163
- if (distinctRuns >= requiredRuns) return;
1164
- throw new NarsilError(
1165
- ErrorCodes.SEARCH_INVALID_FILTER,
1166
- `A tolerance of ${tolerance} on "eq" of pattern field "${fieldPath}" needs ${requiredRuns} distinct runs of three code points in the case fold of the text, while the text holds ${distinctRuns}. Lengthen the text, lower the tolerance, or set it to "auto"`,
1167
- { fieldPath, operator: "tolerance", requiredRuns, distinctRuns }
1168
- );
1148
+ requirePatternSearch(fieldPath).checkOperands(fieldPath, filter, PATTERN_HOST);
1169
1149
  }
1170
1150
  function requireWellFormedOperand(fieldPath, operator, text) {
1171
1151
  if (typeof text !== "string" || !holdsUnpairedSurrogate(text)) return;
@@ -1751,18 +1731,6 @@ function addCompletions(groups, partition, lastToken, typedPrefix) {
1751
1731
  group.members.push({ token: completion, factor, partialFactor: factor });
1752
1732
  }
1753
1733
  }
1754
- function addPartialWords(group, added) {
1755
- const membersByToken = /* @__PURE__ */ new Map();
1756
- for (const member of group.members) membersByToken.set(member.token, member);
1757
- for (const word of added) {
1758
- const member = membersByToken.get(word.token);
1759
- if (member === void 0) {
1760
- group.members.push({ token: word.token, factor: 0, partialFactor: word.factor });
1761
- } else if (word.factor > member.partialFactor) {
1762
- member.partialFactor = word.factor;
1763
- }
1764
- }
1765
- }
1766
1734
  function partialWordAnalysisOf(fields, language, analysis) {
1767
1735
  return {
1768
1736
  fields,
@@ -1781,29 +1749,6 @@ function searchesAPartialField(params, partialFields) {
1781
1749
  }
1782
1750
  return false;
1783
1751
  }
1784
- function partialWordRequests(params, queryTokens, written, prefixToken) {
1785
- const eligible = [];
1786
- for (const queryToken of queryTokens) {
1787
- const word = written.get(queryToken.position);
1788
- if (word === void 0 || codePointCount(word) < PARTIAL_WORD_MIN_CODE_POINTS) continue;
1789
- eligible.push({ token: queryToken.token, written: word });
1790
- if (eligible.length === PARTIAL_WORDS_ADDED_PER_QUERY) break;
1791
- }
1792
- const count = eligible.length;
1793
- if (count === 0) return [];
1794
- const evenShare = Math.floor(PARTIAL_WORDS_ADDED_PER_QUERY / count);
1795
- const remainder = PARTIAL_WORDS_ADDED_PER_QUERY % count;
1796
- return eligible.map((entry, order) => ({
1797
- token: entry.token,
1798
- request: {
1799
- written: entry.written,
1800
- ownToken: entry.token,
1801
- share: evenShare + (order < remainder ? 1 : 0),
1802
- tolerance: entry.token === prefixToken ? 0 : params.tolerance ?? 0,
1803
- prefixLength: params.prefixLength ?? DEFAULT_FUZZY_PREFIX_LENGTH
1804
- }
1805
- }));
1806
- }
1807
1752
  function resolveTermGroups(partition, params, language, schema, queryTokens, lastToken, analysis) {
1808
1753
  const term = params.term;
1809
1754
  if (term === void 0 || params.exact === true) return {};
@@ -1816,16 +1761,18 @@ function resolveTermGroups(partition, params, language, schema, queryTokens, las
1816
1761
  if (usesPrefix) addCompletions(groups, partition, lastToken, written.get(lastToken.position));
1817
1762
  const prefixToken = groups.has(lastToken.token) ? lastToken.token : void 0;
1818
1763
  if (usesPartialWords) {
1819
- const requests = partialWordRequests(params, queryTokens, written, prefixToken);
1820
- const added = partition.expandPartialWords(
1821
- partialWordAnalysisOf(partialFields, language, analysis),
1822
- requests.map((entry) => entry.request)
1764
+ addPartialWordMembers(
1765
+ {
1766
+ queryTokens,
1767
+ written,
1768
+ prefixToken,
1769
+ tolerance: params.tolerance ?? 0,
1770
+ prefixLength: params.prefixLength,
1771
+ analysis: partialWordAnalysisOf(partialFields, language, analysis)
1772
+ },
1773
+ (partialAnalysis, requests) => partition.expandPartialWords(partialAnalysis, requests),
1774
+ (token, typoMatches) => groupFor(groups, token, typoMatches)
1823
1775
  );
1824
- for (let at = 0; at < requests.length; at++) {
1825
- if (added[at].length === 0) continue;
1826
- const token = requests[at].token;
1827
- addPartialWords(groupFor(groups, token, token !== prefixToken), added[at]);
1828
- }
1829
1776
  }
1830
1777
  const termGroups = [...groups.values()];
1831
1778
  if (termGroups.length === 0) return {};
@@ -2320,4 +2267,4 @@ function setNestedValue(obj, path, value) {
2320
2267
  current[segments[segments.length - 1]] = value;
2321
2268
  }
2322
2269
 
2323
- export { FIELD_FILTER_OPERATORS, FILTER_EXPRESSION_KEYS, PATTERN_HOST, applyPagination, applyProjection, applySorting, availablePatternSearch, clampRowCount, cloneProjected, collectQueryTermStats, computeFacets, countsWithoutScores, coveringRanges, createPatternWorkMeter, decodePageCursor, encodePageCursor, everyValueFacetConfig, fanOutMatchCount, fanOutQuery, filterTestCount, fnv1a, fnv1aBytes, fnv1aUint32s, fulltextMatches, joinPatternWorkMeter, kWayMerge, locationCode, mergeFacets, mergePartitionStats, normalizeSort, oversampledFacetConfig, oversampledShardSize, partitionsIn, patternIndexOf, polygonBoxes, polygonContainment, projectionKeepsField, pruneStatsToQueryTerms, radiusBoxes, readSortValues, registerPatternSearch, requireMatchingCursor, requirePatternSearch, requirePatternSearchFor, requireSortableFields, requireWithinResultWindow, resolveProjection, sanitizeGlobalStats, setNestedValue, sortModesOf, sortSignatureEntry, sortSignatureOf, undeclaredFieldOnStrictIndex, undeclaredFilterField, validatedFilterOf };
2270
+ export { FIELD_FILTER_OPERATORS, FILTER_EXPRESSION_KEYS, PATTERN_HOST, applyPagination, applyProjection, applySorting, availablePatternSearch, buildPartialWordTableFrom, clampRowCount, cloneProjected, collectQueryTermStats, computeFacets, countPartialSpelling, countsWithoutScores, coveringRanges, createFrozenPartialWords, createGrowingPartialWords, createPatternWorkMeter, decodePageCursor, encodePageCursor, encodePartialSpellingsOf, everyValueFacetConfig, expandPartialWords, fanOutMatchCount, fanOutQuery, filterTestCount, fnv1a, fnv1aBytes, fnv1aUint32s, fulltextMatches, joinPatternWorkMeter, kWayMerge, locationCode, mergeFacets, mergePartitionStats, normalizeSort, oversampledFacetConfig, oversampledShardSize, partialSpellingsOfDocuments, partialWordHighlighter, partialWordsToHighlight, partitionsIn, patternIndexOf, polygonBoxes, polygonContainment, projectionKeepsField, pruneStatsToQueryTerms, radiusBoxes, readSortValues, registerPartialWordSearch, registerPatternSearch, requireMatchingCursor, requirePartialWordSearchFor, requirePatternSearch, requirePatternSearchFor, requireSortableFields, requireWithinResultWindow, resolveProjection, sanitizeGlobalStats, setNestedValue, sortModesOf, sortSignatureEntry, sortSignatureOf, undeclaredFieldOnStrictIndex, undeclaredFilterField, validatedFilterOf };
@@ -0,0 +1,56 @@
1
+ // src/core/ordering/code-points.ts
2
+ function exceedsCodePoints(value, maximum) {
3
+ if (value.length <= maximum) return false;
4
+ let counted = 0;
5
+ let i = 0;
6
+ while (i < value.length) {
7
+ const unit = value.charCodeAt(i);
8
+ if (unit >= 55296 && unit < 56320 && i + 1 < value.length) {
9
+ const low = value.charCodeAt(i + 1);
10
+ if (low >= 56320 && low < 57344) i++;
11
+ }
12
+ i++;
13
+ counted++;
14
+ if (counted > maximum) return true;
15
+ }
16
+ return false;
17
+ }
18
+ var SURROGATE_UNIT = /[\ud800-\udfff]/;
19
+ function holdsUnpairedSurrogate(value) {
20
+ if (!SURROGATE_UNIT.test(value)) return false;
21
+ for (let i = 0; i < value.length; i++) {
22
+ const unit = value.charCodeAt(i);
23
+ if (unit < 55296 || unit >= 57344) continue;
24
+ if (unit >= 56320) return true;
25
+ const low = value.charCodeAt(i + 1);
26
+ if (!(low >= 56320 && low < 57344)) return true;
27
+ i++;
28
+ }
29
+ return false;
30
+ }
31
+ function codePointCount(value) {
32
+ let counted = 0;
33
+ for (let i = 0; i < value.length; i++) {
34
+ const unit = value.charCodeAt(i);
35
+ if (unit >= 55296 && unit < 56320 && i + 1 < value.length) {
36
+ const low = value.charCodeAt(i + 1);
37
+ if (low >= 56320 && low < 57344) i++;
38
+ }
39
+ counted++;
40
+ }
41
+ return counted;
42
+ }
43
+ function adjustUtf16Unit(unit) {
44
+ if (unit < 55296) return unit;
45
+ if (unit < 57344) return unit + 8192;
46
+ return unit - 2048;
47
+ }
48
+ function compareCodePoints(a, b) {
49
+ const shorter = a.length < b.length ? a.length : b.length;
50
+ let i = 0;
51
+ while (i < shorter && a.charCodeAt(i) === b.charCodeAt(i)) i++;
52
+ if (i === shorter) return a.length - b.length;
53
+ return adjustUtf16Unit(a.charCodeAt(i)) - adjustUtf16Unit(b.charCodeAt(i));
54
+ }
55
+
56
+ export { codePointCount, compareCodePoints, exceedsCodePoints, holdsUnpairedSurrogate };
@@ -1,6 +1,6 @@
1
1
  import { P as PartitionConfig, A as AnyDocument, a as InsertOptions, W as WriteOptions } from './schema-DgyDijhf.js';
2
- import { V as VectorMaintenanceResult, B as BatchResult, L as ListParams, h as ListResult, I as IndexInfo, g as IndexStats, P as PartitionStatsResult, Q as QueryParams, e as QueryResult, j as PreflightResult, k as SuggestParams, l as SuggestResult } from './memory-DW3OJ0im.js';
3
- import { e as TaskRecord, M as MemoryStatsResponse, b as ImportResult, H as HttpIndexConfig, c as TaskListQuery, T as TaskListPage } from './tasks-BTbwBqar.js';
2
+ import { V as VectorMaintenanceResult, B as BatchResult, L as ListParams, h as ListResult, I as IndexInfo, g as IndexStats, P as PartitionStatsResult, Q as QueryParams, e as QueryResult, j as PreflightResult, k as SuggestParams, l as SuggestResult } from './memory-B6SBOKlS.js';
3
+ import { e as TaskRecord, M as MemoryStatsResponse, b as ImportResult, H as HttpIndexConfig, c as TaskListQuery, T as TaskListPage } from './tasks-CYAQe6qd.js';
4
4
 
5
5
  /**
6
6
  * This is the `fetch` implementation the client sends every request through.
package/dist/client.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, N as NarsilError, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes, i as isNarsilError } from './memory-DW3OJ0im.js';
2
- export { A as ASYNC_IMPORT_CAPABILITY, D as DOCUMENT_EXPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, R as REBUILD_ANALYSIS_CAPABILITY, S as SERVER_CAPABILITIES, T as TASK_CANCEL_CAPABILITY, a as TASK_FILTER_CAPABILITY } from './capabilities-1lEYL3WK.js';
3
- export { C as CapabilitiesResponse, a as CreateIndexEmbedding, H as HttpIndexConfig, I as ImportError, b as ImportResult, M as MemoryStatsResponse, T as TaskListPage, c as TaskListQuery, d as TaskProgress, e as TaskRecord, f as TaskStatus, g as TaskType } from './tasks-BTbwBqar.js';
4
- export { A as AdminOperations, B as BulkOperations, D as DocumentOperations, F as FetchFunction, I as ImportSource, a as IndexOperations, N as NarsilClient, b as NarsilClientOptions, P as PutResult, R as RequestOptions, S as SearchOperations, c as ServerOperations, d as ServerVersion, T as TaskOperations, W as WaitForTaskOptions, e as createNarsilClient } from './client-ZXcbSViH.js';
1
+ export { C as ClientErrorCode, a as ClientErrorCodes, E as ErrorCode, b as ErrorCodes, N as NarsilError, c as NarsilErrorCode, S as ServerErrorCode, d as ServerErrorCodes, i as isNarsilError } from './memory-B6SBOKlS.js';
2
+ export { A as ASYNC_IMPORT_CAPABILITY, D as DOCUMENT_EXPORT_CAPABILITY, E as ErrorEnvelope, I as INDEX_LIFECYCLE_CAPABILITY, R as REBUILD_ANALYSIS_CAPABILITY, S as SERVER_CAPABILITIES, T as TASK_CANCEL_CAPABILITY, a as TASK_FILTER_CAPABILITY } from './capabilities-CcTDWh_P.js';
3
+ export { C as CapabilitiesResponse, a as CreateIndexEmbedding, H as HttpIndexConfig, I as ImportError, b as ImportResult, M as MemoryStatsResponse, T as TaskListPage, c as TaskListQuery, d as TaskProgress, e as TaskRecord, f as TaskStatus, g as TaskType } from './tasks-CYAQe6qd.js';
4
+ export { A as AdminOperations, B as BulkOperations, D as DocumentOperations, F as FetchFunction, I as ImportSource, a as IndexOperations, N as NarsilClient, b as NarsilClientOptions, P as PutResult, R as RequestOptions, S as SearchOperations, c as ServerOperations, d as ServerVersion, T as TaskOperations, W as WaitForTaskOptions, e as createNarsilClient } from './client-CsybN673.js';
5
5
  import './schema-DgyDijhf.js';
6
6
  import './adapters-79OIa4xm.js';
7
- import './config-DHL2KsfD.js';
8
- import './config-DTe5EbWW.js';
7
+ import './config-CFonR_gY.js';
8
+ import './config-BCNQtszf.js';
9
9
  import './types-ChrVy4lH.js';
10
10
  import './types-Cb9kiY5P.js';
@@ -1,5 +1,5 @@
1
1
  import { P as PersistenceAdapter, I as InvalidationAdapter, E as EmbeddingAdapter } from './adapters-79OIa4xm.js';
2
- import { Q as QueryParams, e as QueryResult, f as NarsilEventHandlers } from './memory-DW3OJ0im.js';
2
+ import { Q as QueryParams, e as QueryResult, f as NarsilEventHandlers } from './memory-B6SBOKlS.js';
3
3
  import { I as IndexConfig, A as AnyDocument } from './schema-DgyDijhf.js';
4
4
 
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { N as NarsilConfig } from './config-DTe5EbWW.js';
1
+ import { N as NarsilConfig } from './config-BCNQtszf.js';
2
2
  import { A as AllocationTable, N as NodeRole, a as NodeRegistration, C as ClusterCoordinator, b as NodeCapacity } from './types-ChrVy4lH.js';
3
3
  import { N as NodeTransport } from './types-Cb9kiY5P.js';
4
4
 
@@ -0,0 +1,19 @@
1
+ export { createDirectExecutor } from './chunk-K4FZ55Q2.mjs';
2
+ import './chunk-YGLSR7BC.mjs';
3
+ import './chunk-4MQ5F4IL.mjs';
4
+ import './chunk-GG2FBGVZ.mjs';
5
+ import './chunk-TGP5M5R7.mjs';
6
+ import './chunk-23HJ5QXQ.mjs';
7
+ import './chunk-ZJ4CSAB2.mjs';
8
+ import './chunk-2E35UM3G.mjs';
9
+ import './chunk-R2XCJIO7.mjs';
10
+ import './chunk-WQBCBKY3.mjs';
11
+ import './chunk-P2PYEZZE.mjs';
12
+ import './chunk-OSF3SGJV.mjs';
13
+ import './chunk-KEHK2O6P.mjs';
14
+ import './chunk-GES7U2PM.mjs';
15
+ import './chunk-DQABW5UQ.mjs';
16
+ import './chunk-U2BKYEC7.mjs';
17
+ import './chunk-R6A773WK.mjs';
18
+ import './chunk-YTJCGKM4.mjs';
19
+ import './chunk-I64LXKO3.mjs';
@@ -1,5 +1,6 @@
1
1
  import { MAX_NODE_ID_LENGTH, MAX_WATCHERS } from '../../chunk-ORBLD3EL.mjs';
2
- import { compareCodePoints } from '../../chunk-IBR6634K.mjs';
2
+ import '../../chunk-R6A773WK.mjs';
3
+ import { compareCodePoints } from '../../chunk-YTJCGKM4.mjs';
3
4
  import { NarsilError, ErrorCodes } from '../../chunk-I64LXKO3.mjs';
4
5
  import { decode, encode } from '@msgpack/msgpack';
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { NODE_HEARTBEAT_TTL_MS } from '../../chunk-ORBLD3EL.mjs';
2
- import { compareCodePoints } from '../../chunk-IBR6634K.mjs';
2
+ import '../../chunk-R6A773WK.mjs';
3
+ import { compareCodePoints } from '../../chunk-YTJCGKM4.mjs';
3
4
 
4
5
  // src/distribution/coordinator/in-memory.ts
5
6
  var NODE_HEARTBEAT_PREFIX = "_narsil/node/";
@@ -1,12 +1,12 @@
1
- import { a as CreateIndexOptions, C as ClusterNamespace, b as ClusterNodeConfig } from './config-DHL2KsfD.js';
2
- export { c as ClusterControllerConfig, d as ClusterNodeInfo, e as ClusterQueryConfig, N as NodeReadiness, R as ReplicationConfig } from './config-DHL2KsfD.js';
3
- import { B as BatchResult, L as ListParams, h as ListResult, k as SuggestParams, l as SuggestResult, Q as QueryParams, j as PreflightResult, g as IndexStats, P as PartitionStatsResult, M as MemoryStats, m as NarsilEventMap, e as QueryResult } from './memory-DW3OJ0im.js';
1
+ import { a as CreateIndexOptions, C as ClusterNamespace, b as ClusterNodeConfig } from './config-CFonR_gY.js';
2
+ export { c as ClusterControllerConfig, d as ClusterNodeInfo, e as ClusterQueryConfig, N as NodeReadiness, R as ReplicationConfig } from './config-CFonR_gY.js';
3
+ import { B as BatchResult, L as ListParams, h as ListResult, k as SuggestParams, l as SuggestResult, Q as QueryParams, j as PreflightResult, g as IndexStats, P as PartitionStatsResult, M as MemoryStats, m as NarsilEventMap, e as QueryResult } from './memory-B6SBOKlS.js';
4
4
  import { I as IndexConfig, A as AnyDocument, a as InsertOptions } from './schema-DgyDijhf.js';
5
5
  import { b as NodeCapacity, N as NodeRole } from './types-ChrVy4lH.js';
6
6
  export { c as AllocationConstraints, d as AllocationEvent, A as AllocationTable, C as ClusterCoordinator, e as NodeEvent, a as NodeRegistration, P as PartitionAssignment, f as PartitionState, S as SchemaEvent, U as UnassignedReason } from './types-ChrVy4lH.js';
7
- import { N as Narsil } from './engine-BjPBzWkA.js';
7
+ import { N as Narsil } from './engine-B0oIF1_r.js';
8
8
  export { L as ListenHandler, N as NodeTransport, R as RespondFn, T as TransportConfig, a as TransportMessage } from './types-Cb9kiY5P.js';
9
- import './config-DTe5EbWW.js';
9
+ import './config-BCNQtszf.js';
10
10
  import './adapters-79OIa4xm.js';
11
11
 
12
12
  /**
@@ -1,25 +1,27 @@
1
1
  import { MAX_MESSAGE_SIZE_BYTES } from './chunk-UNEEFTEU.mjs';
2
- import { validateIndexName, indexConfigKey, withPartitionCount, indexSettingsOf, putIndexMetadata, getIndexMetadata, getClusterIndexConfig } from './chunk-PJWG547Z.mjs';
3
- import { requireKnownConfig, resolveRunnableConfig, createEngineCore, startEngineCore, createNarsilFromCore, runEngineQueryStats, runEngineListDocuments, runEngineSuggest, runEnginePreflight, runEngineQuery, createEngineIndex, buildArchiveFromMemory, indexMetadataOf, encodeIndexConfiguration, archiveStream, applyIndexEntry, applyDeleteEntry, requireConfigurationWithinSizeLimit, validateEntryBatchPayload, createAckMessage, validateEntryPayload, validateForwardBatchPayload, createForwardBatchResultMessage, memoryCheckpointStore, readSnapshotArchive, createByteReader, openChecksummedEnvelope, loadPartitionSegments, readListedFile, createForwardBatchMessage, validateForwardBatchResultPayload, createForwardMessage, validateReplicationEntry, crc32Init, crc32Final, crc32Update, computeEntryChecksum, createEntryMessage, createEntryBatchMessage, createInsyncConfirmMessage, validateAckPayload, createInsyncRemoveMessage, validateInsyncConfirmPayload, createInsyncAddMessage } from './chunk-55WEJKWT.mjs';
4
- import { now, listBindingOf, requireSurfaceFormsForPartialFields, queryBindingOf, hitsKeptPerGroup, clampLimit, resolveHybridFusion, dedupePinnedEntries, foldGroupReducer } from './chunk-R6WBLBTC.mjs';
2
+ import { validateIndexName, indexConfigKey, withPartitionCount, indexSettingsOf, putIndexMetadata, getIndexMetadata, getClusterIndexConfig } from './chunk-MEOOYKWL.mjs';
3
+ import { requireKnownConfig, resolveRunnableConfig, createEngineCore, startEngineCore, createNarsilFromCore, runEngineQueryStats, runEngineListDocuments, runEngineSuggest, runEnginePreflight, runEngineQuery, createEngineIndex, buildArchiveFromMemory, indexMetadataOf, encodeIndexConfiguration, archiveStream, applyIndexEntry, applyDeleteEntry, requireConfigurationWithinSizeLimit, validateEntryBatchPayload, createAckMessage, validateEntryPayload, validateForwardBatchPayload, createForwardBatchResultMessage, memoryCheckpointStore, readSnapshotArchive, createByteReader, openChecksummedEnvelope, loadPartitionSegments, readListedFile, createForwardBatchMessage, validateForwardBatchResultPayload, createForwardMessage, validateReplicationEntry, crc32Init, crc32Final, crc32Update, computeEntryChecksum, createEntryMessage, createEntryBatchMessage, createInsyncConfirmMessage, validateAckPayload, createInsyncRemoveMessage, validateInsyncConfirmPayload, createInsyncAddMessage } from './chunk-NSXQCE4K.mjs';
4
+ import { now, listBindingOf, requireSurfaceFormsForPartialFields, queryBindingOf, hitsKeptPerGroup, clampLimit, resolveHybridFusion, dedupePinnedEntries, foldGroupReducer } from './chunk-4QDQEJDV.mjs';
5
5
  import { ReplicationMessageTypes, TransportErrorCodes, ClusterMessageTypes, QueryMessageTypes, TransportError } from './chunk-GCM3JFVA.mjs';
6
- import { providedDocId, MAX_PARTITION_COUNT, MAX_REPLICATION_FACTOR, WIRE_BATCH_BUDGET } from './chunk-XSZTF4ZQ.mjs';
7
- import { generateId, decodeVectorFilePayload, bytesToVectors, isDead } from './chunk-DFW3U5UW.mjs';
8
- import { oversampledShardSize, resolveProjection, clampRowCount, sortSignatureOf, requireMatchingCursor, decodePageCursor, normalizeSort, sortModesOf, encodePageCursor, applyProjection, readSortValues, requireWithinResultWindow, fnv1a, sortSignatureEntry, FILTER_EXPRESSION_KEYS, filterTestCount, fnv1aUint32s, mergePartitionStats, FIELD_FILTER_OPERATORS } from './chunk-P2BEMMOD.mjs';
6
+ import { providedDocId, MAX_PARTITION_COUNT, MAX_REPLICATION_FACTOR, WIRE_BATCH_BUDGET } from './chunk-HJASKX4F.mjs';
7
+ import { generateId, decodeVectorFilePayload, bytesToVectors, isDead } from './chunk-K4FZ55Q2.mjs';
8
+ import { oversampledShardSize, resolveProjection, clampRowCount, sortSignatureOf, requireMatchingCursor, decodePageCursor, normalizeSort, sortModesOf, encodePageCursor, applyProjection, readSortValues, requireWithinResultWindow, fnv1a, sortSignatureEntry, FILTER_EXPRESSION_KEYS, filterTestCount, fnv1aUint32s, mergePartitionStats, FIELD_FILTER_OPERATORS } from './chunk-YGLSR7BC.mjs';
9
9
  import { getLanguage } from './chunk-4MQ5F4IL.mjs';
10
- import { DEFAULT_SUGGEST_LIMIT, MAX_SUGGEST_LIMIT, DEFAULT_PAGE_SIZE, MAX_SUGGEST_SCATTER_LIMIT, MAX_INDEX_NAME_LENGTH, MAX_FILTER_DEPTH, MAX_FILTER_TESTS, MAX_SORT_FIELDS, MAX_DOC_ID_LENGTH, MAX_CURSOR_LENGTH, MAX_TOLERANCE, SUGGEST_OVERSAMPLE_FACTOR, SUGGEST_OVERSAMPLE_PADDING, INDEX_NAME_PATTERN, MAX_PREFIX_LENGTH, RESULT_WINDOW, MAX_FILTER_ARRAY_SIZE } from './chunk-IOZPBNSG.mjs';
10
+ import { DEFAULT_SUGGEST_LIMIT, MAX_SUGGEST_LIMIT, MAX_SUGGEST_SCATTER_LIMIT, MAX_INDEX_NAME_LENGTH, MAX_DOC_ID_LENGTH, SUGGEST_OVERSAMPLE_FACTOR, SUGGEST_OVERSAMPLE_PADDING, INDEX_NAME_PATTERN } from './chunk-GG2FBGVZ.mjs';
11
11
  import './chunk-TGP5M5R7.mjs';
12
- import './chunk-AMGDG4ZJ.mjs';
12
+ import './chunk-23HJ5QXQ.mjs';
13
13
  import { MIN_OVERSAMPLE } from './chunk-ZJ4CSAB2.mjs';
14
14
  import './chunk-2E35UM3G.mjs';
15
- import { isPatternTolerance } from './chunk-4344I4MR.mjs';
16
- import './chunk-RTR44V2A.mjs';
17
- import './chunk-WFVOBZS4.mjs';
18
- import { validateSchema, requireCreatableSchema, encodeDocument, MAX_STORED_VECTOR_DIMENSION, MIN_POLYGON_POINTS, isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES, MAX_NESTING_DEPTH } from './chunk-PXDQFYD5.mjs';
15
+ import { isPatternTolerance } from './chunk-R2XCJIO7.mjs';
16
+ import { MAX_FILTER_DEPTH, MAX_FILTER_TESTS, MAX_FILTER_ARRAY_SIZE } from './chunk-WQBCBKY3.mjs';
17
+ import './chunk-P2PYEZZE.mjs';
18
+ import { validateSchema, requireCreatableSchema, DEFAULT_PAGE_SIZE, encodeDocument, MAX_SORT_FIELDS, MAX_CURSOR_LENGTH, MAX_TOLERANCE, MAX_PREFIX_LENGTH, RESULT_WINDOW, MIN_POLYGON_POINTS, isLatitude, MAX_LATITUDE_DEGREES, isLongitude, MAX_LONGITUDE_DEGREES } from './chunk-OSF3SGJV.mjs';
19
19
  import './chunk-KEHK2O6P.mjs';
20
20
  import './chunk-GES7U2PM.mjs';
21
+ import { MAX_STORED_VECTOR_DIMENSION, MAX_NESTING_DEPTH } from './chunk-DQABW5UQ.mjs';
21
22
  import './chunk-U2BKYEC7.mjs';
22
- import { compareCodePoints, toComparableSortValue, compareComparableKeys, isSortMode, SORT_MODES, exceedsCodePoints, compareSortValues } from './chunk-IBR6634K.mjs';
23
+ import { toComparableSortValue, compareComparableKeys, isSortMode, SORT_MODES, compareSortValues } from './chunk-R6A773WK.mjs';
24
+ import { compareCodePoints, exceedsCodePoints } from './chunk-YTJCGKM4.mjs';
23
25
  import './chunk-POWOTUKJ.mjs';
24
26
  import { ErrorCodes, NarsilError, describeError } from './chunk-I64LXKO3.mjs';
25
27
  import { encode, decode } from '@msgpack/msgpack';