drizzle-cube 0.6.2 → 0.6.3

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 (302) 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/{locale-ZLUUNUxr.cjs → compiler-ChGO4ZLU.cjs} +1 -1
  56. package/dist/adapters/{locale-DDvZDFVn.js → compiler-LKTN9PTt.js} +2 -21
  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 +8 -9
  81. package/dist/adapters/nextjs/index.js +181 -288
  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 +8 -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/charts/ActivityGridChart.config.d.ts +6 -1
  101. package/dist/cjs/client/components/charts/AreaChart.config.d.ts +6 -1
  102. package/dist/cjs/client/components/charts/BarChart.config.d.ts +6 -1
  103. package/dist/cjs/client/components/charts/BoxPlotChart.config.d.ts +6 -1
  104. package/dist/cjs/client/components/charts/BubbleChart.config.d.ts +6 -1
  105. package/dist/cjs/client/components/charts/CandlestickChart.config.d.ts +6 -1
  106. package/dist/cjs/client/components/charts/DataTable.config.d.ts +6 -1
  107. package/dist/cjs/client/components/charts/FunnelChart.config.d.ts +5 -0
  108. package/dist/cjs/client/components/charts/GaugeChart.config.d.ts +6 -1
  109. package/dist/cjs/client/components/charts/HeatMapChart.config.d.ts +6 -1
  110. package/dist/cjs/client/components/charts/KpiDelta.config.d.ts +6 -1
  111. package/dist/cjs/client/components/charts/KpiNumber.config.d.ts +6 -1
  112. package/dist/cjs/client/components/charts/KpiText.config.d.ts +6 -1
  113. package/dist/cjs/client/components/charts/LineChart.config.d.ts +6 -1
  114. package/dist/cjs/client/components/charts/MarkdownChart.config.d.ts +6 -1
  115. package/dist/cjs/client/components/charts/MeasureProfileChart.config.d.ts +6 -1
  116. package/dist/cjs/client/components/charts/PieChart.config.d.ts +6 -1
  117. package/dist/cjs/client/components/charts/RadarChart.config.d.ts +6 -1
  118. package/dist/cjs/client/components/charts/RadialBarChart.config.d.ts +6 -1
  119. package/dist/cjs/client/components/charts/SankeyChart.config.d.ts +5 -0
  120. package/dist/cjs/client/components/charts/ScatterChart.config.d.ts +6 -1
  121. package/dist/cjs/client/components/charts/SunburstChart.config.d.ts +5 -0
  122. package/dist/cjs/client/components/charts/TreeMapChart.config.d.ts +6 -1
  123. package/dist/cjs/client/components/charts/WaterfallChart.config.d.ts +6 -1
  124. package/dist/cjs/client/hooks/analysisQueryExecutionModes.d.ts +1 -1
  125. package/dist/cjs/client/hooks/useAnalysisEffects.d.ts +33 -0
  126. package/dist/{client/hooks/useAnalysisQueryExecution.d.ts → cjs/client/hooks/useAnalysisQuery.d.ts} +3 -3
  127. package/dist/cjs/client/hooks/useAnalysisState.d.ts +165 -0
  128. package/dist/cjs/client/icons/registry.d.ts +0 -6
  129. package/dist/cjs/client/icons/types.d.ts +5 -0
  130. package/dist/client/charts/chartComponentRegistry.d.ts +1 -9
  131. package/dist/client/charts/chartConfigRegistry.d.ts +5 -1
  132. package/dist/client/charts/chartPlugin.d.ts +1 -2
  133. package/dist/client/charts/chartRegistry.d.ts +73 -0
  134. package/dist/client/charts.js +3 -3
  135. package/dist/client/chunks/{DashboardEditModal-okVfH8ZK.js → DashboardEditModal-CWurUU2B.js} +7 -7
  136. package/dist/client/chunks/{DashboardEditModal-okVfH8ZK.js.map → DashboardEditModal-CWurUU2B.js.map} +1 -1
  137. package/dist/client/chunks/{analysis-builder-DB88FojM.js → analysis-builder-Uj_Fxv0-.js} +1588 -1857
  138. package/dist/client/chunks/analysis-builder-Uj_Fxv0-.js.map +1 -0
  139. package/dist/client/chunks/{analysis-builder-shared-BVK4TYfR.js → analysis-builder-shared-AdAYIfj_.js} +1531 -1266
  140. package/dist/client/chunks/analysis-builder-shared-AdAYIfj_.js.map +1 -0
  141. package/dist/client/chunks/{chart-config-activity-grid-D_UX4NHC.js → chart-config-activity-grid-BU_bkvER.js} +1 -11
  142. package/dist/client/chunks/chart-config-activity-grid-BU_bkvER.js.map +1 -0
  143. package/dist/client/chunks/{chart-config-area-BNigHUy8.js → chart-config-area-DxwIZ4Uf.js} +1 -5
  144. package/dist/client/chunks/{chart-config-area-BNigHUy8.js.map → chart-config-area-DxwIZ4Uf.js.map} +1 -1
  145. package/dist/client/chunks/{chart-config-bar-DSO_LRTx.js → chart-config-bar-Cc8GY9aQ.js} +5 -9
  146. package/dist/client/chunks/chart-config-bar-Cc8GY9aQ.js.map +1 -0
  147. package/dist/client/chunks/{chart-config-box-plot-oW8axV2q.js → chart-config-box-plot-Bs8ovYvV.js} +3 -8
  148. package/dist/client/chunks/chart-config-box-plot-Bs8ovYvV.js.map +1 -0
  149. package/dist/client/chunks/{chart-config-bubble-gIoqVyjZ.js → chart-config-bubble-BfgY7pt8.js} +1 -11
  150. package/dist/client/chunks/chart-config-bubble-BfgY7pt8.js.map +1 -0
  151. package/dist/client/chunks/{chart-config-candlestick-N6DchAA3.js → chart-config-candlestick-jaeNNEtC.js} +1 -11
  152. package/dist/client/chunks/chart-config-candlestick-jaeNNEtC.js.map +1 -0
  153. package/dist/client/chunks/{chart-config-data-table-d7VBY-y_.js → chart-config-data-table-CRk0C0rW.js} +1 -4
  154. package/dist/client/chunks/chart-config-data-table-CRk0C0rW.js.map +1 -0
  155. package/dist/client/chunks/{chart-config-funnel-DEYMcxsD.js → chart-config-funnel-boT_LNfl.js} +1 -4
  156. package/dist/client/chunks/chart-config-funnel-boT_LNfl.js.map +1 -0
  157. package/dist/client/chunks/{chart-config-gauge-Dq-_H9UN.js → chart-config-gauge-C5uJEr97.js} +3 -8
  158. package/dist/client/chunks/chart-config-gauge-C5uJEr97.js.map +1 -0
  159. package/dist/client/chunks/{chart-config-heat-map-CfRnRNcw.js → chart-config-heat-map-CCarP44-.js} +1 -11
  160. package/dist/client/chunks/chart-config-heat-map-CCarP44-.js.map +1 -0
  161. package/dist/client/chunks/{chart-config-kpi-delta-DSQbvqu_.js → chart-config-kpi-delta-DYopvwyG.js} +3 -8
  162. package/dist/client/chunks/chart-config-kpi-delta-DYopvwyG.js.map +1 -0
  163. package/dist/client/chunks/{chart-config-kpi-number-EFSWY1We.js → chart-config-kpi-number-BhMdoArB.js} +3 -8
  164. package/dist/client/chunks/chart-config-kpi-number-BhMdoArB.js.map +1 -0
  165. package/dist/client/chunks/{chart-config-kpi-text-KM3V5X2u.js → chart-config-kpi-text-DE6Zdi53.js} +3 -8
  166. package/dist/client/chunks/chart-config-kpi-text-DE6Zdi53.js.map +1 -0
  167. package/dist/client/chunks/{chart-config-line-D6jG8PCH.js → chart-config-line-CBfM0Rds.js} +6 -10
  168. package/dist/client/chunks/chart-config-line-CBfM0Rds.js.map +1 -0
  169. package/dist/client/chunks/{chart-config-markdown-BtRIe8JN.js → chart-config-markdown-BCDyBI8K.js} +1 -4
  170. package/dist/client/chunks/chart-config-markdown-BCDyBI8K.js.map +1 -0
  171. package/dist/client/chunks/{chart-config-measure-profile-DxRGa-zf.js → chart-config-measure-profile-BgQIH1u2.js} +1 -8
  172. package/dist/client/chunks/chart-config-measure-profile-BgQIH1u2.js.map +1 -0
  173. package/dist/client/chunks/{chart-config-pie-BhzW-fdn.js → chart-config-pie-ChfFz6DV.js} +5 -9
  174. package/dist/client/chunks/chart-config-pie-ChfFz6DV.js.map +1 -0
  175. package/dist/client/chunks/{chart-config-radar-D7REP1q_.js → chart-config-radar-BlAIGnww.js} +5 -9
  176. package/dist/client/chunks/chart-config-radar-BlAIGnww.js.map +1 -0
  177. package/dist/client/chunks/{chart-config-radial-bar-Byx6qOPU.js → chart-config-radial-bar-VFerwbCO.js} +5 -9
  178. package/dist/client/chunks/chart-config-radial-bar-VFerwbCO.js.map +1 -0
  179. package/dist/client/chunks/{chart-config-sankey-BTnWA7EW.js → chart-config-sankey-BhrDxIgj.js} +1 -4
  180. package/dist/client/chunks/chart-config-sankey-BhrDxIgj.js.map +1 -0
  181. package/dist/client/chunks/{chart-config-scatter-DSYTjwRb.js → chart-config-scatter-q_olh54e.js} +1 -11
  182. package/dist/client/chunks/chart-config-scatter-q_olh54e.js.map +1 -0
  183. package/dist/client/chunks/{chart-config-sunburst-Bwjtdf7X.js → chart-config-sunburst-BOmkOnKn.js} +1 -4
  184. package/dist/client/chunks/chart-config-sunburst-BOmkOnKn.js.map +1 -0
  185. package/dist/client/chunks/{chart-config-tree-map-DVrvf3yQ.js → chart-config-tree-map-BjX88YBY.js} +5 -9
  186. package/dist/client/chunks/chart-config-tree-map-BjX88YBY.js.map +1 -0
  187. package/dist/client/chunks/{chart-config-waterfall-DmFeQdIk.js → chart-config-waterfall-QsWXVSoF.js} +3 -8
  188. package/dist/client/chunks/chart-config-waterfall-QsWXVSoF.js.map +1 -0
  189. package/dist/client/chunks/{chart-data-table-CKauQXme.js → chart-data-table-D4g5_jfF.js} +1277 -1094
  190. package/dist/client/chunks/chart-data-table-D4g5_jfF.js.map +1 -0
  191. package/dist/client/chunks/{chart-kpi-delta-Dn-jjO-2.js → chart-kpi-delta-BvWOt8-D.js} +2 -2
  192. package/dist/client/chunks/{chart-kpi-delta-Dn-jjO-2.js.map → chart-kpi-delta-BvWOt8-D.js.map} +1 -1
  193. package/dist/client/chunks/{chart-kpi-number-P_WBiO5S.js → chart-kpi-number-xgZmMiQY.js} +3 -3
  194. package/dist/client/chunks/{chart-kpi-number-P_WBiO5S.js.map → chart-kpi-number-xgZmMiQY.js.map} +1 -1
  195. package/dist/client/chunks/{chart-kpi-text-C-Y4eb5H.js → chart-kpi-text-ZO3eFi7t.js} +2 -2
  196. package/dist/client/chunks/{chart-kpi-text-C-Y4eb5H.js.map → chart-kpi-text-ZO3eFi7t.js.map} +1 -1
  197. package/dist/client/chunks/{charts-loader-DdTeCeNo.js → charts-loader-B0DOQMFH.js} +6 -6
  198. package/dist/client/chunks/{charts-loader-DdTeCeNo.js.map → charts-loader-B0DOQMFH.js.map} +1 -1
  199. package/dist/client/chunks/{schema-visualization-Cb_E9_Gd.js → schema-visualization-DJPTktM6.js} +2 -2
  200. package/dist/client/chunks/{schema-visualization-Cb_E9_Gd.js.map → schema-visualization-DJPTktM6.js.map} +1 -1
  201. package/dist/client/chunks/{useDirtyStateTracking-MbpxH_v6.js → useDirtyStateTracking-BY_IIG1n.js} +2 -2
  202. package/dist/client/chunks/{useDirtyStateTracking-MbpxH_v6.js.map → useDirtyStateTracking-BY_IIG1n.js.map} +1 -1
  203. package/dist/client/chunks/{useExplainAI-evnZkjCY.js → useExplainAI-PjMBmj2p.js} +4 -4
  204. package/dist/client/chunks/{useExplainAI-evnZkjCY.js.map → useExplainAI-PjMBmj2p.js.map} +1 -1
  205. package/dist/client/chunks/{utils-3P6z1vz5.js → utils-Cq-j5E5I.js} +2 -2
  206. package/dist/client/chunks/{utils-3P6z1vz5.js.map → utils-Cq-j5E5I.js.map} +1 -1
  207. package/dist/client/chunks/{vendor-DSpR0IW6.js → vendor-D4jADu8t.js} +2 -2
  208. package/dist/client/chunks/{vendor-DSpR0IW6.js.map → vendor-D4jADu8t.js.map} +1 -1
  209. package/dist/client/components/AIAssistant/index.d.ts +2 -2
  210. package/dist/client/components/charts/ActivityGridChart.config.d.ts +6 -1
  211. package/dist/client/components/charts/AreaChart.config.d.ts +6 -1
  212. package/dist/client/components/charts/BarChart.config.d.ts +6 -1
  213. package/dist/client/components/charts/BoxPlotChart.config.d.ts +6 -1
  214. package/dist/client/components/charts/BubbleChart.config.d.ts +6 -1
  215. package/dist/client/components/charts/CandlestickChart.config.d.ts +6 -1
  216. package/dist/client/components/charts/DataTable.config.d.ts +6 -1
  217. package/dist/client/components/charts/FunnelChart.config.d.ts +5 -0
  218. package/dist/client/components/charts/GaugeChart.config.d.ts +6 -1
  219. package/dist/client/components/charts/HeatMapChart.config.d.ts +6 -1
  220. package/dist/client/components/charts/KpiDelta.config.d.ts +6 -1
  221. package/dist/client/components/charts/KpiNumber.config.d.ts +6 -1
  222. package/dist/client/components/charts/KpiText.config.d.ts +6 -1
  223. package/dist/client/components/charts/LineChart.config.d.ts +6 -1
  224. package/dist/client/components/charts/MarkdownChart.config.d.ts +6 -1
  225. package/dist/client/components/charts/MeasureProfileChart.config.d.ts +6 -1
  226. package/dist/client/components/charts/PieChart.config.d.ts +6 -1
  227. package/dist/client/components/charts/RadarChart.config.d.ts +6 -1
  228. package/dist/client/components/charts/RadialBarChart.config.d.ts +6 -1
  229. package/dist/client/components/charts/SankeyChart.config.d.ts +5 -0
  230. package/dist/client/components/charts/ScatterChart.config.d.ts +6 -1
  231. package/dist/client/components/charts/SunburstChart.config.d.ts +5 -0
  232. package/dist/client/components/charts/TreeMapChart.config.d.ts +6 -1
  233. package/dist/client/components/charts/WaterfallChart.config.d.ts +6 -1
  234. package/dist/client/components.js +2 -2
  235. package/dist/client/hooks/analysisQueryExecutionModes.d.ts +1 -1
  236. package/dist/client/hooks/useAnalysisEffects.d.ts +33 -0
  237. package/dist/{cjs/client/hooks/useAnalysisQueryExecution.d.ts → client/hooks/useAnalysisQuery.d.ts} +3 -3
  238. package/dist/client/hooks/useAnalysisState.d.ts +165 -0
  239. package/dist/client/hooks.js +3 -3
  240. package/dist/client/icons/registry.d.ts +0 -6
  241. package/dist/client/icons/types.d.ts +5 -0
  242. package/dist/client/icons.js +1 -1
  243. package/dist/client/index.js +9 -9
  244. package/dist/client/providers.js +1 -1
  245. package/dist/client/schema.js +1 -1
  246. package/dist/client/utils.js +3 -3
  247. package/dist/client-bundle-stats.html +1 -1
  248. package/dist/mcp-app/mcp-app.html +34 -34
  249. package/dist/server/chartConfigHelpers-CcvqrIWF.js +72 -0
  250. package/dist/server/chartConfigHelpers-DHQB-_v5.cjs +1 -0
  251. package/dist/server/index.cjs +68 -68
  252. package/dist/server/index.js +3800 -3728
  253. package/dist/server/{openai-D-6l1Y8h.cjs → openai-B4kAJTSD.cjs} +1 -1
  254. package/dist/server/{openai-DTSTMiXL.cjs → openai-Cdf2wWZA.cjs} +1 -1
  255. package/dist/server/{openai-CmVRIbUg.js → openai-CmMzrs1Y.js} +1 -1
  256. package/dist/server/{openai-CtXqeznO.js → openai-DhzGY9R4.js} +1 -1
  257. package/package.json +12 -2
  258. package/dist/adapters/handler-OwxSBJH8.cjs +0 -25
  259. package/dist/adapters/hono/mcp-handler.d.ts +0 -37
  260. package/dist/adapters/mcp-transport-B7ddET3M.cjs +0 -40
  261. package/dist/adapters/mcp-transport-Dfuj4j4q.js +0 -591
  262. package/dist/cjs/adapters/hono/mcp-handler.d.ts +0 -37
  263. package/dist/cjs/client/hooks/useAnalysisAI.d.ts +0 -56
  264. package/dist/cjs/client/hooks/useAnalysisChartDefaults.d.ts +0 -35
  265. package/dist/cjs/client/hooks/useAnalysisCombinedFields.d.ts +0 -18
  266. package/dist/cjs/client/hooks/useAnalysisInitialization.d.ts +0 -25
  267. package/dist/cjs/client/hooks/useAnalysisQueryBuilder.d.ts +0 -32
  268. package/dist/cjs/client/hooks/useAnalysisShare.d.ts +0 -18
  269. package/dist/cjs/client/hooks/useAnalysisUIState.d.ts +0 -24
  270. package/dist/client/chunks/analysis-builder-DB88FojM.js.map +0 -1
  271. package/dist/client/chunks/analysis-builder-shared-BVK4TYfR.js.map +0 -1
  272. package/dist/client/chunks/chart-config-activity-grid-D_UX4NHC.js.map +0 -1
  273. package/dist/client/chunks/chart-config-bar-DSO_LRTx.js.map +0 -1
  274. package/dist/client/chunks/chart-config-box-plot-oW8axV2q.js.map +0 -1
  275. package/dist/client/chunks/chart-config-bubble-gIoqVyjZ.js.map +0 -1
  276. package/dist/client/chunks/chart-config-candlestick-N6DchAA3.js.map +0 -1
  277. package/dist/client/chunks/chart-config-data-table-d7VBY-y_.js.map +0 -1
  278. package/dist/client/chunks/chart-config-funnel-DEYMcxsD.js.map +0 -1
  279. package/dist/client/chunks/chart-config-gauge-Dq-_H9UN.js.map +0 -1
  280. package/dist/client/chunks/chart-config-heat-map-CfRnRNcw.js.map +0 -1
  281. package/dist/client/chunks/chart-config-kpi-delta-DSQbvqu_.js.map +0 -1
  282. package/dist/client/chunks/chart-config-kpi-number-EFSWY1We.js.map +0 -1
  283. package/dist/client/chunks/chart-config-kpi-text-KM3V5X2u.js.map +0 -1
  284. package/dist/client/chunks/chart-config-line-D6jG8PCH.js.map +0 -1
  285. package/dist/client/chunks/chart-config-markdown-BtRIe8JN.js.map +0 -1
  286. package/dist/client/chunks/chart-config-measure-profile-DxRGa-zf.js.map +0 -1
  287. package/dist/client/chunks/chart-config-pie-BhzW-fdn.js.map +0 -1
  288. package/dist/client/chunks/chart-config-radar-D7REP1q_.js.map +0 -1
  289. package/dist/client/chunks/chart-config-radial-bar-Byx6qOPU.js.map +0 -1
  290. package/dist/client/chunks/chart-config-sankey-BTnWA7EW.js.map +0 -1
  291. package/dist/client/chunks/chart-config-scatter-DSYTjwRb.js.map +0 -1
  292. package/dist/client/chunks/chart-config-sunburst-Bwjtdf7X.js.map +0 -1
  293. package/dist/client/chunks/chart-config-tree-map-DVrvf3yQ.js.map +0 -1
  294. package/dist/client/chunks/chart-config-waterfall-DmFeQdIk.js.map +0 -1
  295. package/dist/client/chunks/chart-data-table-CKauQXme.js.map +0 -1
  296. package/dist/client/hooks/useAnalysisAI.d.ts +0 -56
  297. package/dist/client/hooks/useAnalysisChartDefaults.d.ts +0 -35
  298. package/dist/client/hooks/useAnalysisCombinedFields.d.ts +0 -18
  299. package/dist/client/hooks/useAnalysisInitialization.d.ts +0 -25
  300. package/dist/client/hooks/useAnalysisQueryBuilder.d.ts +0 -32
  301. package/dist/client/hooks/useAnalysisShare.d.ts +0 -18
  302. 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-LKTN9PTt.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,103 @@ 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
