@jaepil/uqa 0.1.0

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 (233) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +788 -0
  3. package/dist/types/src/analysis/analyzer.d.ts +27 -0
  4. package/dist/types/src/analysis/analyzer.d.ts.map +1 -0
  5. package/dist/types/src/analysis/char-filter.d.ts +27 -0
  6. package/dist/types/src/analysis/char-filter.d.ts.map +1 -0
  7. package/dist/types/src/analysis/token-filter.d.ts +73 -0
  8. package/dist/types/src/analysis/token-filter.d.ts.map +1 -0
  9. package/dist/types/src/analysis/tokenizer.d.ts +42 -0
  10. package/dist/types/src/analysis/tokenizer.d.ts.map +1 -0
  11. package/dist/types/src/api/query-builder.d.ts +103 -0
  12. package/dist/types/src/api/query-builder.d.ts.map +1 -0
  13. package/dist/types/src/cli/repl.d.ts +42 -0
  14. package/dist/types/src/cli/repl.d.ts.map +1 -0
  15. package/dist/types/src/core/functor.d.ts +38 -0
  16. package/dist/types/src/core/functor.d.ts.map +1 -0
  17. package/dist/types/src/core/hierarchical.d.ts +24 -0
  18. package/dist/types/src/core/hierarchical.d.ts.map +1 -0
  19. package/dist/types/src/core/posting-list.d.ts +43 -0
  20. package/dist/types/src/core/posting-list.d.ts.map +1 -0
  21. package/dist/types/src/core/types.d.ts +116 -0
  22. package/dist/types/src/core/types.d.ts.map +1 -0
  23. package/dist/types/src/engine.d.ts +130 -0
  24. package/dist/types/src/engine.d.ts.map +1 -0
  25. package/dist/types/src/execution/batch.d.ts +144 -0
  26. package/dist/types/src/execution/batch.d.ts.map +1 -0
  27. package/dist/types/src/execution/physical.d.ts +18 -0
  28. package/dist/types/src/execution/physical.d.ts.map +1 -0
  29. package/dist/types/src/execution/relational.d.ts +174 -0
  30. package/dist/types/src/execution/relational.d.ts.map +1 -0
  31. package/dist/types/src/execution/scan.d.ts +41 -0
  32. package/dist/types/src/execution/scan.d.ts.map +1 -0
  33. package/dist/types/src/execution/spill.d.ts +39 -0
  34. package/dist/types/src/execution/spill.d.ts.map +1 -0
  35. package/dist/types/src/fdw/arrow-handler.d.ts +28 -0
  36. package/dist/types/src/fdw/arrow-handler.d.ts.map +1 -0
  37. package/dist/types/src/fdw/duckdb-handler.d.ts +32 -0
  38. package/dist/types/src/fdw/duckdb-handler.d.ts.map +1 -0
  39. package/dist/types/src/fdw/foreign-table.d.ts +47 -0
  40. package/dist/types/src/fdw/foreign-table.d.ts.map +1 -0
  41. package/dist/types/src/fdw/handler.d.ts +52 -0
  42. package/dist/types/src/fdw/handler.d.ts.map +1 -0
  43. package/dist/types/src/fusion/attention.d.ts +23 -0
  44. package/dist/types/src/fusion/attention.d.ts.map +1 -0
  45. package/dist/types/src/fusion/boolean.d.ts +6 -0
  46. package/dist/types/src/fusion/boolean.d.ts.map +1 -0
  47. package/dist/types/src/fusion/learned.d.ts +12 -0
  48. package/dist/types/src/fusion/learned.d.ts.map +1 -0
  49. package/dist/types/src/fusion/log-odds.d.ts +87 -0
  50. package/dist/types/src/fusion/log-odds.d.ts.map +1 -0
  51. package/dist/types/src/fusion/query-features.d.ts +8 -0
  52. package/dist/types/src/fusion/query-features.d.ts.map +1 -0
  53. package/dist/types/src/graph/centrality.d.ts +35 -0
  54. package/dist/types/src/graph/centrality.d.ts.map +1 -0
  55. package/dist/types/src/graph/cross-paradigm.d.ts +68 -0
  56. package/dist/types/src/graph/cross-paradigm.d.ts.map +1 -0
  57. package/dist/types/src/graph/cypher/ast.d.ts +175 -0
  58. package/dist/types/src/graph/cypher/ast.d.ts.map +1 -0
  59. package/dist/types/src/graph/cypher/compiler.d.ts +60 -0
  60. package/dist/types/src/graph/cypher/compiler.d.ts.map +1 -0
  61. package/dist/types/src/graph/cypher/lexer.d.ts +82 -0
  62. package/dist/types/src/graph/cypher/lexer.d.ts.map +1 -0
  63. package/dist/types/src/graph/cypher/parser.d.ts +50 -0
  64. package/dist/types/src/graph/cypher/parser.d.ts.map +1 -0
  65. package/dist/types/src/graph/delta.d.ts +31 -0
  66. package/dist/types/src/graph/delta.d.ts.map +1 -0
  67. package/dist/types/src/graph/graph-embedding.d.ts +13 -0
  68. package/dist/types/src/graph/graph-embedding.d.ts.map +1 -0
  69. package/dist/types/src/graph/incremental-match.d.ts +16 -0
  70. package/dist/types/src/graph/incremental-match.d.ts.map +1 -0
  71. package/dist/types/src/graph/index.d.ts +58 -0
  72. package/dist/types/src/graph/index.d.ts.map +1 -0
  73. package/dist/types/src/graph/join.d.ts +18 -0
  74. package/dist/types/src/graph/join.d.ts.map +1 -0
  75. package/dist/types/src/graph/message-passing.d.ts +17 -0
  76. package/dist/types/src/graph/message-passing.d.ts.map +1 -0
  77. package/dist/types/src/graph/operators.d.ts +81 -0
  78. package/dist/types/src/graph/operators.d.ts.map +1 -0
  79. package/dist/types/src/graph/pattern.d.ts +63 -0
  80. package/dist/types/src/graph/pattern.d.ts.map +1 -0
  81. package/dist/types/src/graph/posting-list.d.ts +24 -0
  82. package/dist/types/src/graph/posting-list.d.ts.map +1 -0
  83. package/dist/types/src/graph/rpq-optimizer.d.ts +25 -0
  84. package/dist/types/src/graph/rpq-optimizer.d.ts.map +1 -0
  85. package/dist/types/src/graph/store.d.ts +61 -0
  86. package/dist/types/src/graph/store.d.ts.map +1 -0
  87. package/dist/types/src/graph/temporal-filter.d.ts +12 -0
  88. package/dist/types/src/graph/temporal-filter.d.ts.map +1 -0
  89. package/dist/types/src/graph/temporal-pattern-match.d.ts +26 -0
  90. package/dist/types/src/graph/temporal-pattern-match.d.ts.map +1 -0
  91. package/dist/types/src/graph/temporal-traverse.d.ts +25 -0
  92. package/dist/types/src/graph/temporal-traverse.d.ts.map +1 -0
  93. package/dist/types/src/graph/versioned-store.d.ts +64 -0
  94. package/dist/types/src/graph/versioned-store.d.ts.map +1 -0
  95. package/dist/types/src/index.d.ts +20 -0
  96. package/dist/types/src/index.d.ts.map +1 -0
  97. package/dist/types/src/joins/base.d.ts +18 -0
  98. package/dist/types/src/joins/base.d.ts.map +1 -0
  99. package/dist/types/src/joins/cross-paradigm.d.ts +46 -0
  100. package/dist/types/src/joins/cross-paradigm.d.ts.map +1 -0
  101. package/dist/types/src/joins/cross.d.ts +9 -0
  102. package/dist/types/src/joins/cross.d.ts.map +1 -0
  103. package/dist/types/src/joins/index.d.ts +7 -0
  104. package/dist/types/src/joins/index.d.ts.map +1 -0
  105. package/dist/types/src/joins/inner.d.ts +7 -0
  106. package/dist/types/src/joins/inner.d.ts.map +1 -0
  107. package/dist/types/src/joins/outer.d.ts +16 -0
  108. package/dist/types/src/joins/outer.d.ts.map +1 -0
  109. package/dist/types/src/joins/semi.d.ts +22 -0
  110. package/dist/types/src/joins/semi.d.ts.map +1 -0
  111. package/dist/types/src/joins/sort-merge.d.ts +7 -0
  112. package/dist/types/src/joins/sort-merge.d.ts.map +1 -0
  113. package/dist/types/src/math/linalg.d.ts +27 -0
  114. package/dist/types/src/math/linalg.d.ts.map +1 -0
  115. package/dist/types/src/math/random.d.ts +15 -0
  116. package/dist/types/src/math/random.d.ts.map +1 -0
  117. package/dist/types/src/operators/aggregation.d.ts +65 -0
  118. package/dist/types/src/operators/aggregation.d.ts.map +1 -0
  119. package/dist/types/src/operators/attention.d.ts +16 -0
  120. package/dist/types/src/operators/attention.d.ts.map +1 -0
  121. package/dist/types/src/operators/backend.d.ts +52 -0
  122. package/dist/types/src/operators/backend.d.ts.map +1 -0
  123. package/dist/types/src/operators/base.d.ts +32 -0
  124. package/dist/types/src/operators/base.d.ts.map +1 -0
  125. package/dist/types/src/operators/boolean.d.ts +23 -0
  126. package/dist/types/src/operators/boolean.d.ts.map +1 -0
  127. package/dist/types/src/operators/calibrated-vector.d.ts +56 -0
  128. package/dist/types/src/operators/calibrated-vector.d.ts.map +1 -0
  129. package/dist/types/src/operators/deep-fusion.d.ts +104 -0
  130. package/dist/types/src/operators/deep-fusion.d.ts.map +1 -0
  131. package/dist/types/src/operators/deep-learn.d.ts +87 -0
  132. package/dist/types/src/operators/deep-learn.d.ts.map +1 -0
  133. package/dist/types/src/operators/hierarchical.d.ts +44 -0
  134. package/dist/types/src/operators/hierarchical.d.ts.map +1 -0
  135. package/dist/types/src/operators/hybrid.d.ts +75 -0
  136. package/dist/types/src/operators/hybrid.d.ts.map +1 -0
  137. package/dist/types/src/operators/learned-fusion.d.ts +15 -0
  138. package/dist/types/src/operators/learned-fusion.d.ts.map +1 -0
  139. package/dist/types/src/operators/multi-field.d.ts +13 -0
  140. package/dist/types/src/operators/multi-field.d.ts.map +1 -0
  141. package/dist/types/src/operators/multi-stage.d.ts +12 -0
  142. package/dist/types/src/operators/multi-stage.d.ts.map +1 -0
  143. package/dist/types/src/operators/primitive.d.ts +75 -0
  144. package/dist/types/src/operators/primitive.d.ts.map +1 -0
  145. package/dist/types/src/operators/progressive-fusion.d.ts +13 -0
  146. package/dist/types/src/operators/progressive-fusion.d.ts.map +1 -0
  147. package/dist/types/src/operators/sparse.d.ts +12 -0
  148. package/dist/types/src/operators/sparse.d.ts.map +1 -0
  149. package/dist/types/src/planner/cardinality.d.ts +110 -0
  150. package/dist/types/src/planner/cardinality.d.ts.map +1 -0
  151. package/dist/types/src/planner/cost-model.d.ts +16 -0
  152. package/dist/types/src/planner/cost-model.d.ts.map +1 -0
  153. package/dist/types/src/planner/executor.d.ts +48 -0
  154. package/dist/types/src/planner/executor.d.ts.map +1 -0
  155. package/dist/types/src/planner/join-enumerator.d.ts +76 -0
  156. package/dist/types/src/planner/join-enumerator.d.ts.map +1 -0
  157. package/dist/types/src/planner/join-graph.d.ts +61 -0
  158. package/dist/types/src/planner/join-graph.d.ts.map +1 -0
  159. package/dist/types/src/planner/join-order.d.ts +24 -0
  160. package/dist/types/src/planner/join-order.d.ts.map +1 -0
  161. package/dist/types/src/planner/optimizer.d.ts +62 -0
  162. package/dist/types/src/planner/optimizer.d.ts.map +1 -0
  163. package/dist/types/src/planner/parallel.d.ts +43 -0
  164. package/dist/types/src/planner/parallel.d.ts.map +1 -0
  165. package/dist/types/src/scoring/bayesian-bm25.d.ts +22 -0
  166. package/dist/types/src/scoring/bayesian-bm25.d.ts.map +1 -0
  167. package/dist/types/src/scoring/bm25.d.ts +20 -0
  168. package/dist/types/src/scoring/bm25.d.ts.map +1 -0
  169. package/dist/types/src/scoring/calibration.d.ts +68 -0
  170. package/dist/types/src/scoring/calibration.d.ts.map +1 -0
  171. package/dist/types/src/scoring/external-prior.d.ts +55 -0
  172. package/dist/types/src/scoring/external-prior.d.ts.map +1 -0
  173. package/dist/types/src/scoring/fusion-wand.d.ts +19 -0
  174. package/dist/types/src/scoring/fusion-wand.d.ts.map +1 -0
  175. package/dist/types/src/scoring/multi-field.d.ts +10 -0
  176. package/dist/types/src/scoring/multi-field.d.ts.map +1 -0
  177. package/dist/types/src/scoring/parameter-learner.d.ts +42 -0
  178. package/dist/types/src/scoring/parameter-learner.d.ts.map +1 -0
  179. package/dist/types/src/scoring/vector.d.ts +42 -0
  180. package/dist/types/src/scoring/vector.d.ts.map +1 -0
  181. package/dist/types/src/scoring/wand.d.ts +51 -0
  182. package/dist/types/src/scoring/wand.d.ts.map +1 -0
  183. package/dist/types/src/sql/compiler.d.ts +551 -0
  184. package/dist/types/src/sql/compiler.d.ts.map +1 -0
  185. package/dist/types/src/sql/expr-evaluator.d.ts +43 -0
  186. package/dist/types/src/sql/expr-evaluator.d.ts.map +1 -0
  187. package/dist/types/src/sql/fts-query.d.ts +60 -0
  188. package/dist/types/src/sql/fts-query.d.ts.map +1 -0
  189. package/dist/types/src/sql/table.d.ts +72 -0
  190. package/dist/types/src/sql/table.d.ts.map +1 -0
  191. package/dist/types/src/storage/abc/document-store.d.ts +44 -0
  192. package/dist/types/src/storage/abc/document-store.d.ts.map +1 -0
  193. package/dist/types/src/storage/abc/graph-store.d.ts +109 -0
  194. package/dist/types/src/storage/abc/graph-store.d.ts.map +1 -0
  195. package/dist/types/src/storage/abc/inverted-index.d.ts +118 -0
  196. package/dist/types/src/storage/abc/inverted-index.d.ts.map +1 -0
  197. package/dist/types/src/storage/block-max-index.d.ts +45 -0
  198. package/dist/types/src/storage/block-max-index.d.ts.map +1 -0
  199. package/dist/types/src/storage/btree-index.d.ts +18 -0
  200. package/dist/types/src/storage/btree-index.d.ts.map +1 -0
  201. package/dist/types/src/storage/catalog.d.ts +87 -0
  202. package/dist/types/src/storage/catalog.d.ts.map +1 -0
  203. package/dist/types/src/storage/document-store.d.ts +20 -0
  204. package/dist/types/src/storage/document-store.d.ts.map +1 -0
  205. package/dist/types/src/storage/index-abc.d.ts +16 -0
  206. package/dist/types/src/storage/index-abc.d.ts.map +1 -0
  207. package/dist/types/src/storage/index-manager.d.ts +19 -0
  208. package/dist/types/src/storage/index-manager.d.ts.map +1 -0
  209. package/dist/types/src/storage/index-types.d.ts +10 -0
  210. package/dist/types/src/storage/index-types.d.ts.map +1 -0
  211. package/dist/types/src/storage/inverted-index.d.ts +55 -0
  212. package/dist/types/src/storage/inverted-index.d.ts.map +1 -0
  213. package/dist/types/src/storage/ivf-index.d.ts +57 -0
  214. package/dist/types/src/storage/ivf-index.d.ts.map +1 -0
  215. package/dist/types/src/storage/managed-connection.d.ts +64 -0
  216. package/dist/types/src/storage/managed-connection.d.ts.map +1 -0
  217. package/dist/types/src/storage/spatial-index.d.ts +18 -0
  218. package/dist/types/src/storage/spatial-index.d.ts.map +1 -0
  219. package/dist/types/src/storage/sqlite-document-store.d.ts +54 -0
  220. package/dist/types/src/storage/sqlite-document-store.d.ts.map +1 -0
  221. package/dist/types/src/storage/sqlite-graph-store.d.ts +59 -0
  222. package/dist/types/src/storage/sqlite-graph-store.d.ts.map +1 -0
  223. package/dist/types/src/storage/sqlite-inverted-index.d.ts +75 -0
  224. package/dist/types/src/storage/sqlite-inverted-index.d.ts.map +1 -0
  225. package/dist/types/src/storage/transaction.d.ts +15 -0
  226. package/dist/types/src/storage/transaction.d.ts.map +1 -0
  227. package/dist/types/src/storage/vector-index.d.ts +23 -0
  228. package/dist/types/src/storage/vector-index.d.ts.map +1 -0
  229. package/dist/uqa.es.js +16156 -0
  230. package/dist/uqa.es.js.map +1 -0
  231. package/dist/uqa.umd.js +11 -0
  232. package/dist/uqa.umd.js.map +1 -0
  233. package/package.json +73 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../../../src/operators/boolean.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,qBAAa,aAAc,SAAQ,QAAQ;IACzC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC;gBAElB,QAAQ,EAAE,QAAQ,EAAE;IAKhC,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW;IAS/C,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;CAOxC;AAED,qBAAa,iBAAkB,SAAQ,QAAQ;IAC7C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC;gBAElB,QAAQ,EAAE,QAAQ,EAAE;IAKhC,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW;IAW/C,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;CASxC;AAED,qBAAa,kBAAmB,SAAQ,QAAQ;IAC9C,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC;gBAEf,OAAO,EAAE,QAAQ;IAK7B,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW;IAa/C,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;CAGxC"}
