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.
- package/dist/adapters/ActivityGridChart.config-BtECymia.cjs +1 -0
- package/dist/adapters/ActivityGridChart.config-CTd5HYjI.js +2 -0
- package/dist/adapters/AreaChart.config-1B8iQnfn.js +2 -0
- package/dist/adapters/AreaChart.config-hnncyQL4.cjs +1 -0
- package/dist/adapters/BarChart.config-C-QCf1rL.cjs +1 -0
- package/dist/adapters/BarChart.config-CFelK1qP.js +2 -0
- package/dist/adapters/BoxPlotChart.config-CD9WEPyF.js +2 -0
- package/dist/adapters/BoxPlotChart.config-DEbLA0BX.cjs +1 -0
- package/dist/adapters/BubbleChart.config-B_M4hzzV.js +2 -0
- package/dist/adapters/BubbleChart.config-dRZZlAke.cjs +1 -0
- package/dist/adapters/CandlestickChart.config-Dsil2Fop.cjs +1 -0
- package/dist/adapters/CandlestickChart.config-fuhyFvob.js +2 -0
- package/dist/adapters/DataTable.config-q2gqBi6t.cjs +1 -0
- package/dist/adapters/DataTable.config-wIQnHX5R.js +2 -0
- package/dist/adapters/FunnelChart.config-Dz710ssx.js +2 -0
- package/dist/adapters/FunnelChart.config-YNP9CeS-.cjs +1 -0
- package/dist/adapters/GaugeChart.config-BG9FcMCn.cjs +1 -0
- package/dist/adapters/GaugeChart.config-CgwniXkd.js +2 -0
- package/dist/adapters/HeatMapChart.config-1zSMXXoN.cjs +1 -0
- package/dist/adapters/HeatMapChart.config-YVEWx6s5.js +2 -0
- package/dist/adapters/KpiDelta.config-BWvYXuFp.cjs +1 -0
- package/dist/adapters/KpiDelta.config-C_dYM64q.js +2 -0
- package/dist/adapters/KpiNumber.config-CXg6toZG.js +2 -0
- package/dist/adapters/KpiNumber.config-CZmV-yU1.cjs +1 -0
- package/dist/adapters/KpiText.config-BY-SJvAF.js +2 -0
- package/dist/adapters/KpiText.config-GSIxy0CE.cjs +1 -0
- package/dist/adapters/LineChart.config-CJtF8SOu.js +2 -0
- package/dist/adapters/LineChart.config-d0y60gw9.cjs +1 -0
- package/dist/adapters/MarkdownChart.config-B6w0spya.cjs +1 -0
- package/dist/adapters/MarkdownChart.config-BuIQcWOn.js +2 -0
- package/dist/adapters/MeasureProfileChart.config-Bo2n5Ae5.cjs +1 -0
- package/dist/adapters/MeasureProfileChart.config-C5d34lsc.js +2 -0
- package/dist/adapters/PieChart.config-CDxfXCIt.cjs +1 -0
- package/dist/adapters/PieChart.config-CuZxQc5m.js +2 -0
- package/dist/adapters/RadarChart.config-DpdVWyh5.cjs +1 -0
- package/dist/adapters/RadarChart.config-KrxwaaGu.js +2 -0
- package/dist/adapters/RadialBarChart.config-DpRZd0FW.js +2 -0
- package/dist/adapters/RadialBarChart.config-faIY4jpE.cjs +1 -0
- package/dist/adapters/RetentionCombinedChart.config-CUnScqnS.cjs +1 -0
- package/dist/adapters/RetentionCombinedChart.config-Dd8FuawP.js +2 -0
- package/dist/adapters/RetentionHeatmap.config-CPd6GeoQ.js +2 -0
- package/dist/adapters/RetentionHeatmap.config-CPlHbLom.cjs +1 -0
- package/dist/adapters/SankeyChart.config-DbIUqi-H.cjs +1 -0
- package/dist/adapters/SankeyChart.config-kzAnW0C7.js +2 -0
- package/dist/adapters/ScatterChart.config-4Okvn27v.js +2 -0
- package/dist/adapters/ScatterChart.config-4f9nNw3e.cjs +1 -0
- package/dist/adapters/SunburstChart.config-BsUQkIM_.js +2 -0
- package/dist/adapters/SunburstChart.config-lvnYkWs7.cjs +1 -0
- package/dist/adapters/TreeMapChart.config-S0qsgAFW.js +2 -0
- package/dist/adapters/TreeMapChart.config-jbwKsTYt.cjs +1 -0
- package/dist/adapters/WaterfallChart.config-CDQ74-pS.cjs +1 -0
- package/dist/adapters/WaterfallChart.config-XdtH-O5g.js +2 -0
- package/dist/adapters/chartConfigHelpers-CcvqrIWF.js +72 -0
- package/dist/adapters/chartConfigHelpers-DHQB-_v5.cjs +1 -0
- package/dist/adapters/{locale-ZLUUNUxr.cjs → compiler-ChGO4ZLU.cjs} +1 -1
- package/dist/adapters/{locale-DDvZDFVn.js → compiler-LKTN9PTt.js} +2 -21
- package/dist/adapters/core/cube-http-handler.d.ts +27 -0
- package/dist/adapters/core/http-port.d.ts +39 -0
- package/dist/adapters/core/index.cjs +1 -0
- package/dist/adapters/core/index.d.ts +11 -0
- package/dist/adapters/core/index.js +2 -0
- package/dist/adapters/core/mcp-handler.d.ts +13 -0
- package/dist/adapters/core/rest-handlers.d.ts +14 -0
- package/dist/adapters/core/security-context.d.ts +17 -0
- package/dist/adapters/core-Bbchr0ui.js +244 -0
- package/dist/adapters/core-F1pCQPde.cjs +1 -0
- package/dist/adapters/express/index.cjs +2 -2
- package/dist/adapters/express/index.js +93 -201
- package/dist/adapters/fastify/index.cjs +2 -2
- package/dist/adapters/fastify/index.js +79 -217
- package/dist/adapters/handler-DRZb2ip6.cjs +25 -0
- package/dist/adapters/{handler-CtaSua-i.js → handler-u8FyzPBT.js} +1572 -1500
- package/dist/adapters/hono/index.cjs +2 -2
- package/dist/adapters/hono/index.js +69 -225
- package/dist/adapters/mcp-tools.cjs +1 -1
- package/dist/adapters/mcp-tools.js +1 -1
- package/dist/adapters/mcp-transport-Bw_zqky2.js +591 -0
- package/dist/adapters/mcp-transport-CNIPoe1i.cjs +40 -0
- package/dist/adapters/nextjs/index.cjs +1 -1
- package/dist/adapters/nextjs/index.d.ts +8 -9
- package/dist/adapters/nextjs/index.js +181 -288
- package/dist/adapters/nextjs/mcp-handler.d.ts +0 -28
- package/dist/adapters/{openai-D-6l1Y8h.cjs → openai-B4kAJTSD.cjs} +1 -1
- package/dist/adapters/{openai-DTSTMiXL.cjs → openai-Cdf2wWZA.cjs} +1 -1
- package/dist/adapters/{openai-CmVRIbUg.js → openai-CmMzrs1Y.js} +1 -1
- package/dist/adapters/{openai-CtXqeznO.js → openai-DhzGY9R4.js} +1 -1
- package/dist/cjs/adapters/core/cube-http-handler.d.ts +27 -0
- package/dist/cjs/adapters/core/http-port.d.ts +39 -0
- package/dist/cjs/adapters/core/index.d.ts +11 -0
- package/dist/cjs/adapters/core/mcp-handler.d.ts +13 -0
- package/dist/cjs/adapters/core/rest-handlers.d.ts +14 -0
- package/dist/cjs/adapters/core/security-context.d.ts +17 -0
- package/dist/cjs/adapters/nextjs/index.d.ts +8 -9
- package/dist/cjs/adapters/nextjs/mcp-handler.d.ts +0 -28
- package/dist/cjs/client/charts/chartComponentRegistry.d.ts +1 -9
- package/dist/cjs/client/charts/chartConfigRegistry.d.ts +5 -1
- package/dist/cjs/client/charts/chartPlugin.d.ts +1 -2
- package/dist/cjs/client/charts/chartRegistry.d.ts +73 -0
- package/dist/cjs/client/components/AIAssistant/index.d.ts +2 -2
- package/dist/cjs/client/components/charts/ActivityGridChart.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/AreaChart.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/BarChart.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/BoxPlotChart.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/BubbleChart.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/CandlestickChart.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/DataTable.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/FunnelChart.config.d.ts +5 -0
- package/dist/cjs/client/components/charts/GaugeChart.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/HeatMapChart.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/KpiDelta.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/KpiNumber.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/KpiText.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/LineChart.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/MarkdownChart.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/MeasureProfileChart.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/PieChart.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/RadarChart.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/RadialBarChart.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/SankeyChart.config.d.ts +5 -0
- package/dist/cjs/client/components/charts/ScatterChart.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/SunburstChart.config.d.ts +5 -0
- package/dist/cjs/client/components/charts/TreeMapChart.config.d.ts +6 -1
- package/dist/cjs/client/components/charts/WaterfallChart.config.d.ts +6 -1
- package/dist/cjs/client/hooks/analysisQueryExecutionModes.d.ts +1 -1
- package/dist/cjs/client/hooks/useAnalysisEffects.d.ts +33 -0
- package/dist/{client/hooks/useAnalysisQueryExecution.d.ts → cjs/client/hooks/useAnalysisQuery.d.ts} +3 -3
- package/dist/cjs/client/hooks/useAnalysisState.d.ts +165 -0
- package/dist/cjs/client/icons/registry.d.ts +0 -6
- package/dist/cjs/client/icons/types.d.ts +5 -0
- package/dist/client/charts/chartComponentRegistry.d.ts +1 -9
- package/dist/client/charts/chartConfigRegistry.d.ts +5 -1
- package/dist/client/charts/chartPlugin.d.ts +1 -2
- package/dist/client/charts/chartRegistry.d.ts +73 -0
- package/dist/client/charts.js +3 -3
- package/dist/client/chunks/{DashboardEditModal-okVfH8ZK.js → DashboardEditModal-CWurUU2B.js} +7 -7
- package/dist/client/chunks/{DashboardEditModal-okVfH8ZK.js.map → DashboardEditModal-CWurUU2B.js.map} +1 -1
- package/dist/client/chunks/{analysis-builder-DB88FojM.js → analysis-builder-Uj_Fxv0-.js} +1588 -1857
- package/dist/client/chunks/analysis-builder-Uj_Fxv0-.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-shared-BVK4TYfR.js → analysis-builder-shared-AdAYIfj_.js} +1531 -1266
- package/dist/client/chunks/analysis-builder-shared-AdAYIfj_.js.map +1 -0
- package/dist/client/chunks/{chart-config-activity-grid-D_UX4NHC.js → chart-config-activity-grid-BU_bkvER.js} +1 -11
- package/dist/client/chunks/chart-config-activity-grid-BU_bkvER.js.map +1 -0
- package/dist/client/chunks/{chart-config-area-BNigHUy8.js → chart-config-area-DxwIZ4Uf.js} +1 -5
- package/dist/client/chunks/{chart-config-area-BNigHUy8.js.map → chart-config-area-DxwIZ4Uf.js.map} +1 -1
- package/dist/client/chunks/{chart-config-bar-DSO_LRTx.js → chart-config-bar-Cc8GY9aQ.js} +5 -9
- package/dist/client/chunks/chart-config-bar-Cc8GY9aQ.js.map +1 -0
- package/dist/client/chunks/{chart-config-box-plot-oW8axV2q.js → chart-config-box-plot-Bs8ovYvV.js} +3 -8
- package/dist/client/chunks/chart-config-box-plot-Bs8ovYvV.js.map +1 -0
- package/dist/client/chunks/{chart-config-bubble-gIoqVyjZ.js → chart-config-bubble-BfgY7pt8.js} +1 -11
- package/dist/client/chunks/chart-config-bubble-BfgY7pt8.js.map +1 -0
- package/dist/client/chunks/{chart-config-candlestick-N6DchAA3.js → chart-config-candlestick-jaeNNEtC.js} +1 -11
- package/dist/client/chunks/chart-config-candlestick-jaeNNEtC.js.map +1 -0
- package/dist/client/chunks/{chart-config-data-table-d7VBY-y_.js → chart-config-data-table-CRk0C0rW.js} +1 -4
- package/dist/client/chunks/chart-config-data-table-CRk0C0rW.js.map +1 -0
- package/dist/client/chunks/{chart-config-funnel-DEYMcxsD.js → chart-config-funnel-boT_LNfl.js} +1 -4
- package/dist/client/chunks/chart-config-funnel-boT_LNfl.js.map +1 -0
- package/dist/client/chunks/{chart-config-gauge-Dq-_H9UN.js → chart-config-gauge-C5uJEr97.js} +3 -8
- package/dist/client/chunks/chart-config-gauge-C5uJEr97.js.map +1 -0
- package/dist/client/chunks/{chart-config-heat-map-CfRnRNcw.js → chart-config-heat-map-CCarP44-.js} +1 -11
- package/dist/client/chunks/chart-config-heat-map-CCarP44-.js.map +1 -0
- package/dist/client/chunks/{chart-config-kpi-delta-DSQbvqu_.js → chart-config-kpi-delta-DYopvwyG.js} +3 -8
- package/dist/client/chunks/chart-config-kpi-delta-DYopvwyG.js.map +1 -0
- package/dist/client/chunks/{chart-config-kpi-number-EFSWY1We.js → chart-config-kpi-number-BhMdoArB.js} +3 -8
- package/dist/client/chunks/chart-config-kpi-number-BhMdoArB.js.map +1 -0
- package/dist/client/chunks/{chart-config-kpi-text-KM3V5X2u.js → chart-config-kpi-text-DE6Zdi53.js} +3 -8
- package/dist/client/chunks/chart-config-kpi-text-DE6Zdi53.js.map +1 -0
- package/dist/client/chunks/{chart-config-line-D6jG8PCH.js → chart-config-line-CBfM0Rds.js} +6 -10
- package/dist/client/chunks/chart-config-line-CBfM0Rds.js.map +1 -0
- package/dist/client/chunks/{chart-config-markdown-BtRIe8JN.js → chart-config-markdown-BCDyBI8K.js} +1 -4
- package/dist/client/chunks/chart-config-markdown-BCDyBI8K.js.map +1 -0
- package/dist/client/chunks/{chart-config-measure-profile-DxRGa-zf.js → chart-config-measure-profile-BgQIH1u2.js} +1 -8
- package/dist/client/chunks/chart-config-measure-profile-BgQIH1u2.js.map +1 -0
- package/dist/client/chunks/{chart-config-pie-BhzW-fdn.js → chart-config-pie-ChfFz6DV.js} +5 -9
- package/dist/client/chunks/chart-config-pie-ChfFz6DV.js.map +1 -0
- package/dist/client/chunks/{chart-config-radar-D7REP1q_.js → chart-config-radar-BlAIGnww.js} +5 -9
- package/dist/client/chunks/chart-config-radar-BlAIGnww.js.map +1 -0
- package/dist/client/chunks/{chart-config-radial-bar-Byx6qOPU.js → chart-config-radial-bar-VFerwbCO.js} +5 -9
- package/dist/client/chunks/chart-config-radial-bar-VFerwbCO.js.map +1 -0
- package/dist/client/chunks/{chart-config-sankey-BTnWA7EW.js → chart-config-sankey-BhrDxIgj.js} +1 -4
- package/dist/client/chunks/chart-config-sankey-BhrDxIgj.js.map +1 -0
- package/dist/client/chunks/{chart-config-scatter-DSYTjwRb.js → chart-config-scatter-q_olh54e.js} +1 -11
- package/dist/client/chunks/chart-config-scatter-q_olh54e.js.map +1 -0
- package/dist/client/chunks/{chart-config-sunburst-Bwjtdf7X.js → chart-config-sunburst-BOmkOnKn.js} +1 -4
- package/dist/client/chunks/chart-config-sunburst-BOmkOnKn.js.map +1 -0
- package/dist/client/chunks/{chart-config-tree-map-DVrvf3yQ.js → chart-config-tree-map-BjX88YBY.js} +5 -9
- package/dist/client/chunks/chart-config-tree-map-BjX88YBY.js.map +1 -0
- package/dist/client/chunks/{chart-config-waterfall-DmFeQdIk.js → chart-config-waterfall-QsWXVSoF.js} +3 -8
- package/dist/client/chunks/chart-config-waterfall-QsWXVSoF.js.map +1 -0
- package/dist/client/chunks/{chart-data-table-CKauQXme.js → chart-data-table-D4g5_jfF.js} +1277 -1094
- package/dist/client/chunks/chart-data-table-D4g5_jfF.js.map +1 -0
- package/dist/client/chunks/{chart-kpi-delta-Dn-jjO-2.js → chart-kpi-delta-BvWOt8-D.js} +2 -2
- package/dist/client/chunks/{chart-kpi-delta-Dn-jjO-2.js.map → chart-kpi-delta-BvWOt8-D.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-number-P_WBiO5S.js → chart-kpi-number-xgZmMiQY.js} +3 -3
- package/dist/client/chunks/{chart-kpi-number-P_WBiO5S.js.map → chart-kpi-number-xgZmMiQY.js.map} +1 -1
- package/dist/client/chunks/{chart-kpi-text-C-Y4eb5H.js → chart-kpi-text-ZO3eFi7t.js} +2 -2
- package/dist/client/chunks/{chart-kpi-text-C-Y4eb5H.js.map → chart-kpi-text-ZO3eFi7t.js.map} +1 -1
- package/dist/client/chunks/{charts-loader-DdTeCeNo.js → charts-loader-B0DOQMFH.js} +6 -6
- package/dist/client/chunks/{charts-loader-DdTeCeNo.js.map → charts-loader-B0DOQMFH.js.map} +1 -1
- package/dist/client/chunks/{schema-visualization-Cb_E9_Gd.js → schema-visualization-DJPTktM6.js} +2 -2
- package/dist/client/chunks/{schema-visualization-Cb_E9_Gd.js.map → schema-visualization-DJPTktM6.js.map} +1 -1
- package/dist/client/chunks/{useDirtyStateTracking-MbpxH_v6.js → useDirtyStateTracking-BY_IIG1n.js} +2 -2
- package/dist/client/chunks/{useDirtyStateTracking-MbpxH_v6.js.map → useDirtyStateTracking-BY_IIG1n.js.map} +1 -1
- package/dist/client/chunks/{useExplainAI-evnZkjCY.js → useExplainAI-PjMBmj2p.js} +4 -4
- package/dist/client/chunks/{useExplainAI-evnZkjCY.js.map → useExplainAI-PjMBmj2p.js.map} +1 -1
- package/dist/client/chunks/{utils-3P6z1vz5.js → utils-Cq-j5E5I.js} +2 -2
- package/dist/client/chunks/{utils-3P6z1vz5.js.map → utils-Cq-j5E5I.js.map} +1 -1
- package/dist/client/chunks/{vendor-DSpR0IW6.js → vendor-D4jADu8t.js} +2 -2
- package/dist/client/chunks/{vendor-DSpR0IW6.js.map → vendor-D4jADu8t.js.map} +1 -1
- package/dist/client/components/AIAssistant/index.d.ts +2 -2
- package/dist/client/components/charts/ActivityGridChart.config.d.ts +6 -1
- package/dist/client/components/charts/AreaChart.config.d.ts +6 -1
- package/dist/client/components/charts/BarChart.config.d.ts +6 -1
- package/dist/client/components/charts/BoxPlotChart.config.d.ts +6 -1
- package/dist/client/components/charts/BubbleChart.config.d.ts +6 -1
- package/dist/client/components/charts/CandlestickChart.config.d.ts +6 -1
- package/dist/client/components/charts/DataTable.config.d.ts +6 -1
- package/dist/client/components/charts/FunnelChart.config.d.ts +5 -0
- package/dist/client/components/charts/GaugeChart.config.d.ts +6 -1
- package/dist/client/components/charts/HeatMapChart.config.d.ts +6 -1
- package/dist/client/components/charts/KpiDelta.config.d.ts +6 -1
- package/dist/client/components/charts/KpiNumber.config.d.ts +6 -1
- package/dist/client/components/charts/KpiText.config.d.ts +6 -1
- package/dist/client/components/charts/LineChart.config.d.ts +6 -1
- package/dist/client/components/charts/MarkdownChart.config.d.ts +6 -1
- package/dist/client/components/charts/MeasureProfileChart.config.d.ts +6 -1
- package/dist/client/components/charts/PieChart.config.d.ts +6 -1
- package/dist/client/components/charts/RadarChart.config.d.ts +6 -1
- package/dist/client/components/charts/RadialBarChart.config.d.ts +6 -1
- package/dist/client/components/charts/SankeyChart.config.d.ts +5 -0
- package/dist/client/components/charts/ScatterChart.config.d.ts +6 -1
- package/dist/client/components/charts/SunburstChart.config.d.ts +5 -0
- package/dist/client/components/charts/TreeMapChart.config.d.ts +6 -1
- package/dist/client/components/charts/WaterfallChart.config.d.ts +6 -1
- package/dist/client/components.js +2 -2
- package/dist/client/hooks/analysisQueryExecutionModes.d.ts +1 -1
- package/dist/client/hooks/useAnalysisEffects.d.ts +33 -0
- package/dist/{cjs/client/hooks/useAnalysisQueryExecution.d.ts → client/hooks/useAnalysisQuery.d.ts} +3 -3
- package/dist/client/hooks/useAnalysisState.d.ts +165 -0
- package/dist/client/hooks.js +3 -3
- package/dist/client/icons/registry.d.ts +0 -6
- package/dist/client/icons/types.d.ts +5 -0
- package/dist/client/icons.js +1 -1
- package/dist/client/index.js +9 -9
- package/dist/client/providers.js +1 -1
- package/dist/client/schema.js +1 -1
- package/dist/client/utils.js +3 -3
- package/dist/client-bundle-stats.html +1 -1
- package/dist/mcp-app/mcp-app.html +34 -34
- package/dist/server/chartConfigHelpers-CcvqrIWF.js +72 -0
- package/dist/server/chartConfigHelpers-DHQB-_v5.cjs +1 -0
- package/dist/server/index.cjs +68 -68
- package/dist/server/index.js +3800 -3728
- package/dist/server/{openai-D-6l1Y8h.cjs → openai-B4kAJTSD.cjs} +1 -1
- package/dist/server/{openai-DTSTMiXL.cjs → openai-Cdf2wWZA.cjs} +1 -1
- package/dist/server/{openai-CmVRIbUg.js → openai-CmMzrs1Y.js} +1 -1
- package/dist/server/{openai-CtXqeznO.js → openai-DhzGY9R4.js} +1 -1
- package/package.json +12 -2
- package/dist/adapters/handler-OwxSBJH8.cjs +0 -25
- package/dist/adapters/hono/mcp-handler.d.ts +0 -37
- package/dist/adapters/mcp-transport-B7ddET3M.cjs +0 -40
- package/dist/adapters/mcp-transport-Dfuj4j4q.js +0 -591
- package/dist/cjs/adapters/hono/mcp-handler.d.ts +0 -37
- package/dist/cjs/client/hooks/useAnalysisAI.d.ts +0 -56
- package/dist/cjs/client/hooks/useAnalysisChartDefaults.d.ts +0 -35
- package/dist/cjs/client/hooks/useAnalysisCombinedFields.d.ts +0 -18
- package/dist/cjs/client/hooks/useAnalysisInitialization.d.ts +0 -25
- package/dist/cjs/client/hooks/useAnalysisQueryBuilder.d.ts +0 -32
- package/dist/cjs/client/hooks/useAnalysisShare.d.ts +0 -18
- package/dist/cjs/client/hooks/useAnalysisUIState.d.ts +0 -24
- package/dist/client/chunks/analysis-builder-DB88FojM.js.map +0 -1
- package/dist/client/chunks/analysis-builder-shared-BVK4TYfR.js.map +0 -1
- package/dist/client/chunks/chart-config-activity-grid-D_UX4NHC.js.map +0 -1
- package/dist/client/chunks/chart-config-bar-DSO_LRTx.js.map +0 -1
- package/dist/client/chunks/chart-config-box-plot-oW8axV2q.js.map +0 -1
- package/dist/client/chunks/chart-config-bubble-gIoqVyjZ.js.map +0 -1
- package/dist/client/chunks/chart-config-candlestick-N6DchAA3.js.map +0 -1
- package/dist/client/chunks/chart-config-data-table-d7VBY-y_.js.map +0 -1
- package/dist/client/chunks/chart-config-funnel-DEYMcxsD.js.map +0 -1
- package/dist/client/chunks/chart-config-gauge-Dq-_H9UN.js.map +0 -1
- package/dist/client/chunks/chart-config-heat-map-CfRnRNcw.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-delta-DSQbvqu_.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-number-EFSWY1We.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-text-KM3V5X2u.js.map +0 -1
- package/dist/client/chunks/chart-config-line-D6jG8PCH.js.map +0 -1
- package/dist/client/chunks/chart-config-markdown-BtRIe8JN.js.map +0 -1
- package/dist/client/chunks/chart-config-measure-profile-DxRGa-zf.js.map +0 -1
- package/dist/client/chunks/chart-config-pie-BhzW-fdn.js.map +0 -1
- package/dist/client/chunks/chart-config-radar-D7REP1q_.js.map +0 -1
- package/dist/client/chunks/chart-config-radial-bar-Byx6qOPU.js.map +0 -1
- package/dist/client/chunks/chart-config-sankey-BTnWA7EW.js.map +0 -1
- package/dist/client/chunks/chart-config-scatter-DSYTjwRb.js.map +0 -1
- package/dist/client/chunks/chart-config-sunburst-Bwjtdf7X.js.map +0 -1
- package/dist/client/chunks/chart-config-tree-map-DVrvf3yQ.js.map +0 -1
- package/dist/client/chunks/chart-config-waterfall-DmFeQdIk.js.map +0 -1
- package/dist/client/chunks/chart-data-table-CKauQXme.js.map +0 -1
- package/dist/client/hooks/useAnalysisAI.d.ts +0 -56
- package/dist/client/hooks/useAnalysisChartDefaults.d.ts +0 -35
- package/dist/client/hooks/useAnalysisCombinedFields.d.ts +0 -18
- package/dist/client/hooks/useAnalysisInitialization.d.ts +0 -25
- package/dist/client/hooks/useAnalysisQueryBuilder.d.ts +0 -32
- package/dist/client/hooks/useAnalysisShare.d.ts +0 -18
- package/dist/client/hooks/useAnalysisUIState.d.ts +0 -24
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
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
|
|
7
|
-
let n = new TextEncoder(), r =
|
|
8
|
-
e.enqueue(n.encode(
|
|
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
|
|
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
|
|
70
|
-
let { cubes: t, drizzle: n, schema: r, engineType: i, cache:
|
|
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
|
|
29
|
+
let c = new a({
|
|
73
30
|
drizzle: n,
|
|
74
31
|
schema: r,
|
|
75
32
|
engineType: i,
|
|
76
|
-
cache:
|
|
77
|
-
rlsSetup:
|
|
33
|
+
cache: o,
|
|
34
|
+
rlsSetup: s
|
|
78
35
|
});
|
|
79
36
|
return t.forEach((e) => {
|
|
80
|
-
|
|
81
|
-
}),
|
|
37
|
+
c.registerCube(e);
|
|
38
|
+
}), c;
|
|
82
39
|
}
|
|
83
|
-
function
|
|
40
|
+
function v(e) {
|
|
84
41
|
return {
|
|
85
|
-
extractSecurityContext: async (t, n) => f(await e.extractSecurityContext(t, n),
|
|
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:
|
|
45
|
+
allowedHeaders: d(e.cors.allowedHeaders)
|
|
89
46
|
} : void 0
|
|
90
47
|
};
|
|
91
48
|
}
|
|
92
|
-
function
|
|
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
|
|
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 =
|
|
113
|
+
let n = y(t, {
|
|
99
114
|
...e,
|
|
100
|
-
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
|
|
109
|
-
let {
|
|
123
|
+
function C(e) {
|
|
124
|
+
let { httpHandler: t, corsHeaders: r, baseContext: i } = b(e);
|
|
110
125
|
return async function(e, a) {
|
|
111
|
-
|
|
112
|
-
|
|
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
|
|
135
|
-
let {
|
|
136
|
-
return async function(
|
|
137
|
-
|
|
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
|
|
146
|
-
let {
|
|
136
|
+
function T(e) {
|
|
137
|
+
let { httpHandler: t, corsHeaders: r, baseContext: i } = b(e);
|
|
147
138
|
return async function(e, a) {
|
|
148
|
-
|
|
149
|
-
|
|
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
|
|
174
|
-
let {
|
|
143
|
+
function E(e) {
|
|
144
|
+
let { httpHandler: t, corsHeaders: n, baseContext: r } = b(e);
|
|
175
145
|
return async function(e, i) {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
|
210
|
-
let {
|
|
211
|
-
return async function(e,
|
|
212
|
-
|
|
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
|
|
225
|
-
let {
|
|
159
|
+
function O(e) {
|
|
160
|
+
let { httpHandler: t, corsHeaders: n, baseContext: r } = b(e);
|
|
226
161
|
return async function(e, i) {
|
|
227
|
-
|
|
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
|
|
239
|
-
let { cors: t } =
|
|
240
|
-
return async function(e,
|
|
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
|
|
243
|
-
let
|
|
244
|
-
return
|
|
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),
|
|
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
|
|
251
|
-
let { cors:
|
|
252
|
-
return async function(
|
|
177
|
+
function A(t) {
|
|
178
|
+
let { cors: r } = v(t), i = _(t);
|
|
179
|
+
return async function(t, a) {
|
|
253
180
|
try {
|
|
254
|
-
if (
|
|
255
|
-
let a = await
|
|
256
|
-
if (!a.naturalLanguage) return
|
|
257
|
-
let o = await
|
|
258
|
-
return
|
|
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),
|
|
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
|
|
265
|
-
let { cors:
|
|
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
|
|
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
|
|
271
|
-
let o = await
|
|
272
|
-
return
|
|
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),
|
|
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
|
|
279
|
-
let { extractSecurityContext: t, cors:
|
|
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
|
|
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
|
|
285
|
-
let c = await a
|
|
286
|
-
return
|
|
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),
|
|
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
|
|
293
|
-
let {
|
|
294
|
-
|
|
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
|
|
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":
|
|
334
|
-
}) : e.method === "DELETE" ?
|
|
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
|
|
338
|
-
let {
|
|
339
|
-
if (!
|
|
340
|
-
let
|
|
341
|
-
return async function(
|
|
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 (
|
|
344
|
-
let { handleAgentChat: o } = await import("../handler-
|
|
345
|
-
if (!s || typeof s != "string") return
|
|
346
|
-
let u = (
|
|
347
|
-
if (
|
|
348
|
-
let
|
|
349
|
-
|
|
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
|
|
352
|
-
let d =
|
|
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:
|
|
359
|
-
securityContext:
|
|
360
|
-
agentConfig:
|
|
251
|
+
semanticLayer: r,
|
|
252
|
+
securityContext: g,
|
|
253
|
+
agentConfig: n,
|
|
361
254
|
apiKey: u,
|
|
362
|
-
systemContext:
|
|
255
|
+
systemContext: _,
|
|
363
256
|
providerOverride: d,
|
|
364
257
|
modelOverride: f,
|
|
365
|
-
baseURLOverride:
|
|
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(
|
|
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(
|
|
269
|
+
e.enqueue(v.encode(`data: ${JSON.stringify(n)}\n\n`));
|
|
377
270
|
} finally {
|
|
378
271
|
e.close();
|
|
379
272
|
}
|
|
380
|
-
} }),
|
|
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 (
|
|
386
|
-
let
|
|
387
|
-
Object.entries(
|
|
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:
|
|
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),
|
|
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
|
|
291
|
+
function F(e) {
|
|
399
292
|
let { mcp: t = { enabled: !0 } } = e, n = {
|
|
400
|
-
load:
|
|
401
|
-
meta:
|
|
402
|
-
sql:
|
|
403
|
-
dryRun:
|
|
404
|
-
batch:
|
|
405
|
-
explain:
|
|
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 =
|
|
300
|
+
return t.enabled !== !1 && (n.mcpRpc = N(e)), e.agent && (n.agentChat = P(e)), n;
|
|
408
301
|
}
|
|
409
302
|
//#endregion
|
|
410
|
-
export {
|
|
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;
|