+ let { cubes: t, drizzle: n, schema: r, engineType: i, cache: o, rlsSetup: s } = e;
71
28
  if (!t || t.length === 0) throw Error("At least one cube must be provided in the cubes array");
72
- let s = new u({
29
+ let c = new a({
73
30
  drizzle: n,
74
31
  schema: r,
75
32
  engineType: i,
76
- cache: a,
77
- rlsSetup: o
33
+ cache: o,
34
+ rlsSetup: s
78
35
  });
79
36
  return t.forEach((e) => {
80
- s.registerCube(e);
81
- }), s;
37
+ c.registerCube(e);
38
+ }), c;
82
39
  }
83
- function R(e) {
40
+ function v(e) {
84
41
  return {
85
- extractSecurityContext: async (t, n) => f(await e.extractSecurityContext(t, n), d((e) => t.headers.get(e))),
42
+ extractSecurityContext: async (t, n) => f(await e.extractSecurityContext(t, n), u((e) => t.headers.get(e))),
86
43
  cors: e.cors ? {
87
44
  ...e.cors,
88
- allowedHeaders: p(e.cors.allowedHeaders)
45
+ allowedHeaders: d(e.cors.allowedHeaders)
89
46
  } : void 0
90
47
  };
91
48
  }
92
- function z(e, t) {
49
+ function y(e, t) {
93
50
  let n = e.headers.get("origin"), r = {};
94
51
  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
52
  }
96
- function B(e) {
53
+ function b(e) {
54
+ let t = m({
55
+ semanticLayer: _(e),
56
+ onError: (e) => {
57
+ process.env.NODE_ENV !== "test" && console.error("Next.js handler error:", e);
58
+ },
59
+ mcp: e.mcp
60
+ }), n = e.cors ? {
61
+ ...e.cors,
62
+ allowedHeaders: d(e.cors.allowedHeaders)
63
+ } : void 0;
64
+ return {
65
+ httpHandler: t,
66
+ corsHeaders: (e) => n ? y(e, n) : {},
67
+ baseContext: (t, n) => () => e.extractSecurityContext(t, n)
68
+ };
69
+ }
70
+ function x(e, t) {
71
+ let n = {};
72
+ return {
73
+ getHeader: (t) => e.headers.get(t) ?? void 0,
74
+ getBody: async () => {
75
+ try {
76
+ return await e.json();
77
+ } catch {
78
+ return null;
79
+ }
80
+ },
81
+ getQueryParam: (t) => e.nextUrl.searchParams.get(t) ?? void 0,
82
+ send: (e, r) => h.json(r, {
83
+ status: e,
84
+ headers: {
85
+ ...t,
86
+ ...n
87
+ }
88
+ }),
89
+ setHeader: (e, t) => {
90
+ n[e] = t;
91
+ },
92
+ sendEmpty: (e) => new h(null, {
93
+ status: e,
94
+ headers: {
95
+ ...t,
96
+ ...n
97
+ }
98
+ }),
99
+ sendSse: (e, r) => new h(r, {
100
+ status: e,
101
+ headers: {
102
+ "Content-Type": "text/event-stream",
103
+ "Cache-Control": "no-cache",
104
+ Connection: "keep-alive",
105
+ ...t,
106
+ ...n
107
+ }
108
+ })
109
+ };
110
+ }
111
+ function S(e) {
97
112
  return async function(t) {
98
- let n = z(t, {
113
+ let n = y(t, {
99
114
  ...e,
100
- allowedHeaders: p(e.allowedHeaders)
115
+ allowedHeaders: d(e.allowedHeaders)
101
116
  });
102
117
  return new Response(null, {
103
118
  status: 200,
@@ -105,306 +120,184 @@ function B(e) {
105
120
  });
106
121
  };
107
122
  }
108
- function V(e) {
109
- let { extractSecurityContext: t, cors: n } = R(e), i = L(e);
123
+ function C(e) {
124
+ let { httpHandler: t, corsHeaders: r, baseContext: i } = b(e);
110
125
  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
- }
126
+ let o = x(e, r(e));
127
+ 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
128
  };
133
129
  }
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
- }
130
+ function w(e) {
131
+ let { httpHandler: t, corsHeaders: n } = b(e);
132
+ return async function(e, r) {
133
+ return t.handleMetaGet(x(e, n(e)));
143
134
  };
144
135
  }
145
- function U(e) {
146
- let { extractSecurityContext: t, cors: n } = R(e), i = L(e);
136
+ function T(e) {
137
+ let { httpHandler: t, corsHeaders: r, baseContext: i } = b(e);
147
138
  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
- }
139
+ let o = x(e, r(e));
140
+ 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
141
  };
172
142
  }
173
- function W(e) {
174
- let { extractSecurityContext: t, cors: n } = R(e), r = L(e);
143
+ function E(e) {
144
+ let { httpHandler: t, corsHeaders: n, baseContext: r } = b(e);
175
145
  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
- }
146
+ let a = x(e, n(e));
147
+ return e.method === "POST" ? t.handleDryRunPost(a, r(e, i)) : e.method === "GET" ? t.handleDryRunGet(a, r(e, i)) : h.json({
148
+ error: "Method not allowed",
149
+ valid: !1
150
+ }, { status: 405 });
207
151
  };
208
152
  }
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
- }
153
+ function D(e) {
154
+ let { httpHandler: t, corsHeaders: r, baseContext: i } = b(e);
155
+ return async function(e, a) {
156
+ 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
157
  };
223
158
  }
224
- function K(e) {
225
- let { extractSecurityContext: t, cors: n } = R(e), r = L(e);
159
+ function O(e) {
160
+ let { httpHandler: t, corsHeaders: n, baseContext: r } = b(e);
226
161
  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
- }
162
+ return e.method === "POST" ? t.handleExplainPost(x(e, n(e)), r(e, i)) : h.json({ error: "Method not allowed" }, { status: 405 });
236
163
  };
237
164
  }