@@ -0,0 +1,56 @@
1
+ import type { IndexStats } from "../core/types.js";
2
+ import { PostingList } from "../core/posting-list.js";
3
+ import type { ExecutionContext } from "./base.js";
4
+ import { Operator } from "./base.js";
5
+ /**
6
+ * IVF background stats: distance distribution parameters (mu_G, sigma_G).
7
+ */
8
+ export interface IVFBackgroundStats {
9
+ mu: number;
10
+ sigma: number;
11
+ }
12
+ /**
13
+ * Minimal interface for VectorProbabilityTransform calibration.
14
+ * Full implementation is delegated to the bayesian-bm25 package.
15
+ */
16
+ export interface VectorProbabilityTransformLike {
17
+ calibrate(distances: number[], opts?: {
18
+ weights?: number[] | null;
19
+ method?: string;
20
+ bandwidthFactor?: number;
21
+ densityPrior?: number[] | null;
22
+ }): number[];
23
+ }
24
+ /**
25
+ * Compute IVF density prior weight for a single cell.
26
+ *
27
+ * w(c) = (pop(c) / avg_pop)^gamma
28
+ *
29
+ * High-population cells produce a higher prior because they
30
+ * represent denser regions of the embedding space.
31
+ */
32
+ export declare function ivfDensityPrior(cellPop: number, avgPop: number, gamma?: number): number;
33
+ /**
34
+ * Fit a VectorProbabilityTransform from background distance samples.
35
+ *
36
+ * Returns a transform object that can calibrate new distances into
37
+ * probabilities. This is a simplified JS implementation.
38
+ */
39
+ export declare function fitBackgroundTransform(bgDistances: number[], baseRate?: number): VectorProbabilityTransformLike;
40
+ export declare class CalibratedVectorOperator extends Operator {
41
+ readonly queryVector: Float64Array;
42
+ readonly k: number;
43
+ readonly field: string;
44
+ readonly estimationMethod: string;
45
+ readonly baseRate: number;
46
+ readonly weightSource: string;
47
+ readonly bm25Query: string | null;
48
+ readonly bm25Field: string | null;
49
+ readonly densityGamma: number;
50
+ readonly bandwidthScale: number;
51
+ constructor(queryVector: Float64Array, k: number, field?: string, estimationMethod?: string, baseRate?: number, weightSource?: string, bm25Query?: string | null, bm25Field?: string | null, densityGamma?: number, bandwidthScale?: number);
52
+ execute(context: ExecutionContext): PostingList;
53
+ private _resolveWeightsAndMethod;
54
+ costEstimate(stats: IndexStats): number;
55
+ }
56
+ //# sourceMappingURL=calibrated-vector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calibrated-vector.d.ts","sourceRoot":"","sources":["../../../../src/operators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MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;gBAG9B,WAAW,EAAE,YAAY,EACzB,CAAC,EAAE,MAAM,EACT,KAAK,SAAc,EACnB,gBAAgB,SAAQ,EACxB,QAAQ,SAAM,EACd,YAAY,SAAkB,EAC9B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,EACzB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,EACzB,YAAY,SAAM,EAClB,cAAc,SAAM;IAetB,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW;IA8F/C,OAAO,CAAC,wBAAwB;IA4ChC,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;CAGxC"}
@@ -0,0 +1,104 @@
1
+ import type { IndexStats } from "../core/types.js";
2
+ import { PostingList } from "../core/posting-list.js";
3
+ import type { ExecutionContext } from "./base.js";
4
+ import { Operator } from "./base.js";
5
+ export interface SignalLayer {
6
+ readonly type: "signal";
7
+ readonly signals: Operator[];
8
+ }
9
+ export interface PropagateLayer {
10
+ readonly type: "propagate";
11
+ readonly edgeLabel: string;
12
+ readonly aggregation: string;
13
+ readonly direction: string;
14
+ }
15
+ export interface ConvLayer {
16
+ readonly type: "conv";
17
+ readonly edgeLabel: string;
18
+ readonly hopWeights: readonly number[];
19
+ readonly direction: string;
20
+ readonly kernel?: readonly number[] | null;
21
+ readonly kernelShape?: readonly number[] | null;
22
+ }
23
+ export interface PoolLayer {
24
+ readonly type: "pool";
25
+ readonly edgeLabel: string;
26
+ readonly poolSize: number;
27
+ readonly method: string;
28
+ readonly direction: string;
29
+ }
30
+ export interface DenseLayer {
31
+ readonly type: "dense";
32
+ readonly weights: readonly number[];
33
+ readonly bias: readonly number[];
34
+ readonly outputChannels: number;
35
+ readonly inputChannels: number;
36
+ }
37
+ export interface FlattenLayer {
38
+ readonly type: "flatten";
39
+ }
40
+ export interface SoftmaxLayer {
41
+ readonly type: "softmax";
42
+ }
43
+ export interface BatchNormLayer {
44
+ readonly type: "batchnorm";
45
+ readonly epsilon?: number;
46
+ }
47
+ export interface DropoutLayer {
48
+ readonly type: "dropout";
49
+ readonly p: number;
50
+ }
51
+ export interface GlobalPoolLayer {
52
+ readonly type: "global_pool";
53
+ readonly method: string;
54
+ }
55
+ export interface AttentionLayer {
56
+ readonly type: "attention";
57
+ readonly nHeads: number;
58
+ readonly mode: string;
59
+ readonly qWeights?: readonly number[] | null;
60
+ readonly qShape?: readonly number[] | null;
61
+ readonly kWeights?: readonly number[] | null;
62
+ readonly kShape?: readonly number[] | null;
63
+ readonly vWeights?: readonly number[] | null;
64
+ readonly vShape?: readonly number[] | null;
65
+ }
66
+ export interface EmbedLayer {
67
+ readonly type: "embed";
68
+ readonly embedding?: readonly number[];
69
+ readonly vectorField?: string;
70
+ readonly gridH: number;
71
+ readonly gridW: number;
72
+ readonly inChannels?: number;
73
+ }
74
+ export type FusionLayer = SignalLayer | PropagateLayer | ConvLayer | PoolLayer | DenseLayer | FlattenLayer | SoftmaxLayer | BatchNormLayer | DropoutLayer | GlobalPoolLayer | AttentionLayer | EmbedLayer;
75
+ export declare function safeLogit(p: number): number;
76
+ export declare function sigmoidVal(x: number): number;
77
+ export declare function applyGating(logitVal: number, gating: string): number;
78
+ export declare class DeepFusionOperator extends Operator {
79
+ readonly layers: FusionLayer[];
80
+ readonly alpha: number;
81
+ readonly gating: string;
82
+ readonly graphName: string;
83
+ readonly embedMode: boolean;
84
+ private readonly _gridShape;
85
+ constructor(layers: FusionLayer[], alpha?: number, gating?: string, graphName?: string);
86
+ execute(context: ExecutionContext): PostingList;
87
+ private static _buildResult;
88
+ private _executeSignalLayer;
89
+ private _executePropagateLayer;
90
+ private _executeConvLayer;
91
+ private _executePoolLayer;
92
+ private _executeDenseLayer;
93
+ private static _executeFlattenLayer;
94
+ private static _executeGlobalPoolLayer;
95
+ private static _executeSoftmaxLayer;
96
+ private static _executeBatchNormLayer;
97
+ private static _executeDropoutLayer;
98
+ private _executeAttentionLayer;
99
+ private static _executeEmbedLayer;
100
+ private _executeGrid;
101
+ costEstimate(stats: IndexStats): number;
102
+ }
103
+ export declare function estimateConvWeights(graphStore: unknown, docStore: unknown, edgeLabel: string, kernelHops: number, graphName: string, embeddingField?: string): number[];
104
+ //# sourceMappingURL=deep-fusion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep-fusion.d.ts","sourceRoot":"","sources":["../../../../src/operators/deep-fusion.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAS,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAsBrC,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAA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{
4
+ readonly type: "conv";
5
+ readonly kernelHops: number;
6
+ readonly nChannels: number;
7
+ readonly initMode: string;
8
+ }
9
+ export interface PoolSpec {
10
+ readonly type: "pool";
11
+ readonly method: string;
12
+ readonly poolSize: number;
13
+ }
14
+ export interface FlattenSpec {
15
+ readonly type: "flatten";
16
+ }
17
+ export interface GlobalPoolSpec {
18
+ readonly type: "global_pool";
19
+ readonly method: string;
20
+ }
21
+ export interface DenseSpec {
22
+ readonly type: "dense";
23
+ readonly outputChannels: number;
24
+ }
25
+ export interface SoftmaxSpec {
26
+ readonly type: "softmax";
27
+ }
28
+ export interface AttentionSpec {
29
+ readonly type: "attention";
30
+ readonly nHeads: number;
31
+ readonly mode: string;
32
+ }
33
+ export type LayerSpec = ConvSpec | PoolSpec | FlattenSpec | GlobalPoolSpec | DenseSpec | SoftmaxSpec | AttentionSpec;
34
+ export interface TrainedModel {
35
+ modelName: string;
36
+ tableName: string | null;
37
+ labelField: string;
38
+ embeddingField: string;
39
+ edgeLabel: string;
40
+ gating: string;
41
+ lam: number;
42
+ layerSpecs: Record<string, unknown>[];
43
+ convWeights: number[][];
44
+ denseWeights: number[];
45
+ denseBias: number[];
46
+ denseInputChannels: number;
47
+ denseOutputChannels: number;
48
+ numClasses: number;
49
+ classLabels: unknown[];
50
+ gridSize: number;
51
+ embeddingDim: number;
52
+ trainingAccuracy: number;
53
+ trainingSamples: number;
54
+ expertWeights: number[][];
55
+ expertBiases: number[][];
56
+ expertInputChannels: number[];
57
+ expertAccuracies: number[];
58
+ shrinkageAlpha: number;
59
+ convKernelData: number[][];
60
+ convKernelShapes: number[][];
61
+ inChannels: number;
62
+ attentionParams: Record<string, unknown>[];
63
+ l1Ratio: number;
64
+ pruneRatio: number;
65
+ weightSparsity: number;
66
+ }
67
+ export declare function trainedModelToJSON(model: TrainedModel): string;
68
+ export declare function trainedModelFromJSON(s: string): TrainedModel;
69
+ export declare function trainedModelToDict(model: TrainedModel): Record<string, unknown>;
70
+ export declare function trainedModelFromDict(d: Record<string, unknown>): TrainedModel;
71
+ export declare function trainedModelToDeepFusionLayers(model: TrainedModel): FusionLayer[];
72
+ export declare function generateKernels(nChannels: number, inChannels: number, seed?: number, initMode?: string, trainingData?: Float64Array | null, shapeData?: linalg.Shape2D | null, gridH?: number, gridW?: number): Float64Array;
73
+ interface SpecDict {
74
+ type: string;
75
+ [key: string]: unknown;
76
+ }
77
+ export interface Engine {
78
+ _tables: Map<string, unknown>;
79
+ saveModel(name: string, data: Record<string, unknown>): void;
80
+ loadModel(name: string): Record<string, unknown> | null;
81
+ }
82
+ export declare function trainModel(engine: Engine, modelName: string, tableName: string | null, labelField: string, embeddingField: string, edgeLabel: string, layerSpecs: LayerSpec[], gating?: string, lam?: number, l1Ratio?: number, pruneRatio?: number, rows?: Record<string, unknown>[] | null): Record<string, unknown>;
83
+ export declare function predict(engine: Engine, modelName: string, inputEmbedding: number[]): [number, number][];
84
+ export declare function identifyStages(specDicts: SpecDict[]): [SpecDict, SpecDict][];
85
+ export declare function dictsToSpecs(dicts: Record<string, unknown>[]): LayerSpec[];
86
+ export {};
87
+ //# sourceMappingURL=deep-learn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deep-learn.d.ts","sourceRoot":"","sources":["../../../../src/operators/deep-learn.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAkBjD,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM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ats, PathExpr, Predicate } from "../core/types.js";
2
+ import { PostingList } from "../core/posting-list.js";
3
+ import type { ExecutionContext } from "./base.js";
4
+ import { Operator } from "./base.js";
5
+ import type { AggregationMonoid } from "./aggregation.js";
6
+ export declare class PathFilterOperator extends Operator {
7
+ readonly path: PathExpr;
8
+ readonly predicate: Predicate;
9
+ readonly source: Operator | null;
10
+ constructor(path: PathExpr, predicate: Predicate, source?: Operator | null);
11
+ execute(context: ExecutionContext): PostingList;
12
+ costEstimate(stats: IndexStats): number;
13
+ }
14
+ export declare class PathProjectOperator extends Operator {
15
+ readonly paths: PathExpr[];
16
+ readonly source: Operator;
17
+ constructor(paths: PathExpr[], source: Operator);
18
+ execute(context: ExecutionContext): PostingList;
19
+ costEstimate(stats: IndexStats): number;
20
+ }
21
+ export declare class PathUnnestOperator extends Operator {
22
+ readonly path: PathExpr;
23
+ readonly source: Operator;
24
+ constructor(path: PathExpr, source: Operator);
25
+ execute(context: ExecutionContext): PostingList;
26
+ costEstimate(stats: IndexStats): number;
27
+ }
28
+ export declare class PathAggregateOperator extends Operator {
29
+ readonly path: PathExpr;
30
+ readonly monoid: AggregationMonoid<unknown, unknown, unknown>;
31
+ readonly source: Operator | null;
32
+ constructor(path: PathExpr, monoid: AggregationMonoid<unknown, unknown, unknown>, source?: Operator | null);
33
+ execute(context: ExecutionContext): PostingList;
34
+ costEstimate(stats: IndexStats): number;
35
+ }
36
+ export declare class UnifiedFilterOperator extends Operator {
37
+ readonly fieldExpr: string;
38
+ readonly predicate: Predicate;
39
+ readonly source: Operator | null;
40
+ constructor(fieldExpr: string, predicate: Predicate, source?: Operator | null);
41
+ execute(context: ExecutionContext): PostingList;
42
+ costEstimate(stats: IndexStats): number;
43
+ }
44
+ //# sourceMappingURL=hierarchical.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hierarchical.d.ts","sourceRoot":"","sources":["../../../../src/operators/hierarchical.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAS,UAAU,E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;CAGxC;AAID,qBAAa,qBAAsB,SAAQ,QAAQ;IACjD,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC9D,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;gBAG/B,IAAI,EAAE,QAAQ,EACd,MAAM,EAAE,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EACpD,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI;IAQ1B,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW;IA2C/C,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;CAGxC;AAID,qBAAa,qBAAsB,SAAQ,QAAQ;IACjD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;gBAErB,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,IAAI;IAO7E,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW;IAU/C,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;CAGxC"}
@@ -0,0 +1,75 @@
1
+ import type { IndexStats } from "../core/types.js";
2
+ import { PostingList } from "../core/posting-list.js";
3
+ import type { ExecutionContext } from "./base.js";
4
+ import { Operator } from "./base.js";
5
+ export declare function coverageBasedDefault(nHits: number, nTotal: number, floor?: number): number;
6
+ export declare class HybridTextVectorOperator extends Operator {
7
+ private readonly _termOp;
8
+ private readonly _vectorOp;
9
+ constructor(term: string, queryVector: Float64Array, threshold: number);
10
+ execute(context: ExecutionContext): PostingList;
11
+ costEstimate(stats: IndexStats): number;
12
+ }
13
+ export declare class SemanticFilterOperator extends Operator {
14
+ readonly source: Operator;
15
+ private readonly _vectorOp;
16
+ constructor(source: Operator, queryVector: Float64Array, threshold: number);
17
+ execute(context: ExecutionContext): PostingList;
18
+ costEstimate(stats: IndexStats): number;
19
+ }
20
+ export declare class LogOddsFusionOperator extends Operator {
21
+ readonly signals: Operator[];
22
+ readonly alpha: number;
23
+ readonly topK: number | null;
24
+ readonly gating: string | null;
25
+ readonly gatingBeta: number | null;
26
+ constructor(signals: Operator[], alpha?: number, topK?: number | null, gating?: string | null, gatingBeta?: number | null);
27
+ execute(context: ExecutionContext): PostingList;
28
+ costEstimate(stats: IndexStats): number;
29
+ }
30
+ export declare class ProbBoolFusionOperator extends Operator {
31
+ readonly signals: Operator[];
32
+ readonly mode: "and" | "or";
33
+ constructor(signals: Operator[], mode?: "and" | "or");
34
+ execute(context: ExecutionContext): PostingList;
35
+ costEstimate(stats: IndexStats): number;
36
+ }
37
+ export declare class VectorExclusionOperator extends Operator {
38
+ readonly positive: Operator;
39
+ private readonly _negativeOp;
40
+ constructor(positive: Operator, negativeVector: Float64Array, negativeThreshold: number, field?: string);
41
+ execute(context: ExecutionContext): PostingList;
42
+ costEstimate(stats: IndexStats): number;
43
+ }
44
+ export declare class FacetVectorOperator extends Operator {
45
+ readonly facetField: string;
46
+ private readonly _vectorOp;
47
+ readonly source: Operator | null;
48
+ constructor(facetField: string, queryVector: Float64Array, threshold: number, source?: Operator | null);
49
+ execute(context: ExecutionContext): PostingList;
50
+ costEstimate(stats: IndexStats): number;
51
+ }
52
+ export declare class ProbNotOperator extends Operator {
53
+ readonly signal: Operator;
54
+ readonly defaultProb: number;
55
+ constructor(signal: Operator, defaultProb?: number);
56
+ execute(context: ExecutionContext): PostingList;
57
+ costEstimate(stats: IndexStats): number;
58
+ }
59
+ /**
60
+ * Signal quality metrics for adaptive fusion.
61
+ */
62
+ export interface SignalQuality {
63
+ coverageRatio: number;
64
+ scoreVariance: number;
65
+ calibrationError: number;
66
+ }
67
+ export declare class AdaptiveLogOddsFusionOperator extends Operator {
68
+ readonly signals: Operator[];
69
+ readonly baseAlpha: number;
70
+ readonly gating: string | null;
71
+ constructor(signals: Operator[], baseAlpha?: number, gating?: string | null);
72
+ execute(context: ExecutionContext): PostingList;
73
+ costEstimate(stats: IndexStats): number;
74
+ }
75
+ //# sourceMappingURL=hybrid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hybrid.d.ts","sourceRoot":"","sources":["../../../../src/operators/hybrid.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAS,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAMrC,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,KAAK,SAAO,GACX,MAAM,CAIR;AAID,qBAAa,wBAAyB,SAAQ,QAAQ;IACpD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;IACvC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA2B;gBAEzC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM;IAMtE,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW;IAM/C,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;CAMxC;AAID,qBAAa,sBAAuB,SAAQ,QAAQ;IAClD,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA2B;gBAEzC,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM;IAM1E,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW;IAM/C,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;CA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 -0,0 +1,15 @@
1
+ import type { IndexStats } from "../core/types.js";
2
+ import { PostingList } from "../core/posting-list.js";
3
+ import type { ExecutionContext } from "./base.js";
4
+ import { Operator } from "./base.js";
5
+ export interface LearnedFusionLike {
6
+ fuse(probs: number[]): number;
7
+ }
8
+ export declare class LearnedFusionOperator extends Operator {
9
+ readonly signals: Operator[];
10
+ readonly learned: LearnedFusionLike;
11
+ constructor(signals: Operator[], learned: LearnedFusionLike);
12
+ execute(context: ExecutionContext): PostingList;
13
+ costEstimate(stats: IndexStats): number;
14
+ }
15
+ //# sourceMappingURL=learned-fusion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"learned-fusion.d.ts","sourceRoot":"","sources":["../../../../src/operators/learned-fusion.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAS,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAIrC,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;CAC/B;AAED,qBAAa,qBAAsB,SAAQ,QAAQ;IACjD,QAAQ,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;IAC7B,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;gBAExB,OAAO,EAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,iBAAiB;IAM3D,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW;IA+B/C,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;CAKxC"}
@@ -0,0 +1,13 @@
1
+ import type { IndexStats } from "../core/types.js";
2
+ import { PostingList } from "../core/posting-list.js";
3
+ import type { ExecutionContext } from "./base.js";
4
+ import { Operator } from "./base.js";
5
+ export declare class MultiFieldSearchOperator extends Operator {
6
+ readonly fields: string[];
7
+ readonly query: string;
8
+ readonly weights: number[];
9
+ constructor(fields: string[], query: string, weights?: number[] | null);
10
+ execute(context: ExecutionContext): PostingList;
11
+ costEstimate(stats: IndexStats): number;
12
+ }
13
+ //# sourceMappingURL=multi-field.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-field.d.ts","sourceRoot":"","sources":["../../../../src/operators/multi-field.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAS,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAQrC,qBAAa,wBAAyB,SAAQ,QAAQ;IACpD,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;gBAEf,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI;IAOtE,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW;IA2C/C,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;CAGxC"}
@@ -0,0 +1,12 @@
1
+ import type { IndexStats } from "../core/types.js";
2
+ import { PostingList } from "../core/posting-list.js";
3
+ import type { ExecutionContext } from "./base.js";
4
+ import { Operator } from "./base.js";
5
+ export declare class MultiStageOperator extends Operator {
6
+ readonly stages: [Operator, number][];
7
+ constructor(stages: [Operator, number][]);
8
+ execute(context: ExecutionContext): PostingList;
9
+ costEstimate(stats: IndexStats): number;
10
+ static applyCutoff(pl: PostingList, cutoff: number): PostingList;
11
+ }
12
+ //# sourceMappingURL=multi-stage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"multi-stage.d.ts","sourceRoot":"","sources":["../../../../src/operators/multi-stage.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,qBAAa,kBAAmB,SAAQ,QAAQ;IAC9C,QAAQ,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC;gBAE1B,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE;IAQxC,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW;IA8B/C,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;IAavC,MAAM,CAAC,WAAW,CAAC,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW;CAGjE"}
@@ -0,0 +1,75 @@
1
+ import type { IndexStats, Predicate } from "../core/types.js";
2
+ import { PostingList } from "../core/posting-list.js";
3
+ import type { ExecutionContext } from "./base.js";
4
+ import { Operator } from "./base.js";
5
+ import type { Index } from "../storage/index-abc.js";
6
+ export declare class TermOperator extends Operator {
7
+ readonly term: string;
8
+ readonly field: string | null;
9
+ constructor(term: string, field?: string | null);
10
+ execute(context: ExecutionContext): PostingList;
11
+ costEstimate(stats: IndexStats): number;
12
+ }
13
+ export declare class VectorSimilarityOperator extends Operator {
14
+ readonly queryVector: Float64Array;
15
+ readonly threshold: number;
16
+ readonly field: string;
17
+ constructor(queryVector: Float64Array, threshold: number, field?: string);
18
+ execute(context: ExecutionContext): PostingList;
19
+ costEstimate(stats: IndexStats): number;
20
+ }
21
+ export declare class KNNOperator extends Operator {
22
+ readonly queryVector: Float64Array;
23
+ readonly k: number;
24
+ readonly field: string;
25
+ constructor(queryVector: Float64Array, k: number, field?: string);
26
+ execute(context: ExecutionContext): PostingList;
27
+ costEstimate(stats: IndexStats): number;
28
+ }
29
+ export declare class SpatialWithinOperator extends Operator {
30
+ readonly field: string;
31
+ readonly centerX: number;
32
+ readonly centerY: number;
33
+ readonly distance: number;
34
+ constructor(field: string, centerX: number, centerY: number, distance: number);
35
+ execute(context: ExecutionContext): PostingList;
36
+ private _bruteForceScan;
37
+ costEstimate(stats: IndexStats): number;
38
+ }
39
+ export declare class FilterOperator extends Operator {
40
+ readonly field: string;
41
+ readonly predicate: Predicate;
42
+ readonly source: Operator | null;
43
+ constructor(field: string, predicate: Predicate, source?: Operator | null);
44
+ execute(context: ExecutionContext): PostingList;
45
+ costEstimate(stats: IndexStats): number;
46
+ }
47
+ export declare class FacetOperator extends Operator {
48
+ readonly field: string;
49
+ readonly source: Operator | null;
50
+ constructor(field: string, source?: Operator | null);
51
+ execute(context: ExecutionContext): PostingList;
52
+ costEstimate(stats: IndexStats): number;
53
+ }
54
+ export declare class ScoreOperator extends Operator {
55
+ readonly scorer: {
56
+ score(termFreq: number, docLength: number, docFreq: number): number;
57
+ idf?(docFreq: number): number;
58
+ scoreWithIdf?(termFreq: number, docLength: number, idfVal: number): number;
59
+ combineScores?(scores: number[]): number;
60
+ };
61
+ readonly source: Operator;
62
+ readonly queryTerms: string[];
63
+ readonly field: string | null;
64
+ constructor(scorer: ScoreOperator["scorer"], source: Operator, queryTerms: string[], field?: string | null);
65
+ execute(context: ExecutionContext): PostingList;
66
+ }
67
+ export declare class IndexScanOperator extends Operator {
68
+ readonly index: Index;
69
+ readonly field: string;
70
+ readonly predicate: Predicate;
71
+ constructor(index: Index, field: string, predicate: Predicate);
72
+ execute(_context: ExecutionContext): PostingList;
73
+ costEstimate(_stats: IndexStats): number;
74
+ }
75
+ //# sourceMappingURL=primitive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitive.d.ts","sourceRoot":"","sources":["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,QAAQ;IACzC,QAAQ,CAAC,MAAM,EAAE;QACf,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;QACpE,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;QAC9B,YAAY,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;QAC3E,aAAa,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;KAC1C,CAAC;IACF,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;gBAG5B,MAAM,EAAE,aAAa,CAAC,QAAQ,CAAC,EAC/B,MAAM,EAAE,QAAQ,EAChB,UAAU,EAAE,MAAM,EAAE,EACpB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IASvB,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW;CAyFhD;AAID,qBAAa,iBAAkB,SAAQ,QAAQ;IAC7C,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;gBAElB,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS;IAO7D,OAAO,CAAC,QAAQ,EAAE,gBAAgB,GAAG,WAAW;IAIhD,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM;CAGzC"}
@@ -0,0 +1,13 @@
1
+ import type { IndexStats } from "../core/types.js";
2
+ import { PostingList } from "../core/posting-list.js";
3
+ import type { ExecutionContext } from "./base.js";
4
+ import { Operator } from "./base.js";
5
+ export declare class ProgressiveFusionOperator extends Operator {
6
+ readonly stages: [Operator[], number][];
7
+ readonly alpha: number;
8
+ readonly gating: string | null;
9
+ constructor(stages: [Operator[], number][], alpha?: number, gating?: string | null);
10
+ execute(context: ExecutionContext): PostingList;
11
+ costEstimate(stats: IndexStats): number;
12
+ }
13
+ //# sourceMappingURL=progressive-fusion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progressive-fusion.d.ts","sourceRoot":"","sources":["../../../../src/operators/progressive-fusion.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAS,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAGrC,qBAAa,yBAA0B,SAAQ,QAAQ;IACrD,QAAQ,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;gBAEnB,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,SAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAO/E,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW;IA6C/C,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;CAWxC"}
@@ -0,0 +1,12 @@
1
+ import type { IndexStats } from "../core/types.js";
2
+ import { PostingList } from "../core/posting-list.js";
3
+ import type { ExecutionContext } from "./base.js";
4
+ import { Operator } from "./base.js";
5
+ export declare class SparseThresholdOperator extends Operator {
6
+ readonly source: Operator;
7
+ readonly threshold: number;
8
+ constructor(source: Operator, threshold: number);
9
+ execute(context: ExecutionContext): PostingList;
10
+ costEstimate(stats: IndexStats): number;
11
+ }
12
+ //# sourceMappingURL=sparse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sparse.d.ts","sourceRoot":"","sources":["../../../../src/operators/sparse.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,qBAAa,uBAAwB,SAAQ,QAAQ;IACnD,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAEf,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM;IAM/C,OAAO,CAAC,OAAO,EAAE,gBAAgB,GAAG,WAAW;IAqB/C,YAAY,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM;CAGxC"}