drizzle-cube 0.5.8 → 0.6.1

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 (725) hide show
  1. package/README.md +2 -0
  2. package/dist/adapters/express/index.cjs +1 -1
  3. package/dist/adapters/{adapters/express → express}/index.d.ts +3 -3
  4. package/dist/adapters/express/index.js +50 -50
  5. package/dist/adapters/fastify/index.cjs +1 -1
  6. package/dist/adapters/{adapters/fastify → fastify}/index.d.ts +3 -3
  7. package/dist/adapters/fastify/index.js +78 -78
  8. package/dist/adapters/google-BOnRIN1w.cjs +2 -0
  9. package/dist/{server/google-CFYljAOF.js → adapters/google-CvKM9yVM.js} +83 -71
  10. package/dist/adapters/{handler-Cx8QYLk6.js → handler-CfgE0JSL.js} +499 -576
  11. package/dist/adapters/handler-Cn0dOctE.cjs +25 -0
  12. package/dist/adapters/hono/agent-handler.d.ts +9 -0
  13. package/dist/adapters/hono/index.cjs +2 -2
  14. package/dist/adapters/{adapters/hono → hono}/index.d.ts +4 -4
  15. package/dist/adapters/hono/index.js +205 -175
  16. package/dist/adapters/hono/mcp-handler.d.ts +37 -0
  17. package/dist/adapters/locale-DDvZDFVn.js +8114 -0
  18. package/dist/adapters/locale-ZLUUNUxr.cjs +166 -0
  19. package/dist/adapters/{adapters/locale.d.ts → locale.d.ts} +1 -1
  20. package/dist/adapters/mcp-tools-handlers.d.ts +18 -0
  21. package/dist/adapters/mcp-tools.cjs +1 -1
  22. package/dist/adapters/{adapters/mcp-tools.d.ts → mcp-tools.d.ts} +5 -5
  23. package/dist/adapters/mcp-tools.js +49 -38
  24. package/dist/adapters/mcp-transport-B7ddET3M.cjs +40 -0
  25. package/dist/adapters/mcp-transport-Dfuj4j4q.js +591 -0
  26. package/dist/adapters/{adapters/mcp-transport.d.ts → mcp-transport.d.ts} +3 -3
  27. package/dist/adapters/nextjs/index.cjs +1 -1
  28. package/dist/adapters/{adapters/nextjs → nextjs}/index.d.ts +3 -3
  29. package/dist/adapters/nextjs/index.js +190 -197
  30. package/dist/adapters/nextjs/mcp-handler.d.ts +36 -0
  31. package/dist/adapters/{openai-BZdAA7Ji.js → openai-cDlFSTk6.js} +60 -58
  32. package/dist/adapters/openai-vXvLni8v.cjs +1 -0
  33. package/dist/adapters/{adapters/types.d.ts → types.d.ts} +1 -1
  34. package/dist/adapters/{utils-D9JPLmfl.js → utils-BPWZsX7k.js} +1271 -1218
  35. package/dist/adapters/utils-_whV4fXL.cjs +128 -0
  36. package/dist/adapters/utils.cjs +1 -1
  37. package/dist/adapters/{adapters/utils.d.ts → utils.d.ts} +17 -92
  38. package/dist/adapters/utils.js +2 -2
  39. package/dist/cli/index.cjs +2 -2
  40. package/dist/client/adapters/adapterRegistry.d.ts +2 -2
  41. package/dist/client/adapters/flowModeAdapter.d.ts +2 -2
  42. package/dist/client/adapters/funnelModeAdapter.d.ts +2 -2
  43. package/dist/client/adapters/index.d.ts +9 -9
  44. package/dist/client/adapters/modeAdapter.d.ts +1 -1
  45. package/dist/client/adapters/queryModeAdapter.d.ts +3 -3
  46. package/dist/client/adapters/retentionModeAdapter.d.ts +2 -2
  47. package/dist/client/charts/ChartLoader.d.ts +3 -17
  48. package/dist/client/charts/chartComponentRegistry.d.ts +46 -0
  49. package/dist/client/charts/chartConfigHelpers.d.ts +38 -0
  50. package/dist/client/charts/chartConfigRegistry.d.ts +1 -1
  51. package/dist/client/charts/chartPlugin.d.ts +3 -3
  52. package/dist/client/charts/lazyChartConfigRegistry.d.ts +2 -2
  53. package/dist/client/charts.d.ts +8 -8
  54. package/dist/client/charts.js +14 -13
  55. package/dist/client/chunks/{DashboardEditModal-CjCIAT-J.js → DashboardEditModal-okVfH8ZK.js} +5296 -4544
  56. package/dist/client/chunks/DashboardEditModal-okVfH8ZK.js.map +1 -0
  57. package/dist/client/chunks/{RetentionCombinedChart-BPkfcTa8.js → RetentionCombinedChart-BgbDhsPz.js} +10 -10
  58. package/dist/client/chunks/RetentionCombinedChart-BgbDhsPz.js.map +1 -0
  59. package/dist/client/chunks/{RetentionHeatmap-DGzLzr7h.js → RetentionHeatmap-DjXZaTPq.js} +5 -5
  60. package/dist/client/chunks/RetentionHeatmap-DjXZaTPq.js.map +1 -0
  61. package/dist/client/chunks/analysis-builder-DB88FojM.js +5674 -0
  62. package/dist/client/chunks/analysis-builder-DB88FojM.js.map +1 -0
  63. package/dist/client/chunks/{analysis-builder-shared-CYVwSPqt.js → analysis-builder-shared-BVK4TYfR.js} +1578 -1292
  64. package/dist/client/chunks/analysis-builder-shared-BVK4TYfR.js.map +1 -0
  65. package/dist/client/chunks/{chart-activity-grid-DmruKPab.js → chart-activity-grid-DX0SJbxs.js} +635 -492
  66. package/dist/client/chunks/chart-activity-grid-DX0SJbxs.js.map +1 -0
  67. package/dist/client/chunks/chart-area-of01_62R.js +775 -0
  68. package/dist/client/chunks/chart-area-of01_62R.js.map +1 -0
  69. package/dist/client/chunks/chart-bar-BqelQE_I.js +194 -0
  70. package/dist/client/chunks/chart-bar-BqelQE_I.js.map +1 -0
  71. package/dist/client/chunks/{chart-box-plot-DYKfyOI8.js → chart-box-plot-kkBixZ27.js} +2 -2
  72. package/dist/client/chunks/chart-box-plot-kkBixZ27.js.map +1 -0
  73. package/dist/client/chunks/chart-bubble-B2he1--4.js +221 -0
  74. package/dist/client/chunks/chart-bubble-B2he1--4.js.map +1 -0
  75. package/dist/client/chunks/{chart-candlestick-Dwc92Mrj.js → chart-candlestick-DZp19Tzh.js} +2 -2
  76. package/dist/client/chunks/chart-candlestick-DZp19Tzh.js.map +1 -0
  77. package/dist/client/chunks/chart-config-activity-grid-D_UX4NHC.js.map +1 -1
  78. package/dist/client/chunks/chart-config-area-BNigHUy8.js +124 -0
  79. package/dist/client/chunks/chart-config-area-BNigHUy8.js.map +1 -0
  80. package/dist/client/chunks/chart-config-bar-DSO_LRTx.js +54 -0
  81. package/dist/client/chunks/chart-config-bar-DSO_LRTx.js.map +1 -0
  82. package/dist/client/chunks/{chart-config-box-plot-DJ-dWWXA.js → chart-config-box-plot-oW8axV2q.js} +5 -10
  83. package/dist/client/chunks/chart-config-box-plot-oW8axV2q.js.map +1 -0
  84. package/dist/client/chunks/chart-config-bubble-gIoqVyjZ.js.map +1 -1
  85. package/dist/client/chunks/chart-config-candlestick-N6DchAA3.js.map +1 -1
  86. package/dist/client/chunks/chart-config-data-table-d7VBY-y_.js.map +1 -1
  87. package/dist/client/chunks/chart-config-funnel-DEYMcxsD.js.map +1 -1
  88. package/dist/client/chunks/{chart-config-gauge-DSwC04l0.js → chart-config-gauge-Dq-_H9UN.js} +5 -7
  89. package/dist/client/chunks/chart-config-gauge-Dq-_H9UN.js.map +1 -0
  90. package/dist/client/chunks/chart-config-heat-map-CfRnRNcw.js.map +1 -1
  91. package/dist/client/chunks/{chart-config-kpi-delta-D6BIkHL3.js → chart-config-kpi-delta-DSQbvqu_.js} +5 -10
  92. package/dist/client/chunks/chart-config-kpi-delta-DSQbvqu_.js.map +1 -0
  93. package/dist/client/chunks/{chart-config-kpi-number-Bx-V9a62.js → chart-config-kpi-number-EFSWY1We.js} +5 -7
  94. package/dist/client/chunks/chart-config-kpi-number-EFSWY1We.js.map +1 -0
  95. package/dist/client/chunks/{chart-config-kpi-text-CcqC1u-8.js → chart-config-kpi-text-KM3V5X2u.js} +5 -7
  96. package/dist/client/chunks/chart-config-kpi-text-KM3V5X2u.js.map +1 -0
  97. package/dist/client/chunks/{chart-config-line-Db3jDsWc.js → chart-config-line-D6jG8PCH.js} +9 -36
  98. package/dist/client/chunks/chart-config-line-D6jG8PCH.js.map +1 -0
  99. package/dist/client/chunks/chart-config-markdown-BtRIe8JN.js.map +1 -1
  100. package/dist/client/chunks/chart-config-measure-profile-DxRGa-zf.js.map +1 -1
  101. package/dist/client/chunks/{chart-config-pie-DD4SmRTF.js → chart-config-pie-BhzW-fdn.js} +6 -16
  102. package/dist/client/chunks/chart-config-pie-BhzW-fdn.js.map +1 -0
  103. package/dist/client/chunks/{chart-config-radar-CC2XAaGr.js → chart-config-radar-D7REP1q_.js} +6 -16
  104. package/dist/client/chunks/chart-config-radar-D7REP1q_.js.map +1 -0
  105. package/dist/client/chunks/{chart-config-radial-bar-DmxKx1R0.js → chart-config-radial-bar-Byx6qOPU.js} +6 -16
  106. package/dist/client/chunks/chart-config-radial-bar-Byx6qOPU.js.map +1 -0
  107. package/dist/client/chunks/chart-config-sankey-BTnWA7EW.js.map +1 -1
  108. package/dist/client/chunks/chart-config-scatter-DSYTjwRb.js.map +1 -1
  109. package/dist/client/chunks/chart-config-sunburst-Bwjtdf7X.js.map +1 -1
  110. package/dist/client/chunks/{chart-config-tree-map-BI-oQStO.js → chart-config-tree-map-DVrvf3yQ.js} +6 -16
  111. package/dist/client/chunks/chart-config-tree-map-DVrvf3yQ.js.map +1 -0
  112. package/dist/client/chunks/{chart-config-waterfall-DSnyixbI.js → chart-config-waterfall-DmFeQdIk.js} +5 -10
  113. package/dist/client/chunks/chart-config-waterfall-DmFeQdIk.js.map +1 -0
  114. package/dist/client/chunks/{chart-data-table-BO4sXsim.js → chart-data-table-CKauQXme.js} +1046 -1121
  115. package/dist/client/chunks/chart-data-table-CKauQXme.js.map +1 -0
  116. package/dist/client/chunks/{chart-funnel-DnWRsmnS.js → chart-funnel-CToKSBaL.js} +184 -222
  117. package/dist/client/chunks/chart-funnel-CToKSBaL.js.map +1 -0
  118. package/dist/client/chunks/chart-gauge-DTVezSk7.js +403 -0
  119. package/dist/client/chunks/chart-gauge-DTVezSk7.js.map +1 -0
  120. package/dist/client/chunks/chart-heat-map-DTuUl0BR.js +236 -0
  121. package/dist/client/chunks/chart-heat-map-DTuUl0BR.js.map +1 -0
  122. package/dist/client/chunks/chart-kpi-delta-Dn-jjO-2.js +408 -0
  123. package/dist/client/chunks/chart-kpi-delta-Dn-jjO-2.js.map +1 -0
  124. package/dist/client/chunks/chart-kpi-number-P_WBiO5S.js +244 -0
  125. package/dist/client/chunks/chart-kpi-number-P_WBiO5S.js.map +1 -0
  126. package/dist/client/chunks/chart-kpi-text-C-Y4eb5H.js +185 -0
  127. package/dist/client/chunks/chart-kpi-text-C-Y4eb5H.js.map +1 -0
  128. package/dist/client/chunks/chart-line-DKgrQA6c.js +101 -0
  129. package/dist/client/chunks/chart-line-DKgrQA6c.js.map +1 -0
  130. package/dist/client/chunks/{chart-markdown-dgUetjyM.js → chart-markdown-CV75S_zL.js} +2 -2
  131. package/dist/client/chunks/chart-markdown-CV75S_zL.js.map +1 -0
  132. package/dist/client/chunks/{chart-measure-profile-ClfpLs4q.js → chart-measure-profile-Ket8fJyf.js} +7 -7
  133. package/dist/client/chunks/chart-measure-profile-Ket8fJyf.js.map +1 -0
  134. package/dist/client/chunks/chart-pie-ByieAX5H.js +119 -0
  135. package/dist/client/chunks/chart-pie-ByieAX5H.js.map +1 -0
  136. package/dist/client/chunks/chart-radar-CiSwHWp4.js +138 -0
  137. package/dist/client/chunks/chart-radar-CiSwHWp4.js.map +1 -0
  138. package/dist/client/chunks/chart-radial-bar-BF6Mhl6f.js +122 -0
  139. package/dist/client/chunks/chart-radial-bar-BF6Mhl6f.js.map +1 -0
  140. package/dist/client/chunks/{chart-sankey-M3XpO_ah.js → chart-sankey-DjrvKw6K.js} +36 -39
  141. package/dist/client/chunks/chart-sankey-DjrvKw6K.js.map +1 -0
  142. package/dist/client/chunks/chart-scatter-Dd9WFqnS.js +258 -0
  143. package/dist/client/chunks/chart-scatter-Dd9WFqnS.js.map +1 -0
  144. package/dist/client/chunks/{chart-sunburst-A_u6lqlS.js → chart-sunburst-leGpuDj7.js} +3 -3
  145. package/dist/client/chunks/chart-sunburst-leGpuDj7.js.map +1 -0
  146. package/dist/client/chunks/chart-tree-map-Ceq5sLZA.js +323 -0
  147. package/dist/client/chunks/chart-tree-map-Ceq5sLZA.js.map +1 -0
  148. package/dist/client/chunks/{chart-waterfall-BuhMoagf.js → chart-waterfall-DyvQReN5.js} +7 -7
  149. package/dist/client/chunks/chart-waterfall-DyvQReN5.js.map +1 -0
  150. package/dist/client/chunks/{charts-core-jRtb0S2M.js → charts-core-DaXSt1Dd.js} +2 -2
  151. package/dist/client/chunks/charts-core-DaXSt1Dd.js.map +1 -0
  152. package/dist/client/chunks/charts-loader-DdTeCeNo.js +84 -0
  153. package/dist/client/chunks/charts-loader-DdTeCeNo.js.map +1 -0
  154. package/dist/client/chunks/{nl-NL-CpVs7ox3.js → nl-NL-2zTAWTej.js} +2 -1
  155. package/dist/client/chunks/{nl-NL-CpVs7ox3.js.map → nl-NL-2zTAWTej.js.map} +1 -1
  156. package/dist/client/chunks/retention-ChW9jYdy.js.map +1 -1
  157. package/dist/client/chunks/{schema-visualization-DE09kQE3.js → schema-visualization-Cb_E9_Gd.js} +12 -12
  158. package/dist/client/chunks/schema-visualization-Cb_E9_Gd.js.map +1 -0
  159. package/dist/client/chunks/{useDirtyStateTracking-CoeQbprt.js → useDirtyStateTracking-MbpxH_v6.js} +95 -84
  160. package/dist/client/chunks/useDirtyStateTracking-MbpxH_v6.js.map +1 -0
  161. package/dist/client/chunks/{useExplainAI-DlnXWdmz.js → useExplainAI-evnZkjCY.js} +14 -14
  162. package/dist/client/chunks/useExplainAI-evnZkjCY.js.map +1 -0
  163. package/dist/client/chunks/{utils-CTKNaXS8.js → utils-3P6z1vz5.js} +2 -2
  164. package/dist/client/chunks/utils-3P6z1vz5.js.map +1 -0
  165. package/dist/client/chunks/{vendor-CPIYyeuD.js → vendor-DSpR0IW6.js} +43 -43
  166. package/dist/client/chunks/{vendor-CPIYyeuD.js.map → vendor-DSpR0IW6.js.map} +1 -1
  167. package/dist/client/client/BatchCoordinator.d.ts +1 -1
  168. package/dist/client/client/CubeClient.d.ts +1 -1
  169. package/dist/client/components/AIAssistant/index.d.ts +3 -3
  170. package/dist/client/components/AIAssistant/utils.d.ts +1 -1
  171. package/dist/client/components/AgenticNotebook/ChatMessage.d.ts +1 -1
  172. package/dist/client/components/AgenticNotebook/NotebookCanvas.d.ts +1 -1
  173. package/dist/client/components/AgenticNotebook/NotebookMarkdownBlock.d.ts +1 -1
  174. package/dist/client/components/AgenticNotebook/NotebookPortletBlock.d.ts +2 -2
  175. package/dist/client/components/AgenticNotebook/agentChatParts.d.ts +34 -0
  176. package/dist/client/components/AgenticNotebook/chatMessageParts.d.ts +39 -0
  177. package/dist/client/components/AgenticNotebook/index.d.ts +2 -2
  178. package/dist/client/components/AgenticNotebook/useAgentChatController.d.ts +25 -0
  179. package/dist/client/components/AgenticNotebook/useNotebookAutosave.d.ts +12 -0
  180. package/dist/client/components/AnalysisBuilder/AnalysisAxisDropZone.d.ts +1 -1
  181. package/dist/client/components/AnalysisBuilder/AnalysisChartConfigPanel.d.ts +4 -4
  182. package/dist/client/components/AnalysisBuilder/AnalysisDisplayConfigPanel.d.ts +1 -1
  183. package/dist/client/components/AnalysisBuilder/AnalysisFilterGroup.d.ts +2 -2
  184. package/dist/client/components/AnalysisBuilder/AnalysisFilterItem.d.ts +2 -2
  185. package/dist/client/components/AnalysisBuilder/AnalysisFilterSection.d.ts +2 -2
  186. package/dist/client/components/AnalysisBuilder/AnalysisModeErrorBoundary.d.ts +1 -1
  187. package/dist/client/components/AnalysisBuilder/AnalysisQueryPanel.d.ts +1 -1
  188. package/dist/client/components/AnalysisBuilder/AnalysisQueryPanelParts.d.ts +64 -0
  189. package/dist/client/components/AnalysisBuilder/AnalysisResultsHeader.d.ts +67 -0
  190. package/dist/client/components/AnalysisBuilder/AnalysisResultsPanel.d.ts +1 -1
  191. package/dist/client/components/AnalysisBuilder/AnalysisTypeSelector.d.ts +1 -1
  192. package/dist/client/components/AnalysisBuilder/BreakdownComparisonToggle.d.ts +13 -0
  193. package/dist/client/components/AnalysisBuilder/BreakdownItemCard.d.ts +1 -1
  194. package/dist/client/components/AnalysisBuilder/BreakdownRow.d.ts +26 -0
  195. package/dist/client/components/AnalysisBuilder/BreakdownSection.d.ts +1 -1
  196. package/dist/client/components/AnalysisBuilder/DisplayOptionControl.d.ts +10 -0
  197. package/dist/client/components/AnalysisBuilder/ExecutionPlanPanel.d.ts +1 -1
  198. package/dist/client/components/AnalysisBuilder/ExecutionPlanPanelParts.d.ts +22 -0
  199. package/dist/client/components/AnalysisBuilder/ExplainAIPanel.d.ts +1 -1
  200. package/dist/client/components/AnalysisBuilder/FieldDetailPanel.d.ts +1 -1
  201. package/dist/client/components/AnalysisBuilder/FieldSearchItem.d.ts +1 -1
  202. package/dist/client/components/AnalysisBuilder/FieldSearchModal.d.ts +1 -1
  203. package/dist/client/components/AnalysisBuilder/FieldSearchResults.d.ts +16 -0
  204. package/dist/client/components/AnalysisBuilder/FilterConfigModal.d.ts +2 -2
  205. package/dist/client/components/AnalysisBuilder/FilterValueInput.d.ts +63 -0
  206. package/dist/client/components/AnalysisBuilder/FlowConfigPanel.d.ts +1 -1
  207. package/dist/client/components/AnalysisBuilder/FlowDepthControls.d.ts +10 -0
  208. package/dist/client/components/AnalysisBuilder/FlowModeContent.d.ts +3 -3
  209. package/dist/client/components/AnalysisBuilder/FlowVisualizationPicker.d.ts +7 -0
  210. package/dist/client/components/AnalysisBuilder/FunnelBindingKeySelector.d.ts +1 -1
  211. package/dist/client/components/AnalysisBuilder/FunnelConfigPanel.d.ts +1 -1
  212. package/dist/client/components/AnalysisBuilder/FunnelModeContent.d.ts +2 -2
  213. package/dist/client/components/AnalysisBuilder/FunnelStepCard.d.ts +1 -1
  214. package/dist/client/components/AnalysisBuilder/FunnelStepList.d.ts +1 -1
  215. package/dist/client/components/AnalysisBuilder/LegacyBooleanOptions.d.ts +8 -0
  216. package/dist/client/components/AnalysisBuilder/MetricItemCard.d.ts +1 -1
  217. package/dist/client/components/AnalysisBuilder/MetricRow.d.ts +23 -0
  218. package/dist/client/components/AnalysisBuilder/MetricsSection.d.ts +1 -1
  219. package/dist/client/components/AnalysisBuilder/RetentionConfigPanel.d.ts +2 -2
  220. package/dist/client/components/AnalysisBuilder/RetentionModeContent.d.ts +3 -3
  221. package/dist/client/components/AnalysisBuilder/SortToggleButton.d.ts +13 -0
  222. package/dist/client/components/AnalysisBuilder/StringArrayInput.d.ts +17 -0
  223. package/dist/client/components/AnalysisBuilder/filterConfigModalUtils.d.ts +30 -0
  224. package/dist/client/components/AnalysisBuilder/hooks/useAnalysisBuilderImperativeHandle.d.ts +13 -0
  225. package/dist/client/components/AnalysisBuilder/hooks/useDragReorder.d.ts +25 -0
  226. package/dist/client/components/AnalysisBuilder/hooks/useFieldSearchKeyboard.d.ts +11 -0
  227. package/dist/client/components/AnalysisBuilder/index.d.ts +1 -1
  228. package/dist/client/components/AnalysisBuilder/types.d.ts +28 -28
  229. package/dist/client/components/AnalysisBuilder/utils/axisConfigUtils.d.ts +23 -0
  230. package/dist/client/components/AnalysisBuilder/utils/executionPlanMarkdown.d.ts +8 -0
  231. package/dist/client/components/AnalysisBuilder/utils/fieldUtils.d.ts +7 -2
  232. package/dist/client/components/AnalysisBuilder/utils/filterUtils.d.ts +1 -1
  233. package/dist/client/components/AnalysisBuilder/utils/index.d.ts +6 -6
  234. package/dist/client/components/AnalysisBuilder/utils/queryUtils.d.ts +2 -2
  235. package/dist/client/components/AnalysisBuilder/utils/recentFieldsUtils.d.ts +2 -2
  236. package/dist/client/components/AnalysisBuilder/utils/resultsPanelDerive.d.ts +68 -0
  237. package/dist/client/components/AnalysisBuilder/utils/shareStateUtils.d.ts +68 -0
  238. package/dist/client/components/AnalysisBuilder/utils/sortUtils.d.ts +7 -0
  239. package/dist/client/components/AnalysisBuilder/utils/storageUtils.d.ts +2 -2
  240. package/dist/client/components/AnalysisBuilderLazy.d.ts +1 -1
  241. package/dist/client/components/AnalyticsDashboard.d.ts +1 -1
  242. package/dist/client/components/AnalyticsPortlet.d.ts +1 -1
  243. package/dist/client/components/ChartTypeSelector.d.ts +2 -2
  244. package/dist/client/components/DashboardFilterPanel.d.ts +1 -1
  245. package/dist/client/components/DashboardFilters/CompactFilterBar.d.ts +1 -1
  246. package/dist/client/components/DashboardFilters/CompactFilterBarParts.d.ts +26 -0
  247. package/dist/client/components/DashboardFilters/DashboardFilterConfigModal.d.ts +2 -2
  248. package/dist/client/components/DashboardFilters/DashboardFilterConfigModalParts.d.ts +27 -0
  249. package/dist/client/components/DashboardFilters/DashboardFilterItem.d.ts +2 -2
  250. package/dist/client/components/DashboardFilters/DashboardFilterValueInput.d.ts +39 -0
  251. package/dist/client/components/DashboardFilters/EditModeFilterList.d.ts +1 -1
  252. package/dist/client/components/DashboardFilters/FilterChip.d.ts +1 -1
  253. package/dist/client/components/DashboardFilters/FilterEditModal.d.ts +2 -2
  254. package/dist/client/components/DashboardFilters/FilterValuePopover.d.ts +1 -1
  255. package/dist/client/components/DashboardFilters/ReadOnlyFilterList.d.ts +2 -2
  256. package/dist/client/components/DashboardFilters/dashboardFilterConfigModalUtils.d.ts +21 -0
  257. package/dist/client/components/DashboardFilters/useCompactFilterBar.d.ts +19 -0
  258. package/dist/client/components/DashboardFilters/useDashboardFilterConfigModal.d.ts +69 -0
  259. package/dist/client/components/DashboardFilters/useDateRangeState.d.ts +19 -0
  260. package/dist/client/components/DashboardFilters/useFilterDropdowns.d.ts +21 -0
  261. package/dist/client/components/DashboardFilters/useFilterValueFetch.d.ts +23 -0
  262. package/dist/client/components/DashboardGrid.d.ts +2 -2
  263. package/dist/client/components/DashboardPortletCard.d.ts +2 -57
  264. package/dist/client/components/DebugModal.d.ts +2 -2
  265. package/dist/client/components/DrillBreadcrumb.d.ts +1 -1
  266. package/dist/client/components/DrillMenu.d.ts +1 -1
  267. package/dist/client/components/FloatingEditToolbar.d.ts +1 -1
  268. package/dist/client/components/MobileStackedLayout.d.ts +2 -2
  269. package/dist/client/components/PortletAnalysisModal.d.ts +1 -1
  270. package/dist/client/components/PortletContainer.d.ts +1 -1
  271. package/dist/client/components/PortletFilterConfigModal.d.ts +1 -1
  272. package/dist/client/components/RowManagedLayout.d.ts +1 -1
  273. package/dist/client/components/SchemaVisualization/CubeNode.d.ts +1 -1
  274. package/dist/client/components/SchemaVisualization/FieldDetailPanel.d.ts +1 -1
  275. package/dist/client/components/SchemaVisualization/RelationshipEdge.d.ts +1 -1
  276. package/dist/client/components/SchemaVisualization/SchemaVisualizationLazy.d.ts +1 -1
  277. package/dist/client/components/TextPortletModal.d.ts +2 -2
  278. package/dist/client/components/analyticsPortlet/PortletChart.d.ts +31 -0
  279. package/dist/client/components/analyticsPortlet/PortletChartView.d.ts +35 -0
  280. package/dist/client/components/analyticsPortlet/PortletStates.d.ts +65 -0
  281. package/dist/client/components/analyticsPortlet/parsePortletQuery.d.ts +22 -0
  282. package/dist/client/components/analyticsPortlet/portletRenderState.d.ts +31 -0
  283. package/dist/client/components/analyticsPortlet/usePortletDebugData.d.ts +37 -0
  284. package/dist/client/components/analyticsPortlet/usePortletDrillState.d.ts +17 -0
  285. package/dist/client/components/analyticsPortlet/usePortletQueryResults.d.ts +37 -0
  286. package/dist/client/components/charts/ActivityGridChart.config.d.ts +1 -1
  287. package/dist/client/components/charts/ActivityGridChart.d.ts +1 -1
  288. package/dist/client/components/charts/ActivityGridChart.helpers.d.ts +33 -0
  289. package/dist/client/components/charts/ActivityGridChart.render.d.ts +31 -0
  290. package/dist/client/components/charts/AreaChart.config.d.ts +1 -1
  291. package/dist/client/components/charts/AreaChart.d.ts +1 -1
  292. package/dist/client/components/charts/AxisFormatControls.d.ts +4 -2
  293. package/dist/client/components/charts/BarChart.config.d.ts +1 -1
  294. package/dist/client/components/charts/BarChart.d.ts +1 -1
  295. package/dist/client/components/charts/BarChart.helpers.d.ts +23 -0
  296. package/dist/client/components/charts/BarSeries.d.ts +29 -0
  297. package/dist/client/components/charts/BoxPlotChart.config.d.ts +1 -1
  298. package/dist/client/components/charts/BoxPlotChart.d.ts +1 -1
  299. package/dist/client/components/charts/BubbleChart.config.d.ts +1 -1
  300. package/dist/client/components/charts/BubbleChart.d.ts +1 -1
  301. package/dist/client/components/charts/BubbleChart.helpers.d.ts +43 -0
  302. package/dist/client/components/charts/BubbleChart.render.d.ts +21 -0
  303. package/dist/client/components/charts/CandlestickChart.config.d.ts +1 -1
  304. package/dist/client/components/charts/CandlestickChart.d.ts +1 -1
  305. package/dist/client/components/charts/ChartStates.d.ts +38 -0
  306. package/dist/client/components/charts/DataTable.config.d.ts +1 -1
  307. package/dist/client/components/charts/DataTable.d.ts +1 -1
  308. package/dist/client/components/charts/FunnelChart.config.d.ts +1 -1
  309. package/dist/client/components/charts/FunnelChart.d.ts +1 -1
  310. package/dist/client/components/charts/FunnelChart.helpers.d.ts +25 -0
  311. package/dist/client/components/charts/FunnelViews.d.ts +16 -0
  312. package/dist/client/components/charts/GaugeChart.config.d.ts +1 -1
  313. package/dist/client/components/charts/GaugeChart.d.ts +1 -1
  314. package/dist/client/components/charts/HeatMapCanvas.d.ts +25 -0
  315. package/dist/client/components/charts/HeatMapChart.config.d.ts +1 -1
  316. package/dist/client/components/charts/HeatMapChart.d.ts +1 -1
  317. package/dist/client/components/charts/HeatMapChart.helpers.d.ts +64 -0
  318. package/dist/client/components/charts/KpiDelta.config.d.ts +1 -1
  319. package/dist/client/components/charts/KpiDelta.d.ts +1 -1
  320. package/dist/client/components/charts/KpiDelta.helpers.d.ts +20 -0
  321. package/dist/client/components/charts/KpiNumber.config.d.ts +1 -1
  322. package/dist/client/components/charts/KpiNumber.d.ts +1 -1
  323. package/dist/client/components/charts/KpiNumber.helpers.d.ts +30 -0
  324. package/dist/client/components/charts/KpiStates.d.ts +19 -0
  325. package/dist/client/components/charts/KpiText.config.d.ts +1 -1
  326. package/dist/client/components/charts/KpiText.d.ts +1 -1
  327. package/dist/client/components/charts/LineChart.config.d.ts +1 -1
  328. package/dist/client/components/charts/LineChart.d.ts +1 -1
  329. package/dist/client/components/charts/MarkdownChart.config.d.ts +1 -1
  330. package/dist/client/components/charts/MarkdownChart.d.ts +1 -1
  331. package/dist/client/components/charts/MeasureProfileChart.config.d.ts +1 -1
  332. package/dist/client/components/charts/MeasureProfileChart.d.ts +1 -1
  333. package/dist/client/components/charts/PieChart.config.d.ts +1 -1
  334. package/dist/client/components/charts/PieChart.d.ts +1 -1
  335. package/dist/client/components/charts/RadarChart.config.d.ts +1 -1
  336. package/dist/client/components/charts/RadarChart.d.ts +1 -1
  337. package/dist/client/components/charts/RadialBarChart.config.d.ts +1 -1
  338. package/dist/client/components/charts/RadialBarChart.d.ts +1 -1
  339. package/dist/client/components/charts/RetentionCombinedChart.config.d.ts +1 -1
  340. package/dist/client/components/charts/RetentionCombinedChart.d.ts +1 -1
  341. package/dist/client/components/charts/RetentionHeatmap.config.d.ts +1 -1
  342. package/dist/client/components/charts/RetentionHeatmap.d.ts +1 -1
  343. package/dist/client/components/charts/SankeyChart.config.d.ts +1 -1
  344. package/dist/client/components/charts/SankeyChart.d.ts +1 -1
  345. package/dist/client/components/charts/ScatterChart.config.d.ts +1 -1
  346. package/dist/client/components/charts/ScatterChart.d.ts +1 -1
  347. package/dist/client/components/charts/ScatterChart.helpers.d.ts +43 -0
  348. package/dist/client/components/charts/ScatterSeries.d.ts +17 -0
  349. package/dist/client/components/charts/ScatterTooltip.d.ts +21 -0
  350. package/dist/client/components/charts/SunburstChart.config.d.ts +1 -1
  351. package/dist/client/components/charts/SunburstChart.d.ts +1 -1
  352. package/dist/client/components/charts/TreeMapChart.config.d.ts +1 -1
  353. package/dist/client/components/charts/TreeMapChart.d.ts +1 -1
  354. package/dist/client/components/charts/TreeMapChart.helpers.d.ts +37 -0
  355. package/dist/client/components/charts/TreeMapContent.d.ts +24 -0
  356. package/dist/client/components/charts/TreeMapLegend.d.ts +13 -0
  357. package/dist/client/components/charts/WaterfallChart.config.d.ts +1 -1
  358. package/dist/client/components/charts/WaterfallChart.d.ts +1 -1
  359. package/dist/client/components/charts/cartesianChartHelpers.d.ts +126 -0
  360. package/dist/client/components/charts/chartAxisResolution.d.ts +32 -0
  361. package/dist/client/components/charts/chartScaffolding.d.ts +77 -0
  362. package/dist/client/components/charts/gaugeChartHelpers.d.ts +36 -0
  363. package/dist/client/components/charts/index.d.ts +21 -21
  364. package/dist/client/components/charts/kpiTextHelpers.d.ts +46 -0
  365. package/dist/client/components/charts/radarChartHelpers.d.ts +14 -0
  366. package/dist/client/components/charts/radialBarChartHelpers.d.ts +22 -0
  367. package/dist/client/components/charts/useChartDimensions.d.ts +20 -0
  368. package/dist/client/components/charts/useKpiDimensions.d.ts +30 -0
  369. package/dist/client/components/dashboard/DashboardContext.d.ts +6 -6
  370. package/dist/client/components/dashboard/DashboardCoordinator.d.ts +1 -1
  371. package/dist/client/components/dashboard/DashboardEditBar.d.ts +5 -0
  372. package/dist/client/components/dashboard/DashboardProvider.d.ts +1 -1
  373. package/dist/client/components/dashboard/LayoutModeToggle.d.ts +10 -0
  374. package/dist/client/components/dashboard/dashboardGridUtils.d.ts +1 -1
  375. package/dist/client/components/dashboard/index.d.ts +7 -7
  376. package/dist/client/components/dashboardPortletCard/FilterFieldChip.d.ts +12 -0
  377. package/dist/client/components/dashboardPortletCard/PortletCardHeader.d.ts +43 -0
  378. package/dist/client/components/dashboardPortletCard/cardStyles.d.ts +33 -0
  379. package/dist/client/components/dashboardPortletCard/filterField.d.ts +12 -0
  380. package/dist/client/components/dashboardPortletCard/propsEqual.d.ts +55 -0
  381. package/dist/client/components/dashboardPortletCard/usePortletCardActions.d.ts +16 -0
  382. package/dist/client/components/portletAnalysisModal/saveValidation.d.ts +8 -0
  383. package/dist/client/components/shared/DateRangeFilter.d.ts +1 -1
  384. package/dist/client/components/shared/FilterBuilder.d.ts +1 -1
  385. package/dist/client/components/shared/FilterGroup.d.ts +1 -1
  386. package/dist/client/components/shared/FilterItem.d.ts +1 -1
  387. package/dist/client/components/shared/FilterValueSelector.d.ts +1 -1
  388. package/dist/client/components/shared/dateRangeUtils.d.ts +40 -0
  389. package/dist/client/components/shared/filterDisplayUtils.d.ts +10 -0
  390. package/dist/client/components/shared/filterItem/FilterDateRangeSelector.d.ts +17 -0
  391. package/dist/client/components/shared/filterItem/FilterFieldDropdown.d.ts +16 -0
  392. package/dist/client/components/shared/filterItem/dateRangeSync.d.ts +14 -0
  393. package/dist/client/components/shared/filterItem/fieldVisuals.d.ts +5 -0
  394. package/dist/client/components/shared/filterValueSelector/FilterValueInputs.d.ts +55 -0
  395. package/dist/client/components/shared/filterValueSelector/useFilterValueSelectorState.d.ts +25 -0
  396. package/dist/client/components/shared/queryFieldUtils.d.ts +21 -0
  397. package/dist/client/components/shared/types.d.ts +8 -8
  398. package/dist/client/components/shared/utils.d.ts +7 -46
  399. package/dist/client/components.d.ts +11 -11
  400. package/dist/client/components.js +3 -3
  401. package/dist/client/hooks/agentChatStream.d.ts +39 -0
  402. package/dist/client/hooks/analysisQueryExecutionModes.d.ts +133 -0
  403. package/dist/client/hooks/dashboard/layoutUtils.d.ts +1 -1
  404. package/dist/client/hooks/dashboard/useDashboardController.d.ts +2 -2
  405. package/dist/client/hooks/dashboard/useGridLayoutEngine.d.ts +1 -1
  406. package/dist/client/hooks/dashboard/useRowLayoutEngine.d.ts +1 -1
  407. package/dist/client/hooks/drillNavigation.d.ts +25 -0
  408. package/dist/client/hooks/queries/index.d.ts +9 -9
  409. package/dist/client/hooks/queries/useCubeLoadQuery.d.ts +2 -2
  410. package/dist/client/hooks/queries/useCubeMetaQuery.d.ts +2 -2
  411. package/dist/client/hooks/queries/useDryRunQuery.d.ts +2 -2
  412. package/dist/client/hooks/queries/useExplainAI.d.ts +1 -1
  413. package/dist/client/hooks/queries/useExplainQuery.d.ts +1 -1
  414. package/dist/client/hooks/queries/useFlowQuery.d.ts +1 -1
  415. package/dist/client/hooks/queries/useFunnelQuery.d.ts +1 -1
  416. package/dist/client/hooks/queries/useMultiCubeLoadQuery.d.ts +1 -1
  417. package/dist/client/hooks/queries/useRetentionQuery.d.ts +1 -1
  418. package/dist/client/hooks/useAgentChat.d.ts +1 -1
  419. package/dist/client/hooks/useAnalysisAI.d.ts +4 -4
  420. package/dist/client/hooks/useAnalysisBuilderHook.d.ts +27 -27
  421. package/dist/client/hooks/useAnalysisChartDefaults.d.ts +4 -4
  422. package/dist/client/hooks/useAnalysisCombinedFields.d.ts +2 -2
  423. package/dist/client/hooks/useAnalysisInitialization.d.ts +1 -1
  424. package/dist/client/hooks/useAnalysisQueryBuilder.d.ts +3 -3
  425. package/dist/client/hooks/useAnalysisQueryExecution.d.ts +7 -7
  426. package/dist/client/hooks/useAnalysisShare.d.ts +1 -1
  427. package/dist/client/hooks/useAnalysisUIState.d.ts +2 -2
  428. package/dist/client/hooks/useDashboardHook.d.ts +2 -2
  429. package/dist/client/hooks/useDataBrowser.d.ts +5 -5
  430. package/dist/client/hooks/useDrillInteraction.d.ts +1 -1
  431. package/dist/client/hooks/useTheme.d.ts +1 -1
  432. package/dist/client/hooks/useTranslation.d.ts +1 -1
  433. package/dist/client/hooks.d.ts +11 -11
  434. package/dist/client/hooks.js +3 -3
  435. package/dist/client/icons/defaultIcons.d.ts +1 -1
  436. package/dist/client/icons/index.d.ts +3 -3
  437. package/dist/client/icons/registry.d.ts +1 -1
  438. package/dist/client/icons.js +2 -2
  439. package/dist/client/index.d.ts +74 -74
  440. package/dist/client/index.js +816 -669
  441. package/dist/client/index.js.map +1 -1
  442. package/dist/client/providers/CubeApiProvider.d.ts +3 -3
  443. package/dist/client/providers/CubeFeaturesProvider.d.ts +1 -1
  444. package/dist/client/providers/CubeMetaContext.d.ts +1 -1
  445. package/dist/client/providers/CubeProvider.d.ts +7 -7
  446. package/dist/client/providers/I18nProvider.d.ts +1 -1
  447. package/dist/client/providers.d.ts +4 -4
  448. package/dist/client/providers.js +3 -3
  449. package/dist/client/schema.d.ts +2 -2
  450. package/dist/client/schema.js +1 -1
  451. package/dist/client/shared/chartConfigBuilders.d.ts +18 -0
  452. package/dist/client/shared/chartDefaults.d.ts +4 -4
  453. package/dist/client/shared/components/QueryAnalysisPanel.d.ts +1 -1
  454. package/dist/client/shared/components/QueryAnalysisPanel.sections.d.ts +41 -0
  455. package/dist/client/shared/index.d.ts +7 -7
  456. package/dist/client/shared/queryTransforms.d.ts +20 -0
  457. package/dist/client/shared/types.d.ts +1 -1
  458. package/dist/client/shared/utils.d.ts +4 -6
  459. package/dist/client/stores/analysisBuilderStore.d.ts +9 -9
  460. package/dist/client/stores/dashboardStore.d.ts +3 -3
  461. package/dist/client/stores/dataBrowserStore.d.ts +1 -1
  462. package/dist/client/stores/notebookStore.d.ts +1 -1
  463. package/dist/client/stores/optionsToAnalysisConfig.d.ts +17 -0
  464. package/dist/client/stores/slices/coreSlice.d.ts +3 -3
  465. package/dist/client/stores/slices/flowSlice.d.ts +3 -3
  466. package/dist/client/stores/slices/funnelSlice.d.ts +3 -3
  467. package/dist/client/stores/slices/index.d.ts +7 -7
  468. package/dist/client/stores/slices/querySlice.d.ts +3 -3
  469. package/dist/client/stores/slices/retentionSlice.d.ts +3 -3
  470. package/dist/client/stores/slices/uiSlice.d.ts +2 -2
  471. package/dist/client/styles.css +1 -1
  472. package/dist/client/types/analysisConfig.d.ts +4 -4
  473. package/dist/client/types/drill.d.ts +5 -5
  474. package/dist/client/types/flow.d.ts +2 -2
  475. package/dist/client/types/funnel.d.ts +1 -1
  476. package/dist/client/types/retention.d.ts +2 -2
  477. package/dist/client/types.d.ts +12 -12
  478. package/dist/client/utils/axisValueFormatting.d.ts +32 -0
  479. package/dist/client/utils/chartUtils.d.ts +1 -1
  480. package/dist/client/utils/configMigration.d.ts +2 -2
  481. package/dist/client/utils/drillQueryBuilder.d.ts +2 -2
  482. package/dist/client/utils/exportXlsx.d.ts +2 -2
  483. package/dist/client/utils/filterUtils.d.ts +1 -1
  484. package/dist/client/utils/funnelExecution.d.ts +2 -2
  485. package/dist/client/utils/funnelValidation.d.ts +2 -2
  486. package/dist/client/utils/index.d.ts +10 -10
  487. package/dist/client/utils/joinReachability.d.ts +1 -1
  488. package/dist/client/utils/multiQueryUtils.d.ts +1 -1
  489. package/dist/client/utils/multiQueryValidation.d.ts +1 -1
  490. package/dist/client/utils/pivotUtils.d.ts +1 -1
  491. package/dist/client/utils/shareUtils.d.ts +1 -1
  492. package/dist/client/utils/thumbnail.d.ts +1 -1
  493. package/dist/client/utils/timeValueFormatting.d.ts +32 -0
  494. package/dist/client/utils.d.ts +2 -2
  495. package/dist/client/utils.js +6 -6
  496. package/dist/client-bundle-stats.html +1 -1
  497. package/dist/mcp-app/mcp-app.html +55 -55
  498. package/dist/server/{server/adapters → adapters}/base-adapter.d.ts +81 -36
  499. package/dist/server/adapters/databend-adapter.d.ts +63 -0
  500. package/dist/server/{server/adapters → adapters}/duckdb-adapter.d.ts +6 -60
  501. package/dist/server/adapters/mysql-adapter.d.ts +65 -0
  502. package/dist/server/adapters/postgres-adapter.d.ts +55 -0
  503. package/dist/server/{server/adapters → adapters}/singlestore-adapter.d.ts +1 -1
  504. package/dist/server/adapters/snowflake-adapter.d.ts +53 -0
  505. package/dist/server/{server/adapters → adapters}/sqlite-adapter.d.ts +13 -33
  506. package/dist/server/adapters/window-function-builder.d.ts +11 -0
  507. package/dist/server/{server/agent → agent}/chart-validation.d.ts +0 -5
  508. package/dist/server/agent/handler-steps.d.ts +37 -0
  509. package/dist/server/{server/agent → agent}/handler.d.ts +3 -3
  510. package/dist/server/agent/index.d.ts +11 -0
  511. package/dist/server/{server/agent → agent}/providers/anthropic.d.ts +1 -1
  512. package/dist/server/{server/agent → agent}/providers/factory.d.ts +1 -1
  513. package/dist/server/{server/agent → agent}/providers/google.d.ts +1 -1
  514. package/dist/server/agent/providers/index.d.ts +6 -0
  515. package/dist/server/{server/agent → agent}/providers/openai.d.ts +1 -1
  516. package/dist/server/{server/agent → agent}/system-prompt.d.ts +1 -1
  517. package/dist/server/{server/agent → agent}/tools.d.ts +4 -4
  518. package/dist/server/{server/agent → agent}/types.d.ts +1 -1
  519. package/dist/server/ai/discovery-helpers.d.ts +29 -0
  520. package/dist/server/{server/ai → ai}/discovery.d.ts +6 -2
  521. package/dist/server/{server/ai → ai}/index.d.ts +6 -6
  522. package/dist/server/ai/suggestion-helpers.d.ts +33 -0
  523. package/dist/server/{server/ai → ai}/suggestion.d.ts +2 -5
  524. package/dist/server/ai/validation-helpers.d.ts +21 -0
  525. package/dist/server/{server/ai → ai}/validation.d.ts +2 -5
  526. package/dist/server/builders/analysis-utils.d.ts +106 -0
  527. package/dist/server/{server/builders → builders}/comparison-query-builder.d.ts +2 -2
  528. package/dist/server/{server/builders → builders}/cte-builder.d.ts +48 -2
  529. package/dist/server/{server/builders → builders}/date-time-builder.d.ts +7 -2
  530. package/dist/server/builders/date-time-helpers.d.ts +34 -0
  531. package/dist/server/{server/builders → builders}/filter-builder.d.ts +5 -3
  532. package/dist/server/builders/filter-operators.d.ts +23 -0
  533. package/dist/server/builders/flow-query-builder.d.ts +136 -0
  534. package/dist/server/{server/builders → builders}/funnel-query-builder.d.ts +18 -7
  535. package/dist/server/{server/builders → builders}/group-by-builder.d.ts +13 -2
  536. package/dist/server/builders/index.d.ts +13 -0
  537. package/dist/server/{server/builders → builders}/measure-builder.d.ts +46 -3
  538. package/dist/server/{server/builders → builders}/retention-query-builder.d.ts +14 -16
  539. package/dist/server/cache-providers/index.d.ts +5 -0
  540. package/dist/server/{server/cache-providers → cache-providers}/memory.d.ts +1 -1
  541. package/dist/server/{server/cache-utils.d.ts → cache-utils.d.ts} +26 -6
  542. package/dist/server/compiler-metadata.d.ts +11 -0
  543. package/dist/server/{server/compiler.d.ts → compiler.d.ts} +9 -15
  544. package/dist/server/{server/cube-utils.d.ts → cube-utils.d.ts} +29 -4
  545. package/dist/server/{server/database-utils.d.ts → database-utils.d.ts} +1 -1
  546. package/dist/server/execution/annotation-builder.d.ts +12 -0
  547. package/dist/server/execution/filter-cache-preloader.d.ts +19 -0
  548. package/dist/server/execution/mode-router.d.ts +25 -0
  549. package/dist/server/execution/query-result-cache.d.ts +21 -0
  550. package/dist/server/execution/result-post-processor.d.ts +10 -0
  551. package/dist/server/{server/executor.d.ts → executor.d.ts} +35 -32
  552. package/dist/server/{server/executors → executors}/base-executor.d.ts +2 -2
  553. package/dist/server/{server/executors → executors}/databend-executor.d.ts +2 -2
  554. package/dist/server/{server/executors → executors}/duckdb-executor.d.ts +2 -2
  555. package/dist/server/executors/explain-utils.d.ts +28 -0
  556. package/dist/server/{server/executors → executors}/index.d.ts +9 -9
  557. package/dist/server/{server/executors → executors}/mysql-executor.d.ts +2 -2
  558. package/dist/server/{server/executors → executors}/postgres-executor.d.ts +2 -2
  559. package/dist/server/{server/executors → executors}/singlestore-executor.d.ts +2 -2
  560. package/dist/server/{server/executors → executors}/snowflake-executor.d.ts +2 -2
  561. package/dist/server/{server/executors → executors}/sqlite-executor.d.ts +2 -2
  562. package/dist/server/{server/explain → explain}/databend-parser.d.ts +1 -1
  563. package/dist/server/{server/explain → explain}/duckdb-parser.d.ts +1 -1
  564. package/dist/server/explain/explain-tree.d.ts +20 -0
  565. package/dist/server/explain/index.d.ts +9 -0
  566. package/dist/server/{server/explain → explain}/mysql-parser.d.ts +1 -1
  567. package/dist/server/{server/explain → explain}/postgres-parser.d.ts +1 -1
  568. package/dist/server/{server/explain → explain}/snowflake-parser.d.ts +1 -1
  569. package/dist/server/{server/explain → explain}/sqlite-parser.d.ts +1 -1
  570. package/dist/server/{server/filter-cache.d.ts → filter-cache.d.ts} +2 -2
  571. package/dist/server/{server/gap-filler.d.ts → gap-filler.d.ts} +8 -2
  572. package/dist/server/google-BOnRIN1w.cjs +2 -0
  573. package/dist/{adapters/google-CFYljAOF.js → server/google-CvKM9yVM.js} +83 -71
  574. package/dist/server/index.cjs +179 -211
  575. package/dist/server/index.d.ts +38 -2
  576. package/dist/server/index.js +6330 -6458
  577. package/dist/server/logical-plan/cte-planner-helpers.d.ts +37 -0
  578. package/dist/server/logical-plan/cte-planner.d.ts +104 -0
  579. package/dist/server/logical-plan/filter-propagation.d.ts +44 -0
  580. package/dist/server/{server/logical-plan → logical-plan}/index.d.ts +11 -6
  581. package/dist/server/logical-plan/join-planner.d.ts +27 -0
  582. package/dist/server/{server/logical-plan → logical-plan}/logical-plan-builder.d.ts +5 -5
  583. package/dist/server/logical-plan/logical-planner.d.ts +39 -0
  584. package/dist/server/{server/logical-plan → logical-plan}/optimiser.d.ts +4 -2
  585. package/dist/server/logical-plan/plan-analysis-reporter.d.ts +59 -0
  586. package/dist/server/logical-plan/planner-utils.d.ts +20 -0
  587. package/dist/server/{server/logical-plan → logical-plan}/types.d.ts +18 -10
  588. package/dist/server/measure-classification.d.ts +40 -0
  589. package/dist/server/{openai-BZdAA7Ji.js → openai-cDlFSTk6.js} +60 -58
  590. package/dist/server/openai-vXvLni8v.cjs +1 -0
  591. package/dist/server/physical-plan/drizzle-plan-builder.d.ts +50 -0
  592. package/dist/server/{server/physical-plan → physical-plan}/drizzle-sql-builder.d.ts +14 -3
  593. package/dist/server/physical-plan/index.d.ts +2 -0
  594. package/dist/server/{server/physical-plan → physical-plan}/processors/cte-processor.d.ts +2 -2
  595. package/dist/server/physical-plan/processors/index.d.ts +8 -0
  596. package/dist/server/{server/physical-plan → physical-plan}/processors/joins-processor.d.ts +2 -2
  597. package/dist/server/physical-plan/processors/keys-dedup-processor.d.ts +13 -0
  598. package/dist/server/physical-plan/processors/multi-fact-processor.d.ts +13 -0
  599. package/dist/server/{server/physical-plan → physical-plan}/processors/predicates-processor.d.ts +2 -2
  600. package/dist/server/{server/physical-plan → physical-plan}/processors/selection-processor.d.ts +2 -2
  601. package/dist/server/{server/physical-plan → physical-plan}/processors/shared.d.ts +9 -4
  602. package/dist/server/{server/physical-plan → physical-plan}/processors/window-processor.d.ts +2 -2
  603. package/dist/server/query-handlers.d.ts +79 -0
  604. package/dist/server/query-modes.d.ts +28 -0
  605. package/dist/server/query-validator.d.ts +9 -0
  606. package/dist/server/{server/resolvers → resolvers}/calculated-measure-resolver.d.ts +6 -1
  607. package/dist/server/{server/resolvers → resolvers}/index.d.ts +2 -2
  608. package/dist/server/{server/resolvers → resolvers}/join-path-resolver.d.ts +7 -1
  609. package/dist/server/sql-format.d.ts +11 -0
  610. package/dist/server/{server/template-substitution.d.ts → template-substitution.d.ts} +1 -1
  611. package/dist/server/{server/types → types}/cache.d.ts +1 -1
  612. package/dist/server/{server/types → types}/cube.d.ts +22 -8
  613. package/dist/server/{server/types → types}/executor.d.ts +2 -2
  614. package/dist/server/{server/types → types}/flow.d.ts +7 -6
  615. package/dist/server/{server/types → types}/funnel.d.ts +1 -1
  616. package/dist/server/types/index.d.ts +11 -0
  617. package/dist/server/{server/types → types}/metadata.d.ts +1 -1
  618. package/dist/server/{server/types → types}/query.d.ts +4 -4
  619. package/dist/server/{server/types → types}/retention.d.ts +1 -1
  620. package/dist/server/{server/types → types}/utils.d.ts +1 -1
  621. package/dist/server/types/validation.d.ts +14 -0
  622. package/package.json +22 -7
  623. package/dist/adapters/google-DUlXeeDA.cjs +0 -2
  624. package/dist/adapters/handler-CzbCuS6_.cjs +0 -25
  625. package/dist/adapters/locale-BPB7flIG.js +0 -8249
  626. package/dist/adapters/locale-tIMrNcCr.cjs +0 -198
  627. package/dist/adapters/mcp-transport-C2QzXm6h.cjs +0 -40
  628. package/dist/adapters/mcp-transport-D0B3S1tB.js +0 -579
  629. package/dist/adapters/openai-D_U4V0kT.cjs +0 -1
  630. package/dist/adapters/utils-KV37IBIv.cjs +0 -128
  631. package/dist/client/chunks/DashboardEditModal-CjCIAT-J.js.map +0 -1
  632. package/dist/client/chunks/RetentionCombinedChart-BPkfcTa8.js.map +0 -1
  633. package/dist/client/chunks/RetentionHeatmap-DGzLzr7h.js.map +0 -1
  634. package/dist/client/chunks/analysis-builder-MuMIzoRq.js +0 -5367
  635. package/dist/client/chunks/analysis-builder-MuMIzoRq.js.map +0 -1
  636. package/dist/client/chunks/analysis-builder-shared-CYVwSPqt.js.map +0 -1
  637. package/dist/client/chunks/chart-activity-grid-DmruKPab.js.map +0 -1
  638. package/dist/client/chunks/chart-area-DHCPM4Em.js +0 -450
  639. package/dist/client/chunks/chart-area-DHCPM4Em.js.map +0 -1
  640. package/dist/client/chunks/chart-bar-KddciGDv.js +0 -271
  641. package/dist/client/chunks/chart-bar-KddciGDv.js.map +0 -1
  642. package/dist/client/chunks/chart-box-plot-DYKfyOI8.js.map +0 -1
  643. package/dist/client/chunks/chart-bubble-CfqiB538.js +0 -273
  644. package/dist/client/chunks/chart-bubble-CfqiB538.js.map +0 -1
  645. package/dist/client/chunks/chart-candlestick-Dwc92Mrj.js.map +0 -1
  646. package/dist/client/chunks/chart-config-area-Bq_UsW3x.js +0 -101
  647. package/dist/client/chunks/chart-config-area-Bq_UsW3x.js.map +0 -1
  648. package/dist/client/chunks/chart-config-bar-_JEGZnAu.js +0 -95
  649. package/dist/client/chunks/chart-config-bar-_JEGZnAu.js.map +0 -1
  650. package/dist/client/chunks/chart-config-box-plot-DJ-dWWXA.js.map +0 -1
  651. package/dist/client/chunks/chart-config-gauge-DSwC04l0.js.map +0 -1
  652. package/dist/client/chunks/chart-config-kpi-delta-D6BIkHL3.js.map +0 -1
  653. package/dist/client/chunks/chart-config-kpi-number-Bx-V9a62.js.map +0 -1
  654. package/dist/client/chunks/chart-config-kpi-text-CcqC1u-8.js.map +0 -1
  655. package/dist/client/chunks/chart-config-line-Db3jDsWc.js.map +0 -1
  656. package/dist/client/chunks/chart-config-pie-DD4SmRTF.js.map +0 -1
  657. package/dist/client/chunks/chart-config-radar-CC2XAaGr.js.map +0 -1
  658. package/dist/client/chunks/chart-config-radial-bar-DmxKx1R0.js.map +0 -1
  659. package/dist/client/chunks/chart-config-tree-map-BI-oQStO.js.map +0 -1
  660. package/dist/client/chunks/chart-config-waterfall-DSnyixbI.js.map +0 -1
  661. package/dist/client/chunks/chart-data-table-BO4sXsim.js.map +0 -1
  662. package/dist/client/chunks/chart-funnel-DnWRsmnS.js.map +0 -1
  663. package/dist/client/chunks/chart-gauge-CgMeqeGb.js +0 -424
  664. package/dist/client/chunks/chart-gauge-CgMeqeGb.js.map +0 -1
  665. package/dist/client/chunks/chart-heat-map-DcGm9SWK.js +0 -231
  666. package/dist/client/chunks/chart-heat-map-DcGm9SWK.js.map +0 -1
  667. package/dist/client/chunks/chart-kpi-delta-C2wKPqCb.js +0 -343
  668. package/dist/client/chunks/chart-kpi-delta-C2wKPqCb.js.map +0 -1
  669. package/dist/client/chunks/chart-kpi-number-gWYF44ol.js +0 -322
  670. package/dist/client/chunks/chart-kpi-number-gWYF44ol.js.map +0 -1
  671. package/dist/client/chunks/chart-kpi-text-DIYtJtk4.js +0 -149
  672. package/dist/client/chunks/chart-kpi-text-DIYtJtk4.js.map +0 -1
  673. package/dist/client/chunks/chart-line-9BEGN5Ti.js +0 -433
  674. package/dist/client/chunks/chart-line-9BEGN5Ti.js.map +0 -1
  675. package/dist/client/chunks/chart-markdown-dgUetjyM.js.map +0 -1
  676. package/dist/client/chunks/chart-measure-profile-ClfpLs4q.js.map +0 -1
  677. package/dist/client/chunks/chart-pie-BjAIhyOi.js +0 -172
  678. package/dist/client/chunks/chart-pie-BjAIhyOi.js.map +0 -1
  679. package/dist/client/chunks/chart-radar-Dgkcl2bN.js +0 -154
  680. package/dist/client/chunks/chart-radar-Dgkcl2bN.js.map +0 -1
  681. package/dist/client/chunks/chart-radial-bar-DdWJjAhK.js +0 -148
  682. package/dist/client/chunks/chart-radial-bar-DdWJjAhK.js.map +0 -1
  683. package/dist/client/chunks/chart-sankey-M3XpO_ah.js.map +0 -1
  684. package/dist/client/chunks/chart-scatter-DaHYP_OL.js +0 -255
  685. package/dist/client/chunks/chart-scatter-DaHYP_OL.js.map +0 -1
  686. package/dist/client/chunks/chart-sunburst-A_u6lqlS.js.map +0 -1
  687. package/dist/client/chunks/chart-tree-map-uiwUU4nb.js +0 -298
  688. package/dist/client/chunks/chart-tree-map-uiwUU4nb.js.map +0 -1
  689. package/dist/client/chunks/chart-waterfall-BuhMoagf.js.map +0 -1
  690. package/dist/client/chunks/charts-core-jRtb0S2M.js.map +0 -1
  691. package/dist/client/chunks/schema-visualization-DE09kQE3.js.map +0 -1
  692. package/dist/client/chunks/useDirtyStateTracking-CoeQbprt.js.map +0 -1
  693. package/dist/client/chunks/useExplainAI-DlnXWdmz.js.map +0 -1
  694. package/dist/client/chunks/utils-CTKNaXS8.js.map +0 -1
  695. package/dist/server/google-DUlXeeDA.cjs +0 -2
  696. package/dist/server/openai-D_U4V0kT.cjs +0 -1
  697. package/dist/server/server/adapters/databend-adapter.d.ts +0 -114
  698. package/dist/server/server/adapters/mysql-adapter.d.ts +0 -122
  699. package/dist/server/server/adapters/postgres-adapter.d.ts +0 -119
  700. package/dist/server/server/adapters/snowflake-adapter.d.ts +0 -116
  701. package/dist/server/server/agent/index.d.ts +0 -11
  702. package/dist/server/server/agent/providers/index.d.ts +0 -6
  703. package/dist/server/server/builders/flow-query-builder.d.ts +0 -109
  704. package/dist/server/server/builders/index.d.ts +0 -13
  705. package/dist/server/server/cache-providers/index.d.ts +0 -5
  706. package/dist/server/server/explain/index.d.ts +0 -9
  707. package/dist/server/server/index.d.ts +0 -36
  708. package/dist/server/server/logical-plan/logical-planner.d.ts +0 -232
  709. package/dist/server/server/physical-plan/drizzle-plan-builder.d.ts +0 -50
  710. package/dist/server/server/physical-plan/index.d.ts +0 -2
  711. package/dist/server/server/physical-plan/processors/index.d.ts +0 -6
  712. package/dist/server/server/types/index.d.ts +0 -11
  713. /package/dist/server/{server/agent → agent}/providers/types.d.ts +0 -0
  714. /package/dist/server/{server/ai → ai}/mcp-prompts.d.ts +0 -0
  715. /package/dist/server/{server/ai → ai}/query-schema.d.ts +0 -0
  716. /package/dist/server/{server/ai → ai}/schemas.d.ts +0 -0
  717. /package/dist/server/{server/prompts → prompts}/explain-analysis-prompt.d.ts +0 -0
  718. /package/dist/server/{server/prompts → prompts}/index.d.ts +0 -0
  719. /package/dist/server/{server/prompts → prompts}/single-step-prompt.d.ts +0 -0
  720. /package/dist/server/{server/prompts → prompts}/step0-validation-prompt.d.ts +0 -0
  721. /package/dist/server/{server/prompts → prompts}/step1-shape-prompt.d.ts +0 -0
  722. /package/dist/server/{server/prompts → prompts}/step2-complete-prompt.d.ts +0 -0
  723. /package/dist/server/{server/prompts → prompts}/types.d.ts +0 -0
  724. /package/dist/server/{server/types → types}/analysis.d.ts +0 -0
  725. /package/dist/server/{server/types → types}/core.d.ts +0 -0