238
- function q(e) {
239
- let { cors: t } = R(e), n = L(e);
240
- return async function(e, i) {
165
+ function k(e) {
166
+ let { cors: t } = v(e), r = _(e);
167
+ return async function(e, a) {
241
168
  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) : {} });
169
+ if (e.method !== "POST") return h.json(n("Method not allowed - use POST", 405), { status: 405 });
170
+ let a = await i(r, await e.json());
171
+ return h.json(a, { headers: t ? y(e, t) : {} });
245
172
  } 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 });
173
+ 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
174
  }
248
175
  };
249
176
  }
250
- function J(e) {
251
- let { cors: n } = R(e), i = L(e);
252
- return async function(e, a) {
177
+ function A(t) {
178
+ let { cors: r } = v(t), i = _(t);
179
+ return async function(t, a) {
253
180
  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) : {} });
181
+ if (t.method !== "POST") return h.json(n("Method not allowed - use POST", 405), { status: 405 });
182
+ let a = await t.json();
183
+ if (!a.naturalLanguage) return h.json(n("naturalLanguage field is required", 400), { status: 400 });
184
+ let o = await e(i, a);
185
+ return h.json(o, { headers: r ? y(t, r) : {} });
259
186
  } 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 });
187
+ 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
188
  }
262
189
  };
