drizzle-cube 0.5.8 → 0.6.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 (388) hide show
  1. package/README.md +2 -0
  2. package/dist/adapters/adapters/hono/agent-handler.d.ts +9 -0
  3. package/dist/adapters/adapters/hono/mcp-handler.d.ts +37 -0
  4. package/dist/adapters/adapters/mcp-tools-handlers.d.ts +18 -0
  5. package/dist/adapters/adapters/nextjs/mcp-handler.d.ts +36 -0
  6. package/dist/adapters/adapters/utils.d.ts +6 -81
  7. package/dist/adapters/express/index.cjs +1 -1
  8. package/dist/adapters/express/index.js +50 -50
  9. package/dist/adapters/fastify/index.cjs +1 -1
  10. package/dist/adapters/fastify/index.js +78 -78
  11. package/dist/adapters/google-BOnRIN1w.cjs +2 -0
  12. package/dist/adapters/{google-CFYljAOF.js → google-CvKM9yVM.js} +83 -71
  13. package/dist/adapters/{handler-Cx8QYLk6.js → handler-CfgE0JSL.js} +499 -576
  14. package/dist/adapters/handler-Cn0dOctE.cjs +25 -0
  15. package/dist/adapters/hono/index.cjs +2 -2
  16. package/dist/adapters/hono/index.js +205 -175
  17. package/dist/adapters/locale-DDvZDFVn.js +8114 -0
  18. package/dist/adapters/locale-ZLUUNUxr.cjs +166 -0
  19. package/dist/adapters/mcp-tools.cjs +1 -1
  20. package/dist/adapters/mcp-tools.js +49 -38
  21. package/dist/adapters/mcp-transport-Chiaj4ll.cjs +40 -0
  22. package/dist/adapters/mcp-transport-H96VG3WY.js +591 -0
  23. package/dist/adapters/nextjs/index.cjs +1 -1
  24. package/dist/adapters/nextjs/index.js +190 -197
  25. package/dist/adapters/{openai-BZdAA7Ji.js → openai-cDlFSTk6.js} +60 -58
  26. package/dist/adapters/openai-vXvLni8v.cjs +1 -0
  27. package/dist/adapters/{utils-D9JPLmfl.js → utils-BPWZsX7k.js} +1271 -1218
  28. package/dist/adapters/utils-_whV4fXL.cjs +128 -0
  29. package/dist/adapters/utils.cjs +1 -1
  30. package/dist/adapters/utils.js +2 -2
  31. package/dist/client/charts/ChartLoader.d.ts +2 -16
  32. package/dist/client/charts/chartComponentRegistry.d.ts +46 -0
  33. package/dist/client/charts/chartConfigHelpers.d.ts +38 -0
  34. package/dist/client/charts.js +14 -13
  35. package/dist/client/chunks/{DashboardEditModal-CjCIAT-J.js → DashboardEditModal-okVfH8ZK.js} +5296 -4544
  36. package/dist/client/chunks/DashboardEditModal-okVfH8ZK.js.map +1 -0
  37. package/dist/client/chunks/{RetentionCombinedChart-BPkfcTa8.js → RetentionCombinedChart-BgbDhsPz.js} +10 -10
  38. package/dist/client/chunks/{RetentionCombinedChart-BPkfcTa8.js.map → RetentionCombinedChart-BgbDhsPz.js.map} +1 -1
  39. package/dist/client/chunks/{RetentionHeatmap-DGzLzr7h.js → RetentionHeatmap-DjXZaTPq.js} +5 -5
  40. package/dist/client/chunks/{RetentionHeatmap-DGzLzr7h.js.map → RetentionHeatmap-DjXZaTPq.js.map} +1 -1
  41. package/dist/client/chunks/analysis-builder-DB88FojM.js +5674 -0
  42. package/dist/client/chunks/analysis-builder-DB88FojM.js.map +1 -0
  43. package/dist/client/chunks/{analysis-builder-shared-CYVwSPqt.js → analysis-builder-shared-BVK4TYfR.js} +1578 -1292
  44. package/dist/client/chunks/analysis-builder-shared-BVK4TYfR.js.map +1 -0
  45. package/dist/client/chunks/{chart-activity-grid-DmruKPab.js → chart-activity-grid-DX0SJbxs.js} +635 -492
  46. package/dist/client/chunks/chart-activity-grid-DX0SJbxs.js.map +1 -0
  47. package/dist/client/chunks/chart-area-of01_62R.js +775 -0
  48. package/dist/client/chunks/chart-area-of01_62R.js.map +1 -0
  49. package/dist/client/chunks/chart-bar-BqelQE_I.js +194 -0
  50. package/dist/client/chunks/chart-bar-BqelQE_I.js.map +1 -0
  51. package/dist/client/chunks/{chart-box-plot-DYKfyOI8.js → chart-box-plot-kkBixZ27.js} +2 -2
  52. package/dist/client/chunks/{chart-box-plot-DYKfyOI8.js.map → chart-box-plot-kkBixZ27.js.map} +1 -1
  53. package/dist/client/chunks/chart-bubble-B2he1--4.js +221 -0
  54. package/dist/client/chunks/chart-bubble-B2he1--4.js.map +1 -0
  55. package/dist/client/chunks/{chart-candlestick-Dwc92Mrj.js → chart-candlestick-DZp19Tzh.js} +2 -2
  56. package/dist/client/chunks/{chart-candlestick-Dwc92Mrj.js.map → chart-candlestick-DZp19Tzh.js.map} +1 -1
  57. package/dist/client/chunks/chart-config-area-BNigHUy8.js +124 -0
  58. package/dist/client/chunks/chart-config-area-BNigHUy8.js.map +1 -0
  59. package/dist/client/chunks/chart-config-bar-DSO_LRTx.js +54 -0
  60. package/dist/client/chunks/chart-config-bar-DSO_LRTx.js.map +1 -0
  61. package/dist/client/chunks/{chart-config-box-plot-DJ-dWWXA.js → chart-config-box-plot-oW8axV2q.js} +5 -10
  62. package/dist/client/chunks/chart-config-box-plot-oW8axV2q.js.map +1 -0
  63. package/dist/client/chunks/{chart-config-gauge-DSwC04l0.js → chart-config-gauge-Dq-_H9UN.js} +5 -7
  64. package/dist/client/chunks/chart-config-gauge-Dq-_H9UN.js.map +1 -0
  65. package/dist/client/chunks/{chart-config-kpi-delta-D6BIkHL3.js → chart-config-kpi-delta-DSQbvqu_.js} +5 -10
  66. package/dist/client/chunks/chart-config-kpi-delta-DSQbvqu_.js.map +1 -0
  67. package/dist/client/chunks/{chart-config-kpi-number-Bx-V9a62.js → chart-config-kpi-number-EFSWY1We.js} +5 -7
  68. package/dist/client/chunks/chart-config-kpi-number-EFSWY1We.js.map +1 -0
  69. package/dist/client/chunks/{chart-config-kpi-text-CcqC1u-8.js → chart-config-kpi-text-KM3V5X2u.js} +5 -7
  70. package/dist/client/chunks/chart-config-kpi-text-KM3V5X2u.js.map +1 -0
  71. package/dist/client/chunks/{chart-config-line-Db3jDsWc.js → chart-config-line-D6jG8PCH.js} +9 -36
  72. package/dist/client/chunks/chart-config-line-D6jG8PCH.js.map +1 -0
  73. package/dist/client/chunks/{chart-config-pie-DD4SmRTF.js → chart-config-pie-BhzW-fdn.js} +6 -16
  74. package/dist/client/chunks/chart-config-pie-BhzW-fdn.js.map +1 -0
  75. package/dist/client/chunks/{chart-config-radar-CC2XAaGr.js → chart-config-radar-D7REP1q_.js} +6 -16
  76. package/dist/client/chunks/chart-config-radar-D7REP1q_.js.map +1 -0
  77. package/dist/client/chunks/{chart-config-radial-bar-DmxKx1R0.js → chart-config-radial-bar-Byx6qOPU.js} +6 -16
  78. package/dist/client/chunks/chart-config-radial-bar-Byx6qOPU.js.map +1 -0
  79. package/dist/client/chunks/{chart-config-tree-map-BI-oQStO.js → chart-config-tree-map-DVrvf3yQ.js} +6 -16
  80. package/dist/client/chunks/chart-config-tree-map-DVrvf3yQ.js.map +1 -0
  81. package/dist/client/chunks/{chart-config-waterfall-DSnyixbI.js → chart-config-waterfall-DmFeQdIk.js} +5 -10
  82. package/dist/client/chunks/chart-config-waterfall-DmFeQdIk.js.map +1 -0
  83. package/dist/client/chunks/{chart-data-table-BO4sXsim.js → chart-data-table-CKauQXme.js} +1046 -1121
  84. package/dist/client/chunks/chart-data-table-CKauQXme.js.map +1 -0
  85. package/dist/client/chunks/{chart-funnel-DnWRsmnS.js → chart-funnel-CToKSBaL.js} +184 -222
  86. package/dist/client/chunks/chart-funnel-CToKSBaL.js.map +1 -0
  87. package/dist/client/chunks/chart-gauge-DTVezSk7.js +403 -0
  88. package/dist/client/chunks/chart-gauge-DTVezSk7.js.map +1 -0
  89. package/dist/client/chunks/chart-heat-map-DTuUl0BR.js +236 -0
  90. package/dist/client/chunks/chart-heat-map-DTuUl0BR.js.map +1 -0
  91. package/dist/client/chunks/chart-kpi-delta-Dn-jjO-2.js +408 -0
  92. package/dist/client/chunks/chart-kpi-delta-Dn-jjO-2.js.map +1 -0
  93. package/dist/client/chunks/chart-kpi-number-P_WBiO5S.js +244 -0
  94. package/dist/client/chunks/chart-kpi-number-P_WBiO5S.js.map +1 -0
  95. package/dist/client/chunks/chart-kpi-text-C-Y4eb5H.js +185 -0
  96. package/dist/client/chunks/chart-kpi-text-C-Y4eb5H.js.map +1 -0
  97. package/dist/client/chunks/chart-line-DKgrQA6c.js +101 -0
  98. package/dist/client/chunks/chart-line-DKgrQA6c.js.map +1 -0
  99. package/dist/client/chunks/{chart-markdown-dgUetjyM.js → chart-markdown-CV75S_zL.js} +2 -2
  100. package/dist/client/chunks/{chart-markdown-dgUetjyM.js.map → chart-markdown-CV75S_zL.js.map} +1 -1
  101. package/dist/client/chunks/{chart-measure-profile-ClfpLs4q.js → chart-measure-profile-Ket8fJyf.js} +7 -7
  102. package/dist/client/chunks/{chart-measure-profile-ClfpLs4q.js.map → chart-measure-profile-Ket8fJyf.js.map} +1 -1
  103. package/dist/client/chunks/chart-pie-ByieAX5H.js +119 -0
  104. package/dist/client/chunks/chart-pie-ByieAX5H.js.map +1 -0
  105. package/dist/client/chunks/chart-radar-CiSwHWp4.js +138 -0
  106. package/dist/client/chunks/chart-radar-CiSwHWp4.js.map +1 -0
  107. package/dist/client/chunks/chart-radial-bar-BF6Mhl6f.js +122 -0
  108. package/dist/client/chunks/chart-radial-bar-BF6Mhl6f.js.map +1 -0
  109. package/dist/client/chunks/{chart-sankey-M3XpO_ah.js → chart-sankey-DjrvKw6K.js} +36 -39
  110. package/dist/client/chunks/{chart-sankey-M3XpO_ah.js.map → chart-sankey-DjrvKw6K.js.map} +1 -1
  111. package/dist/client/chunks/chart-scatter-Dd9WFqnS.js +258 -0
  112. package/dist/client/chunks/chart-scatter-Dd9WFqnS.js.map +1 -0
  113. package/dist/client/chunks/{chart-sunburst-A_u6lqlS.js → chart-sunburst-leGpuDj7.js} +3 -3
  114. package/dist/client/chunks/{chart-sunburst-A_u6lqlS.js.map → chart-sunburst-leGpuDj7.js.map} +1 -1
  115. package/dist/client/chunks/chart-tree-map-Ceq5sLZA.js +323 -0
  116. package/dist/client/chunks/chart-tree-map-Ceq5sLZA.js.map +1 -0
  117. package/dist/client/chunks/{chart-waterfall-BuhMoagf.js → chart-waterfall-DyvQReN5.js} +7 -7
  118. package/dist/client/chunks/{chart-waterfall-BuhMoagf.js.map → chart-waterfall-DyvQReN5.js.map} +1 -1
  119. package/dist/client/chunks/{charts-core-jRtb0S2M.js → charts-core-DaXSt1Dd.js} +2 -2
  120. package/dist/client/chunks/{charts-core-jRtb0S2M.js.map → charts-core-DaXSt1Dd.js.map} +1 -1
  121. package/dist/client/chunks/charts-loader-DdTeCeNo.js +84 -0
  122. package/dist/client/chunks/charts-loader-DdTeCeNo.js.map +1 -0
  123. package/dist/client/chunks/{nl-NL-CpVs7ox3.js → nl-NL-2zTAWTej.js} +2 -1
  124. package/dist/client/chunks/{nl-NL-CpVs7ox3.js.map → nl-NL-2zTAWTej.js.map} +1 -1
  125. package/dist/client/chunks/retention-ChW9jYdy.js.map +1 -1
  126. package/dist/client/chunks/{schema-visualization-DE09kQE3.js → schema-visualization-Cb_E9_Gd.js} +12 -12
  127. package/dist/client/chunks/{schema-visualization-DE09kQE3.js.map → schema-visualization-Cb_E9_Gd.js.map} +1 -1
  128. package/dist/client/chunks/{useDirtyStateTracking-CoeQbprt.js → useDirtyStateTracking-MbpxH_v6.js} +95 -84
  129. package/dist/client/chunks/useDirtyStateTracking-MbpxH_v6.js.map +1 -0
  130. package/dist/client/chunks/{useExplainAI-DlnXWdmz.js → useExplainAI-evnZkjCY.js} +14 -14
  131. package/dist/client/chunks/{useExplainAI-DlnXWdmz.js.map → useExplainAI-evnZkjCY.js.map} +1 -1
  132. package/dist/client/chunks/{utils-CTKNaXS8.js → utils-3P6z1vz5.js} +2 -2
  133. package/dist/client/chunks/{utils-CTKNaXS8.js.map → utils-3P6z1vz5.js.map} +1 -1
  134. package/dist/client/chunks/{vendor-CPIYyeuD.js → vendor-DSpR0IW6.js} +43 -43
  135. package/dist/client/chunks/{vendor-CPIYyeuD.js.map → vendor-DSpR0IW6.js.map} +1 -1
  136. package/dist/client/components/AgenticNotebook/agentChatParts.d.ts +34 -0
  137. package/dist/client/components/AgenticNotebook/chatMessageParts.d.ts +39 -0
  138. package/dist/client/components/AgenticNotebook/useAgentChatController.d.ts +25 -0
  139. package/dist/client/components/AgenticNotebook/useNotebookAutosave.d.ts +12 -0
  140. package/dist/client/components/AnalysisBuilder/AnalysisQueryPanelParts.d.ts +64 -0
  141. package/dist/client/components/AnalysisBuilder/AnalysisResultsHeader.d.ts +67 -0
  142. package/dist/client/components/AnalysisBuilder/BreakdownComparisonToggle.d.ts +13 -0
  143. package/dist/client/components/AnalysisBuilder/BreakdownRow.d.ts +26 -0
  144. package/dist/client/components/AnalysisBuilder/DisplayOptionControl.d.ts +10 -0
  145. package/dist/client/components/AnalysisBuilder/ExecutionPlanPanelParts.d.ts +22 -0
  146. package/dist/client/components/AnalysisBuilder/FieldSearchResults.d.ts +16 -0
  147. package/dist/client/components/AnalysisBuilder/FilterValueInput.d.ts +63 -0
  148. package/dist/client/components/AnalysisBuilder/FlowDepthControls.d.ts +10 -0
  149. package/dist/client/components/AnalysisBuilder/FlowVisualizationPicker.d.ts +7 -0
  150. package/dist/client/components/AnalysisBuilder/LegacyBooleanOptions.d.ts +8 -0
  151. package/dist/client/components/AnalysisBuilder/MetricRow.d.ts +23 -0
  152. package/dist/client/components/AnalysisBuilder/SortToggleButton.d.ts +13 -0
  153. package/dist/client/components/AnalysisBuilder/StringArrayInput.d.ts +17 -0
  154. package/dist/client/components/AnalysisBuilder/filterConfigModalUtils.d.ts +30 -0
  155. package/dist/client/components/AnalysisBuilder/hooks/useAnalysisBuilderImperativeHandle.d.ts +13 -0
  156. package/dist/client/components/AnalysisBuilder/hooks/useDragReorder.d.ts +25 -0
  157. package/dist/client/components/AnalysisBuilder/hooks/useFieldSearchKeyboard.d.ts +11 -0
  158. package/dist/client/components/AnalysisBuilder/utils/axisConfigUtils.d.ts +23 -0
  159. package/dist/client/components/AnalysisBuilder/utils/executionPlanMarkdown.d.ts +8 -0
  160. package/dist/client/components/AnalysisBuilder/utils/fieldUtils.d.ts +5 -0
  161. package/dist/client/components/AnalysisBuilder/utils/resultsPanelDerive.d.ts +68 -0
  162. package/dist/client/components/AnalysisBuilder/utils/shareStateUtils.d.ts +68 -0
  163. package/dist/client/components/AnalysisBuilder/utils/sortUtils.d.ts +7 -0
  164. package/dist/client/components/DashboardFilters/CompactFilterBarParts.d.ts +26 -0
  165. package/dist/client/components/DashboardFilters/DashboardFilterConfigModalParts.d.ts +27 -0
  166. package/dist/client/components/DashboardFilters/DashboardFilterValueInput.d.ts +39 -0
  167. package/dist/client/components/DashboardFilters/dashboardFilterConfigModalUtils.d.ts +21 -0
  168. package/dist/client/components/DashboardFilters/useCompactFilterBar.d.ts +19 -0
  169. package/dist/client/components/DashboardFilters/useDashboardFilterConfigModal.d.ts +69 -0
  170. package/dist/client/components/DashboardFilters/useDateRangeState.d.ts +19 -0
  171. package/dist/client/components/DashboardFilters/useFilterDropdowns.d.ts +21 -0
  172. package/dist/client/components/DashboardFilters/useFilterValueFetch.d.ts +23 -0
  173. package/dist/client/components/DashboardPortletCard.d.ts +2 -57
  174. package/dist/client/components/analyticsPortlet/PortletChart.d.ts +31 -0
  175. package/dist/client/components/analyticsPortlet/PortletChartView.d.ts +35 -0
  176. package/dist/client/components/analyticsPortlet/PortletStates.d.ts +65 -0
  177. package/dist/client/components/analyticsPortlet/parsePortletQuery.d.ts +22 -0
  178. package/dist/client/components/analyticsPortlet/portletRenderState.d.ts +31 -0
  179. package/dist/client/components/analyticsPortlet/usePortletDebugData.d.ts +37 -0
  180. package/dist/client/components/analyticsPortlet/usePortletDrillState.d.ts +17 -0
  181. package/dist/client/components/analyticsPortlet/usePortletQueryResults.d.ts +37 -0
  182. package/dist/client/components/charts/ActivityGridChart.helpers.d.ts +33 -0
  183. package/dist/client/components/charts/ActivityGridChart.render.d.ts +31 -0
  184. package/dist/client/components/charts/AxisFormatControls.d.ts +3 -1
  185. package/dist/client/components/charts/BarChart.helpers.d.ts +23 -0
  186. package/dist/client/components/charts/BarSeries.d.ts +29 -0
  187. package/dist/client/components/charts/BubbleChart.helpers.d.ts +43 -0
  188. package/dist/client/components/charts/BubbleChart.render.d.ts +21 -0
  189. package/dist/client/components/charts/ChartStates.d.ts +38 -0
  190. package/dist/client/components/charts/FunnelChart.helpers.d.ts +25 -0
  191. package/dist/client/components/charts/FunnelViews.d.ts +16 -0
  192. package/dist/client/components/charts/HeatMapCanvas.d.ts +25 -0
  193. package/dist/client/components/charts/HeatMapChart.helpers.d.ts +64 -0
  194. package/dist/client/components/charts/KpiDelta.helpers.d.ts +20 -0
  195. package/dist/client/components/charts/KpiNumber.helpers.d.ts +30 -0
  196. package/dist/client/components/charts/KpiStates.d.ts +19 -0
  197. package/dist/client/components/charts/ScatterChart.helpers.d.ts +43 -0
  198. package/dist/client/components/charts/ScatterSeries.d.ts +17 -0
  199. package/dist/client/components/charts/ScatterTooltip.d.ts +21 -0
  200. package/dist/client/components/charts/TreeMapChart.helpers.d.ts +37 -0
  201. package/dist/client/components/charts/TreeMapContent.d.ts +24 -0
  202. package/dist/client/components/charts/TreeMapLegend.d.ts +13 -0
  203. package/dist/client/components/charts/cartesianChartHelpers.d.ts +126 -0
  204. package/dist/client/components/charts/chartAxisResolution.d.ts +32 -0
  205. package/dist/client/components/charts/chartScaffolding.d.ts +77 -0
  206. package/dist/client/components/charts/gaugeChartHelpers.d.ts +36 -0
  207. package/dist/client/components/charts/kpiTextHelpers.d.ts +46 -0
  208. package/dist/client/components/charts/radarChartHelpers.d.ts +14 -0
  209. package/dist/client/components/charts/radialBarChartHelpers.d.ts +22 -0
  210. package/dist/client/components/charts/useChartDimensions.d.ts +20 -0
  211. package/dist/client/components/charts/useKpiDimensions.d.ts +30 -0
  212. package/dist/client/components/dashboard/DashboardEditBar.d.ts +5 -0
  213. package/dist/client/components/dashboard/LayoutModeToggle.d.ts +10 -0
  214. package/dist/client/components/dashboardPortletCard/FilterFieldChip.d.ts +12 -0
  215. package/dist/client/components/dashboardPortletCard/PortletCardHeader.d.ts +43 -0
  216. package/dist/client/components/dashboardPortletCard/cardStyles.d.ts +33 -0
  217. package/dist/client/components/dashboardPortletCard/filterField.d.ts +12 -0
  218. package/dist/client/components/dashboardPortletCard/propsEqual.d.ts +55 -0
  219. package/dist/client/components/dashboardPortletCard/usePortletCardActions.d.ts +16 -0
  220. package/dist/client/components/portletAnalysisModal/saveValidation.d.ts +8 -0
  221. package/dist/client/components/shared/dateRangeUtils.d.ts +40 -0
  222. package/dist/client/components/shared/filterDisplayUtils.d.ts +10 -0
  223. package/dist/client/components/shared/filterItem/FilterDateRangeSelector.d.ts +17 -0
  224. package/dist/client/components/shared/filterItem/FilterFieldDropdown.d.ts +16 -0
  225. package/dist/client/components/shared/filterItem/dateRangeSync.d.ts +14 -0
  226. package/dist/client/components/shared/filterItem/fieldVisuals.d.ts +5 -0
  227. package/dist/client/components/shared/filterValueSelector/FilterValueInputs.d.ts +55 -0
  228. package/dist/client/components/shared/filterValueSelector/useFilterValueSelectorState.d.ts +25 -0
  229. package/dist/client/components/shared/queryFieldUtils.d.ts +21 -0
  230. package/dist/client/components/shared/utils.d.ts +4 -43
  231. package/dist/client/components.js +3 -3
  232. package/dist/client/hooks/agentChatStream.d.ts +39 -0
  233. package/dist/client/hooks/analysisQueryExecutionModes.d.ts +133 -0
  234. package/dist/client/hooks/drillNavigation.d.ts +25 -0
  235. package/dist/client/hooks.js +3 -3
  236. package/dist/client/icons.js +2 -2
  237. package/dist/client/index.js +816 -669
  238. package/dist/client/index.js.map +1 -1
  239. package/dist/client/providers.js +3 -3
  240. package/dist/client/schema.js +1 -1
  241. package/dist/client/shared/chartConfigBuilders.d.ts +18 -0
  242. package/dist/client/shared/components/QueryAnalysisPanel.sections.d.ts +41 -0
  243. package/dist/client/shared/queryTransforms.d.ts +20 -0
  244. package/dist/client/shared/utils.d.ts +2 -4
  245. package/dist/client/stores/optionsToAnalysisConfig.d.ts +17 -0
  246. package/dist/client/styles.css +1 -1
  247. package/dist/client/utils/axisValueFormatting.d.ts +32 -0
  248. package/dist/client/utils/timeValueFormatting.d.ts +32 -0
  249. package/dist/client/utils.js +6 -6
  250. package/dist/client-bundle-stats.html +1 -1
  251. package/dist/mcp-app/mcp-app.html +55 -55
  252. package/dist/server/google-BOnRIN1w.cjs +2 -0
  253. package/dist/server/{google-CFYljAOF.js → google-CvKM9yVM.js} +83 -71
  254. package/dist/server/index.cjs +179 -211
  255. package/dist/server/index.js +6330 -6458
  256. package/dist/server/{openai-BZdAA7Ji.js → openai-cDlFSTk6.js} +60 -58
  257. package/dist/server/openai-vXvLni8v.cjs +1 -0
  258. package/dist/server/server/adapters/base-adapter.d.ts +80 -35
  259. package/dist/server/server/adapters/databend-adapter.d.ts +8 -59
  260. package/dist/server/server/adapters/duckdb-adapter.d.ts +5 -59
  261. package/dist/server/server/adapters/mysql-adapter.d.ts +13 -70
  262. package/dist/server/server/adapters/postgres-adapter.d.ts +1 -65
  263. package/dist/server/server/adapters/snowflake-adapter.d.ts +5 -68
  264. package/dist/server/server/adapters/sqlite-adapter.d.ts +12 -32
  265. package/dist/server/server/adapters/window-function-builder.d.ts +11 -0
  266. package/dist/server/server/agent/chart-validation.d.ts +0 -5
  267. package/dist/server/server/agent/handler-steps.d.ts +37 -0
  268. package/dist/server/server/ai/discovery-helpers.d.ts +29 -0
  269. package/dist/server/server/ai/discovery.d.ts +4 -0
  270. package/dist/server/server/ai/suggestion-helpers.d.ts +33 -0
  271. package/dist/server/server/ai/suggestion.d.ts +0 -3
  272. package/dist/server/server/ai/validation-helpers.d.ts +21 -0
  273. package/dist/server/server/ai/validation.d.ts +0 -3
  274. package/dist/server/server/builders/analysis-utils.d.ts +106 -0
  275. package/dist/server/server/builders/cte-builder.d.ts +46 -0
  276. package/dist/server/server/builders/date-time-builder.d.ts +5 -0
  277. package/dist/server/server/builders/date-time-helpers.d.ts +34 -0
  278. package/dist/server/server/builders/filter-builder.d.ts +2 -0
  279. package/dist/server/server/builders/filter-operators.d.ts +23 -0
  280. package/dist/server/server/builders/flow-query-builder.d.ts +46 -19
  281. package/dist/server/server/builders/funnel-query-builder.d.ts +16 -5
  282. package/dist/server/server/builders/group-by-builder.d.ts +11 -0
  283. package/dist/server/server/builders/measure-builder.d.ts +43 -0
  284. package/dist/server/server/builders/retention-query-builder.d.ts +12 -14
  285. package/dist/server/server/cache-utils.d.ts +25 -5
  286. package/dist/server/server/compiler-metadata.d.ts +11 -0
  287. package/dist/server/server/compiler.d.ts +8 -14
  288. package/dist/server/server/cube-utils.d.ts +29 -4
  289. package/dist/server/server/execution/annotation-builder.d.ts +12 -0
  290. package/dist/server/server/execution/filter-cache-preloader.d.ts +19 -0
  291. package/dist/server/server/execution/mode-router.d.ts +25 -0
  292. package/dist/server/server/execution/query-result-cache.d.ts +21 -0
  293. package/dist/server/server/execution/result-post-processor.d.ts +10 -0
  294. package/dist/server/server/executor.d.ts +33 -30
  295. package/dist/server/server/executors/explain-utils.d.ts +28 -0
  296. package/dist/server/server/explain/explain-tree.d.ts +20 -0
  297. package/dist/server/server/filter-cache.d.ts +2 -2
  298. package/dist/server/server/gap-filler.d.ts +6 -0
  299. package/dist/server/server/index.d.ts +3 -1
  300. package/dist/server/server/logical-plan/cte-planner-helpers.d.ts +37 -0
  301. package/dist/server/server/logical-plan/cte-planner.d.ts +104 -0
  302. package/dist/server/server/logical-plan/filter-propagation.d.ts +44 -0
  303. package/dist/server/server/logical-plan/index.d.ts +6 -1
  304. package/dist/server/server/logical-plan/join-planner.d.ts +27 -0
  305. package/dist/server/server/logical-plan/logical-planner.d.ts +7 -200
  306. package/dist/server/server/logical-plan/optimiser.d.ts +3 -1
  307. package/dist/server/server/logical-plan/plan-analysis-reporter.d.ts +59 -0
  308. package/dist/server/server/logical-plan/planner-utils.d.ts +20 -0
  309. package/dist/server/server/logical-plan/types.d.ts +17 -9
  310. package/dist/server/server/measure-classification.d.ts +40 -0
  311. package/dist/server/server/physical-plan/drizzle-plan-builder.d.ts +21 -21
  312. package/dist/server/server/physical-plan/drizzle-sql-builder.d.ts +11 -0
  313. package/dist/server/server/physical-plan/processors/index.d.ts +2 -0
  314. package/dist/server/server/physical-plan/processors/keys-dedup-processor.d.ts +13 -0
  315. package/dist/server/server/physical-plan/processors/multi-fact-processor.d.ts +13 -0
  316. package/dist/server/server/physical-plan/processors/shared.d.ts +5 -0
  317. package/dist/server/server/query-handlers.d.ts +79 -0
  318. package/dist/server/server/query-modes.d.ts +28 -0
  319. package/dist/server/server/query-validator.d.ts +9 -0
  320. package/dist/server/server/resolvers/calculated-measure-resolver.d.ts +5 -0
  321. package/dist/server/server/resolvers/join-path-resolver.d.ts +6 -0
  322. package/dist/server/server/sql-format.d.ts +11 -0
  323. package/dist/server/server/types/cube.d.ts +18 -4
  324. package/dist/server/server/types/flow.d.ts +6 -5
  325. package/dist/server/server/types/index.d.ts +1 -1
  326. package/dist/server/server/types/validation.d.ts +14 -0
  327. package/package.json +11 -4
  328. package/dist/adapters/google-DUlXeeDA.cjs +0 -2
  329. package/dist/adapters/handler-CzbCuS6_.cjs +0 -25
  330. package/dist/adapters/locale-BPB7flIG.js +0 -8249
  331. package/dist/adapters/locale-tIMrNcCr.cjs +0 -198
  332. package/dist/adapters/mcp-transport-C2QzXm6h.cjs +0 -40
  333. package/dist/adapters/mcp-transport-D0B3S1tB.js +0 -579
  334. package/dist/adapters/openai-D_U4V0kT.cjs +0 -1
  335. package/dist/adapters/utils-KV37IBIv.cjs +0 -128
  336. package/dist/client/chunks/DashboardEditModal-CjCIAT-J.js.map +0 -1
  337. package/dist/client/chunks/analysis-builder-MuMIzoRq.js +0 -5367
  338. package/dist/client/chunks/analysis-builder-MuMIzoRq.js.map +0 -1
  339. package/dist/client/chunks/analysis-builder-shared-CYVwSPqt.js.map +0 -1
  340. package/dist/client/chunks/chart-activity-grid-DmruKPab.js.map +0 -1
  341. package/dist/client/chunks/chart-area-DHCPM4Em.js +0 -450
  342. package/dist/client/chunks/chart-area-DHCPM4Em.js.map +0 -1
  343. package/dist/client/chunks/chart-bar-KddciGDv.js +0 -271
  344. package/dist/client/chunks/chart-bar-KddciGDv.js.map +0 -1
  345. package/dist/client/chunks/chart-bubble-CfqiB538.js +0 -273
  346. package/dist/client/chunks/chart-bubble-CfqiB538.js.map +0 -1
  347. package/dist/client/chunks/chart-config-area-Bq_UsW3x.js +0 -101
  348. package/dist/client/chunks/chart-config-area-Bq_UsW3x.js.map +0 -1
  349. package/dist/client/chunks/chart-config-bar-_JEGZnAu.js +0 -95
  350. package/dist/client/chunks/chart-config-bar-_JEGZnAu.js.map +0 -1
  351. package/dist/client/chunks/chart-config-box-plot-DJ-dWWXA.js.map +0 -1
  352. package/dist/client/chunks/chart-config-gauge-DSwC04l0.js.map +0 -1
  353. package/dist/client/chunks/chart-config-kpi-delta-D6BIkHL3.js.map +0 -1
  354. package/dist/client/chunks/chart-config-kpi-number-Bx-V9a62.js.map +0 -1
  355. package/dist/client/chunks/chart-config-kpi-text-CcqC1u-8.js.map +0 -1
  356. package/dist/client/chunks/chart-config-line-Db3jDsWc.js.map +0 -1
  357. package/dist/client/chunks/chart-config-pie-DD4SmRTF.js.map +0 -1
  358. package/dist/client/chunks/chart-config-radar-CC2XAaGr.js.map +0 -1
  359. package/dist/client/chunks/chart-config-radial-bar-DmxKx1R0.js.map +0 -1
  360. package/dist/client/chunks/chart-config-tree-map-BI-oQStO.js.map +0 -1
  361. package/dist/client/chunks/chart-config-waterfall-DSnyixbI.js.map +0 -1
  362. package/dist/client/chunks/chart-data-table-BO4sXsim.js.map +0 -1
  363. package/dist/client/chunks/chart-funnel-DnWRsmnS.js.map +0 -1
  364. package/dist/client/chunks/chart-gauge-CgMeqeGb.js +0 -424
  365. package/dist/client/chunks/chart-gauge-CgMeqeGb.js.map +0 -1
  366. package/dist/client/chunks/chart-heat-map-DcGm9SWK.js +0 -231
  367. package/dist/client/chunks/chart-heat-map-DcGm9SWK.js.map +0 -1
  368. package/dist/client/chunks/chart-kpi-delta-C2wKPqCb.js +0 -343
  369. package/dist/client/chunks/chart-kpi-delta-C2wKPqCb.js.map +0 -1
  370. package/dist/client/chunks/chart-kpi-number-gWYF44ol.js +0 -322
  371. package/dist/client/chunks/chart-kpi-number-gWYF44ol.js.map +0 -1
  372. package/dist/client/chunks/chart-kpi-text-DIYtJtk4.js +0 -149
  373. package/dist/client/chunks/chart-kpi-text-DIYtJtk4.js.map +0 -1
  374. package/dist/client/chunks/chart-line-9BEGN5Ti.js +0 -433
  375. package/dist/client/chunks/chart-line-9BEGN5Ti.js.map +0 -1
  376. package/dist/client/chunks/chart-pie-BjAIhyOi.js +0 -172
  377. package/dist/client/chunks/chart-pie-BjAIhyOi.js.map +0 -1
  378. package/dist/client/chunks/chart-radar-Dgkcl2bN.js +0 -154
  379. package/dist/client/chunks/chart-radar-Dgkcl2bN.js.map +0 -1
  380. package/dist/client/chunks/chart-radial-bar-DdWJjAhK.js +0 -148
  381. package/dist/client/chunks/chart-radial-bar-DdWJjAhK.js.map +0 -1
  382. package/dist/client/chunks/chart-scatter-DaHYP_OL.js +0 -255
  383. package/dist/client/chunks/chart-scatter-DaHYP_OL.js.map +0 -1
  384. package/dist/client/chunks/chart-tree-map-uiwUU4nb.js +0 -298
  385. package/dist/client/chunks/chart-tree-map-uiwUU4nb.js.map +0 -1
  386. package/dist/client/chunks/useDirtyStateTracking-CoeQbprt.js.map +0 -1
  387. package/dist/server/google-DUlXeeDA.cjs +0 -2
  388. package/dist/server/openai-D_U4V0kT.cjs +0 -1