@@ -0,0 +1,37 @@
1
+ import { Cube, CubeJoin, SemanticQuery } from '../types/index.js';
2
+ /** A resolved CTE join key (column names plus the underlying column objects). */
3
+ export interface CTEJoinKey {
4
+ sourceColumn: string;
5
+ targetColumn: string;
6
+ sourceColumnObj: any;
7
+ targetColumnObj: any;
8
+ }
9
+ /** A join definition located relative to a primary/target cube pair. */
10
+ export interface FoundJoinInfo {
11
+ sourceCube: Cube;
12
+ joinDef: CubeJoin;
13
+ reversed?: boolean;
14
+ }
15
+ /**
16
+ * Derive the CTE join keys for a located join definition, handling
17
+ * belongsToMany junctions and reversed (belongsTo-back-to-primary) joins.
18
+ */
19
+ export declare function deriveCTEJoinKeys(joinInfo: FoundJoinInfo, primaryCube: Cube): CTEJoinKey[];
20
+ /**
21
+ * Derive the join keys connecting a downstream dimension cube through the CTE
22
+ * cube, handling belongsToMany (via junction sourceKey) and regular joins.
23
+ */
24
+ export declare function deriveDownstreamJoinKeys(joinDef: CubeJoin): CTEJoinKey[];
25
+ /**
26
+ * Find join information for a target cube, searching (in priority order):
27
+ * 1. The primary cube's direct join to the target.
28
+ * 2. The target cube's join back to the primary (reverse lookup → reversed).
29
+ * 3. Any other registered cube's join to the target.
30
+ */
31
+ export declare function findJoinInfoForCube(cubes: Map<string, Cube>, primaryCube: Cube, targetCubeName: string): FoundJoinInfo | null;
32
+ /**
33
+ * Collect the names of cubes (other than the CTE cube) that contribute
34
+ * dimensions, time dimensions, or filter members to the query. These are the
35
+ * candidate downstream cubes that may need to join through the CTE.
36
+ */
37
+ export declare function collectDimensionCubeNames(query: SemanticQuery, cteCubeName: string): Set<string>;
@@ -0,0 +1,104 @@
1
+ import { Cube, QueryContext, PhysicalQueryPlan, SemanticQuery } from '../types/index.js';
2
+ import { ResolverCache } from './planner-utils.js';
3
+ import { FilterPropagation } from './filter-propagation.js';
4
+ import { JoinRef } from './types.js';
5
+ export declare class CTEPlanner {
6
+ private readonly resolverCache;
7
+ private readonly filterPropagation;
8
+ constructor(resolverCache: ResolverCache, filterPropagation: FilterPropagation);
9
+ /**
10
+ * Plan pre-aggregation CTEs for hasMany relationships to prevent fan-out
11
+ * Note: belongsToMany relationships handle fan-out differently through their junction table structure
12
+ * and don't require CTEs - the two-hop join with the junction table provides natural grouping
13
+ *
14
+ * CRITICAL FAN-OUT PREVENTION LOGIC:
15
+ * When a query contains ANY hasMany relationship in the join graph, ALL cubes with measures
16
+ * that could be affected by row multiplication need CTEs. This includes:
17
+ *
18
+ * 1. Cubes with direct hasMany FROM primary (existing logic)
19
+ * 2. Cubes with measures that would be multiplied due to hasMany elsewhere in the query
20
+ * - Example: Query has Departments.totalBudget + Productivity.recordCount
21
+ * - Employees hasMany → Productivity causes row multiplication
22
+ * - Departments.totalBudget would be inflated without CTE pre-aggregation
23
+ */
24
+ planPreAggregationCTEs(cubes: Map<string, Cube>, primaryCube: Cube, joinCubes: JoinRef[], query: SemanticQuery, _ctx: QueryContext): PhysicalQueryPlan['preAggregationCTEs'];
25
+ /**
26
+ * Build a single pre-aggregation CTE for one join-cube entry, or return null
27
+ * when the cube contributes no aggregate measures / has no resolvable join.
28
+ */
29
+ private buildCTEForJoinCube;
30
+ /**
31
+ * Resolve the join keys (and any intermediate joins to absorb) for a CTE cube.
32
+ *
33
+ * Analyses the path from primary to the CTE cube: if an intermediate hasMany
34
+ * exists, returns the corrected keys plus intermediate joins; otherwise locates
35
+ * the join definition and derives keys from it.
36
+ */
37
+ private resolveCTEJoinKeys;
38
+ /**
39
+ * Locate the join definition for a CTE cube, preferring the final step of the
40
+ * analysed path and falling back to a primary/reverse/any-cube search.
41
+ */
42
+ private locateJoinInfo;
43
+ /**
44
+ * Analyze the join path from primary cube to a target CTE cube.
45
+ * Detects if there are intermediate hasMany relationships that would cause fan-out.
46
+ *
47
+ * Returns information about:
48
+ * - The full join path
49
+ * - Whether there are hasMany relationships ON the path (not just at the end)
50
+ * - Which intermediate tables need to be absorbed into the CTE
51
+ * - The correct join key to use (from primary cube's connection point)
52
+ *
53
+ * @param cubes Map of all registered cubes
54
+ * @param primaryCube The primary cube (FROM clause)
55
+ * @param targetCubeName The CTE cube we're analyzing the path to
56
+ * @param query The semantic query (drives query-aware path selection)
57
+ */
58
+ private analyzeJoinPathToPrimary;
59
+ /**
60
+ * Compute CTE reasons from the actual join plan entries.
61
+ *
62
+ * Instead of scanning all registered cubes (which causes false positives when
63
+ * unrelated hasMany relationships exist), this walks only the planned joins
64
+ * using the `relationship` field now stored on each JoinCubePlanEntry.
65
+ *
66
+ * Algorithm:
67
+ * 1. Scan join plan entries for hasMany/belongsToMany relationships
68
+ * 2. If none found → return empty map (no CTEs needed)
69
+ * 3. hasMany/belongsToMany targets with measures → 'hasMany'
70
+ * 4. Other join cubes with measures (not hasMany source) → 'fanOutPrevention'
71
+ */
72
+ private computeCTEReasons;
73
+ /**
74
+ * Find downstream cubes that need join keys included in the CTE.
75
+ *
76
+ * When a query has dimensions from a cube (e.g., Teams.name) and measures from
77
+ * a junction cube (e.g., EmployeeTeams.count), the junction CTE needs to include
78
+ * the join key to the dimension cube (team_id) so the dimension cube can be
79
+ * joined through the CTE instead of via an alternative path.
80
+ *
81
+ * @param cteCube The cube being converted to a CTE (e.g., EmployeeTeams)
82
+ * @param query The semantic query with dimensions and measures
83
+ * @param allCubes Map of all registered cubes
84
+ * @returns Array of downstream join key info for cubes needing join through this CTE
85
+ */
86
+ private findDownstreamJoinKeys;
87
+ /**
88
+ * Expand calculated measures to include their dependencies
89
+ */
90
+ private expandCalculatedMeasureDependencies;
91
+ /**
92
+ * Extract measure references from calculatedSql template
93
+ */
94
+ private extractDependenciesFromTemplate;
95
+ /**
96
+ * Extract measures referenced in filters (for CTE inclusion)
97
+ */
98
+ private extractMeasuresFromFilters;
99
+ /**
100
+ * Recursively extract measures from filters for a specific cube
101
+ * Only includes filter members that are actually measures (not dimensions)
102
+ */
103
+ private extractMeasuresFromFilter;
104
+ }
@@ -0,0 +1,44 @@
1
+ import { Cube, SemanticQuery, PropagatingFilter, Filter } from '../types/index.js';
2
+ export declare class FilterPropagation {
3
+ /**
4
+ * Find filters that need to propagate from related cubes to a CTE cube.
5
+ * When cube A has filters and a hasMany relationship to cube B (the CTE cube),
6
+ * A's filters should propagate into B's CTE via a subquery.
7
+ *
8
+ * Example: Employees.createdAt filter should propagate to Productivity CTE
9
+ * via: employee_id IN (SELECT id FROM employees WHERE created_at >= $date)
10
+ */
11
+ findPropagatingFilters(query: SemanticQuery, cteCube: Cube, allCubes: Map<string, Cube>): PropagatingFilter[];
12
+ /**
13
+ * Collect cube names referenced by filters and by time-dimension date ranges.
14
+ */
15
+ private collectFilterCubeNames;
16
+ /**
17
+ * Build a single PropagatingFilter for a filterCube → cteCube hasMany edge,
18
+ * or null when the cube contributes no filters / the join has no keys.
19
+ */
20
+ private buildPropagatingFilter;
21
+ /**
22
+ * Extract cube names from filters into a Set (helper for findPropagatingFilters)
23
+ */
24
+ extractFilterCubeNamesToSet(filters: Filter[], cubesSet: Set<string>): void;
25
+ /**
26
+ * Extract filters for a specific cube from the filter array
27
+ *
28
+ * Logic for preserving filter semantics:
29
+ * - AND: Safe to extract only matching branches (AND of fewer conditions is more permissive)
30
+ * - OR: Must include ALL branches or skip entirely (partial OR changes semantics)
31
+ * If any branch belongs to another cube, skip the entire OR to be safe
32
+ * since we can't evaluate the other cube's conditions
33
+ */
34
+ extractFiltersForCube(filters: Filter[], targetCubeName: string): Filter[];
35
+ /**
36
+ * Check if all simple filters in a filter array belong to the specified cube
37
+ * Recursively checks nested AND/OR filters
38
+ */
39
+ allFiltersFromCube(filters: Filter[], targetCubeName: string): boolean;
40
+ /**
41
+ * Extract time dimension date range filters as regular filters for a specific cube
42
+ */
43
+ extractTimeDimensionFiltersForCube(query: SemanticQuery, targetCubeName: string): Filter[];
44
+ }
@@ -6,9 +6,14 @@
6
6
  * - LogicalPlanBuilder: SemanticQuery → LogicalNode tree