263
190
  }
264
- function Y(e) {
265
- let { cors: t } = R(e), i = L(e);
191
+ function j(e) {
192
+ let { cors: r } = v(e), i = _(e);
266
193
  return async function(e, a) {
267
194
  try {
268
- if (e.method !== "POST") return j.json(r("Method not allowed - use POST", 405), { status: 405 });
195
+ if (e.method !== "POST") return h.json(n("Method not allowed - use POST", 405), { status: 405 });
269
196
  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) : {} });
197
+ if (!a.query) return h.json(n("query field is required", 400), { status: 400 });
198
+ let o = await t(i, a);
199
+ return h.json(o, { headers: r ? y(e, r) : {} });
273
200
  } 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 });
201
+ 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
202
  }
276
203
  };
277
204
  }
278
- function X(e) {
279
- let { extractSecurityContext: t, cors: n } = R(e), i = L(e);
205
+ function M(e) {
206
+ let { extractSecurityContext: t, cors: i } = v(e), a = _(e);
280
207
  return async function(e, o) {
281
208
  try {
282
- if (e.method !== "POST") return j.json(r("Method not allowed - use POST", 405), { status: 405 });
209
+ if (e.method !== "POST") return h.json(n("Method not allowed - use POST", 405), { status: 405 });
283
210
  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) : {} });
211
+ if (!s.query) return h.json(n("query field is required", 400), { status: 400 });
212
+ let c = await r(a, await t(e, o), s);
213
+ return h.json(c, { headers: i ? y(e, i) : {} });
287
214
  } 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 });