@@ -1,12 +1,8 @@
1
1
  import { SQL, AnyColumn } from 'drizzle-orm';
2
2
  import { TimeGranularity } from '../types';
3
- import { BaseDatabaseAdapter, DatabaseCapabilities, WindowFunctionType, WindowFunctionConfig } from './base-adapter';
3
+ import { BaseDatabaseAdapter, DatabaseCapabilities } from './base-adapter';
4
4
  export declare class PostgresAdapter extends BaseDatabaseAdapter {
5
5
  getEngineType(): 'postgres';
6
- /**
7
- * PostgreSQL supports LATERAL joins since version 9.3
8
- */
9
- supportsLateralJoins(): boolean;
10
6
  /**
11
7
  * Build PostgreSQL INTERVAL from ISO 8601 duration
12
8
  * PostgreSQL supports INTERVAL literal syntax: INTERVAL '7 days'
@@ -42,78 +38,18 @@ export declare class PostgresAdapter extends BaseDatabaseAdapter {
42
38
  * Extracted from executor.ts:649-670 and multi-cube-builder.ts:306-320
43
39
  */
44
40
  buildTimeDimension(granularity: TimeGranularity, fieldExpr: AnyColumn | SQL): SQL;
45
- /**
46
- * Build PostgreSQL string matching conditions using ILIKE (case-insensitive)
47
- * Extracted from executor.ts:807-813 and multi-cube-builder.ts:468-474
48
- */
49
- buildStringCondition(fieldExpr: AnyColumn | SQL, operator: 'contains' | 'notContains' | 'startsWith' | 'endsWith' | 'like' | 'notLike' | 'ilike' | 'regex' | 'notRegex', value: string): SQL;
50
41
  /**
51
42
  * Build PostgreSQL type casting using :: syntax
52
43
  * Extracted from various locations where ::timestamp was used
53
44
  */
54
45
  castToType(fieldExpr: AnyColumn | SQL, targetType: 'timestamp' | 'decimal' | 'integer'): SQL;
55
- /**
56
- * Build PostgreSQL AVG aggregation with COALESCE for NULL handling
57
- * PostgreSQL AVG returns NULL for empty sets, so we use COALESCE for consistent behavior
58
- * Extracted from multi-cube-builder.ts:284
59
- */
60
- buildAvg(fieldExpr: AnyColumn | SQL): SQL;
61
- /**
62
- * Build PostgreSQL CASE WHEN conditional expression
63
- */
64
- buildCaseWhen(conditions: Array<{
65
- when: SQL;
66
- then: any;
67
- }>, elseValue?: any): SQL;
68
- /**
69
- * Build PostgreSQL boolean literal
70
- * PostgreSQL uses TRUE/FALSE keywords
71
- */
72
- buildBooleanLiteral(value: boolean): SQL;
73
- /**
74
- * Convert filter values - PostgreSQL uses native types
75
- * No conversion needed for PostgreSQL
76
- */
77
- convertFilterValue(value: any): any;
78
- /**
79
- * Prepare date value for PostgreSQL
80
- * PostgreSQL accepts Date objects directly
81
- */
82
- prepareDateValue(date: Date): any;
83
- /**
84
- * PostgreSQL stores timestamps as native timestamp types
85
- */
86
- isTimestampInteger(): boolean;
87
- /**
88
- * PostgreSQL time dimensions already return proper values
89
- * No conversion needed
90
- */
91
- convertTimeDimensionResult(value: any): any;
92
46
  /**
93
47
  * PostgreSQL has full support for statistical and window functions
94
48
  */
95
49
  getCapabilities(): DatabaseCapabilities;
96
- /**
97
- * Build PostgreSQL STDDEV aggregation
98
- * Uses STDDEV_POP for population, STDDEV_SAMP for sample
99
- */
100
- buildStddev(fieldExpr: AnyColumn | SQL, useSample?: boolean): SQL;
101
- /**
102
- * Build PostgreSQL VARIANCE aggregation
103
- * Uses VAR_POP for population, VAR_SAMP for sample
104
- */
105
- buildVariance(fieldExpr: AnyColumn | SQL, useSample?: boolean): SQL;
106
50
  /**
107
51
  * Build PostgreSQL PERCENTILE_CONT aggregation
108
52
  * Uses ordered-set aggregate function
109
53
  */
110
54
  buildPercentile(fieldExpr: AnyColumn | SQL, percentile: number): SQL;
111
- /**
112
- * Build PostgreSQL window function expression
113
- * PostgreSQL has full window function support
114
- */
115
- buildWindowFunction(type: WindowFunctionType, fieldExpr: AnyColumn | SQL | null, partitionBy?: (AnyColumn | SQL)[], orderBy?: Array<{
116
- field: AnyColumn | SQL;
117
- direction: 'asc' | 'desc';
118
- }>, config?: WindowFunctionConfig): SQL;
119
55
  }
