drizzle-cube 0.6.2 → 0.6.4

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 (328) hide show
  1. package/dist/adapters/ActivityGridChart.config-BtECymia.cjs +1 -0
  2. package/dist/adapters/ActivityGridChart.config-CTd5HYjI.js +2 -0
  3. package/dist/adapters/AreaChart.config-1B8iQnfn.js +2 -0
  4. package/dist/adapters/AreaChart.config-hnncyQL4.cjs +1 -0
  5. package/dist/adapters/BarChart.config-C-QCf1rL.cjs +1 -0
  6. package/dist/adapters/BarChart.config-CFelK1qP.js +2 -0
  7. package/dist/adapters/BoxPlotChart.config-CD9WEPyF.js +2 -0
  8. package/dist/adapters/BoxPlotChart.config-DEbLA0BX.cjs +1 -0
  9. package/dist/adapters/BubbleChart.config-B_M4hzzV.js +2 -0
  10. package/dist/adapters/BubbleChart.config-dRZZlAke.cjs +1 -0
  11. package/dist/adapters/CandlestickChart.config-Dsil2Fop.cjs +1 -0
  12. package/dist/adapters/CandlestickChart.config-fuhyFvob.js +2 -0
  13. package/dist/adapters/DataTable.config-q2gqBi6t.cjs +1 -0
  14. package/dist/adapters/DataTable.config-wIQnHX5R.js +2 -0
  15. package/dist/adapters/FunnelChart.config-Dz710ssx.js +2 -0
  16. package/dist/adapters/FunnelChart.config-YNP9CeS-.cjs +1 -0
  17. package/dist/adapters/GaugeChart.config-BG9FcMCn.cjs +1 -0
  18. package/dist/adapters/GaugeChart.config-CgwniXkd.js +2 -0
  19. package/dist/adapters/HeatMapChart.config-1zSMXXoN.cjs +1 -0
  20. package/dist/adapters/HeatMapChart.config-YVEWx6s5.js +2 -0
  21. package/dist/adapters/KpiDelta.config-BWvYXuFp.cjs +1 -0
  22. package/dist/adapters/KpiDelta.config-C_dYM64q.js +2 -0
  23. package/dist/adapters/KpiNumber.config-CXg6toZG.js +2 -0
  24. package/dist/adapters/KpiNumber.config-CZmV-yU1.cjs +1 -0
  25. package/dist/adapters/KpiText.config-BY-SJvAF.js +2 -0
  26. package/dist/adapters/KpiText.config-GSIxy0CE.cjs +1 -0
  27. package/dist/adapters/LineChart.config-CJtF8SOu.js +2 -0
  28. package/dist/adapters/LineChart.config-d0y60gw9.cjs +1 -0
  29. package/dist/adapters/MarkdownChart.config-B6w0spya.cjs +1 -0
  30. package/dist/adapters/MarkdownChart.config-BuIQcWOn.js +2 -0
  31. package/dist/adapters/MeasureProfileChart.config-Bo2n5Ae5.cjs +1 -0
  32. package/dist/adapters/MeasureProfileChart.config-C5d34lsc.js +2 -0
  33. package/dist/adapters/PieChart.config-CDxfXCIt.cjs +1 -0
  34. package/dist/adapters/PieChart.config-CuZxQc5m.js +2 -0
  35. package/dist/adapters/RadarChart.config-DpdVWyh5.cjs +1 -0
  36. package/dist/adapters/RadarChart.config-KrxwaaGu.js +2 -0
  37. package/dist/adapters/RadialBarChart.config-DpRZd0FW.js +2 -0
  38. package/dist/adapters/RadialBarChart.config-faIY4jpE.cjs +1 -0
  39. package/dist/adapters/RetentionCombinedChart.config-CUnScqnS.cjs +1 -0
  40. package/dist/adapters/RetentionCombinedChart.config-Dd8FuawP.js +2 -0
  41. package/dist/adapters/RetentionHeatmap.config-CPd6GeoQ.js +2 -0
  42. package/dist/adapters/RetentionHeatmap.config-CPlHbLom.cjs +1 -0
  43. package/dist/adapters/SankeyChart.config-DbIUqi-H.cjs +1 -0
  44. package/dist/adapters/SankeyChart.config-kzAnW0C7.js +2 -0
  45. package/dist/adapters/ScatterChart.config-4Okvn27v.js +2 -0
  46. package/dist/adapters/ScatterChart.config-4f9nNw3e.cjs +1 -0
  47. package/dist/adapters/SunburstChart.config-BsUQkIM_.js +2 -0
  48. package/dist/adapters/SunburstChart.config-lvnYkWs7.cjs +1 -0
  49. package/dist/adapters/TreeMapChart.config-S0qsgAFW.js +2 -0
  50. package/dist/adapters/TreeMapChart.config-jbwKsTYt.cjs +1 -0
  51. package/dist/adapters/WaterfallChart.config-CDQ74-pS.cjs +1 -0
  52. package/dist/adapters/WaterfallChart.config-XdtH-O5g.js +2 -0
  53. package/dist/adapters/chartConfigHelpers-CcvqrIWF.js +72 -0
  54. package/dist/adapters/chartConfigHelpers-DHQB-_v5.cjs +1 -0
  55. package/dist/adapters/compiler-DyyBaLry.cjs +166 -0
  56. package/dist/adapters/{locale-DDvZDFVn.js → compiler-lG6eNsoI.js} +215 -230
  57. package/dist/adapters/core/cube-http-handler.d.ts +27 -0
  58. package/dist/adapters/core/http-port.d.ts +39 -0
  59. package/dist/adapters/core/index.cjs +1 -0
  60. package/dist/adapters/core/index.d.ts +11 -0
  61. package/dist/adapters/core/index.js +2 -0
  62. package/dist/adapters/core/mcp-handler.d.ts +13 -0
  63. package/dist/adapters/core/rest-handlers.d.ts +14 -0
  64. package/dist/adapters/core/security-context.d.ts +17 -0
  65. package/dist/adapters/core-Bbchr0ui.js +244 -0
  66. package/dist/adapters/core-F1pCQPde.cjs +1 -0
  67. package/dist/adapters/express/index.cjs +2 -2
  68. package/dist/adapters/express/index.js +93 -201
  69. package/dist/adapters/fastify/index.cjs +2 -2
  70. package/dist/adapters/fastify/index.js +79 -217
  71. package/dist/adapters/handler-DRZb2ip6.cjs +25 -0
  72. package/dist/adapters/{handler-CtaSua-i.js → handler-u8FyzPBT.js} +1572 -1500
  73. package/dist/adapters/hono/index.cjs +2 -2
  74. package/dist/adapters/hono/index.js +69 -225
  75. package/dist/adapters/mcp-tools.cjs +1 -1
  76. package/dist/adapters/mcp-tools.js +1 -1
  77. package/dist/adapters/mcp-transport-Bw_zqky2.js +591 -0
  78. package/dist/adapters/mcp-transport-CNIPoe1i.cjs +40 -0
  79. package/dist/adapters/nextjs/index.cjs +1 -1
  80. package/dist/adapters/nextjs/index.d.ts +18 -9
  81. package/dist/adapters/nextjs/index.js +186 -289
  82. package/dist/adapters/nextjs/mcp-handler.d.ts +0 -28
  83. package/dist/adapters/{openai-D-6l1Y8h.cjs → openai-B4kAJTSD.cjs} +1 -1
  84. package/dist/adapters/{openai-DTSTMiXL.cjs → openai-Cdf2wWZA.cjs} +1 -1
  85. package/dist/adapters/{openai-CmVRIbUg.js → openai-CmMzrs1Y.js} +1 -1
  86. package/dist/adapters/{openai-CtXqeznO.js → openai-DhzGY9R4.js} +1 -1
  87. package/dist/cjs/adapters/core/cube-http-handler.d.ts +27 -0
  88. package/dist/cjs/adapters/core/http-port.d.ts +39 -0
  89. package/dist/cjs/adapters/core/index.d.ts +11 -0
  90. package/dist/cjs/adapters/core/mcp-handler.d.ts +13 -0
  91. package/dist/cjs/adapters/core/rest-handlers.d.ts +14 -0
  92. package/dist/cjs/adapters/core/security-context.d.ts +17 -0
  93. package/dist/cjs/adapters/nextjs/index.d.ts +18 -9
  94. package/dist/cjs/adapters/nextjs/mcp-handler.d.ts +0 -28
  95. package/dist/cjs/client/charts/chartComponentRegistry.d.ts +1 -9
  96. package/dist/cjs/client/charts/chartConfigRegistry.d.ts +5 -1
  97. package/dist/cjs/client/charts/chartPlugin.d.ts +1 -2
  98. package/dist/cjs/client/charts/chartRegistry.d.ts +73 -0
  99. package/dist/cjs/client/components/AIAssistant/index.d.ts +2 -2
  100. package/dist/cjs/client/components/AnalysisBuilder/utils/filterUtils.d.ts +4 -10
  101. package/dist/cjs/client/components/charts/ActivityGridChart.config.d.ts +6 -1
  102. package/dist/cjs/client/components/charts/AreaChart.config.d.ts +6 -1
  103. package/dist/cjs/client/components/charts/BarChart.config.d.ts +6 -1
  104. package/dist/cjs/client/components/charts/BoxPlotChart.config.d.ts +6 -1
  105. package/dist/cjs/client/components/charts/BubbleChart.config.d.ts +6 -1
  106. package/dist/cjs/client/components/charts/CandlestickChart.config.d.ts +6 -1
  107. package/dist/cjs/client/components/charts/DataTable.config.d.ts +6 -1
  108. package/dist/cjs/client/components/charts/FunnelChart.config.d.ts +5 -0
  109. package/dist/cjs/client/components/charts/GaugeChart.config.d.ts +6 -1
  110. package/dist/cjs/client/components/charts/HeatMapChart.config.d.ts +6 -1
  111. package/dist/cjs/client/components/charts/KpiDelta.config.d.ts +6 -1
  112. package/dist/cjs/client/components/charts/KpiNumber.config.d.ts +6 -1
  113. package/dist/cjs/client/components/charts/KpiText.config.d.ts +6 -1
  114. package/dist/cjs/client/components/charts/LineChart.config.d.ts +6 -1
  115. package/dist/cjs/client/components/charts/MarkdownChart.config.d.ts +6 -1
  116. package/dist/cjs/client/components/charts/MeasureProfileChart.config.d.ts +6 -1
  117. package/dist/cjs/client/components/charts/PieChart.config.d.ts +6 -1
  118. package/dist/cjs/client/components/charts/RadarChart.config.d.ts +6 -1
  119. package/dist/cjs/client/components/charts/RadialBarChart.config.d.ts +6 -1
  120. package/dist/cjs/client/components/charts/SankeyChart.config.d.ts +5 -0
  121. package/dist/cjs/client/components/charts/ScatterChart.config.d.ts +6 -1
  122. package/dist/cjs/client/components/charts/SunburstChart.config.d.ts +5 -0
  123. package/dist/cjs/client/components/charts/TreeMapChart.config.d.ts +6 -1
  124. package/dist/cjs/client/components/charts/WaterfallChart.config.d.ts +6 -1
  125. package/dist/cjs/client/components/shared/utils.d.ts +2 -1
  126. package/dist/cjs/client/hooks/analysisQueryExecutionModes.d.ts +1 -1
  127. package/dist/cjs/client/hooks/useAnalysisEffects.d.ts +33 -0
  128. package/dist/{client/hooks/useAnalysisQueryExecution.d.ts → cjs/client/hooks/useAnalysisQuery.d.ts} +3 -3
  129. package/dist/cjs/client/hooks/useAnalysisState.d.ts +165 -0
  130. package/dist/cjs/client/icons/registry.d.ts +0 -6
  131. package/dist/cjs/client/icons/types.d.ts +5 -0
  132. package/dist/cjs/client/shared/filters/filterOperations.d.ts +95 -0
  133. package/dist/cjs/client/shared/filters/index.d.ts +10 -0
  134. package/dist/cjs/client/shared/filters/operators.d.ts +23 -0
  135. package/dist/cjs/client/shared/index.d.ts +3 -2
  136. package/dist/cjs/client/shared/types.d.ts +3 -10
  137. package/dist/cjs/client/shared/utils.d.ts +1 -59
  138. package/dist/cjs/client/utils/filterUtils.d.ts +2 -9
  139. package/dist/cjs/server/logical-plan/logical-plan-builder.d.ts +0 -5
  140. package/dist/cjs/server/logical-plan/schema-builder.d.ts +19 -0
  141. package/dist/client/charts/chartComponentRegistry.d.ts +1 -9
  142. package/dist/client/charts/chartConfigRegistry.d.ts +5 -1
  143. package/dist/client/charts/chartPlugin.d.ts +1 -2
  144. package/dist/client/charts/chartRegistry.d.ts +73 -0
  145. package/dist/client/charts.js +3 -3
  146. package/dist/client/chunks/{DashboardEditModal-okVfH8ZK.js → DashboardEditModal-Cs1ig1_V.js} +1522 -1121
  147. package/dist/client/chunks/DashboardEditModal-Cs1ig1_V.js.map +1 -0
  148. package/dist/client/chunks/{analysis-builder-DB88FojM.js → analysis-builder-B64yaeDe.js} +1609 -1878
  149. package/dist/client/chunks/analysis-builder-B64yaeDe.js.map +1 -0
  150. package/dist/client/chunks/{analysis-builder-shared-BVK4TYfR.js → analysis-builder-shared-CD0n2Nb8.js} +1545 -1355
  151. package/dist/client/chunks/analysis-builder-shared-CD0n2Nb8.js.map +1 -0
  152. package/dist/client/chunks/{chart-config-activity-grid-D_UX4NHC.js → chart-config-activity-grid-BU_bkvER.js} +1 -11
  153. package/dist/client/chunks/chart-config-activity-grid-BU_bkvER.js.map +1 -0
  154. package/dist/client/chunks/{chart-config-area-BNigHUy8.js → chart-config-area-DxwIZ4Uf.js} +1 -5
  155. package/dist/client/chunks/{chart-config-area-BNigHUy8.js.map → chart-config-area-DxwIZ4Uf.js.map} +1 -1
  156. package/dist/client/chunks/{chart-config-bar-DSO_LRTx.js → chart-config-bar-Cc8GY9aQ.js} +5 -9
  157. package/dist/client/chunks/chart-config-bar-Cc8GY9aQ.js.map +1 -0
  158. package/dist/client/chunks/{chart-config-box-plot-oW8axV2q.js → chart-config-box-plot-Bs8ovYvV.js} +3 -8
  159. package/dist/client/chunks/chart-config-box-plot-Bs8ovYvV.js.map +1 -0
  160. package/dist/client/chunks/{chart-config-bubble-gIoqVyjZ.js → chart-config-bubble-BfgY7pt8.js} +1 -11
  161. package/dist/client/chunks/chart-config-bubble-BfgY7pt8.js.map +1 -0
  162. package/dist/client/chunks/{chart-config-candlestick-N6DchAA3.js → chart-config-candlestick-jaeNNEtC.js} +1 -11
  163. package/dist/client/chunks/chart-config-candlestick-jaeNNEtC.js.map +1 -0
  164. package/dist/client/chunks/{chart-config-data-table-d7VBY-y_.js → chart-config-data-table-CRk0C0rW.js} +1 -4
  165. package/dist/client/chunks/chart-config-data-table-CRk0C0rW.js.map +1 -0
  166. package/dist/client/chunks/{chart-config-funnel-DEYMcxsD.js → chart-config-funnel-boT_LNfl.js} +1 -4
  167. package/dist/client/chunks/chart-config-funnel-boT_LNfl.js.map +1 -0
  168. package/dist/client/chunks/{chart-config-gauge-Dq-_H9UN.js → chart-config-gauge-C5uJEr97.js} +3 -8
  169. package/dist/client/chunks/chart-config-gauge-C5uJEr97.js.map +1 -0
  170. package/dist/client/chunks/{chart-config-heat-map-CfRnRNcw.js → chart-config-heat-map-CCarP44-.js} +1 -11
  171. package/dist/client/chunks/chart-config-heat-map-CCarP44-.js.map +1 -0
  172. package/dist/client/chunks/{chart-config-kpi-delta-DSQbvqu_.js → chart-config-kpi-delta-DYopvwyG.js} +3 -8
  173. package/dist/client/chunks/chart-config-kpi-delta-DYopvwyG.js.map +1 -0
  174. package/dist/client/chunks/{chart-config-kpi-number-EFSWY1We.js → chart-config-kpi-number-BhMdoArB.js} +3 -8
  175. package/dist/client/chunks/chart-config-kpi-number-BhMdoArB.js.map +1 -0
  176. package/dist/client/chunks/{chart-config-kpi-text-KM3V5X2u.js → chart-config-kpi-text-DE6Zdi53.js} +3 -8
  177. package/dist/client/chunks/chart-config-kpi-text-DE6Zdi53.js.map +1 -0
  178. package/dist/client/chunks/{chart-config-line-D6jG8PCH.js → chart-config-line-CBfM0Rds.js} +6 -10
  179. package/dist/client/chunks/chart-config-line-CBfM0Rds.js.map +1 -0
  180. package/dist/client/chunks/{chart-config-markdown-BtRIe8JN.js → chart-config-markdown-BCDyBI8K.js} +1 -4
  181. package/dist/client/chunks/chart-config-markdown-BCDyBI8K.js.map +1 -0
  182. package/dist/client/chunks/{chart-config-measure-profile-DxRGa-zf.js → chart-config-measure-profile-BgQIH1u2.js} +1 -8
  183. package/dist/client/chunks/chart-config-measure-profile-BgQIH1u2.js.map +1 -0
  184. package/dist/client/chunks/{chart-config-pie-BhzW-fdn.js → chart-config-pie-ChfFz6DV.js} +5 -9
  185. package/dist/client/chunks/chart-config-pie-ChfFz6DV.js.map +1 -0
  186. package/dist/client/chunks/{chart-config-radar-D7REP1q_.js → chart-config-radar-BlAIGnww.js} +5 -9
  187. package/dist/client/chunks/chart-config-radar-BlAIGnww.js.map +1 -0
  188. package/dist/client/chunks/{chart-config-radial-bar-Byx6qOPU.js → chart-config-radial-bar-VFerwbCO.js} +5 -9
  189. package/dist/client/chunks/chart-config-radial-bar-VFerwbCO.js.map +1 -0
  190. package/dist/client/chunks/{chart-config-sankey-BTnWA7EW.js → chart-config-sankey-BhrDxIgj.js} +1 -4
  191. package/dist/client/chunks/chart-config-sankey-BhrDxIgj.js.map +1 -0
  192. package/dist/client/chunks/{chart-config-scatter-DSYTjwRb.js → chart-config-scatter-q_olh54e.js} +1 -11
  193. package/dist/client/chunks/chart-config-scatter-q_olh54e.js.map +1 -0
  194. package/dist/client/chunks/{chart-config-sunburst-Bwjtdf7X.js → chart-config-sunburst-BOmkOnKn.js} +1 -4
  195. package/dist/client/chunks/chart-config-sunburst-BOmkOnKn.js.map +1 -0
  196. package/dist/client/chunks/{chart-config-tree-map-DVrvf3yQ.js → chart-config-tree-map-BjX88YBY.js} +5 -9
  197. package/dist/client/chunks/chart-config-tree-map-BjX88YBY.js.map +1 -0
  198. package/dist/client/chunks/{chart-config-waterfall-DmFeQdIk.js → chart-config-waterfall-QsWXVSoF.js} +3 -8
  199. package/dist/client/chunks/chart-config-waterfall-QsWXVSoF.js.map +1 -0
  200. package/dist/client/chunks/{chart-data-table-CKauQXme.js → chart-data-table-D4g5_jfF.js} +1277 -1094
  201. package/dist/client/chunks/chart-data-table-D4g5_jfF.js.map +1 -0
  202. package/dist/client/chunks/{chart-kpi-delta-Dn-jjO-2.js → chart-kpi-delta-BvWOt8-D.js} +2 -2
  203. package/dist/client/chunks/{chart-kpi-delta-Dn-jjO-2.js.map → chart-kpi-delta-BvWOt8-D.js.map} +1 -1
  204. package/dist/client/chunks/{chart-kpi-number-P_WBiO5S.js → chart-kpi-number-xgZmMiQY.js} +3 -3
  205. package/dist/client/chunks/{chart-kpi-number-P_WBiO5S.js.map → chart-kpi-number-xgZmMiQY.js.map} +1 -1
  206. package/dist/client/chunks/{chart-kpi-text-C-Y4eb5H.js → chart-kpi-text-ZO3eFi7t.js} +2 -2
  207. package/dist/client/chunks/{chart-kpi-text-C-Y4eb5H.js.map → chart-kpi-text-ZO3eFi7t.js.map} +1 -1
  208. package/dist/client/chunks/{charts-loader-DdTeCeNo.js → charts-loader-B0DOQMFH.js} +6 -6
  209. package/dist/client/chunks/{charts-loader-DdTeCeNo.js.map → charts-loader-B0DOQMFH.js.map} +1 -1
  210. package/dist/client/chunks/{schema-visualization-Cb_E9_Gd.js → schema-visualization-DJPTktM6.js} +2 -2
  211. package/dist/client/chunks/{schema-visualization-Cb_E9_Gd.js.map → schema-visualization-DJPTktM6.js.map} +1 -1
  212. package/dist/client/chunks/{useDirtyStateTracking-MbpxH_v6.js → useDirtyStateTracking-BT6zqCFl.js} +250 -591
  213. package/dist/client/chunks/useDirtyStateTracking-BT6zqCFl.js.map +1 -0
  214. package/dist/client/chunks/{useExplainAI-evnZkjCY.js → useExplainAI-Dq_meKNN.js} +4 -4
  215. package/dist/client/chunks/{useExplainAI-evnZkjCY.js.map → useExplainAI-Dq_meKNN.js.map} +1 -1
  216. package/dist/client/chunks/{utils-3P6z1vz5.js → utils-Cq-j5E5I.js} +2 -2
  217. package/dist/client/chunks/{utils-3P6z1vz5.js.map → utils-Cq-j5E5I.js.map} +1 -1
  218. package/dist/client/chunks/{vendor-DSpR0IW6.js → vendor-D4jADu8t.js} +2 -2
  219. package/dist/client/chunks/{vendor-DSpR0IW6.js.map → vendor-D4jADu8t.js.map} +1 -1
  220. package/dist/client/components/AIAssistant/index.d.ts +2 -2
  221. package/dist/client/components/AnalysisBuilder/utils/filterUtils.d.ts +4 -10
  222. package/dist/client/components/charts/ActivityGridChart.config.d.ts +6 -1
  223. package/dist/client/components/charts/AreaChart.config.d.ts +6 -1
  224. package/dist/client/components/charts/BarChart.config.d.ts +6 -1
  225. package/dist/client/components/charts/BoxPlotChart.config.d.ts +6 -1
  226. package/dist/client/components/charts/BubbleChart.config.d.ts +6 -1
  227. package/dist/client/components/charts/CandlestickChart.config.d.ts +6 -1
  228. package/dist/client/components/charts/DataTable.config.d.ts +6 -1
  229. package/dist/client/components/charts/FunnelChart.config.d.ts +5 -0
  230. package/dist/client/components/charts/GaugeChart.config.d.ts +6 -1
  231. package/dist/client/components/charts/HeatMapChart.config.d.ts +6 -1
  232. package/dist/client/components/charts/KpiDelta.config.d.ts +6 -1
  233. package/dist/client/components/charts/KpiNumber.config.d.ts +6 -1
  234. package/dist/client/components/charts/KpiText.config.d.ts +6 -1
  235. package/dist/client/components/charts/LineChart.config.d.ts +6 -1
  236. package/dist/client/components/charts/MarkdownChart.config.d.ts +6 -1
  237. package/dist/client/components/charts/MeasureProfileChart.config.d.ts +6 -1
  238. package/dist/client/components/charts/PieChart.config.d.ts +6 -1
  239. package/dist/client/components/charts/RadarChart.config.d.ts +6 -1
  240. package/dist/client/components/charts/RadialBarChart.config.d.ts +6 -1
  241. package/dist/client/components/charts/SankeyChart.config.d.ts +5 -0
  242. package/dist/client/components/charts/ScatterChart.config.d.ts +6 -1
  243. package/dist/client/components/charts/SunburstChart.config.d.ts +5 -0
  244. package/dist/client/components/charts/TreeMapChart.config.d.ts +6 -1
  245. package/dist/client/components/charts/WaterfallChart.config.d.ts +6 -1
  246. package/dist/client/components/shared/utils.d.ts +2 -1
  247. package/dist/client/components.js +3 -3
  248. package/dist/client/hooks/analysisQueryExecutionModes.d.ts +1 -1
  249. package/dist/client/hooks/useAnalysisEffects.d.ts +33 -0
  250. package/dist/{cjs/client/hooks/useAnalysisQueryExecution.d.ts → client/hooks/useAnalysisQuery.d.ts} +3 -3
  251. package/dist/client/hooks/useAnalysisState.d.ts +165 -0
  252. package/dist/client/hooks.js +3 -3
  253. package/dist/client/icons/registry.d.ts +0 -6
  254. package/dist/client/icons/types.d.ts +5 -0
  255. package/dist/client/icons.js +1 -1
  256. package/dist/client/index.js +17 -17
  257. package/dist/client/index.js.map +1 -1
  258. package/dist/client/providers.js +1 -1
  259. package/dist/client/schema.js +1 -1
  260. package/dist/client/shared/filters/filterOperations.d.ts +95 -0
  261. package/dist/client/shared/filters/index.d.ts +10 -0
  262. package/dist/client/shared/filters/operators.d.ts +23 -0
  263. package/dist/client/shared/index.d.ts +3 -2
  264. package/dist/client/shared/types.d.ts +3 -10
  265. package/dist/client/shared/utils.d.ts +1 -59
  266. package/dist/client/utils/filterUtils.d.ts +2 -9
  267. package/dist/client/utils.js +3 -3
  268. package/dist/client-bundle-stats.html +1 -1
  269. package/dist/mcp-app/mcp-app.html +34 -34
  270. package/dist/server/chartConfigHelpers-CcvqrIWF.js +72 -0
  271. package/dist/server/chartConfigHelpers-DHQB-_v5.cjs +1 -0
  272. package/dist/server/index.cjs +68 -68
  273. package/dist/server/index.js +3899 -3823
  274. package/dist/server/logical-plan/logical-plan-builder.d.ts +0 -5
  275. package/dist/server/logical-plan/schema-builder.d.ts +19 -0
  276. package/dist/server/{openai-D-6l1Y8h.cjs → openai-B4kAJTSD.cjs} +1 -1
  277. package/dist/server/{openai-DTSTMiXL.cjs → openai-Cdf2wWZA.cjs} +1 -1
  278. package/dist/server/{openai-CmVRIbUg.js → openai-CmMzrs1Y.js} +1 -1
  279. package/dist/server/{openai-CtXqeznO.js → openai-DhzGY9R4.js} +1 -1
  280. package/package.json +13 -3
  281. package/dist/adapters/handler-OwxSBJH8.cjs +0 -25
  282. package/dist/adapters/hono/mcp-handler.d.ts +0 -37
  283. package/dist/adapters/locale-ZLUUNUxr.cjs +0 -166
  284. package/dist/adapters/mcp-transport-B7ddET3M.cjs +0 -40
  285. package/dist/adapters/mcp-transport-Dfuj4j4q.js +0 -591
  286. package/dist/cjs/adapters/hono/mcp-handler.d.ts +0 -37
  287. package/dist/cjs/client/hooks/useAnalysisAI.d.ts +0 -56
  288. package/dist/cjs/client/hooks/useAnalysisChartDefaults.d.ts +0 -35
  289. package/dist/cjs/client/hooks/useAnalysisCombinedFields.d.ts +0 -18
  290. package/dist/cjs/client/hooks/useAnalysisInitialization.d.ts +0 -25
  291. package/dist/cjs/client/hooks/useAnalysisQueryBuilder.d.ts +0 -32
  292. package/dist/cjs/client/hooks/useAnalysisShare.d.ts +0 -18
  293. package/dist/cjs/client/hooks/useAnalysisUIState.d.ts +0 -24
  294. package/dist/client/chunks/DashboardEditModal-okVfH8ZK.js.map +0 -1
  295. package/dist/client/chunks/analysis-builder-DB88FojM.js.map +0 -1
  296. package/dist/client/chunks/analysis-builder-shared-BVK4TYfR.js.map +0 -1
  297. package/dist/client/chunks/chart-config-activity-grid-D_UX4NHC.js.map +0 -1
  298. package/dist/client/chunks/chart-config-bar-DSO_LRTx.js.map +0 -1
  299. package/dist/client/chunks/chart-config-box-plot-oW8axV2q.js.map +0 -1
  300. package/dist/client/chunks/chart-config-bubble-gIoqVyjZ.js.map +0 -1
  301. package/dist/client/chunks/chart-config-candlestick-N6DchAA3.js.map +0 -1
  302. package/dist/client/chunks/chart-config-data-table-d7VBY-y_.js.map +0 -1
  303. package/dist/client/chunks/chart-config-funnel-DEYMcxsD.js.map +0 -1
  304. package/dist/client/chunks/chart-config-gauge-Dq-_H9UN.js.map +0 -1
  305. package/dist/client/chunks/chart-config-heat-map-CfRnRNcw.js.map +0 -1
  306. package/dist/client/chunks/chart-config-kpi-delta-DSQbvqu_.js.map +0 -1
  307. package/dist/client/chunks/chart-config-kpi-number-EFSWY1We.js.map +0 -1
  308. package/dist/client/chunks/chart-config-kpi-text-KM3V5X2u.js.map +0 -1
  309. package/dist/client/chunks/chart-config-line-D6jG8PCH.js.map +0 -1
  310. package/dist/client/chunks/chart-config-markdown-BtRIe8JN.js.map +0 -1
  311. package/dist/client/chunks/chart-config-measure-profile-DxRGa-zf.js.map +0 -1
  312. package/dist/client/chunks/chart-config-pie-BhzW-fdn.js.map +0 -1
  313. package/dist/client/chunks/chart-config-radar-D7REP1q_.js.map +0 -1
  314. package/dist/client/chunks/chart-config-radial-bar-Byx6qOPU.js.map +0 -1
  315. package/dist/client/chunks/chart-config-sankey-BTnWA7EW.js.map +0 -1
  316. package/dist/client/chunks/chart-config-scatter-DSYTjwRb.js.map +0 -1
  317. package/dist/client/chunks/chart-config-sunburst-Bwjtdf7X.js.map +0 -1
  318. package/dist/client/chunks/chart-config-tree-map-DVrvf3yQ.js.map +0 -1
  319. package/dist/client/chunks/chart-config-waterfall-DmFeQdIk.js.map +0 -1
  320. package/dist/client/chunks/chart-data-table-CKauQXme.js.map +0 -1
  321. package/dist/client/chunks/useDirtyStateTracking-MbpxH_v6.js.map +0 -1
  322. package/dist/client/hooks/useAnalysisAI.d.ts +0 -56
  323. package/dist/client/hooks/useAnalysisChartDefaults.d.ts +0 -35
  324. package/dist/client/hooks/useAnalysisCombinedFields.d.ts +0 -18
  325. package/dist/client/hooks/useAnalysisInitialization.d.ts +0 -25
  326. package/dist/client/hooks/useAnalysisQueryBuilder.d.ts +0 -32
  327. package/dist/client/hooks/useAnalysisShare.d.ts +0 -18
  328. package/dist/client/hooks/useAnalysisUIState.d.ts +0 -24