215
+ 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
216
  }
290
217
  };
291
218
  }
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
- }
219
+ function N(e) {
220
+ let { httpHandler: t, corsHeaders: r, baseContext: i } = b(e), { mcp: a = { enabled: !0 } } = e, o = (e, t) => {
221
+ Object.entries(r(e)).forEach(([e, n]) => t.set(e, n));
329
222
  };
330
- return async function(e) {
331
- return i.resourceMetadataUrl && !D(e.headers.get("authorization")) ? j.json({ error: "Bearer token required" }, {
223
+ return async function(e, s) {
224
+ return a.resourceMetadataUrl && !l(e.headers.get("authorization")) ? h.json({ error: "Bearer token required" }, {
332
225
  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 });
226
+ headers: { "WWW-Authenticate": c(a.resourceMetadataUrl) }
227
+ }) : 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
228
  };
336
229
  }
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) {
230
+ function P(e) {
231
+ let { cors: t } = v(e), { agent: n } = e;
232
+ if (!n) throw Error("agent config is required for createAgentChatHandler");
233
+ let r = _(e);
234
+ return async function(i, a) {
342
235
  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());
236
+ if (i.method !== "POST") return h.json({ error: "Method not allowed - use POST" }, { status: 405 });
237
+ let { handleAgentChat: o } = await import("../handler-u8FyzPBT.js"), { message: s, sessionId: c, history: l } = await i.json();
238
+ if (!s || typeof s != "string") return h.json({ error: "message is required and must be a string" }, { status: 400 });
239
+ let u = (n.apiKey || "").trim();
240
+ if (n.allowClientApiKey) {
241
+ let e = i.headers.get("x-agent-api-key");
242
+ e && (u = e.trim());
350
243
  }
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) {
244
+ 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 });
245
+ 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
246
  try {
354
247
  let t = o({
355
248
  message: s,
356
249
  sessionId: c,
357
250
  history: l,
358
- semanticLayer: i,
359
- securityContext: m,
360
- agentConfig: r,
251
+ semanticLayer: r,
252
+ securityContext: g,
253
+ agentConfig: n,
361
254
  apiKey: u,
362
- systemContext: h,
255
+ systemContext: _,
363
256
  providerOverride: d,
364
257
  modelOverride: f,
365
- baseURLOverride: p
258
+ baseURLOverride: m
366
259
  });
367
260
  for await (let n of t) {
368
261
  let t = `data: ${JSON.stringify(n)}\n\n`;
369
- e.enqueue(g.encode(t));
262
+ e.enqueue(v.encode(t));
370
263
  }
371
264
  } catch (t) {
372
265
  let n = {
373
266
  type: "error",
374
267
  data: { message: t instanceof Error ? t.message : "Stream failed" }
375
268
  };
376
- e.enqueue(g.encode(`data: ${JSON.stringify(n)}\n\n`));
269
+ e.enqueue(v.encode(`data: ${JSON.stringify(n)}\n\n`));
377
270
  } finally {
378
271
  e.close();
379
272
  }