@@ -1,19 +1,12 @@
1
1
  import { SQL, AnyColumn } from 'drizzle-orm';
2
2
  import { TimeGranularity } from '../types';
3
- import { BaseDatabaseAdapter, DatabaseCapabilities, WindowFunctionType, WindowFunctionConfig } from './base-adapter';
3
+ import { BaseDatabaseAdapter, DatabaseCapabilities } from './base-adapter';
4
4
  export declare class SnowflakeAdapter extends BaseDatabaseAdapter {
5
5
  getEngineType(): 'snowflake';
6
- /**
7
- * Snowflake supports LATERAL joins
8
- */
9
- supportsLateralJoins(): boolean;
10
6
  /**
11
7
  * Build Snowflake INTERVAL from ISO 8601 duration
12
- * Snowflake doesn't support INTERVAL literal syntax directly in all contexts,
13
- * so we chain DATEADD calls. For standalone interval expressions, we return
14
- * a DATEADD chain applied to TIMESTAMP '1970-01-01' and subtract it back.
15
- * However, buildIntervalFromISO is typically used with buildDateAddInterval,
16
- * so we return a structured representation.
8
+ * Snowflake doesn't have a standalone INTERVAL type like PostgreSQL.
9
+ * We convert to total seconds for use in DATEADD; callers should prefer buildDateAddInterval.
17
10
  */
18
11
  buildIntervalFromISO(duration: string): SQL;
19
12
  /**
@@ -26,11 +19,6 @@ export declare class SnowflakeAdapter extends BaseDatabaseAdapter {
26
19
  * Uses chained DATEADD(unit, amount, timestamp) calls
27
20
  */
28
21
  buildDateAddInterval(timestamp: SQL, duration: string): SQL;
29
- /**
30
- * Build Snowflake conditional aggregation using CASE WHEN
31
- * Snowflake supports FILTER clause but CASE WHEN is more portable
32
- */
33
- buildConditionalAggregation(aggFn: 'count' | 'avg' | 'min' | 'max' | 'sum', expr: SQL | null, condition: SQL): SQL;
34
22
  /**
35
23
  * Build Snowflake date difference in periods using DATEDIFF
36
24
  */
@@ -45,72 +33,21 @@ export declare class SnowflakeAdapter extends BaseDatabaseAdapter {
45
33
  */
46
34
  buildTimeDimension(granularity: TimeGranularity, fieldExpr: AnyColumn | SQL): SQL;
47
35
  /**
48
- * Build Snowflake string matching conditions using native ILIKE
49
- * Snowflake supports ILIKE natively
36
+ * Snowflake uses function-style regex matching: REGEXP_LIKE(field, pattern)
50
37
  */
51
- buildStringCondition(fieldExpr: AnyColumn | SQL, operator: 'contains' | 'notContains' | 'startsWith' | 'endsWith' | 'like' | 'notLike' | 'ilike' | 'regex' | 'notRegex', value: string): SQL;
38
+ protected regexCondition(fieldExpr: AnyColumn | SQL, value: string, negated: boolean): SQL;
52
39
  /**
53
40
  * Build Snowflake type casting using :: syntax
54
41
  * Snowflake supports both :: syntax and CAST() function
55
42
  */
56
43
  castToType(fieldExpr: AnyColumn | SQL, targetType: 'timestamp' | 'decimal' | 'integer'): SQL;
57
- /**
58
- * Build Snowflake AVG aggregation with COALESCE for NULL handling
59
- */
60
- buildAvg(fieldExpr: AnyColumn | SQL): SQL;
61
- /**
62
- * Build Snowflake CASE WHEN conditional expression
63
- */
64
- buildCaseWhen(conditions: Array<{
65
- when: SQL;
66
- then: any;
67
- }>, elseValue?: any): SQL;
68
- /**
69
- * Build Snowflake boolean literal
70
- * Snowflake uses TRUE/FALSE keywords
71
- */
72
- buildBooleanLiteral(value: boolean): SQL;
73
- /**
74
- * Convert filter values - Snowflake uses native types
75
- */
76
- convertFilterValue(value: any): any;
77
- /**
78
- * Prepare date value for Snowflake
79
- * Snowflake accepts Date objects directly
80
- */
81
- prepareDateValue(date: Date): any;
82
- /**
83
- * Snowflake stores timestamps as native timestamp types
84
- */
85
- isTimestampInteger(): boolean;
86
- /**
87
- * Snowflake time dimensions already return proper values
88
- */
89
- convertTimeDimensionResult(value: any): any;
90
44
  /**
91
45
  * Snowflake capabilities - full SQL support
92
46
  */
93
47
  getCapabilities(): DatabaseCapabilities;
94
- /**
95
- * Build Snowflake STDDEV aggregation
96
- */
97
- buildStddev(fieldExpr: AnyColumn | SQL, useSample?: boolean): SQL;
98
- /**
99
- * Build Snowflake VARIANCE aggregation
100
- * Snowflake supports native VAR_POP/VAR_SAMP
101
- */
102
- buildVariance(fieldExpr: AnyColumn | SQL, useSample?: boolean): SQL;
103
48
  /**
104
49
  * Build Snowflake PERCENTILE_CONT aggregation
105
50
  * Uses ordered-set aggregate function
106
51
  */
107
52
  buildPercentile(fieldExpr: AnyColumn | SQL, percentile: number): SQL;
108
- /**
109
- * Build Snowflake window function expression
110
- * Snowflake has full window function support
111
- */
112
- buildWindowFunction(type: WindowFunctionType, fieldExpr: AnyColumn | SQL | null, partitionBy?: (AnyColumn | SQL)[], orderBy?: Array<{
113
- field: AnyColumn | SQL;
114
- direction: 'asc' | 'desc';
115
- }>, config?: WindowFunctionConfig): SQL;
116
53
  }
@@ -1,13 +1,8 @@
1
1
  import { SQL, AnyColumn } from 'drizzle-orm';
2
2
  import { TimeGranularity } from '../types';
3
- import { BaseDatabaseAdapter, DatabaseCapabilities, WindowFunctionType, WindowFunctionConfig } from './base-adapter';
3
+ import { BaseDatabaseAdapter, DatabaseCapabilities } from './base-adapter';
4
4
  export declare class SQLiteAdapter extends BaseDatabaseAdapter {
5
5
  getEngineType(): 'sqlite';
6
- /**
7
- * SQLite does not support LATERAL joins
8
- * Flow queries require LATERAL for efficient execution and are not supported on SQLite
9
- */
10
- supportsLateralJoins(): boolean;
11
6
  /**
12
7
  * Build SQLite INTERVAL from ISO 8601 duration
13
8
  * SQLite doesn't have native interval types, so we convert to seconds
@@ -25,12 +20,6 @@ export declare class SQLiteAdapter extends BaseDatabaseAdapter {
25
20
  * Since SQLite stores timestamps as Unix seconds, just add the seconds
26
21
  */
27
22
  buildDateAddInterval(timestamp: SQL, duration: string): SQL;
28
- /**
29
- * Build SQLite conditional aggregation using CASE WHEN
30
- * SQLite doesn't support FILTER clause, so we use CASE WHEN pattern
31
- * Example: AVG(CASE WHEN step_1_time IS NOT NULL THEN time_diff END)
32
- */
33
- buildConditionalAggregation(aggFn: 'count' | 'avg' | 'min' | 'max' | 'sum', expr: SQL | null, condition: SQL): SQL;
34
23
  /**
35
24
  * Build SQLite date difference in periods
36
25
  * SQLite uses Julian day calculations for date arithmetic
@@ -50,22 +39,26 @@ export declare class SQLiteAdapter extends BaseDatabaseAdapter {
50
39
  */
51
40
  buildTimeDimension(granularity: TimeGranularity, fieldExpr: AnyColumn | SQL): SQL;
52
41
  /**
53
- * Build SQLite string matching conditions using LOWER() + LIKE for case-insensitive matching
54
- * SQLite LIKE is case-insensitive by default, but LOWER() ensures consistency
42
+ * SQLite has no ILIKE use LOWER()+LIKE with the pattern lowercased in JS.
43
+ */
44
+ protected caseInsensitiveLike(fieldExpr: AnyColumn | SQL, pattern: string, negated: boolean): SQL;
45
+ /**
46
+ * SQLite regex requires loading an extension, so GLOB is used as a fallback.
55
47
  */
56
- buildStringCondition(fieldExpr: AnyColumn | SQL, operator: 'contains' | 'notContains' | 'startsWith' | 'endsWith' | 'like' | 'notLike' | 'ilike' | 'regex' | 'notRegex', value: string): SQL;
48
+ protected regexCondition(fieldExpr: AnyColumn | SQL, value: string, negated: boolean): SQL;
57
49
  /**
58
50
  * Build SQLite type casting using CAST() function
59
51
  * SQLite has dynamic typing but supports CAST for consistency
60
52
  */
61
53
  castToType(fieldExpr: AnyColumn | SQL, targetType: 'timestamp' | 'decimal' | 'integer'): SQL;
62
54
  /**
63
- * Build SQLite AVG aggregation with IFNULL for NULL handling
64
- * SQLite AVG returns NULL for empty sets, using IFNULL for consistency
55
+ * SQLite AVG uses IFNULL rather than COALESCE for null-to-zero handling.
65
56
  */
66
- buildAvg(fieldExpr: AnyColumn | SQL): SQL;
57
+ protected nullToZero(expr: SQL): SQL;
67
58
  /**
68
- * Build SQLite CASE WHEN conditional expression
59
+ * Build SQLite CASE WHEN conditional expression.
60
+ * Unlike the base implementation, SQLite must detect embedded SQL objects in THEN/ELSE
61
+ * and inline them rather than binding them as parameters.
69
62
  */
70
63
  buildCaseWhen(conditions: Array<{
71
64
  when: SQL;
@@ -104,11 +97,6 @@ export declare class SQLiteAdapter extends BaseDatabaseAdapter {
104
97
  * SQLite stores timestamps as integers (milliseconds)
105
98
  */
106
99
  isTimestampInteger(): boolean;
107
- /**
108
- * Convert SQLite time dimension results back to Date objects
109
- * SQLite time dimensions return datetime strings, but clients expect Date objects
110
- */
111
- convertTimeDimensionResult(value: any): any;
112
100
  /**
113
101
  * SQLite has limited statistical support (no native STDDEV/VARIANCE/PERCENTILE)
114
102
  * but supports window functions since SQLite 3.25
@@ -129,12 +117,4 @@ export declare class SQLiteAdapter extends BaseDatabaseAdapter {
129
117
  * Returns null for graceful degradation
130
118
  */
131
119
  buildPercentile(_fieldExpr: AnyColumn | SQL, _percentile: number): SQL | null;
132
- /**
133
- * Build SQLite window function expression
134
- * SQLite 3.25+ supports window functions
135
- */
136
- buildWindowFunction(type: WindowFunctionType, fieldExpr: AnyColumn | SQL | null, partitionBy?: (AnyColumn | SQL)[], orderBy?: Array<{
137
- field: AnyColumn | SQL;
138
- direction: 'asc' | 'desc';
139
- }>, config?: WindowFunctionConfig): SQL;
140
120
  }
@@ -0,0 +1,11 @@
1
+ import { SQL, AnyColumn } from 'drizzle-orm';
2
+ import { WindowFunctionType, WindowFunctionConfig } from './base-adapter';
3
+ type FieldExpr = AnyColumn | SQL | null;
4
+ /** Build the full `OVER (...)` clause from partition/order/frame components. */
5
+ export declare function buildWindowOverClause(partitionBy?: (AnyColumn | SQL)[], orderBy?: Array<{
6
+ field: AnyColumn | SQL;
7
+ direction: 'asc' | 'desc';
8
+ }>, config?: WindowFunctionConfig): SQL;
9
+ /** Build the window function expression for a given type and pre-built OVER clause. */
10
+ export declare function buildWindowExpression(type: WindowFunctionType, fieldExpr: FieldExpr, over: SQL, config?: WindowFunctionConfig): SQL;
11
+ export {};
@@ -13,11 +13,6 @@ interface ValidationResult {
13
13
  * Validate chartConfig against the chart type's drop zone requirements.
14
14
  */
15
15
  export declare function validateChartConfig(chartType: string, chartConfig: Record<string, unknown> | undefined, _query: Record<string, unknown>): ValidationResult;
16
- /**
17
- * Auto-infer missing chartConfig fields from the query structure.
18
- * Fills in xAxis, yAxis, series, sizeField, etc. based on query measures/dimensions
19
- * and the chart type's drop zone acceptTypes.
20
- */
21
16
  export declare function inferChartConfig(chartType: string, chartConfig: Record<string, unknown> | undefined, query: Record<string, unknown>): Record<string, unknown>;
22
17
  /**
23
18
  * Build per-chart-type requirements text for the agent tool description.
@@ -0,0 +1,37 @@
1
+ import { AgentSSEEvent, AgentHistoryMessage, AgentConfig } from './types';
2
+ import { ContentBlock, InternalMessage, ToolResult, LLMProvider } from './providers/types';
3
+ import { ToolExecutionResult } from './tools';
4
+ type AgentObservability = AgentConfig['observability'];
5
+ type ToolExecutorMap = Map<string, (input: Record<string, unknown>) => Promise<ToolExecutionResult>>;
6
+ /** Push provider-formatted tool results onto the message list (array or single). */
7
+ export declare function pushFormattedResults(messages: InternalMessage[], formatted: unknown): void;
8
+ /** Run an observability callback, swallowing any error (must never break the agent). */
9
+ export declare function safeObserve(fn: (() => void) | undefined): void;
10
+ /** Rebuild conversation messages from stored history (e.g. after notebook reload). */
11
+ export declare function rebuildMessagesFromHistory(history: AgentHistoryMessage[] | undefined, provider: LLMProvider): InternalMessage[];
12
+ /** Accumulated result of consuming one assistant generation stream. */
13
+ export interface ConsumedStream {
14
+ contentBlocks: ContentBlock[];
15
+ stopReason: string;
16
+ inputTokens?: number;
17
+ outputTokens?: number;
18
+ }
19
+ /**
20
+ * Consume a provider's normalized stream, accumulating the assistant's content
21
+ * blocks and yielding text/tool SSE events. Returns the accumulated blocks,
22
+ * stop reason and token usage.
23
+ */
24
+ export declare function consumeAssistantStream(provider: LLMProvider, stream: AsyncIterable<unknown>): AsyncGenerator<AgentSSEEvent, ConsumedStream>;
25
+ /** Context shared across tool executions within a single turn. */
26
+ export interface ToolExecContext {
27
+ executor: ToolExecutorMap;
28
+ observability: AgentObservability;
29
+ traceId: string;
30
+ turn: number;
31
+ }
32
+ /**
33
+ * Execute all tool-use blocks in the assistant's response, yielding their SSE
34
+ * events and returning the collected ToolResults.
35
+ */
36
+ export declare function executeToolCalls(contentBlocks: ContentBlock[], ctx: ToolExecContext): AsyncGenerator<AgentSSEEvent, ToolResult[]>;
37
+ export {};
@@ -0,0 +1,29 @@
1
+ import { CubeMetadata } from '../types/metadata';
2
+ /** A measure or dimension as carried in cube metadata. */
3
+ type Field = CubeMetadata['measures'][number] | CubeMetadata['dimensions'][number];
4
+ /** Scoring callbacks shared with discovery.ts (avoids a circular import). */
5
+ export interface ScoreFns {
6
+ fuzzyMatchScore: (query: string, target: string) => number;
7
+ matchAgainstArray: (query: string, targets: string[]) => number;
8
+ }
9
+ /**
10
+ * Score a single field (measure or dimension) against a keyword.
11
+ * Returns the best score across name, title, description and synonyms.
12
+ */
13
+ export declare function scoreField(keyword: string, field: Field, fns: ScoreFns): number;
14
+ /**
15
+ * Accumulate field scores for a keyword into a running totals map.
16
+ * Adds to `totalScore` (returned) and records the per-field best score when the
17
+ * field clears the relevance threshold, mutating `scores` and `matchedOn`.
18
+ */
19
+ export declare function accumulateFieldScores(keyword: string, fields: Field[], fns: ScoreFns, scores: Map<string, number>, matchedOn: {
20
+ hit: boolean;
21
+ }): number;
22
+ /** Return the top-N field names from a score map, highest score first. */
23
+ export declare function topScoredFields(scores: Map<string, number>, limit: number): string[];
24
+ /**
25
+ * Score a single field as a best-match candidate (used by findBestFieldMatch).
26
+ * Returns the best score across name, title and synonyms (no description match).
27
+ */
28
+ export declare function scoreFieldForBestMatch(fieldName: string, field: Field, fns: ScoreFns): number;
29
+ export {};
@@ -47,6 +47,10 @@ export interface DiscoveryOptions {
47
47
  /** Minimum relevance score (0-1) */
48
48
  minScore?: number;
49
49
  }
50
+ /**
51
+ * Calculate Levenshtein distance between two strings
52
+ */
53
+ export declare function levenshteinDistance(a: string, b: string): number;
50
54
  /**
51
55
  * Discover relevant cubes based on topic or intent
52
56
  */
@@ -0,0 +1,33 @@
1
+ import { CubeMetadata } from '../types/metadata';
2
+ /** Format a Date as a YYYY-MM-DD string (UTC). */
3
+ export declare function formatDate(d: Date): string;
4
+ /** Resolve a numeric "last N days/weeks/months" expression. */
5
+ export declare function parseRelativeNExpression(n: number, lowerText: string): {
6
+ dateRange: [string, string];
7
+ granularity?: string;
8
+ } | null;
9
+ /** Resolve a "Q1".."Q4" quarter expression for the current year. */
10
+ export declare function parseQuarterExpression(quarterMatch: string): {
11
+ dateRange: [string, string];
12
+ granularity?: string;
13
+ };
14
+ /**
15
+ * Match measures in the primary cube against keywords in the text.
16
+ * Mutates `measures`/`reasoning` and returns the confidence delta to apply.
17
+ */
18
+ export declare function matchMeasuresInText(primaryCube: CubeMetadata, lowerText: string, measures: string[], reasoning: string[]): number;
19
+ /** Aggregation intent shape produced by detectAggregationIntent. */
20
+ export interface AggregationIntent {
21
+ type: 'sum' | 'count' | 'avg' | 'max' | 'min';
22
+ confidence: number;
23
+ }
24
+ /**
25
+ * Backfill measures when none matched directly, using the aggregation intent.
26
+ * Mutates `measures`/`reasoning`.
27
+ */
28
+ export declare function applyAggregationFallback(primaryCube: CubeMetadata, aggregationIntent: AggregationIntent, measures: string[], reasoning: string[]): void;
29
+ /**
30
+ * Resolve grouping dimensions from grouping keywords and explicit "by/per X" text.
31
+ * Mutates `dimensions`/`reasoning` and returns the confidence delta to apply.
32
+ */
33
+ export declare function matchDimensions(relevantCubes: CubeMetadata[], groupingKeywords: string[], lowerText: string, dimensions: string[], reasoning: string[]): number;
@@ -13,7 +13,4 @@ export interface QuerySuggestion {
13
13
  /** Next steps when mode != 'query' */
14
14
  nextSteps?: string[];
15
15
  }
16
- /**
17
- * Suggest a query based on natural language input
18
- */
19
16
  export declare function suggestQuery(metadata: CubeMetadata[], naturalLanguage: string, targetCube?: string): QuerySuggestion;
@@ -0,0 +1,21 @@
1
+ import { TranslationKey } from '../../i18n/types';
2
+ import { CubeMetadata } from '../types/metadata';
3
+ import { SemanticQuery, Filter } from '../types/query';
4
+ import { ValidationError, ValidationWarning } from './validation';
5
+ /** Validate that a required event-stream field is present and (if a string) a valid dimension. */
6
+ export declare function validateRequiredDimensionField(value: unknown, missingMessageKey: TranslationKey, validateDimension: (dimension: string, errors: ValidationError[]) => void, errors: ValidationError[]): void;
7
+ /** Apply field-name corrections to a measures/dimensions string array. */
8
+ export declare function applyCorrectionsToList(list: string[], corrections: Map<string, string>): string[];
9
+ /** Build the corrected query by applying field corrections (returns undefined if none). */
10
+ export declare function buildCorrectedQuery(query: SemanticQuery, corrections: Map<string, string>): SemanticQuery | undefined;
11
+ /** Push performance/best-practice warnings for an oversized standard query. */
12
+ export declare function collectPerformanceWarnings(query: SemanticQuery, warnings: ValidationWarning[]): void;
13
+ /** Warn when a declared time dimension is not actually of time type. */
14
+ export declare function checkTimeDimensionType(dimensionRef: string, metadata: CubeMetadata[], warnings: ValidationWarning[]): void;
15
+ /** Validate a single member-style filter (cube + field existence). */
16
+ export declare function validateMemberFilter(filter: Extract<Filter, {
17
+ member: string;
18
+ }>, metadata: CubeMetadata[], errors: ValidationError[], corrections: Map<string, string>, findClosestField: (fieldName: string, available: string[]) => {
19
+ field: string;
20
+ distance: number;
21
+ } | null): void;
@@ -28,7 +28,4 @@ export interface ValidationWarning {
28
28
  field?: string;
29
29
  suggestion?: string;
30
30
  }
31
- /**
32
- * Validate a query with helpful corrections
33
- */
34
31
  export declare function validateQuery(query: SemanticQuery, metadata: CubeMetadata[]): ValidationResult;
@@ -0,0 +1,106 @@
1
+ import { SQL } from 'drizzle-orm';
2
+ import { Cube, Filter, QueryContext } from '../types';
3
+ /**
4
+ * Type for CTE objects created by db.$with()
5
+ * These can be used with db.with(...ctes).select().from(cte)
6
+ */
7
+ export type WithSubquery = ReturnType<ReturnType<any['$with']>['as']>;
8
+ /**
9
+ * Combine an array of WHERE/JOIN conditions into a single SQL expression.
10
+ *
11
+ * - `[]` → undefined (no condition)
12
+ * - single element → that element verbatim
13
+ * - multiple → `and(...conditions)`
14
+ *
15
+ * Mirrors the inline `conditions.length === 1 ? conditions[0] : and(...conditions) as SQL`
16
+ * pattern that was duplicated across the analysis builders.
17
+ */
18
+ export declare function combineWhere(conditions: SQL[]): SQL | undefined;
19
+ /** The combinator + children of a client-style group filter. */
20
+ export interface GroupFilterParts {
21
+ /** True for an AND group, false for OR. */
22
+ isAnd: boolean;
23
+ filters: Filter[];
24
+ }
25
+ /**
26
+ * Normalise a client-style group filter.
27
+ *
28
+ * The analysis UIs sometimes emit groups as `{ type: 'and' | 'or', filters: [...] }`
29
+ * rather than the canonical `{ and: [...] }` / `{ or: [...] }` (this shape is not part
30
+ * of the `Filter` type; the builders accept it defensively). Returns the group's
31
+ * combinator + children, or `null` if `filter` isn't a client group filter.
32
+ */
33
+ export declare function asGroupFilter(filter: Filter): GroupFilterParts | null;
34
+ /**
35
+ * A single multi-cube field mapping (binding key or time dimension), e.g.
36
+ * `{ cube: 'Events', dimension: 'Events.userId' }`.
37
+ */
38
+ type FieldMapping = {
39
+ cube: string;
40
+ dimension: string;
41
+ };
42
+ /**
43
+ * The i18n namespaces whose binding-key / time-dimension leaf keys are identical.
44
+ * Funnel and flow share the exact same leaf keys under these two prefixes, which
45
+ * is what lets the resolution logic below be shared. (Retention uses a different
46
+ * leaf-key set — see `bindingKeyErrorsForPrefix` vs the bespoke config it passes.)
47
+ */
48
+ type AnalysisErrorPrefix = 'server.errors.funnel' | 'server.errors.flow';
49
+ /**
50
+ * Extract the dimension name from a `'Cube.dim'` or bare `'dim'` reference.
51
+ * (`'Cube.dim'` → `'dim'`, `'dim'` → `'dim'`.) Funnel/flow only ever pass the
52
+ * qualified form, so this is a strict superset of their old `.split('.')[1]`.
53
+ */
54
+ export declare function extractDimensionName(dimension: string): string;
55
+ /**
56
+ * Builders of the i18n error strings thrown while resolving a binding key.
57
+ * Each builder receives the resolved context so callers can preserve their exact
58
+ * existing message keys/params (funnel/flow and retention use different leaf keys).
59
+ */
60
+ export interface BindingKeyErrors {
61
+ /** Array form: no mapping in the array matched the current cube. */
62
+ noMapping: (ctx: {
63
+ cubeName: string;
64
+ }) => string;
65
+ /** The cube named in the key/mapping was not found in the `cubes` registry. */
66
+ cubeNotFound?: (ctx: {
67
+ cubeName: string;
68
+ }) => string;
69
+ /** String form: the binding-key dimension was not found on the resolved cube. */
70
+ keyDimNotFound: (ctx: {
71
+ bindingKey: string;
72
+ cubeName: string;
73
+ dimName: string;
74
+ }) => string;
75
+ /** Array form: the mapped dimension was not found on the resolved cube. */
76
+ mappingDimNotFound: (ctx: {
77
+ dimension: string;
78
+ cubeName: string;
79
+ dimName: string;
80
+ }) => string;
81
+ }
82
+ /**
83
+ * Build the binding-key error messages for funnel/flow from their shared i18n
84
+ * namespace (the leaf keys are identical across the two prefixes).
85
+ */
86
+ export declare function bindingKeyErrorsForPrefix(errorPrefix: AnalysisErrorPrefix): BindingKeyErrors;
87
+ /**
88
+ * Resolve a binding-key SQL expression for the analysis builders.
89
+ *
90
+ * Accepts a `'Cube.dim'` string or an array of `{ cube, dimension }` mappings.
91
+ * `errors` supplies the i18n messages (funnel/flow share one leaf-key set via
92
+ * `bindingKeyErrorsForPrefix`; retention passes its own). When `cubes` is given,
93
+ * the dimension is resolved on the cube named in the key (retention's multi-cube
94
+ * semantics); otherwise it is resolved on `cube` (funnel/flow).
95
+ */
96
+ export declare function resolveBindingKeyExpr(bindingKey: string | FieldMapping[], cube: Cube, context: QueryContext, errors: BindingKeyErrors, cubes?: Map<string, Cube>): SQL;
97
+ /**
98
+ * Resolve a time-dimension SQL expression for funnel/flow builders.
99
+ *
100
+ * Accepts a `'Cube.dim'` string or an array of `{ cube, dimension }` mappings.
101
+ * `errorPrefix` selects the i18n namespace (the leaf keys are identical across
102
+ * funnel and flow): `<prefix>.timeDimNotFound`, `<prefix>.noTimeDimMapping`,
103
+ * `<prefix>.timeDimMappingNotFound`.
104
+ */
105
+ export declare function resolveTimeDimensionExpr(timeDimension: string | FieldMapping[], cube: Cube, context: QueryContext, errorPrefix: AnalysisErrorPrefix): SQL;
106
+ export {};
@@ -26,6 +26,52 @@ export declare class CTEBuilder {
26
26
  * 5. Handles multi-hop join paths by absorbing intermediate tables (fan-out prevention)
27
27
  */
28
28
  buildPreAggregationCTE(cteInfo: CTEInfo, query: SemanticQuery, context: QueryContext, queryPlan: PhysicalQueryPlan, preBuiltFilterMap?: Map<string, SQL[]>): any;
29
+ /**
30
+ * Build the SELECT map for a pre-aggregation CTE: join keys (or the
31
+ * intermediate primary-connected column), downstream join keys, aggregated
32
+ * measures, and requested dimensions / time dimensions from this cube.
33
+ */
34
+ private buildCTESelections;
35
+ /** Add join-key columns (or the intermediate primary-connected column) to the CTE SELECT. */
36
+ private addJoinKeySelections;
37
+ /** Add downstream join-key columns so downstream cubes can be joined through this CTE. */
38
+ private addDownstreamKeySelections;
39
+ /** Add aggregated measure expressions to the CTE SELECT. */
40
+ private addMeasureSelections;
41
+ /** Add requested dimensions and time dimensions (from this cube) to the CTE SELECT. */
42
+ private addDimensionSelections;
43
+ /**
44
+ * Add JOINs to intermediate tables inside the CTE (multi-hop fan-out
45
+ * prevention). Joins from CTE-nearest to primary-nearest so each ON clause
46
+ * only references tables already in scope.
47
+ */
48
+ private applyIntermediateJoins;
49
+ /**
50
+ * Assemble the full WHERE condition list for a pre-aggregation CTE: security
51
+ * context, regular dimension filters, time-dimension date filters, and
52
+ * propagating filters from related cubes.
53
+ *
54
+ * IMPORTANT: Only dimension filters are applied here; measure filters belong
55
+ * in the main query's HAVING clause.
56
+ */
57
+ private buildCTEWhereConditions;
58
+ /**
59
+ * Build the time-dimension date filters (from `timeDimensions.dateRange` and
60
+ * `inDateRange` simple filters) plus propagating-filter subqueries for a CTE.
61
+ */
62
+ private buildCTETimeFilters;
63
+ /**
64
+ * Build the GROUP BY fields for a pre-aggregation CTE: join keys (or the
65
+ * intermediate primary-connected column), downstream join keys, and requested
66
+ * dimensions / time dimensions. De-dupes named columns.
67
+ */
68
+ private buildCTEGroupByFields;
69
+ /**
70
+ * Add join keys (and downstream join keys) to the CTE GROUP BY via the de-dupe
71
+ * callback. For multi-hop paths uses the intermediate table's
72
+ * primary-connected column (e.g. employees.department_id).
73
+ */
74
+ private addJoinKeyGroupBy;
29
75
  /**
30
76
  * Build join condition for CTE
31
77
  *
@@ -12,6 +12,11 @@ export declare class DateTimeBuilder {
12
12
  * Build date range condition for time dimensions
13
13
  */
14
14
  buildDateRangeCondition(fieldExpr: AnyColumn | SQL, dateRange: string | string[]): SQL | null;
15
+ private rangeBetween;
16
+ /** Shift a normalized end value to end-of-day when its source was a date-only string. */
17
+ private endOfDayValue;
18
+ private buildArrayDateRangeCondition;
19
+ private buildStringDateRangeCondition;
15
20
  /**
16
21
  * Parse relative date range expressions like "today", "yesterday", "last 7 days", "this month", etc.
17
22
  * Handles all 14 DATE_RANGE_OPTIONS from the client