@@ -1,11 +1,12 @@
1
- import { a as e, d as t, f as n, i as r, l as i, m as a, o, p as s, r as c, u as l } from "../utils-BPWZsX7k.js";
2
- import { i as u, n as d, r as f, t as p } from "../locale-DDvZDFVn.js";
3
- import { C as m, S as h, _ as g, a as _, b as v, c as y, g as b, h as x, i as S, l as C, m as w, o as T, r as E, u as D, v as O, x as k, y as A } from "../mcp-transport-Dfuj4j4q.js";
4
- import { NextResponse as j } from "next/server";
1
+ import { d as e, f as t, i as n, m as r, p as i } from "../utils-BPWZsX7k.js";
2
+ import { t as a } from "../compiler-lG6eNsoI.js";
3
+ import { _ as o, b as s, c, u as l } from "../mcp-transport-Bw_zqky2.js";
4
+ import { a as u, i as d, o as f, r as p, t as m } from "../core-Bbchr0ui.js";
5
+ import { NextResponse as h } from "next/server";
5
6
  //#region src/adapters/nextjs/mcp-handler.ts
6
- function M(e, t) {
7
- let n = new TextEncoder(), r = g(), i = new ReadableStream({ start(e) {
8
- e.enqueue(n.encode(v({
7
+ function g(e, t) {
8
+ let n = new TextEncoder(), r = o(), i = new ReadableStream({ start(e) {
9
+ e.enqueue(n.encode(s({
9
10
  jsonrpc: "2.0",
10
11
  method: "mcp/ready",
11
12
  params: { protocol: "streamable-http" }
@@ -15,89 +16,104 @@ function M(e, t) {
15
16
  "Cache-Control": "no-cache",
16
17
  Connection: "keep-alive"
17
18
  });
18
- return t(e, a), new j(i, {
19
+ return t(e, a), new h(i, {
19
20
  status: 200,
20
21
  headers: a
21
22
  });
22
23
  }
23
- async function N(e, t) {
24
- let n = h(e.headers.get("origin"), t.allowedOrigins ? { allowedOrigins: t.allowedOrigins } : {});
25
- if (!n.valid) return { response: j.json(S(null, -32600, n.reason), { status: 403 }) };
26
- let r = e.headers.get("accept");
27
- if (!k(r)) return { response: j.json(S(null, -32600, "Accept header must include both application/json and text/event-stream"), { status: 400 }) };
28
- let i = x(Object.fromEntries(e.headers.entries()));
29
- if (!i.ok) return { response: j.json({
30
- error: "Unsupported MCP protocol version",
31
- supported: i.supported
32
- }, { status: 426 }) };
33
- let a;
34
- try {
35
- a = await e.json();
36
- } catch {
37
- a = null;
38
- }
39
- let o = b(a);
40
- return o ? {
41
- rpcRequest: o,
42
- acceptHeader: r
43
- } : { response: j.json(S(null, -32600, "Invalid JSON-RPC 2.0 request"), { status: 400 }) };
44
- }
45
- function P(e, t, n, r = {}) {
46
- let i = new TextEncoder(), a = g(), o = new ReadableStream({ start(e) {
47
- e.enqueue(i.encode(`id: ${a}\n\n`)), e.enqueue(i.encode(v(t, a))), e.close();
48
- } }), s = new Headers({
49
- "Content-Type": "text/event-stream",
50
- "Cache-Control": "no-cache",
51
- Connection: "keep-alive",
52
- ...r
53
- });
54
- return n(e, s), new j(o, {
55
- status: 200,
56
- headers: s
57
- });
58
- }
59
- function F(e, t, n) {
60
- let r = e && t && typeof t == "object" && "sessionId" in t ? t.sessionId : void 0;
61
- return r ? { [n]: r } : {};
62
- }
63
- function I(e, t) {
64
- let n = e?.code ?? -32603, r = e?.data, i = e.message || "MCP request failed";
65
- return S(t ?? null, n, i, r);
66
- }
67
24
  //#endregion
68
25
  //#region src/adapters/nextjs/index.ts
69
- function L(e) {
70
- let { cubes: t, drizzle: n, schema: r, engineType: i, cache: a, rlsSetup: o } = e;
26
+ function _(e) {
27
+ if (e.semanticLayer) return e.semanticLayer;
28
+ let { cubes: t, drizzle: n, schema: r, engineType: i, cache: o, rlsSetup: s } = e;
71
29
  if (!t || t.length === 0) throw Error("At least one cube must be provided in the cubes array");
72
- let s = new u({
30
+ let c = new a({
73
31
  drizzle: n,
74
32
  schema: r,
75
33
  engineType: i,
76
- cache: a,
77
- rlsSetup: o
34
+ cache: o,
35
+ rlsSetup: s
78
36
  });
79
37
  return t.forEach((e) => {
80
- s.registerCube(e);
81
- }), s;
38
+ c.registerCube(e);
39
+ }), c;
82
40
  }
83
- function R(e) {
41
+ function v(e) {
84
42
  return {
85
- extractSecurityContext: async (t, n) => f(await e.extractSecurityContext(t, n), d((e) => t.headers.get(e))),
43
+ extractSecurityContext: async (t, n) => f(await e.extractSecurityContext(t, n), u((e) => t.headers.get(e))),
86
44
  cors: e.cors ? {
87
45
  ...e.cors,
88
- allowedHeaders: p(e.cors.allowedHeaders)
46
+ allowedHeaders: d(e.cors.allowedHeaders)
89
47
  } : void 0
90
48
  };
91
49
  }
92
- function z(e, t) {
50
+ function y(e, t) {
93
51
  let n = e.headers.get("origin"), r = {};
94
52
  return t.origin && (typeof t.origin == "string" ? r["Access-Control-Allow-Origin"] = t.origin : Array.isArray(t.origin) ? n && t.origin.includes(n) && (r["Access-Control-Allow-Origin"] = n) : typeof t.origin == "function" && n && t.origin(n) && (r["Access-Control-Allow-Origin"] = n)), t.methods && (r["Access-Control-Allow-Methods"] = t.methods.join(", ")), t.allowedHeaders && (r["Access-Control-Allow-Headers"] = t.allowedHeaders.join(", ")), t.credentials && (r["Access-Control-Allow-Credentials"] = "true"), r;
95
53
  }
96
- function B(e) {
54
+ function b(e) {
55
+ let t = m({
56
+ semanticLayer: _(e),
57
+ onError: (e) => {
58
+ process.env.NODE_ENV !== "test" && console.error("Next.js handler error:", e);
59
+ },
60
+ mcp: e.mcp
61
+ }), n = e.cors ? {
62
+ ...e.cors,
63
+ allowedHeaders: d(e.cors.allowedHeaders)
64
+ } : void 0;
65
+ return {
66
+ httpHandler: t,
67
+ corsHeaders: (e) => n ? y(e, n) : {},
68
+ baseContext: (t, n) => () => e.extractSecurityContext(t, n)
69
+ };
70
+ }
71
+ function x(e, t) {
72
+ let n = {};
73
+ return {
74
+ getHeader: (t) => e.headers.get(t) ?? void 0,
75
+ getBody: async () => {
76
+ try {
77
+ return await e.json();
78
+ } catch {
79
+ return null;
80
+ }
81
+ },
82
+ getQueryParam: (t) => e.nextUrl.searchParams.get(t) ?? void 0,
83
+ send: (e, r) => h.json(r, {
84
+ status: e,
85
+ headers: {
86
+ ...t,
87
+ ...n
88
+ }
89
+ }),
90
+ setHeader: (e, t) => {
91
+ n[e] = t;
92
+ },
93
+ sendEmpty: (e) => new h(null, {
94
+ status: e,
95
+ headers: {
96
+ ...t,
97
+ ...n
98
+ }
99
+ }),
100
+ sendSse: (e, r) => new h(r, {
101
+ status: e,
102
+ headers: {
103
+ "Content-Type": "text/event-stream",
104
+ "Cache-Control": "no-cache",
105
+ Connection: "keep-alive",
106
+ ...t,
107
+ ...n
108
+ }
109
+ })
110
+ };
111
+ }
112
+ function S(e) {
97
113
  return async function(t) {
98
- let n = z(t, {
114
+ let n = y(t, {
99
115
  ...e,
100
- allowedHeaders: p(e.allowedHeaders)
116
+ allowedHeaders: d(e.allowedHeaders)
101
117
  });
102
118
  return new Response(null, {
103
119
  status: 200,
@@ -105,306 +121,187 @@ function B(e) {
105
121
  });
106
122
  };
107
123
  }
108
- function V(e) {
109
- let { extractSecurityContext: t, cors: n } = R(e), i = L(e);
124
+ function C(e) {
125
+ let { httpHandler: t, corsHeaders: r, baseContext: i } = b(e);
110
126
  return async function(e, a) {
111
- try {
112
- let o;
113
- if (e.method === "POST") {
114
- let t = await e.json();
115
- o = t.query || t;
116
- } else if (e.method === "GET") {
117
- let t = e.nextUrl.searchParams.get("query");
118
- if (!t) return j.json(r("Query parameter is required", 400), { status: 400 });
119
- try {
120
- o = JSON.parse(t);
121
- } catch {
122
- return j.json(r("Invalid JSON in query parameter", 400), { status: 400 });
123
- }
124
- } else return j.json(r("Method not allowed", 405), { status: 405 });
125
- let s = await t(e, a), l = i.validateQuery(o);
126
- if (!l.isValid) return j.json(r(`Query validation failed: ${l.errors.join(", ")}`, 400), { status: 400 });
127
- let u = e.headers.get("x-cache-control") === "no-cache", d = await i.executeMultiCubeQuery(o, s, { skipCache: u }), f = c(o, d, i);
128
- return j.json(f, { headers: n ? z(e, n) : {} });
129
- } catch (e) {
130
- return process.env.NODE_ENV !== "test" && console.error("Next.js load handler error:", e), j.json(r(e instanceof Error ? e.message : "Query execution failed", 500), { status: 500 });
131
- }
127
+ let o = x(e, r(e));
128
+ return e.method === "POST" ? t.handleLoadPost(o, i(e, a)) : e.method === "GET" ? t.handleLoadGet(o, i(e, a)) : h.json(n("Method not allowed", 405), { status: 405 });
132
129
  };
133
130
  }
134
- function H(t) {
135
- let { cors: n } = R(t), i = L(t);
136
- return async function(t, a) {
137
- try {
138
- let r = e(i.getMetadata());
139
- return j.json(r, { headers: n ? z(t, n) : {} });
140
- } catch (e) {
141
- return process.env.NODE_ENV !== "test" && console.error("Next.js meta handler error:", e), j.json(r(e instanceof Error ? e.message : "Failed to fetch metadata", 500), { status: 500 });
142
- }
131
+ function w(e) {
132
+ let { httpHandler: t, corsHeaders: n } = b(e);
133
+ return async function(e, r) {
134
+ return t.handleMetaGet(x(e, n(e)));
143
135
  };
144
136
  }
145
- function U(e) {
146
- let { extractSecurityContext: t, cors: n } = R(e), i = L(e);
137
+ function T(e) {
138
+ let { httpHandler: t, corsHeaders: r, baseContext: i } = b(e);
147
139
  return async function(e, a) {
148
- try {
149
- let s;
150
- if (e.method === "POST") {
151
- let t = await e.json();
152
- s = t.query || t;
153
- } else if (e.method === "GET") {
154
- let t = e.nextUrl.searchParams.get("query");
155
- if (!t) return j.json(r("Query parameter is required", 400), { status: 400 });
156
- try {
157
- s = JSON.parse(t);
158
- } catch {
159
- return j.json(r("Invalid JSON in query parameter", 400), { status: 400 });
160
- }
161
- } else return j.json(r("Method not allowed", 405), { status: 405 });
162
- let c = await t(e, a), l = i.validateQuery(s);
163
- if (!l.isValid) return j.json(r(`Query validation failed: ${l.errors.join(", ")}`, 400), { status: 400 });
164
- let u = s.measures?.[0] || s.dimensions?.[0];
165
- if (!u) return j.json(r("No measures or dimensions specified", 400), { status: 400 });
166
- let d = u.split(".")[0], f = await i.generateSQL(d, s, c), p = o(s, f);
167
- return j.json(p, { headers: n ? z(e, n) : {} });
168
- } catch (e) {
169
- return process.env.NODE_ENV !== "test" && console.error("Next.js SQL handler error:", e), j.json(r(e instanceof Error ? e.message : "SQL generation failed", 500), { status: 500 });
170
- }
140
+ let o = x(e, r(e));
141
+ return e.method === "POST" ? t.handleSqlPost(o, i(e, a)) : e.method === "GET" ? t.handleSqlGet(o, i(e, a)) : h.json(n("Method not allowed", 405), { status: 405 });
171
142
  };
172
143
  }
173
- function W(e) {
174
- let { extractSecurityContext: t, cors: n } = R(e), r = L(e);
144
+ function E(e) {
145
+ let { httpHandler: t, corsHeaders: n, baseContext: r } = b(e);
175
146
  return async function(e, i) {
176
- try {
177
- let a;
178
- if (e.method === "POST") {
179
- let t = await e.json();
180
- a = t.query || t;
181
- } else if (e.method === "GET") {
182
- let t = e.nextUrl.searchParams.get("query");
183
- if (!t) return j.json({
184
- error: "Query parameter is required",
185
- valid: !1
186
- }, { status: 400 });
187
- try {
188
- a = JSON.parse(t);
189
- } catch {
190
- return j.json({
191
- error: "Invalid JSON in query parameter",
192
- valid: !1
193
- }, { status: 400 });
194
- }
195
- } else return j.json({
196
- error: "Method not allowed",
197
- valid: !1
198
- }, { status: 405 });
199
- let o = await t(e, i), s = await l(a, o, r);
200
- return j.json(s, { headers: n ? z(e, n) : {} });
201
- } catch (e) {
202
- return process.env.NODE_ENV !== "test" && console.error("Next.js dry-run handler error:", e), j.json({
203
- error: e instanceof Error ? e.message : "Dry-run validation failed",
204
- valid: !1
205
- }, { status: 400 });
206
- }
147
+ let a = x(e, n(e));
148
+ return e.method === "POST" ? t.handleDryRunPost(a, r(e, i)) : e.method === "GET" ? t.handleDryRunGet(a, r(e, i)) : h.json({
149
+ error: "Method not allowed",
150
+ valid: !1
151
+ }, { status: 405 });
207
152
  };
208
153
  }
209
- function G(e) {
210
- let { extractSecurityContext: t, cors: n } = R(e), a = L(e);
211
- return async function(e, o) {
212
- try {
213
- if (e.method !== "POST") return j.json(r("Method not allowed - use POST", 405), { status: 405 });
214
- let { queries: s } = await e.json();
215
- if (!s || !Array.isArray(s)) return j.json(r("Request body must contain a \"queries\" array", 400), { status: 400 });
216
- if (s.length === 0) return j.json(r("Queries array cannot be empty", 400), { status: 400 });
217
- let c = await i(s, await t(e, o), a, { skipCache: e.headers.get("x-cache-control") === "no-cache" });
218
- return j.json(c, { headers: n ? z(e, n) : {} });
219
- } catch (e) {
220
- return process.env.NODE_ENV !== "test" && console.error("Next.js batch handler error:", e), j.json(r(e instanceof Error ? e.message : "Batch execution failed", 500), { status: 500 });
221
- }
154
+ function D(e) {
155
+ let { httpHandler: t, corsHeaders: r, baseContext: i } = b(e);
156
+ return async function(e, a) {
157
+ return e.method === "POST" ? t.handleBatchPost(x(e, r(e)), i(e, a)) : h.json(n("Method not allowed - use POST", 405), { status: 405 });
222
158
  };
223
159
  }
224
- function K(e) {
225
- let { extractSecurityContext: t, cors: n } = R(e), r = L(e);
160
+ function O(e) {
161
+ let { httpHandler: t, corsHeaders: n, baseContext: r } = b(e);
226
162
  return async function(e, i) {
227
- try {
228
- if (e.method !== "POST") return j.json({ error: "Method not allowed" }, { status: 405 });
229
- let a = await e.json(), o = a.query || a, s = a.options || {}, c = await t(e, i), l = r.validateQuery(o);
230
- if (!l.isValid) return j.json({ error: `Query validation failed: ${l.errors.join(", ")}` }, { status: 400 });
231
- let u = await r.explainQuery(o, c, s);
232
- return j.json(u, { headers: n ? z(e, n) : {} });
233
- } catch (e) {
234
- return process.env.NODE_ENV !== "test" && console.error("Next.js explain handler error:", e), j.json({ error: e instanceof Error ? e.message : "Explain query failed" }, { status: 500 });
235
- }
163
+ return e.method === "POST" ? t.handleExplainPost(x(e, n(e)), r(e, i)) : h.json({ error: "Method not allowed" }, { status: 405 });
236
164
  };
237
165
  }
238
- function q(e) {
239
- let { cors: t } = R(e), n = L(e);
240
- return async function(e, i) {
166
+ function k(e) {
167
+ let { cors: t } = v(e), r = _(e);
168
+ return async function(e, a) {
241
169
  try {
242
- if (e.method !== "POST") return j.json(r("Method not allowed - use POST", 405), { status: 405 });
243
- let i = await s(n, await e.json());
244
- return j.json(i, { headers: t ? z(e, t) : {} });
170
+ if (e.method !== "POST") return h.json(n("Method not allowed - use POST", 405), { status: 405 });
171
+ let a = await i(r, await e.json());
172
+ return h.json(a, { headers: t ? y(e, t) : {} });
245
173
  } catch (e) {
246
- return process.env.NODE_ENV !== "test" && console.error("Next.js discover handler error:", e), j.json(r(e instanceof Error ? e.message : "Discovery failed", 500), { status: 500 });
174
+ return process.env.NODE_ENV !== "test" && console.error("Next.js discover handler error:", e), h.json(n(e instanceof Error ? e.message : "Discovery failed", 500), { status: 500 });
247
175
  }
248
176
  };
249
177
  }
250
- function J(e) {
251
- let { cors: n } = R(e), i = L(e);
252
- return async function(e, a) {
178
+ function A(t) {
179
+ let { cors: r } = v(t), i = _(t);
180
+ return async function(t, a) {
253
181
  try {
254
- if (e.method !== "POST") return j.json(r("Method not allowed - use POST", 405), { status: 405 });
255
- let a = await e.json();
256
- if (!a.naturalLanguage) return j.json(r("naturalLanguage field is required", 400), { status: 400 });
257
- let o = await t(i, a);
258
- return j.json(o, { headers: n ? z(e, n) : {} });
182
+ if (t.method !== "POST") return h.json(n("Method not allowed - use POST", 405), { status: 405 });
183
+ let a = await t.json();
184
+ if (!a.naturalLanguage) return h.json(n("naturalLanguage field is required", 400), { status: 400 });
185
+ let o = await e(i, a);
186
+ return h.json(o, { headers: r ? y(t, r) : {} });
259
187
  } catch (e) {
260
- return process.env.NODE_ENV !== "test" && console.error("Next.js suggest handler error:", e), j.json(r(e instanceof Error ? e.message : "Query suggestion failed", 500), { status: 500 });
188
+ return process.env.NODE_ENV !== "test" && console.error("Next.js suggest handler error:", e), h.json(n(e instanceof Error ? e.message : "Query suggestion failed", 500), { status: 500 });
261
189
  }
262
190
  };
263
191
  }
264
- function Y(e) {
265
- let { cors: t } = R(e), i = L(e);
192
+ function j(e) {
193
+ let { cors: r } = v(e), i = _(e);
266
194
  return async function(e, a) {
267
195
  try {
268
- if (e.method !== "POST") return j.json(r("Method not allowed - use POST", 405), { status: 405 });
196
+ if (e.method !== "POST") return h.json(n("Method not allowed - use POST", 405), { status: 405 });
269
197
  let a = await e.json();
270
- if (!a.query) return j.json(r("query field is required", 400), { status: 400 });
271
- let o = await n(i, a);
272
- return j.json(o, { headers: t ? z(e, t) : {} });
198
+ if (!a.query) return h.json(n("query field is required", 400), { status: 400 });
199
+ let o = await t(i, a);
200
+ return h.json(o, { headers: r ? y(e, r) : {} });
273
201
  } catch (e) {
274
- return process.env.NODE_ENV !== "test" && console.error("Next.js validate handler error:", e), j.json(r(e instanceof Error ? e.message : "Query validation failed", 500), { status: 500 });
202
+ return process.env.NODE_ENV !== "test" && console.error("Next.js validate handler error:", e), h.json(n(e instanceof Error ? e.message : "Query validation failed", 500), { status: 500 });
275
203
  }
276
204
  };
277
205
  }
278
- function X(e) {
279
- let { extractSecurityContext: t, cors: n } = R(e), i = L(e);
206
+ function M(e) {
207
+ let { extractSecurityContext: t, cors: i } = v(e), a = _(e);
280
208
  return async function(e, o) {
281
209
  try {
282
- if (e.method !== "POST") return j.json(r("Method not allowed - use POST", 405), { status: 405 });
210
+ if (e.method !== "POST") return h.json(n("Method not allowed - use POST", 405), { status: 405 });
283
211
  let s = await e.json();
284
- if (!s.query) return j.json(r("query field is required", 400), { status: 400 });
285
- let c = await a(i, await t(e, o), s);
286
- return j.json(c, { headers: n ? z(e, n) : {} });
212
+ if (!s.query) return h.json(n("query field is required", 400), { status: 400 });
213
+ let c = await r(a, await t(e, o), s);
214
+ return h.json(c, { headers: i ? y(e, i) : {} });
287
215
  } catch (e) {
288
- return process.env.NODE_ENV !== "test" && console.error("Next.js MCP load handler error:", e), j.json(r(e instanceof Error ? e.message : "Query execution failed", 500), { status: 500 });
216
+ return process.env.NODE_ENV !== "test" && console.error("Next.js MCP load handler error:", e), h.json(n(e instanceof Error ? e.message : "Query execution failed", 500), { status: 500 });
289
217
  }
290
218
  };
291
219
  }
292
- function Z(e) {
293
- let { extractSecurityContext: t, cors: n } = R(e), { mcp: i = { enabled: !0 } } = e, a = L(e), o = T(a, i.resources), s = A(i.prompts), c = O(i.instructions), l = (e, t) => {
294
- if (!n) return;
295
- let r = z(e, n);
296
- Object.entries(r).forEach(([e, n]) => t.set(e, n));
297
- }, u = async (e) => {
298
- let r = await N(e, i);
299
- if (r.response) return r.response;
300
- let u = r.rpcRequest, d = m(r.acceptHeader), f = u.method === "initialize", p = (t, r = 200, i = {}) => j.json(t, {
301
- status: r,
302
- headers: {
303
- ...n ? z(e, n) : {},
304
- ...i
305
- }
306
- });
307
- try {
308
- let n = await C(u.method, u.params, {
309
- semanticLayer: a,
310
- extractSecurityContext: (e) => t(e),
311
- rawRequest: e,
312
- rawResponse: null,
313
- resources: o,
314
- prompts: s,
315
- instructions: c,
316
- appEnabled: !!i.app,
317
- appConfig: typeof i.app == "object" ? i.app : void 0,
318
- serverName: i.serverName
319
- });
320
- if (w(u)) return new j(null, { status: 202 });
321
- let r = F(f, n, E), m = _(u.id ?? null, n);
322
- return d ? P(e, m, l, r) : p(m, 200, r);
323
- } catch (t) {
324
- if (w(u)) return process.env.NODE_ENV !== "test" && console.error("Next.js MCP notification processing error:", t), new j(null, { status: 202 });
325
- process.env.NODE_ENV !== "test" && console.error("Next.js MCP RPC handler error:", t);
326
- let n = I(t, u.id);
327
- return d ? P(e, n, l) : p(n, 200);
328
- }
220
+ function N(e) {
221
+ let { httpHandler: t, corsHeaders: r, baseContext: i } = b(e), { mcp: a = { enabled: !0 } } = e, o = (e, t) => {
222
+ Object.entries(r(e)).forEach(([e, n]) => t.set(e, n));
329
223
  };
330
- return async function(e) {
331
- return i.resourceMetadataUrl && !D(e.headers.get("authorization")) ? j.json({ error: "Bearer token required" }, {
224
+ return async function(e, s) {
225
+ return a.resourceMetadataUrl && !l(e.headers.get("authorization")) ? h.json({ error: "Bearer token required" }, {
332
226
  status: 401,
333
- headers: { "WWW-Authenticate": y(i.resourceMetadataUrl) }
334
- }) : e.method === "DELETE" ? j.json({ error: "Session termination not supported" }, { status: 405 }) : e.method === "GET" ? M(e, l) : e.method === "POST" ? u(e) : j.json(r("Method not allowed - use POST", 405), { status: 405 });
227
+ headers: { "WWW-Authenticate": c(a.resourceMetadataUrl) }
228
+ }) : e.method === "DELETE" ? h.json({ error: "Session termination not supported" }, { status: 405 }) : e.method === "GET" ? g(e, o) : e.method === "POST" ? t.handleMcpPost(x(e, r(e)), i(e, s)) : h.json(n("Method not allowed - use POST", 405), { status: 405 });
335
229
  };
336
230
  }
337
- function Q(e) {
338
- let { extractSecurityContext: t, cors: n } = R(e), { agent: r } = e;
339
- if (!r) throw Error("agent config is required for createAgentChatHandler");
340
- let i = L(e);
341
- return async function(e, a) {
231
+ function P(e) {
232
+ let { cors: t } = v(e), { agent: n } = e;
233
+ if (!n) throw Error("agent config is required for createAgentChatHandler");
234
+ let r = _(e);
235
+ return async function(i, a) {
342
236
  try {
343
- if (e.method !== "POST") return j.json({ error: "Method not allowed - use POST" }, { status: 405 });
344
- let { handleAgentChat: o } = await import("../handler-CtaSua-i.js"), { message: s, sessionId: c, history: l } = await e.json();
345
- if (!s || typeof s != "string") return j.json({ error: "message is required and must be a string" }, { status: 400 });
346
- let u = (r.apiKey || "").trim();
347
- if (r.allowClientApiKey) {
348
- let t = e.headers.get("x-agent-api-key");
349
- t && (u = t.trim());
237
+ if (i.method !== "POST") return h.json({ error: "Method not allowed - use POST" }, { status: 405 });
238
+ let { handleAgentChat: o } = await import("../handler-u8FyzPBT.js"), { message: s, sessionId: c, history: l } = await i.json();
239
+ if (!s || typeof s != "string") return h.json({ error: "message is required and must be a string" }, { status: 400 });
240
+ let u = (n.apiKey || "").trim();
241
+ if (n.allowClientApiKey) {
242
+ let e = i.headers.get("x-agent-api-key");
243
+ e && (u = e.trim());
350
244
  }
351
- if (!u) return j.json({ error: "No API key configured. Set agent.apiKey in server config or send X-Agent-Api-Key header." }, { status: 401 });
352
- let d = r.allowClientApiKey && e.headers.get("x-agent-provider") || void 0, f = r.allowClientApiKey && e.headers.get("x-agent-model") || void 0, p = r.allowClientApiKey && e.headers.get("x-agent-provider-endpoint") || void 0, m = await t(e, a), h = r.buildSystemContext?.(m), g = new TextEncoder(), _ = new ReadableStream({ async start(e) {
245
+ if (!u) return h.json({ error: "No API key configured. Set agent.apiKey in server config or send X-Agent-Api-Key header." }, { status: 401 });
246
+ let d = n.allowClientApiKey && i.headers.get("x-agent-provider") || void 0, f = n.allowClientApiKey && i.headers.get("x-agent-model") || void 0, m = n.allowClientApiKey && i.headers.get("x-agent-provider-endpoint") || void 0, g = p(await e.extractSecurityContext(i, a), (e) => i.headers.get(e) ?? void 0), _ = n.buildSystemContext?.(g), v = new TextEncoder(), b = new ReadableStream({ async start(e) {
353
247
  try {
354
248
  let t = o({
355
249
  message: s,
356
250
  sessionId: c,
357
251
  history: l,
358
- semanticLayer: i,
359
- securityContext: m,
360
- agentConfig: r,
252
+ semanticLayer: r,
253
+ securityContext: g,
254
+ agentConfig: n,
361
255
  apiKey: u,
362
- systemContext: h,
256
+ systemContext: _,
363
257
  providerOverride: d,
364
258
  modelOverride: f,
365
- baseURLOverride: p
259
+ baseURLOverride: m
366
260
  });
367
261
  for await (let n of t) {
368
262
  let t = `data: ${JSON.stringify(n)}\n\n`;
369
- e.enqueue(g.encode(t));
263
+ e.enqueue(v.encode(t));
370
264
  }
371
265
  } catch (t) {
372
266
  let n = {
373
267
  type: "error",
374
268
  data: { message: t instanceof Error ? t.message : "Stream failed" }
375
269
  };
376
- e.enqueue(g.encode(`data: ${JSON.stringify(n)}\n\n`));
270
+ e.enqueue(v.encode(`data: ${JSON.stringify(n)}\n\n`));
377
271
  } finally {
378
272
  e.close();
379
273
  }
380
- } }), v = new Headers({
274
+ } }), x = new Headers({
381
275
  "Content-Type": "text/event-stream",
382
276
  "Cache-Control": "no-cache",
383
277
  Connection: "keep-alive"
384
278
  });
385
- if (n) {
386
- let t = z(e, n);
387
- Object.entries(t).forEach(([e, t]) => v.set(e, t));
279
+ if (t) {
280
+ let e = y(i, t);
281
+ Object.entries(e).forEach(([e, t]) => x.set(e, t));
388
282
  }
389
- return new Response(_, {
283
+ return new Response(b, {
390
284
  status: 200,
391
- headers: v
285
+ headers: x
392
286
  });
393
287
  } catch (e) {
394
- return process.env.NODE_ENV !== "test" && console.error("Next.js agent chat handler error:", e), j.json({ error: e instanceof Error ? e.message : "Agent chat failed" }, { status: 500 });
288
+ return process.env.NODE_ENV !== "test" && console.error("Next.js agent chat handler error:", e), h.json({ error: e instanceof Error ? e.message : "Agent chat failed" }, { status: 500 });
395
289
  }
396
290
  };
397
291
  }
398
- function $(e) {
399
- let { mcp: t = { enabled: !0 } } = e, n = {
400
- load: V(e),
401
- meta: H(e),
402
- sql: U(e),
403
- dryRun: W(e),
404
- batch: G(e),
405
- explain: K(e)
292
+ function F(e) {
293
+ let { mcp: t = { enabled: !0 } } = e, n = _(e), r = {
294
+ ...e,
295
+ semanticLayer: n
296
+ }, i = {
297
+ load: C(r),
298
+ meta: w(r),
299
+ sql: T(r),
300
+ dryRun: E(r),
301
+ batch: D(r),
302
+ explain: O(r)
406
303
  };
407
- return t.enabled !== !1 && (n.mcpRpc = Z(e)), e.agent && (n.agentChat = Q(e)), n;
304
+ return t.enabled !== !1 && (i.mcpRpc = N(r)), e.agent && (i.agentChat = P(r)), i;
408
305
  }
409
306
  //#endregion
410
- export { Q as createAgentChatHandler, G as createBatchHandler, $ as createCubeHandlers, q as createDiscoverHandler, W as createDryRunHandler, K as createExplainHandler, V as createLoadHandler, X as createMcpLoadHandler, Z as createMcpRpcHandler, H as createMetaHandler, B as createOptionsHandler, U as createSqlHandler, J as createSuggestHandler, Y as createValidateHandler };
307
+ export { P as createAgentChatHandler, D as createBatchHandler, F as createCubeHandlers, k as createDiscoverHandler, E as createDryRunHandler, O as createExplainHandler, C as createLoadHandler, M as createMcpLoadHandler, N as createMcpRpcHandler, w as createMetaHandler, S as createOptionsHandler, T as createSqlHandler, A as createSuggestHandler, j as createValidateHandler };
@@ -1,36 +1,8 @@
1
1
  import { NextRequest, NextResponse } from 'next/server';
2
- import { JsonRpcRequest } from '../mcp-transport.js';
3
- /** MCP endpoint config fields the Next.js handler helpers depend on. */
4
- export interface NextMcpHandlerConfig {
5
- allowedOrigins?: string[];
6
- }
7
2
  /** Applies adapter CORS headers to an outgoing header set (no-op when CORS is disabled). */
8
3
  export type ApplyCors = (request: NextRequest, headers: Headers) => void;
9
- /** Builds the adapter CORS header record for JSON responses (empty when disabled). */
10
- export type CorsHeaders = (request: NextRequest) => Record<string, string>;
11
4
  /**
12
5
  * Build the SSE `Response` for a GET (streaming connection open) request,
13
6
  * emitting the initial `mcp/ready` event.
14
7
  */
15
8
  export declare function buildMcpGetResponse(request: NextRequest, applyCors: ApplyCors): NextResponse;
16
- /**
17
- * Result of the POST pre-dispatch validation gauntlet. When `response` is set
18
- * the caller must return it immediately; otherwise `rpcRequest` and
19
- * `acceptHeader` are populated for dispatch.
20
- */
21
- export interface NextMcpRequestPrep {
22
- response?: NextResponse;
23
- rpcRequest?: JsonRpcRequest;
24
- acceptHeader?: string | null;
25
- }
26
- /**
27
- * Run the POST validation sequence (origin, Accept, protocol, body). Returns a
28
- * short-circuit `response` on the first failure, or the parsed request on success.
29
- */
30
- export declare function prepareMcpPostRequest(request: NextRequest, mcp: NextMcpHandlerConfig): Promise<NextMcpRequestPrep>;
31
- /** Build a single-event SSE `NextResponse` carrying one JSON-RPC payload, with CORS + extra headers. */
32
- export declare function buildMcpSseResponse(request: NextRequest, payload: unknown, applyCors: ApplyCors, extraHeaders?: Record<string, string>): NextResponse;
33
- /** Extract the MCP-Session-Id header value from an `initialize` result, if present. */
34
- export declare function extractMcpSessionHeaders(isInitialize: boolean, result: unknown, headerName: string): Record<string, string>;
35
- /** Build a JSON-RPC error response from a thrown error (preserving code/data). */
36
- export declare function buildMcpErrorPayload(error: unknown, id: JsonRpcRequest['id']): import('../mcp-transport.js').JsonRpcResponse;