380
- } }), v = new Headers({
273
+ } }), x = new Headers({
381
274
  "Content-Type": "text/event-stream",
382
275
  "Cache-Control": "no-cache",
383
276
  Connection: "keep-alive"
384
277
  });
385
- if (n) {
386
- let t = z(e, n);
387
- Object.entries(t).forEach(([e, t]) => v.set(e, t));
278
+ if (t) {
279
+ let e = y(i, t);
280
+ Object.entries(e).forEach(([e, t]) => x.set(e, t));
388
281
  }
389
- return new Response(_, {
282
+ return new Response(b, {
390
283
  status: 200,
391
- headers: v
284
+ headers: x
392
285
  });
393
286
  } 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 });
287
+ 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
288
  }
396
289
  };
397
290
  }
398
- function $(e) {
291
+ function F(e) {
399
292
  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)
293
+ load: C(e),
294
+ meta: w(e),
295
+ sql: T(e),
296
+ dryRun: E(e),
297
+ batch: D(e),
298
+ explain: O(e)
406
299
  };
407
- return t.enabled !== !1 && (n.mcpRpc = Z(e)), e.agent && (n.agentChat = Q(e)), n;
300
+ return t.enabled !== !1 && (n.mcpRpc = N(e)), e.agent && (n.agentChat = P(e)), n;
408
301
  }
409
302
  //#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 };
303
+ 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;