7
7
  * - Optimisers: PlanOptimiser interface and built-in passes
8
8
  */
9
- export type { LogicalNode, LogicalNodeType, LogicalNodeBase, QueryNode, SimpleSource, FullKeyAggregate, CTEPreAggregate, KeysDeduplication, MultiFactMerge, CubeRef, MeasureRef, DimensionRef, TimeDimensionRef, ColumnRef, OrderByRef, JoinRef, LogicalSchema } from './types';
10
- export { LogicalPlanner } from './logical-planner';
11
- export { LogicalPlanBuilder } from './logical-plan-builder';
12
- export type { LogicalPlanWithAnalysis } from './logical-plan-builder';
13
- export type { PlanOptimiser, OptimiserContext } from './optimiser';
14
- export { IdentityOptimiser, OptimiserPipeline } from './optimiser';
9
+ export type { LogicalNode, LogicalNodeType, LogicalNodeBase, QueryNode, SimpleSource, FullKeyAggregate, CTEPreAggregate, KeysDeduplication, MultiFactMerge, CubeRef, MeasureRef, DimensionRef, TimeDimensionRef, ColumnRef, OrderByRef, JoinRef, LogicalSchema } from './types.js';
10
+ export { LogicalPlanner } from './logical-planner.js';
11
+ export { LogicalPlanBuilder } from './logical-plan-builder.js';
12
+ export type { LogicalPlanWithAnalysis } from './logical-plan-builder.js';
13
+ export { JoinPlanner } from './join-planner.js';
14
+ export { CTEPlanner } from './cte-planner.js';
15
+ export { FilterPropagation } from './filter-propagation.js';
16
+ export { PlanAnalysisReporter } from './plan-analysis-reporter.js';
17
+ export { ResolverCache, analyzeCubeUsage, extractCubeNamesFromFilter } from './planner-utils.js';
18
+ export type { PlanOptimiser, OptimiserContext, OptimiserEngineType } from './optimiser.js';
19
+ export { IdentityOptimiser, OptimiserPipeline } from './optimiser.js';
@@ -0,0 +1,27 @@
1
+ import { Cube, CubeJoin, SemanticQuery } from '../types/index.js';
2
+ import { ResolverCache } from './planner-utils.js';
3
+ import { JoinRef } from './types.js';
4
+ export declare class JoinPlanner {
5
+ private readonly resolverCache;
6
+ constructor(resolverCache: ResolverCache);
7
+ /**
8
+ * Build join plan for multi-cube query
9
+ * Supports both direct joins and transitive joins through intermediate cubes
10
+ *
11
+ * Uses query-aware path selection to prefer joining through cubes that have
12
+ * measures in the query (e.g., joining Teams through EmployeeTeams when
13
+ * EmployeeTeams.count is a measure)
14
+ */
15
+ buildJoinPlan(cubes: Map<string, Cube>, primaryCube: Cube, cubeNames: string[], _ctx: unknown, query: SemanticQuery): JoinRef[];
16
+ /**
17
+ * Build a single symbolic JoinRef for a join-path step. Handles belongsToMany
18
+ * (junction-table) joins and regular (belongsTo/hasOne/hasMany) joins. The join
19
+ * conditions and security WHERE are materialized later by DrizzlePlanBuilder;
20
+ * only the join type is resolved here (it depends on the effective relationship).
21
+ */
22
+ private buildJoinRef;
23
+ /**
24
+ * Find hasMany join definition from primary cube to target cube
25
+ */
26
+ findHasManyJoinDef(primaryCube: Cube, targetCubeName: string, cubes?: Map<string, Cube>): CubeJoin | null;
27
+ }
@@ -1,8 +1,8 @@
1
- import { Cube, QueryContext } from '../types';
2
- import { QueryAnalysis } from '../types/analysis';
3
- import { SemanticQuery } from '../types/query';
4
- import { LogicalPlanner } from './logical-planner';
5
- import { QueryNode } from './types';
1
+ import { Cube, QueryContext } from '../types/index.js';
2
+ import { QueryAnalysis } from '../types/analysis.js';
3
+ import { SemanticQuery } from '../types/query.js';
4
+ import { LogicalPlanner } from './logical-planner.js';
5
+ import { QueryNode } from './types.js';
6
6
  export interface LogicalPlanWithAnalysis {
7
7
  plan: QueryNode;
8
8
  analysis: QueryAnalysis;
@@ -0,0 +1,39 @@
1
+ import { Cube, QueryContext, PhysicalQueryPlan, SemanticQuery, PrimaryCubeAnalysis, JoinPathAnalysis, QueryWarning } from '../types/index.js';
2
+ import { JoinRef } from './types.js';
3
+ export declare class LogicalPlanner {
4
+ private readonly resolverCache;
5
+ private readonly joinPlanner;
6
+ private readonly ctePlanner;
7
+ private readonly reporter;
8
+ /**
9
+ * Analyze a semantic query to determine which cubes are involved
10
+ */
11
+ analyzeCubeUsage(query: SemanticQuery): Set<string>;
12
+ /**
13
+ * Analyze primary cube selection with candidate details.
14
+ * Exposed for LogicalPlanBuilder so dry-run/analyze can report
15
+ * exactly which selection rule was used.
16
+ */
17
+ analyzePrimaryCube(cubeNames: string[], query: SemanticQuery, cubes: Map<string, Cube>): PrimaryCubeAnalysis;
18
+ /**
19
+ * Analyze join path for a specific target cube.
20
+ * Exposed for LogicalPlanBuilder to provide join decision trace.
21
+ */
22
+ analyzeJoinPathForTarget(cubes: Map<string, Cube>, fromCube: string, toCube: string, query?: SemanticQuery): JoinPathAnalysis;
23
+ /**
24
+ * Build join plan for a known primary cube.
25
+ * Exposed for LogicalPlanBuilder so logical planning can compose
26
+ * planner phases directly.
27
+ */
28
+ buildJoinPlanForPrimary(cubes: Map<string, Cube>, primaryCube: Cube, cubeNames: string[], ctx: QueryContext, query: SemanticQuery): JoinRef[];
29
+ /**
30
+ * Build pre-aggregation CTE plan from a primary cube and join plan.
31
+ * Exposed for LogicalPlanBuilder phase composition.
32
+ */
33
+ buildPreAggregationCTEs(cubes: Map<string, Cube>, primaryCube: Cube, joinCubes: JoinRef[], query: SemanticQuery, ctx: QueryContext): PhysicalQueryPlan['preAggregationCTEs'];
34
+ /**
35
+ * Generate query warnings from pre-aggregation analysis.
36
+ * Exposed for LogicalPlanBuilder phase composition.
37
+ */
38
+ buildWarnings(query: SemanticQuery, preAggregationCTEs?: PhysicalQueryPlan['preAggregationCTEs']): QueryWarning[];
39
+ }
@@ -1,8 +1,10 @@
1
- import { LogicalNode } from './types';
1
+ import { LogicalNode } from './types.js';
2
+ /** Database engine the optimiser is targeting (all 7 supported engines). */
3
+ export type OptimiserEngineType = 'postgres' | 'mysql' | 'sqlite' | 'singlestore' | 'duckdb' | 'databend' | 'snowflake';
2
4
  /** Context available to optimiser passes */
3
5
  export interface OptimiserContext {
4
6
  /** Database engine type for engine-specific rewrites */
5
- engineType: 'postgres' | 'mysql' | 'sqlite' | 'duckdb';
7
+ engineType: OptimiserEngineType;
6
8
  }
7
9
  /** A single optimiser pass that rewrites a logical plan */
8
10
  export interface PlanOptimiser {
@@ -0,0 +1,59 @@
1
+ import { Cube, PhysicalQueryPlan, SemanticQuery, PrimaryCubeAnalysis, JoinPathAnalysis, QueryWarning } from '../types/index.js';
2
+ import { ResolverCache } from './planner-utils.js';
3
+ export declare class PlanAnalysisReporter {
4
+ private readonly resolverCache;
5
+ constructor(resolverCache: ResolverCache);
6
+ /**
7
+ * Analyze why a particular cube was chosen as primary
8
+ */
9
+ analyzePrimaryCubeSelection(cubeNames: string[], query: SemanticQuery, cubes: Map<string, Cube>): PrimaryCubeAnalysis;
10
+ /**
11
+ * Build the scored candidate list (dimension count, join count, reachability).
12
+ */
13
+ private buildPrimaryCubeCandidates;
14
+ /**
15
+ * Tier 1: select the cube with the most query dimensions that can reach all
16
+ * others. Returns null when no dimension-based winner applies.
17
+ */
18
+ private selectByDimensions;
19
+ /**
20
+ * Tier 2: among cubes that can reach all others, select the most connected.
21
+ * Returns null when no candidate can reach all others.
22
+ */
23
+ private selectByConnectivity;
24
+ /**
25
+ * Analyze the join path between two cubes with detailed step information
26
+ *
27
+ * Uses JoinPathResolver.findPath() for the actual path finding,
28
+ * then converts the result to human-readable analysis format.
29
+ */
30
+ analyzeJoinPath(cubes: Map<string, Cube>, fromCube: string, toCube: string, query?: SemanticQuery): JoinPathAnalysis;
31
+ private convertInternalPathToJoinPathSteps;
32
+ private buildJoinPathSelectionAnalysis;
33
+ private mapPreferredCandidate;
34
+ /**
35
+ * Generate warnings for query edge cases that users should be aware of.
36
+ * Currently detects:
37
+ * - FAN_OUT_NO_DIMENSIONS: Query has hasMany CTEs but no dimensions to group by
38
+ *
39
+ * Note: AVG measures in hasMany CTEs can produce mathematically imprecise results
40
+ * (average of averages vs weighted average), but this warning was removed as it
41
+ * fired too aggressively. The issue only occurs when the outer grouping is coarser
42
+ * than the CTE grouping, which is rare in practice. The limitation is documented
43
+ * in executor.ts comments.
44
+ */
45
+ generateWarnings(query: SemanticQuery, preAggregationCTEs?: PhysicalQueryPlan['preAggregationCTEs']): QueryWarning[];
46
+ /**
47
+ * Detect when a query has measures from multiple cubes with hasMany relationships
48
+ * but no dimensions to provide grouping context.
49
+ *
50
+ * This is an edge case where:
51
+ * - Query has measures from 2+ cubes
52
+ * - At least one CTE exists (indicating hasMany relationship)
53
+ * - Query has NO dimensions AND NO time dimensions with granularity
54
+ *
55
+ * The SQL is technically correct (CTEs with GROUP BY on join keys), but users
56
+ * may be confused by the aggregated results without visible grouping.
57
+ */
58
+ private checkFanOutNoDimensions;
59
+ }
@@ -0,0 +1,20 @@
1
+ import { Cube, SemanticQuery } from '../types/index.js';
2
+ import { JoinPathResolver } from '../resolvers/join-path-resolver.js';
3
+ /**
4
+ * Caches a JoinPathResolver per cubes map to avoid repeated instantiation.
5
+ * Shared by all sub-planners so a single query reuses one resolver per cubes map.
6
+ */
7
+ export declare class ResolverCache {
8
+ private cache;
9
+ get(cubes: Map<string, Cube>): JoinPathResolver;
10
+ }
11
+ /**
12
+ * Analyze a semantic query to determine which cubes are involved.
13
+ * Scans measures, dimensions, time dimensions, filters and ORDER BY members.
14
+ */
15
+ export declare function analyzeCubeUsage(query: SemanticQuery): Set<string>;
16
+ /**
17
+ * Recursively extract cube names from a filter (handles logical AND/OR filters)
18
+ * into the provided set.
19
+ */
20
+ export declare function extractCubeNamesFromFilter(filter: any, cubesUsed: Set<string>): void;
@@ -1,7 +1,7 @@
1
- import { SQL, AnyColumn, Table } from 'drizzle-orm';
2
- import { Cube, JoinKeyInfo, PropagatingFilter, IntermediateJoinInfo, DownstreamJoinKeyInfo } from '../types/cube';
3
- import { Filter } from '../types/query';
4
- import { SecurityContext, QueryWarning, TimeGranularity } from '../types/core';
1
+ import { AnyColumn, Table } from 'drizzle-orm';
2
+ import { Cube, CubeJoin, JoinKeyInfo, PropagatingFilter, IntermediateJoinInfo, DownstreamJoinKeyInfo } from '../types/cube.js';
3
+ import { Filter } from '../types/query.js';
4
+ import { QueryWarning, TimeGranularity } from '../types/core.js';
5
5
  /** Reference to a registered cube */
6
6
  export interface CubeRef {
7
7
  /** Cube name (e.g. 'Employees') */
@@ -59,19 +59,25 @@ export interface JoinRef {
59
59
  target: CubeRef;
60
60
  /** Table alias in the generated SQL */
61
61
  alias: string;
62
- /** SQL join type */
62
+ /** SQL join type (already resolved from the effective relationship) */
63
63
  joinType: 'inner' | 'left' | 'right' | 'full';
64
- /** Drizzle SQL join condition (pre-built by the planner) */
65
- joinCondition: SQL;
64
+ /**
65
+ * Symbolic join definition. The Drizzle join condition is materialized from
66
+ * this by DrizzlePlanBuilder — the logical plan itself holds no SQL and no
67
+ * baked security context.
68
+ */
69
+ joinDef: CubeJoin;
66
70
  /** Relationship type from the join definition */
67
71
  relationship?: 'belongsTo' | 'hasOne' | 'hasMany' | 'belongsToMany';
68
- /** Junction table for belongsToMany relationships */
72
+ /**
73
+ * Junction table for belongsToMany relationships (symbolic).
74
+ * The junction join condition and security WHERE are materialized from
75
+ * `joinDef.through` by DrizzlePlanBuilder at physical-plan time.
76
+ */
69
77
  junctionTable?: {
70
78
  table: Table;
71
79
  alias: string;
72
80
  joinType: 'inner' | 'left' | 'right' | 'full';
73
- joinCondition: SQL;
74
- securitySql?: (securityContext: SecurityContext) => SQL | SQL[];
75
81
  sourceCubeName?: string;
76
82
  };
77
83
  }
@@ -102,6 +108,8 @@ export interface QueryNode extends LogicalNodeBase {
102
108
  orderBy: OrderByRef[];
103
109
  limit?: number;
104
110
  offset?: number;
111
+ /** When true, skip GROUP BY (raw rows) */
112
+ ungrouped?: boolean;
105
113
  /** Planning warnings surfaced to the caller */
106
114
  warnings: QueryWarning[];
107
115
  }
@@ -0,0 +1,40 @@
1
+ import { Cube } from './types/index.js';
2
+ /**
3
+ * Measure types that are window functions. Window functions require special
4
+ * handling: no GROUP BY in the CTE, no re-aggregation in the outer query, and
5
+ * they return individual rows rather than grouped results.
6
+ */
7
+ export declare const WINDOW_FUNCTION_TYPES: readonly ["lag", "lead", "rank", "denseRank", "rowNumber", "ntile", "firstValue", "lastValue", "movingAvg", "movingSum"];
8
+ /** Check if a measure type is a window function. */
9
+ export declare function isWindowFunction(measureType: string): boolean;
10
+ /**
11
+ * Check if a measure is a post-aggregation window function.
12
+ * Post-aggregation windows reference a base `measure` in their windowConfig,
13
+ * indicating they operate on aggregated data rather than raw rows.
14
+ */
15
+ export declare function isPostAggregationWindow(measure: any): boolean;
16
+ /**
17
+ * Resolve the base-measure reference for a post-aggregation window function to a
18
+ * fully qualified name (e.g. 'totalRevenue' -> 'Sales.totalRevenue').
19
+ * Returns null when the measure is not a post-aggregation window.
20
+ */
21
+ export declare function getWindowBaseMeasure(measure: any, cubeName: string): string | null;
22
+ /**
23
+ * Default operation for a window function type.
24
+ * - lag/lead default to 'difference' (compare current vs previous/next)
25
+ * - all others default to 'raw'
26
+ */
27
+ export declare function getDefaultWindowOperation(windowType: string): 'raw' | 'difference' | 'ratio' | 'percentChange';
28
+ /**
29
+ * Categorize measures for post-aggregation window-function handling.
30
+ * - aggregateMeasures: regular aggregates (count, sum, avg, etc.)
31
+ * - postAggWindowMeasures: window functions referencing a base measure
32
+ * - requiredBaseMeasures: base measures those windows depend on (auto-added)
33
+ */
34
+ export declare function categorizeForPostAggregation(measureNames: string[], cubeMap: Map<string, Cube>): {
35
+ aggregateMeasures: string[];
36
+ postAggWindowMeasures: string[];
37
+ requiredBaseMeasures: Set<string>;
38
+ };
39
+ /** Whether any measure in the list is a post-aggregation window function. */
40
+ export declare function hasPostAggregationWindows(measureNames: string[], cubeMap: Map<string, Cube>): boolean;
@@ -1,5 +1,62 @@
1
1
  //#region src/server/agent/providers/openai.ts
2
- var e = class {
2
+ function* e(e, t) {
3
+ let n = e.index ?? 0;
4
+ if (e.id && (t.set(n, {
5
+ id: e.id,
6
+ name: e.function?.name || "",
7
+ arguments: ""
8
+ }), yield {
9
+ type: "tool_use_start",
10
+ id: e.id,
11
+ name: e.function?.name || ""
12
+ }), e.function?.name && t.has(n)) {
13
+ let r = t.get(n);
14
+ r.name ||= e.function.name;
15
+ }
16
+ if (e.function?.arguments) {
17
+ let r = t.get(n);
18
+ r && (r.arguments += e.function.arguments, yield {
19
+ type: "tool_input_delta",
20
+ json: e.function.arguments
21
+ });
22
+ }
23
+ }
24
+ function* t(e, t) {
25
+ for (let [e, n] of t) {
26
+ let r = {};
27
+ try {
28
+ n.arguments && (r = JSON.parse(n.arguments));
29
+ } catch {}
30
+ yield {
31
+ type: "tool_use_end",
32
+ id: n.id,
33
+ input: r
34
+ }, t.delete(e);
35
+ }
36
+ yield {
37
+ type: "message_meta",
38
+ stopReason: e
39
+ };
40
+ }
41
+ function* n(n, r) {
42
+ n.usage && (yield {
43
+ type: "message_meta",
44
+ inputTokens: n.usage.prompt_tokens,
45
+ outputTokens: n.usage.completion_tokens,
46
+ stopReason: ""
47
+ });
48
+ let i = n.choices?.[0];
49
+ if (!i) return;
50
+ let a = i.delta;
51
+ if (a) {
52
+ if (a.content && (yield {
53
+ type: "text_delta",
54
+ text: a.content
55
+ }), a.tool_calls) for (let t of a.tool_calls) yield* e(t, r);
56
+ i.finish_reason && (yield* t(i.finish_reason, r));
57
+ }
58
+ }
59
+ var r = class {
3
60
  client;
4
61
  apiKey;
5
62
  baseURL;
@@ -36,62 +93,7 @@ var e = class {
36
93
  }
37
94
  async *parseStreamEvents(e) {
38
95
  let t = /* @__PURE__ */ new Map();
39
- for await (let n of e) {
40
- let e = n;
41
- e.usage && (yield {
42
- type: "message_meta",
43
- inputTokens: e.usage.prompt_tokens,
44
- outputTokens: e.usage.completion_tokens,
45
- stopReason: ""
46
- });
47
- let r = e.choices?.[0];
48
- if (!r) continue;
49
- let i = r.delta;
50
- if (i) {
51
- if (i.content && (yield {
52
- type: "text_delta",
53
- text: i.content
54
- }), i.tool_calls) for (let e of i.tool_calls) {
55
- let n = e.index ?? 0;
56
- if (e.id && (t.set(n, {
57
- id: e.id,
58
- name: e.function?.name || "",
59
- arguments: ""
60
- }), yield {
61
- type: "tool_use_start",
62
- id: e.id,
63
- name: e.function?.name || ""
64
- }), e.function?.name && t.has(n)) {
65
- let r = t.get(n);
66
- r.name ||= e.function.name;
67
- }
68
- if (e.function?.arguments) {
69
- let r = t.get(n);
70
- r && (r.arguments += e.function.arguments, yield {
71
- type: "tool_input_delta",
72
- json: e.function.arguments
73
- });
74
- }
75
- }
76
- if (r.finish_reason) {
77
- for (let [e, n] of t) {
78
- let r = {};
79
- try {
80
- n.arguments && (r = JSON.parse(n.arguments));
81
- } catch {}
82
- yield {
83
- type: "tool_use_end",
84
- id: n.id,
85
- input: r
86
- }, t.delete(e);
87
- }
88
- yield {
89
- type: "message_meta",
90
- stopReason: r.finish_reason
91
- };
92
- }
93
- }
94
- }
96
+ for await (let r of e) yield* n(r, t);
95
97
  }
96
98
  formatTools(e) {
97
99
  return e.map((e) => ({
@@ -150,4 +152,4 @@ var e = class {
150
152
  }
151
153
  };
152
154
  //#endregion
153
- export { e as OpenAIProvider };
155
+ export { r as OpenAIProvider };
@@ -0,0 +1 @@
1
+ function*e(e,t){let n=e.index??0;if(e.id&&(t.set(n,{id:e.id,name:e.function?.name||``,arguments:``}),yield{type:`tool_use_start`,id:e.id,name:e.function?.name||``}),e.function?.name&&t.has(n)){let r=t.get(n);r.name||=e.function.name}if(e.function?.arguments){let r=t.get(n);r&&(r.arguments+=e.function.arguments,yield{type:`tool_input_delta`,json:e.function.arguments})}}function*t(e,t){for(let[e,n]of t){let r={};try{n.arguments&&(r=JSON.parse(n.arguments))}catch{}yield{type:`tool_use_end`,id:n.id,input:r},t.delete(e)}yield{type:`message_meta`,stopReason:e}}function*n(n,r){n.usage&&(yield{type:`message_meta`,inputTokens:n.usage.prompt_tokens,outputTokens:n.usage.completion_tokens,stopReason:``});let i=n.choices?.[0];if(!i)return;let a=i.delta;if(a){if(a.content&&(yield{type:`text_delta`,text:a.content}),a.tool_calls)for(let t of a.tool_calls)yield*e(t,r);i.finish_reason&&(yield*t(i.finish_reason,r))}}var r=class{client;apiKey;baseURL;initialized=!1;constructor(e,t){this.apiKey=e,this.baseURL=t?.baseURL}async ensureClient(){if(this.initialized)return;let e;try{let t=await Promise.resolve().then(()=>require("./openai-D0musiYP.cjs"));e=t.default||t.OpenAI||t}catch{throw Error(`openai is required for the OpenAI provider. Install it with: npm install openai`)}let t={apiKey:this.apiKey};this.baseURL&&(t.baseURL=this.baseURL),this.client=new e(t),this.initialized=!0}async createStream(e){await this.ensureClient();let{messages:t}=this.formatMessages(e.messages,e.system);return this.client.chat.completions.create({model:e.model,max_completion_tokens:e.maxTokens,tools:this.formatTools(e.tools),messages:t,stream:!0,stream_options:{include_usage:!0}})}async*parseStreamEvents(e){let t=new Map;for await(let r of e)yield*n(r,t)}formatTools(e){return e.map(e=>({type:`function`,function:{name:e.name,description:e.description,parameters:e.parameters}}))}formatMessages(e,t){let n=[{role:`system`,content:t}];for(let t of e)if(t.role===`user`)n.push({role:`user`,content:typeof t.content==`string`?t.content:JSON.stringify(t.content)});else if(t.role===`assistant`)if(typeof t.content==`string`)n.push({role:`assistant`,content:t.content});else{let e=t.content,r=e.filter(e=>e.type===`text`).map(e=>e.text).join(``),i=e.filter(e=>e.type===`tool_use`).map(e=>({id:e.id,type:`function`,function:{name:e.name,arguments:JSON.stringify(e.input||{})}})),a={role:`assistant`};r&&(a.content=r),i.length>0&&(a.tool_calls=i),n.push(a)}else t.role===`tool`?n.push(t):t.role===`tool_result`&&n.push({role:`user`,content:typeof t.content==`string`?t.content:JSON.stringify(t.content)});return{messages:n}}formatToolResults(e){return e.map(e=>({role:`tool`,tool_call_id:e.toolUseId,content:e.content}))}shouldContinue(e){return e===`tool_calls`}formatError(e){if(!e||!(e instanceof Error))return`Something went wrong. Please try again.`;let t=e.message||``,n=e;return n.status===429?`Too many requests. Please wait a moment and try again.`:n.status===401?`Authentication failed. Please check your API key configuration.`:n.status===503||n.status===502?`The AI service is temporarily unavailable. Please try again in a moment.`:n.status===400?`There was a problem with the request. Please try again.`:t.startsWith(`{`)||t.startsWith(`Error: {`)?`The AI service encountered an error. Please try again.`:t}};exports.OpenAIProvider=r;