drizzle-cube 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/compiler-DyyBaLry.cjs +166 -0
- package/dist/adapters/{locale-DDvZDFVn.js → compiler-lG6eNsoI.js} +215 -230
- 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 +18 -9
- package/dist/adapters/nextjs/index.js +186 -289
- 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 +18 -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/AnalysisBuilder/utils/filterUtils.d.ts +4 -10
- 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/components/shared/utils.d.ts +2 -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/cjs/client/shared/filters/filterOperations.d.ts +95 -0
- package/dist/cjs/client/shared/filters/index.d.ts +10 -0
- package/dist/cjs/client/shared/filters/operators.d.ts +23 -0
- package/dist/cjs/client/shared/index.d.ts +3 -2
- package/dist/cjs/client/shared/types.d.ts +3 -10
- package/dist/cjs/client/shared/utils.d.ts +1 -59
- package/dist/cjs/client/utils/filterUtils.d.ts +2 -9
- package/dist/cjs/server/logical-plan/logical-plan-builder.d.ts +0 -5
- package/dist/cjs/server/logical-plan/schema-builder.d.ts +19 -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-Cs1ig1_V.js} +1522 -1121
- package/dist/client/chunks/DashboardEditModal-Cs1ig1_V.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-DB88FojM.js → analysis-builder-B64yaeDe.js} +1609 -1878
- package/dist/client/chunks/analysis-builder-B64yaeDe.js.map +1 -0
- package/dist/client/chunks/{analysis-builder-shared-BVK4TYfR.js → analysis-builder-shared-CD0n2Nb8.js} +1545 -1355
- package/dist/client/chunks/analysis-builder-shared-CD0n2Nb8.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-BT6zqCFl.js} +250 -591
- package/dist/client/chunks/useDirtyStateTracking-BT6zqCFl.js.map +1 -0
- package/dist/client/chunks/{useExplainAI-evnZkjCY.js → useExplainAI-Dq_meKNN.js} +4 -4
- package/dist/client/chunks/{useExplainAI-evnZkjCY.js.map → useExplainAI-Dq_meKNN.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/AnalysisBuilder/utils/filterUtils.d.ts +4 -10
- 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/shared/utils.d.ts +2 -1
- package/dist/client/components.js +3 -3
- 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 +17 -17
- package/dist/client/index.js.map +1 -1
- package/dist/client/providers.js +1 -1
- package/dist/client/schema.js +1 -1
- package/dist/client/shared/filters/filterOperations.d.ts +95 -0
- package/dist/client/shared/filters/index.d.ts +10 -0
- package/dist/client/shared/filters/operators.d.ts +23 -0
- package/dist/client/shared/index.d.ts +3 -2
- package/dist/client/shared/types.d.ts +3 -10
- package/dist/client/shared/utils.d.ts +1 -59
- package/dist/client/utils/filterUtils.d.ts +2 -9
- 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 +3899 -3823
- package/dist/server/logical-plan/logical-plan-builder.d.ts +0 -5
- package/dist/server/logical-plan/schema-builder.d.ts +19 -0
- 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 +13 -3
- package/dist/adapters/handler-OwxSBJH8.cjs +0 -25
- package/dist/adapters/hono/mcp-handler.d.ts +0 -37
- package/dist/adapters/locale-ZLUUNUxr.cjs +0 -166
- 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/DashboardEditModal-okVfH8ZK.js.map +0 -1
- 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/chunks/useDirtyStateTracking-MbpxH_v6.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,4 +1,4 @@
|
|
|
1
|
-
function e(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}function t(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}var n=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return n=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),r=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,e=>(e^r()&15>>e/4).toString(16))};function r(e){return typeof e==`object`&&!!e&&(`name`in e&&e.name===`AbortError`||`message`in e&&String(e.message).includes(`FetchRequestCanceledException`))}var i=e=>{if(e instanceof Error)return e;if(typeof e==`object`&&e){try{if(Object.prototype.toString.call(e)===`[object Error]`){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)},a=class extends Error{},o=class e extends a{constructor(t,n,r,i){super(`${e.makeMessage(t,n,r)}`),this.status=t,this.headers=i,this.requestID=i?.get(`x-request-id`),this.error=n;let a=n;this.code=a?.code,this.param=a?.param,this.type=a?.type}static makeMessage(e,t,n){let r=t?.message?typeof t.message==`string`?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||`(no status code or body)`}static generate(t,n,r,a){if(!t||!a)return new c({message:r,cause:i(n)});let o=n?.error;return t===400?new u(t,o,r,a):t===401?new d(t,o,r,a):t===403?new f(t,o,r,a):t===404?new p(t,o,r,a):t===409?new m(t,o,r,a):t===422?new h(t,o,r,a):t===429?new g(t,o,r,a):t>=500?new _(t,o,r,a):new e(t,o,r,a)}},s=class extends o{constructor({message:e}={}){super(void 0,void 0,e||`Request was aborted.`,void 0)}},c=class extends o{constructor({message:e,cause:t}){super(void 0,void 0,e||`Connection error.`,void 0),t&&(this.cause=t)}},l=class extends c{constructor({message:e}={}){super({message:e??`Request timed out.`})}},u=class extends o{},d=class extends o{},f=class extends o{},p=class extends o{},m=class extends o{},h=class extends o{},g=class extends o{},_=class extends o{},v=class extends a{constructor(){super(`Could not parse response content as the length limit was reached`)}},y=class extends a{constructor(){super(`Could not parse response content as the request was rejected by the content filter`)}},b=class extends Error{constructor(e){super(e)}},x=class extends o{constructor(e,t,n){let r=`OAuth2 authentication error`,i;if(t&&typeof t==`object`){let e=t;i=e.error;let n=e.error_description;n&&typeof n==`string`?r=n:i&&(r=i)}super(e,t,r,n),this.error_code=i}},ee=class extends a{constructor(e,t,n){super(e),this.provider=t,this.cause=n}},te=/^[a-z][a-z0-9+.-]*:/i,ne=e=>te.test(e),S=e=>(S=Array.isArray,S(e)),re=S;function ie(e){return typeof e==`object`?e??{}:{}}function ae(e){if(!e)return!0;for(let t in e)return!1;return!0}function oe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function se(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ce=(e,t)=>{if(typeof t!=`number`||!Number.isInteger(t))throw new a(`${e} must be an integer`);if(t<0)throw new a(`${e} must be a positive integer`);return t},le=e=>{try{return JSON.parse(e)}catch{return}},ue=e=>new Promise(t=>setTimeout(t,e)),de=`6.43.0`,fe=()=>typeof window<`u`&&window.document!==void 0&&typeof navigator<`u`;function pe(){return typeof Deno<`u`&&Deno.build!=null?`deno`:typeof EdgeRuntime<`u`?`edge`:Object.prototype.toString.call(globalThis.process===void 0?0:globalThis.process)===`[object process]`?`node`:`unknown`}var me=()=>{let e=pe();if(e===`deno`)return{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":de,"X-Stainless-OS":_e(Deno.build.os),"X-Stainless-Arch":ge(Deno.build.arch),"X-Stainless-Runtime":`deno`,"X-Stainless-Runtime-Version":typeof Deno.version==`string`?Deno.version:Deno.version?.deno??`unknown`};if(typeof EdgeRuntime<`u`)return{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":de,"X-Stainless-OS":`Unknown`,"X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":`edge`,"X-Stainless-Runtime-Version":globalThis.process.version};if(e===`node`)return{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":de,"X-Stainless-OS":_e(globalThis.process.platform??`unknown`),"X-Stainless-Arch":ge(globalThis.process.arch??`unknown`),"X-Stainless-Runtime":`node`,"X-Stainless-Runtime-Version":globalThis.process.version??`unknown`};let t=he();return t?{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":de,"X-Stainless-OS":`Unknown`,"X-Stainless-Arch":`unknown`,"X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":de,"X-Stainless-OS":`Unknown`,"X-Stainless-Arch":`unknown`,"X-Stainless-Runtime":`unknown`,"X-Stainless-Runtime-Version":`unknown`}};function he(){if(typeof navigator>`u`||!navigator)return null;for(let{key:e,pattern:t}of[{key:`edge`,pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`ie`,pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`ie`,pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`chrome`,pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`firefox`,pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`safari`,pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}]){let n=t.exec(navigator.userAgent);if(n)return{browser:e,version:`${n[1]||0}.${n[2]||0}.${n[3]||0}`}}return null}var ge=e=>e===`x32`?`x32`:e===`x86_64`||e===`x64`?`x64`:e===`arm`?`arm`:e===`aarch64`||e===`arm64`?`arm64`:e?`other:${e}`:`unknown`,_e=e=>(e=e.toLowerCase(),e.includes(`ios`)?`iOS`:e===`android`?`Android`:e===`darwin`?`MacOS`:e===`win32`?`Windows`:e===`freebsd`?`FreeBSD`:e===`openbsd`?`OpenBSD`:e===`linux`?`Linux`:e?`Other:${e}`:`Unknown`),ve,ye=()=>ve??=me();function be(){if(typeof fetch<`u`)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function xe(...e){let t=globalThis.ReadableStream;if(t===void 0)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function Se(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return xe({start(){},async pull(e){let{done:n,value:r}=await t.next();n?e.close():e.enqueue(r)},async cancel(){await t.return?.()}})}function Ce(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function we(e){if(typeof e!=`object`||!e)return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}var Te=({headers:e,body:t})=>({bodyHeaders:{"content-type":`application/json`},body:JSON.stringify(t)}),Ee=`RFC3986`,De=e=>String(e),Oe={RFC1738:e=>String(e).replace(/%20/g,`+`),RFC3986:De},ke=(e,t)=>(ke=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),ke(e,t)),C=(()=>{let e=[];for(let t=0;t<256;++t)e.push(`%`+((t<16?`0`:``)+t.toString(16)).toUpperCase());return e})(),Ae=1024,je=(e,t,n,r,i)=>{if(e.length===0)return e;let a=e;if(typeof e==`symbol`?a=Symbol.prototype.toString.call(e):typeof e!=`string`&&(a=String(e)),n===`iso-8859-1`)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return`%26%23`+parseInt(e.slice(2),16)+`%3B`});let o=``;for(let e=0;e<a.length;e+=Ae){let t=a.length>=Ae?a.slice(e,e+Ae):a,n=[];for(let e=0;e<t.length;++e){let r=t.charCodeAt(e);if(r===45||r===46||r===95||r===126||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||i===`RFC1738`&&(r===40||r===41)){n[n.length]=t.charAt(e);continue}if(r<128){n[n.length]=C[r];continue}if(r<2048){n[n.length]=C[192|r>>6]+C[128|r&63];continue}if(r<55296||r>=57344){n[n.length]=C[224|r>>12]+C[128|r>>6&63]+C[128|r&63];continue}e+=1,r=65536+((r&1023)<<10|t.charCodeAt(e)&1023),n[n.length]=C[240|r>>18]+C[128|r>>12&63]+C[128|r>>6&63]+C[128|r&63]}o+=n.join(``)}return o};function Me(e){return!e||typeof e!=`object`?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function Ne(e,t){if(S(e)){let n=[];for(let r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)}var Pe={brackets(e){return String(e)+`[]`},comma:`comma`,indices(e,t){return String(e)+`[`+t+`]`},repeat(e){return String(e)}},Fe=function(e,t){Array.prototype.push.apply(e,S(t)?t:[t])},Ie,w={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:`indices`,charset:`utf-8`,charsetSentinel:!1,delimiter:`&`,encode:!0,encodeDotInKeys:!1,encoder:je,encodeValuesOnly:!1,format:Ee,formatter:De,indices:!1,serializeDate(e){return(Ie??=Function.prototype.call.bind(Date.prototype.toISOString))(e)},skipNulls:!1,strictNullHandling:!1};function Le(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`symbol`||typeof e==`bigint`}var Re={};function ze(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let v=e,y=_,b=0,x=!1;for(;(y=y.get(Re))!==void 0&&!x;){let t=y.get(e);if(b+=1,t!==void 0){if(t===b)throw RangeError(`Cyclic object value`);x=!0}y.get(Re)===void 0&&(b=0)}if(typeof l==`function`?v=l(t,v):v instanceof Date?v=f?.(v):n===`comma`&&S(v)&&(v=Ne(v,function(e){return e instanceof Date?f?.(e):e})),v===null){if(a)return c&&!h?c(t,w.encoder,g,`key`,p):t;v=``}if(Le(v)||Me(v)){if(c){let e=h?t:c(t,w.encoder,g,`key`,p);return[m?.(e)+`=`+m?.(c(v,w.encoder,g,`value`,p))]}return[m?.(t)+`=`+m?.(String(v))]}let ee=[];if(v===void 0)return ee;let te;if(n===`comma`&&S(v))h&&c&&(v=Ne(v,c)),te=[{value:v.length>0?v.join(`,`)||null:void 0}];else if(S(l))te=l;else{let e=Object.keys(v);te=u?e.sort(u):e}let ne=s?String(t).replace(/\./g,`%2E`):String(t),re=r&&S(v)&&v.length===1?ne+`[]`:ne;if(i&&S(v)&&v.length===0)return re+`[]`;for(let t=0;t<te.length;++t){let y=te[t],x=typeof y==`object`&&y.value!==void 0?y.value:v[y];if(o&&x===null)continue;let ne=d&&s?y.replace(/\./g,`%2E`):y,ie=S(v)?typeof n==`function`?n(re,ne):re:re+(d?`.`+ne:`[`+ne+`]`);_.set(e,b);let ae=new WeakMap;ae.set(Re,_),Fe(ee,ze(x,ie,n,r,i,a,o,s,n===`comma`&&h&&S(v)?null:c,l,u,d,f,p,m,h,g,ae))}return ee}function Be(e=w){if(e.allowEmptyArrays!==void 0&&typeof e.allowEmptyArrays!=`boolean`)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(e.encodeDotInKeys!==void 0&&typeof e.encodeDotInKeys!=`boolean`)throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&e.encoder!==void 0&&typeof e.encoder!=`function`)throw TypeError(`Encoder has to be a function.`);let t=e.charset||w.charset;if(e.charset!==void 0&&e.charset!==`utf-8`&&e.charset!==`iso-8859-1`)throw TypeError(`The charset option must be either utf-8, iso-8859-1, or undefined`);let n=Ee;if(e.format!==void 0){if(!ke(Oe,e.format))throw TypeError(`Unknown format option provided.`);n=e.format}let r=Oe[n],i=w.filter;(typeof e.filter==`function`||S(e.filter))&&(i=e.filter);let a;if(a=e.arrayFormat&&e.arrayFormat in Pe?e.arrayFormat:`indices`in e?e.indices?`indices`:`repeat`:w.arrayFormat,`commaRoundTrip`in e&&typeof e.commaRoundTrip!=`boolean`)throw TypeError("`commaRoundTrip` must be a boolean, or absent");let o=e.allowDots===void 0?e.encodeDotInKeys?!0:w.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix==`boolean`?e.addQueryPrefix:w.addQueryPrefix,allowDots:o,allowEmptyArrays:typeof e.allowEmptyArrays==`boolean`?!!e.allowEmptyArrays:w.allowEmptyArrays,arrayFormat:a,charset:t,charsetSentinel:typeof e.charsetSentinel==`boolean`?e.charsetSentinel:w.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:e.delimiter===void 0?w.delimiter:e.delimiter,encode:typeof e.encode==`boolean`?e.encode:w.encode,encodeDotInKeys:typeof e.encodeDotInKeys==`boolean`?e.encodeDotInKeys:w.encodeDotInKeys,encoder:typeof e.encoder==`function`?e.encoder:w.encoder,encodeValuesOnly:typeof e.encodeValuesOnly==`boolean`?e.encodeValuesOnly:w.encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:typeof e.serializeDate==`function`?e.serializeDate:w.serializeDate,skipNulls:typeof e.skipNulls==`boolean`?e.skipNulls:w.skipNulls,sort:typeof e.sort==`function`?e.sort:null,strictNullHandling:typeof e.strictNullHandling==`boolean`?e.strictNullHandling:w.strictNullHandling}}function Ve(e,t={}){let n=e,r=Be(t),i,a;typeof r.filter==`function`?(a=r.filter,n=a(``,n)):S(r.filter)&&(a=r.filter,i=a);let o=[];if(typeof n!=`object`||!n)return``;let s=Pe[r.arrayFormat],c=s===`comma`&&r.commaRoundTrip;i||=Object.keys(n),r.sort&&i.sort(r.sort);let l=new WeakMap;for(let e=0;e<i.length;++e){let t=i[e];r.skipNulls&&n[t]===null||Fe(o,ze(n[t],t,s,c,r.allowEmptyArrays,r.strictNullHandling,r.skipNulls,r.encodeDotInKeys,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,l))}let u=o.join(r.delimiter),d=r.addQueryPrefix===!0?`?`:``;return r.charsetSentinel&&(r.charset===`iso-8859-1`?d+=`utf8=%26%2310003%3B&`:d+=`utf8=%E2%9C%93&`),u.length>0?d+u:``}function He(e){return Ve(e,{arrayFormat:`brackets`})}function Ue(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}var We;function Ge(e){let t;return(We??=(t=new globalThis.TextEncoder,t.encode.bind(t)))(e)}var Ke;function qe(e){let t;return(Ke??=(t=new globalThis.TextDecoder,t.decode.bind(t)))(e)}var T,E,Je=class{constructor(){T.set(this,void 0),E.set(this,void 0),e(this,T,new Uint8Array,`f`),e(this,E,null,`f`)}decode(n){if(n==null)return[];let r=n instanceof ArrayBuffer?new Uint8Array(n):typeof n==`string`?Ge(n):n;e(this,T,Ue([t(this,T,`f`),r]),`f`);let i=[],a;for(;(a=Ye(t(this,T,`f`),t(this,E,`f`)))!=null;){if(a.carriage&&t(this,E,`f`)==null){e(this,E,a.index,`f`);continue}if(t(this,E,`f`)!=null&&(a.index!==t(this,E,`f`)+1||a.carriage)){i.push(qe(t(this,T,`f`).subarray(0,t(this,E,`f`)-1))),e(this,T,t(this,T,`f`).subarray(t(this,E,`f`)),`f`),e(this,E,null,`f`);continue}let n=t(this,E,`f`)===null?a.preceding:a.preceding-1,r=qe(t(this,T,`f`).subarray(0,n));i.push(r),e(this,T,t(this,T,`f`).subarray(a.index),`f`),e(this,E,null,`f`)}return i}flush(){return t(this,T,`f`).length?this.decode(`
|
|
1
|
+
function e(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}function t(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}var n=function(){let{crypto:e}=globalThis;if(e?.randomUUID)return n=e.randomUUID.bind(e),e.randomUUID();let t=new Uint8Array(1),r=e?()=>e.getRandomValues(t)[0]:()=>Math.random()*255&255;return`10000000-1000-4000-8000-100000000000`.replace(/[018]/g,e=>(e^r()&15>>e/4).toString(16))};function r(e){return typeof e==`object`&&!!e&&(`name`in e&&e.name===`AbortError`||`message`in e&&String(e.message).includes(`FetchRequestCanceledException`))}var i=e=>{if(e instanceof Error)return e;if(typeof e==`object`&&e){try{if(Object.prototype.toString.call(e)===`[object Error]`){let t=Error(e.message,e.cause?{cause:e.cause}:{});return e.stack&&(t.stack=e.stack),e.cause&&!t.cause&&(t.cause=e.cause),e.name&&(t.name=e.name),t}}catch{}try{return Error(JSON.stringify(e))}catch{}}return Error(e)},a=class extends Error{},o=class e extends a{constructor(t,n,r,i){super(`${e.makeMessage(t,n,r)}`),this.status=t,this.headers=i,this.requestID=i?.get(`x-request-id`),this.error=n;let a=n;this.code=a?.code,this.param=a?.param,this.type=a?.type}static makeMessage(e,t,n){let r=t?.message?typeof t.message==`string`?t.message:JSON.stringify(t.message):t?JSON.stringify(t):n;return e&&r?`${e} ${r}`:e?`${e} status code (no body)`:r||`(no status code or body)`}static generate(t,n,r,a){if(!t||!a)return new c({message:r,cause:i(n)});let o=n?.error;return t===400?new u(t,o,r,a):t===401?new d(t,o,r,a):t===403?new f(t,o,r,a):t===404?new p(t,o,r,a):t===409?new m(t,o,r,a):t===422?new h(t,o,r,a):t===429?new g(t,o,r,a):t>=500?new _(t,o,r,a):new e(t,o,r,a)}},s=class extends o{constructor({message:e}={}){super(void 0,void 0,e||`Request was aborted.`,void 0)}},c=class extends o{constructor({message:e,cause:t}){super(void 0,void 0,e||`Connection error.`,void 0),t&&(this.cause=t)}},l=class extends c{constructor({message:e}={}){super({message:e??`Request timed out.`})}},u=class extends o{},d=class extends o{},f=class extends o{},p=class extends o{},m=class extends o{},h=class extends o{},g=class extends o{},_=class extends o{},v=class extends a{constructor(){super(`Could not parse response content as the length limit was reached`)}},y=class extends a{constructor(){super(`Could not parse response content as the request was rejected by the content filter`)}},b=class extends Error{constructor(e){super(e)}},x=class extends o{constructor(e,t,n){let r=`OAuth2 authentication error`,i;if(t&&typeof t==`object`){let e=t;i=e.error;let n=e.error_description;n&&typeof n==`string`?r=n:i&&(r=i)}super(e,t,r,n),this.error_code=i}},ee=class extends a{constructor(e,t,n){super(e),this.provider=t,this.cause=n}},te=/^[a-z][a-z0-9+.-]*:/i,ne=e=>te.test(e),S=e=>(S=Array.isArray,S(e)),re=S;function ie(e){return typeof e==`object`?e??{}:{}}function ae(e){if(!e)return!0;for(let t in e)return!1;return!0}function oe(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function se(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ce=(e,t)=>{if(typeof t!=`number`||!Number.isInteger(t))throw new a(`${e} must be an integer`);if(t<0)throw new a(`${e} must be a positive integer`);return t},le=e=>{try{return JSON.parse(e)}catch{return}},ue=e=>new Promise(t=>setTimeout(t,e)),de=`6.44.0`,fe=()=>typeof window<`u`&&window.document!==void 0&&typeof navigator<`u`;function pe(){return typeof Deno<`u`&&Deno.build!=null?`deno`:typeof EdgeRuntime<`u`?`edge`:Object.prototype.toString.call(globalThis.process===void 0?0:globalThis.process)===`[object process]`?`node`:`unknown`}var me=()=>{let e=pe();if(e===`deno`)return{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":de,"X-Stainless-OS":_e(Deno.build.os),"X-Stainless-Arch":ge(Deno.build.arch),"X-Stainless-Runtime":`deno`,"X-Stainless-Runtime-Version":typeof Deno.version==`string`?Deno.version:Deno.version?.deno??`unknown`};if(typeof EdgeRuntime<`u`)return{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":de,"X-Stainless-OS":`Unknown`,"X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":`edge`,"X-Stainless-Runtime-Version":globalThis.process.version};if(e===`node`)return{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":de,"X-Stainless-OS":_e(globalThis.process.platform??`unknown`),"X-Stainless-Arch":ge(globalThis.process.arch??`unknown`),"X-Stainless-Runtime":`node`,"X-Stainless-Runtime-Version":globalThis.process.version??`unknown`};let t=he();return t?{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":de,"X-Stainless-OS":`Unknown`,"X-Stainless-Arch":`unknown`,"X-Stainless-Runtime":`browser:${t.browser}`,"X-Stainless-Runtime-Version":t.version}:{"X-Stainless-Lang":`js`,"X-Stainless-Package-Version":de,"X-Stainless-OS":`Unknown`,"X-Stainless-Arch":`unknown`,"X-Stainless-Runtime":`unknown`,"X-Stainless-Runtime-Version":`unknown`}};function he(){if(typeof navigator>`u`||!navigator)return null;for(let{key:e,pattern:t}of[{key:`edge`,pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`ie`,pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`ie`,pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`chrome`,pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`firefox`,pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:`safari`,pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}]){let n=t.exec(navigator.userAgent);if(n)return{browser:e,version:`${n[1]||0}.${n[2]||0}.${n[3]||0}`}}return null}var ge=e=>e===`x32`?`x32`:e===`x86_64`||e===`x64`?`x64`:e===`arm`?`arm`:e===`aarch64`||e===`arm64`?`arm64`:e?`other:${e}`:`unknown`,_e=e=>(e=e.toLowerCase(),e.includes(`ios`)?`iOS`:e===`android`?`Android`:e===`darwin`?`MacOS`:e===`win32`?`Windows`:e===`freebsd`?`FreeBSD`:e===`openbsd`?`OpenBSD`:e===`linux`?`Linux`:e?`Other:${e}`:`Unknown`),ve,ye=()=>ve??=me();function be(){if(typeof fetch<`u`)return fetch;throw Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function xe(...e){let t=globalThis.ReadableStream;if(t===void 0)throw Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...e)}function Se(e){let t=Symbol.asyncIterator in e?e[Symbol.asyncIterator]():e[Symbol.iterator]();return xe({start(){},async pull(e){let{done:n,value:r}=await t.next();n?e.close():e.enqueue(r)},async cancel(){await t.return?.()}})}function Ce(e){if(e[Symbol.asyncIterator])return e;let t=e.getReader();return{async next(){try{let e=await t.read();return e?.done&&t.releaseLock(),e}catch(e){throw t.releaseLock(),e}},async return(){let e=t.cancel();return t.releaseLock(),await e,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function we(e){if(typeof e!=`object`||!e)return;if(e[Symbol.asyncIterator]){await e[Symbol.asyncIterator]().return?.();return}let t=e.getReader(),n=t.cancel();t.releaseLock(),await n}var Te=({headers:e,body:t})=>({bodyHeaders:{"content-type":`application/json`},body:JSON.stringify(t)}),Ee=`RFC3986`,De=e=>String(e),Oe={RFC1738:e=>String(e).replace(/%20/g,`+`),RFC3986:De},ke=(e,t)=>(ke=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),ke(e,t)),C=(()=>{let e=[];for(let t=0;t<256;++t)e.push(`%`+((t<16?`0`:``)+t.toString(16)).toUpperCase());return e})(),Ae=1024,je=(e,t,n,r,i)=>{if(e.length===0)return e;let a=e;if(typeof e==`symbol`?a=Symbol.prototype.toString.call(e):typeof e!=`string`&&(a=String(e)),n===`iso-8859-1`)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return`%26%23`+parseInt(e.slice(2),16)+`%3B`});let o=``;for(let e=0;e<a.length;e+=Ae){let t=a.length>=Ae?a.slice(e,e+Ae):a,n=[];for(let e=0;e<t.length;++e){let r=t.charCodeAt(e);if(r===45||r===46||r===95||r===126||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||i===`RFC1738`&&(r===40||r===41)){n[n.length]=t.charAt(e);continue}if(r<128){n[n.length]=C[r];continue}if(r<2048){n[n.length]=C[192|r>>6]+C[128|r&63];continue}if(r<55296||r>=57344){n[n.length]=C[224|r>>12]+C[128|r>>6&63]+C[128|r&63];continue}e+=1,r=65536+((r&1023)<<10|t.charCodeAt(e)&1023),n[n.length]=C[240|r>>18]+C[128|r>>12&63]+C[128|r>>6&63]+C[128|r&63]}o+=n.join(``)}return o};function Me(e){return!e||typeof e!=`object`?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))}function Ne(e,t){if(S(e)){let n=[];for(let r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)}var Pe={brackets(e){return String(e)+`[]`},comma:`comma`,indices(e,t){return String(e)+`[`+t+`]`},repeat(e){return String(e)}},Fe=function(e,t){Array.prototype.push.apply(e,S(t)?t:[t])},Ie,w={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:`indices`,charset:`utf-8`,charsetSentinel:!1,delimiter:`&`,encode:!0,encodeDotInKeys:!1,encoder:je,encodeValuesOnly:!1,format:Ee,formatter:De,indices:!1,serializeDate(e){return(Ie??=Function.prototype.call.bind(Date.prototype.toISOString))(e)},skipNulls:!1,strictNullHandling:!1};function Le(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`symbol`||typeof e==`bigint`}var Re={};function ze(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let v=e,y=_,b=0,x=!1;for(;(y=y.get(Re))!==void 0&&!x;){let t=y.get(e);if(b+=1,t!==void 0){if(t===b)throw RangeError(`Cyclic object value`);x=!0}y.get(Re)===void 0&&(b=0)}if(typeof l==`function`?v=l(t,v):v instanceof Date?v=f?.(v):n===`comma`&&S(v)&&(v=Ne(v,function(e){return e instanceof Date?f?.(e):e})),v===null){if(a)return c&&!h?c(t,w.encoder,g,`key`,p):t;v=``}if(Le(v)||Me(v)){if(c){let e=h?t:c(t,w.encoder,g,`key`,p);return[m?.(e)+`=`+m?.(c(v,w.encoder,g,`value`,p))]}return[m?.(t)+`=`+m?.(String(v))]}let ee=[];if(v===void 0)return ee;let te;if(n===`comma`&&S(v))h&&c&&(v=Ne(v,c)),te=[{value:v.length>0?v.join(`,`)||null:void 0}];else if(S(l))te=l;else{let e=Object.keys(v);te=u?e.sort(u):e}let ne=s?String(t).replace(/\./g,`%2E`):String(t),re=r&&S(v)&&v.length===1?ne+`[]`:ne;if(i&&S(v)&&v.length===0)return re+`[]`;for(let t=0;t<te.length;++t){let y=te[t],x=typeof y==`object`&&y.value!==void 0?y.value:v[y];if(o&&x===null)continue;let ne=d&&s?y.replace(/\./g,`%2E`):y,ie=S(v)?typeof n==`function`?n(re,ne):re:re+(d?`.`+ne:`[`+ne+`]`);_.set(e,b);let ae=new WeakMap;ae.set(Re,_),Fe(ee,ze(x,ie,n,r,i,a,o,s,n===`comma`&&h&&S(v)?null:c,l,u,d,f,p,m,h,g,ae))}return ee}function Be(e=w){if(e.allowEmptyArrays!==void 0&&typeof e.allowEmptyArrays!=`boolean`)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(e.encodeDotInKeys!==void 0&&typeof e.encodeDotInKeys!=`boolean`)throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&e.encoder!==void 0&&typeof e.encoder!=`function`)throw TypeError(`Encoder has to be a function.`);let t=e.charset||w.charset;if(e.charset!==void 0&&e.charset!==`utf-8`&&e.charset!==`iso-8859-1`)throw TypeError(`The charset option must be either utf-8, iso-8859-1, or undefined`);let n=Ee;if(e.format!==void 0){if(!ke(Oe,e.format))throw TypeError(`Unknown format option provided.`);n=e.format}let r=Oe[n],i=w.filter;(typeof e.filter==`function`||S(e.filter))&&(i=e.filter);let a;if(a=e.arrayFormat&&e.arrayFormat in Pe?e.arrayFormat:`indices`in e?e.indices?`indices`:`repeat`:w.arrayFormat,`commaRoundTrip`in e&&typeof e.commaRoundTrip!=`boolean`)throw TypeError("`commaRoundTrip` must be a boolean, or absent");let o=e.allowDots===void 0?e.encodeDotInKeys?!0:w.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix==`boolean`?e.addQueryPrefix:w.addQueryPrefix,allowDots:o,allowEmptyArrays:typeof e.allowEmptyArrays==`boolean`?!!e.allowEmptyArrays:w.allowEmptyArrays,arrayFormat:a,charset:t,charsetSentinel:typeof e.charsetSentinel==`boolean`?e.charsetSentinel:w.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:e.delimiter===void 0?w.delimiter:e.delimiter,encode:typeof e.encode==`boolean`?e.encode:w.encode,encodeDotInKeys:typeof e.encodeDotInKeys==`boolean`?e.encodeDotInKeys:w.encodeDotInKeys,encoder:typeof e.encoder==`function`?e.encoder:w.encoder,encodeValuesOnly:typeof e.encodeValuesOnly==`boolean`?e.encodeValuesOnly:w.encodeValuesOnly,filter:i,format:n,formatter:r,serializeDate:typeof e.serializeDate==`function`?e.serializeDate:w.serializeDate,skipNulls:typeof e.skipNulls==`boolean`?e.skipNulls:w.skipNulls,sort:typeof e.sort==`function`?e.sort:null,strictNullHandling:typeof e.strictNullHandling==`boolean`?e.strictNullHandling:w.strictNullHandling}}function Ve(e,t={}){let n=e,r=Be(t),i,a;typeof r.filter==`function`?(a=r.filter,n=a(``,n)):S(r.filter)&&(a=r.filter,i=a);let o=[];if(typeof n!=`object`||!n)return``;let s=Pe[r.arrayFormat],c=s===`comma`&&r.commaRoundTrip;i||=Object.keys(n),r.sort&&i.sort(r.sort);let l=new WeakMap;for(let e=0;e<i.length;++e){let t=i[e];r.skipNulls&&n[t]===null||Fe(o,ze(n[t],t,s,c,r.allowEmptyArrays,r.strictNullHandling,r.skipNulls,r.encodeDotInKeys,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,l))}let u=o.join(r.delimiter),d=r.addQueryPrefix===!0?`?`:``;return r.charsetSentinel&&(r.charset===`iso-8859-1`?d+=`utf8=%26%2310003%3B&`:d+=`utf8=%E2%9C%93&`),u.length>0?d+u:``}function He(e){return Ve(e,{arrayFormat:`brackets`})}function Ue(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}var We;function Ge(e){let t;return(We??=(t=new globalThis.TextEncoder,t.encode.bind(t)))(e)}var Ke;function qe(e){let t;return(Ke??=(t=new globalThis.TextDecoder,t.decode.bind(t)))(e)}var T,E,Je=class{constructor(){T.set(this,void 0),E.set(this,void 0),e(this,T,new Uint8Array,`f`),e(this,E,null,`f`)}decode(n){if(n==null)return[];let r=n instanceof ArrayBuffer?new Uint8Array(n):typeof n==`string`?Ge(n):n;e(this,T,Ue([t(this,T,`f`),r]),`f`);let i=[],a;for(;(a=Ye(t(this,T,`f`),t(this,E,`f`)))!=null;){if(a.carriage&&t(this,E,`f`)==null){e(this,E,a.index,`f`);continue}if(t(this,E,`f`)!=null&&(a.index!==t(this,E,`f`)+1||a.carriage)){i.push(qe(t(this,T,`f`).subarray(0,t(this,E,`f`)-1))),e(this,T,t(this,T,`f`).subarray(t(this,E,`f`)),`f`),e(this,E,null,`f`);continue}let n=t(this,E,`f`)===null?a.preceding:a.preceding-1,r=qe(t(this,T,`f`).subarray(0,n));i.push(r),e(this,T,t(this,T,`f`).subarray(a.index),`f`),e(this,E,null,`f`)}return i}flush(){return t(this,T,`f`).length?this.decode(`
|
|
2
2
|
`):[]}};T=new WeakMap,E=new WeakMap,Je.NEWLINE_CHARS=new Set([`
|
|
3
3
|
`,`\r`]),Je.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function Ye(e,t){for(let n=t??0;n<e.length;n++){if(e[n]===10)return{preceding:n,index:n+1,carriage:!1};if(e[n]===13)return{preceding:n,index:n+1,carriage:!0}}return null}function Xe(e){for(let t=0;t<e.length-1;t++){if(e[t]===10&&e[t+1]===10||e[t]===13&&e[t+1]===13)return t+2;if(e[t]===13&&e[t+1]===10&&t+3<e.length&&e[t+2]===13&&e[t+3]===10)return t+4}return-1}var Ze={off:0,error:200,warn:300,info:400,debug:500},Qe=(e,t,n)=>{if(e){if(oe(Ze,e))return e;D(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(Ze))}`)}};function $e(){}function et(e,t,n){return!t||Ze[e]>Ze[n]?$e:t[e].bind(t)}var tt={error:$e,warn:$e,info:$e,debug:$e},nt=new WeakMap;function D(e){let t=e.logger,n=e.logLevel??`off`;if(!t)return tt;let r=nt.get(t);if(r&&r[0]===n)return r[1];let i={error:et(`error`,t,n),warn:et(`warn`,t,n),info:et(`info`,t,n),debug:et(`debug`,t,n)};return nt.set(t,[n,i]),i}var rt=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([e,t])=>[e,e.toLowerCase()===`authorization`||e.toLowerCase()===`api-key`||e.toLowerCase()===`x-api-key`||e.toLowerCase()===`cookie`||e.toLowerCase()===`set-cookie`?`***`:t])),`retryOfRequestLogID`in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e),it,at=class n{constructor(t,n,r){this.iterator=t,it.set(this,void 0),this.controller=n,e(this,it,r,`f`)}static fromSSEResponse(e,t,i,s){let c=!1,l=i?D(i):console;async function*u(){if(c)throw new a("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");c=!0;let n=!1;try{for await(let r of ot(e,t))if(!n){if(r.data.startsWith(`[DONE]`)){n=!0;continue}if(r.event===null||!r.event.startsWith(`thread.`)){let t;try{t=JSON.parse(r.data)}catch(e){throw l.error(`Could not parse message into JSON:`,r.data),l.error(`From chunk:`,r.raw),e}if(t&&t.error)throw new o(void 0,t.error,void 0,e.headers);yield s?{event:r.event,data:t}:t}else{let e;try{e=JSON.parse(r.data)}catch(e){throw console.error(`Could not parse message into JSON:`,r.data),console.error(`From chunk:`,r.raw),e}if(r.event==`error`)throw new o(void 0,e.error,e.message,void 0);yield{event:r.event,data:e}}}n=!0}catch(e){if(r(e))return;throw e}finally{n||t.abort()}}return new n(u,t,i)}static fromReadableStream(e,t,i){let o=!1;async function*s(){let t=new Je,n=Ce(e);for await(let e of n)for(let n of t.decode(e))yield n;for(let e of t.flush())yield e}async function*c(){if(o)throw new a("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let e=!1;try{for await(let t of s())e||t&&(yield JSON.parse(t));e=!0}catch(e){if(r(e))return;throw e}finally{e||t.abort()}}return new n(c,t,i)}[(it=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],r=[],i=this.iterator(),a=t=>({next:()=>{if(t.length===0){let t=i.next();e.push(t),r.push(t)}return t.shift()}});return[new n(()=>a(e),this.controller,t(this,it,`f`)),new n(()=>a(r),this.controller,t(this,it,`f`))]}toReadableStream(){let e=this,t;return xe({async start(){t=e[Symbol.asyncIterator]()},async pull(e){try{let{value:n,done:r}=await t.next();if(r)return e.close();let i=Ge(JSON.stringify(n)+`
|
|
4
4
|
`);e.enqueue(i)}catch(t){e.error(t)}},async cancel(){await t.return?.()}})}};async function*ot(e,t){if(!e.body)throw t.abort(),globalThis.navigator!==void 0&&globalThis.navigator.product===`ReactNative`?new a(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`):new a(`Attempted to iterate over a response with no body`);let n=new ct,r=new Je,i=Ce(e.body);for await(let e of st(i))for(let t of r.decode(e)){let e=n.decode(t);e&&(yield e)}for(let e of r.flush()){let t=n.decode(e);t&&(yield t)}}async function*st(e){let t=new Uint8Array;for await(let n of e){if(n==null)continue;let e=n instanceof ArrayBuffer?new Uint8Array(n):typeof n==`string`?Ge(n):n,r=new Uint8Array(t.length+e.length);r.set(t),r.set(e,t.length),t=r;let i;for(;(i=Xe(t))!==-1;)yield t.slice(0,i),t=t.slice(i)}t.length>0&&(yield t)}var ct=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith(`\r`)&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function*e(e,t){let n=e.index??0;if(e.id&&(t.set(n,{id:e.id,name:e.function?.name||``,arguments:``}),yield{type:`tool_use_start`,id:e.id,name:e.function?.name||``}),e.function?.name&&t.has(n)){let r=t.get(n);r.name||=e.function.name}if(e.function?.arguments){let r=t.get(n);r&&(r.arguments+=e.function.arguments,yield{type:`tool_input_delta`,json:e.function.arguments})}}function*t(e,t){for(let[e,n]of t){let r={};try{n.arguments&&(r=JSON.parse(n.arguments))}catch{}yield{type:`tool_use_end`,id:n.id,input:r},t.delete(e)}yield{type:`message_meta`,stopReason:e}}function*n(n,r){n.usage&&(yield{type:`message_meta`,inputTokens:n.usage.prompt_tokens,outputTokens:n.usage.completion_tokens,stopReason:``});let i=n.choices?.[0];if(!i)return;let a=i.delta;if(a){if(a.content&&(yield{type:`text_delta`,text:a.content}),a.tool_calls)for(let t of a.tool_calls)yield*e(t,r);i.finish_reason&&(yield*t(i.finish_reason,r))}}var r=class{client;apiKey;baseURL;initialized=!1;constructor(e,t){this.apiKey=e,this.baseURL=t?.baseURL}async ensureClient(){if(this.initialized)return;let e;try{let t=await Promise.resolve().then(()=>require("./openai-
|
|
1
|
+
function*e(e,t){let n=e.index??0;if(e.id&&(t.set(n,{id:e.id,name:e.function?.name||``,arguments:``}),yield{type:`tool_use_start`,id:e.id,name:e.function?.name||``}),e.function?.name&&t.has(n)){let r=t.get(n);r.name||=e.function.name}if(e.function?.arguments){let r=t.get(n);r&&(r.arguments+=e.function.arguments,yield{type:`tool_input_delta`,json:e.function.arguments})}}function*t(e,t){for(let[e,n]of t){let r={};try{n.arguments&&(r=JSON.parse(n.arguments))}catch{}yield{type:`tool_use_end`,id:n.id,input:r},t.delete(e)}yield{type:`message_meta`,stopReason:e}}function*n(n,r){n.usage&&(yield{type:`message_meta`,inputTokens:n.usage.prompt_tokens,outputTokens:n.usage.completion_tokens,stopReason:``});let i=n.choices?.[0];if(!i)return;let a=i.delta;if(a){if(a.content&&(yield{type:`text_delta`,text:a.content}),a.tool_calls)for(let t of a.tool_calls)yield*e(t,r);i.finish_reason&&(yield*t(i.finish_reason,r))}}var r=class{client;apiKey;baseURL;initialized=!1;constructor(e,t){this.apiKey=e,this.baseURL=t?.baseURL}async ensureClient(){if(this.initialized)return;let e;try{let t=await Promise.resolve().then(()=>require("./openai-B4kAJTSD.cjs"));e=t.default||t.OpenAI||t}catch{throw Error(`openai is required for the OpenAI provider. Install it with: npm install openai`)}let t={apiKey:this.apiKey};this.baseURL&&(t.baseURL=this.baseURL),this.client=new e(t),this.initialized=!0}async createStream(e){await this.ensureClient();let{messages:t}=this.formatMessages(e.messages,e.system);return this.client.chat.completions.create({model:e.model,max_completion_tokens:e.maxTokens,tools:this.formatTools(e.tools),messages:t,stream:!0,stream_options:{include_usage:!0}})}async*parseStreamEvents(e){let t=new Map;for await(let r of e)yield*n(r,t)}formatTools(e){return e.map(e=>({type:`function`,function:{name:e.name,description:e.description,parameters:e.parameters}}))}formatMessages(e,t){let n=[{role:`system`,content:t}];for(let t of e)if(t.role===`user`)n.push({role:`user`,content:typeof t.content==`string`?t.content:JSON.stringify(t.content)});else if(t.role===`assistant`)if(typeof t.content==`string`)n.push({role:`assistant`,content:t.content});else{let e=t.content,r=e.filter(e=>e.type===`text`).map(e=>e.text).join(``),i=e.filter(e=>e.type===`tool_use`).map(e=>({id:e.id,type:`function`,function:{name:e.name,arguments:JSON.stringify(e.input||{})}})),a={role:`assistant`};r&&(a.content=r),i.length>0&&(a.tool_calls=i),n.push(a)}else t.role===`tool`?n.push(t):t.role===`tool_result`&&n.push({role:`user`,content:typeof t.content==`string`?t.content:JSON.stringify(t.content)});return{messages:n}}formatToolResults(e){return e.map(e=>({role:`tool`,tool_call_id:e.toolUseId,content:e.content}))}shouldContinue(e){return e===`tool_calls`}formatError(e){if(!e||!(e instanceof Error))return`Something went wrong. Please try again.`;let t=e.message||``,n=e;return n.status===429?`Too many requests. Please wait a moment and try again.`:n.status===401?`Authentication failed. Please check your API key configuration.`:n.status===503||n.status===502?`The AI service is temporarily unavailable. Please try again in a moment.`:n.status===400?`There was a problem with the request. Please try again.`:t.startsWith(`{`)||t.startsWith(`Error: {`)?`The AI service encountered an error. Please try again.`:t}};exports.OpenAIProvider=r;
|
|
@@ -119,7 +119,7 @@ var ce = (e, t) => {
|
|
|
119
119
|
} catch {
|
|
120
120
|
return;
|
|
121
121
|
}
|
|
122
|
-
}, ue = (e) => new Promise((t) => setTimeout(t, e)), de = "6.
|
|
122
|
+
}, ue = (e) => new Promise((t) => setTimeout(t, e)), de = "6.44.0", fe = () => typeof window < "u" && window.document !== void 0 && typeof navigator < "u";
|
|
123
123
|
function pe() {
|
|
124
124
|
return typeof Deno < "u" && Deno.build != null ? "deno" : typeof EdgeRuntime < "u" ? "edge" : Object.prototype.toString.call(globalThis.process === void 0 ? 0 : globalThis.process) === "[object process]" ? "node" : "unknown";
|
|
125
125
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SemanticLayerCompiler } from '../../server/compiler.js';
|
|
2
|
+
import { MCPOptions } from '../utils.js';
|
|
3
|
+
import { HttpPort, McpHttpPort } from './http-port.js';
|
|
4
|
+
import { BaseSecurityContextThunk } from './security-context.js';
|
|
5
|
+
import { RestHandlers } from './rest-handlers.js';
|
|
6
|
+
export type { BaseSecurityContextThunk } from './security-context.js';
|
|
7
|
+
export interface CubeHttpHandlerOptions {
|
|
8
|
+
/** The semantic layer the handlers validate and execute against. */
|
|
9
|
+
semanticLayer: SemanticLayerCompiler;
|
|
10
|
+
/** Called in the REST `/load` catch-all 500 path with the thrown error (e.g. for logging). */
|
|
11
|
+
onError: (error: unknown) => void;
|
|
12
|
+
/**
|
|
13
|
+
* MCP endpoint config. Resolved once into the MCP POST handler. When omitted,
|
|
14
|
+
* MCP defaults are used; the adapter decides whether to route the MCP path.
|
|
15
|
+
*/
|
|
16
|
+
mcp?: MCPOptions;
|
|
17
|
+
}
|
|
18
|
+
export interface CubeHttpHandler extends RestHandlers {
|
|
19
|
+
handleLoadGet<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
20
|
+
handleLoadPost<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
21
|
+
handleMcpPost<TRes>(port: McpHttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Build all HTTP handlers once. Each REST entry point owns its own request
|
|
25
|
+
* extraction, then funnels into a shared validate/execute/format tail.
|
|
26
|
+
*/
|
|
27
|
+
export declare function createCubeHttpHandler(options: CubeHttpHandlerOptions): CubeHttpHandler;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework port for the HTTP handler core.
|
|
3
|
+
*
|
|
4
|
+
* Captures the minimal transport surface a handler needs, generically over the
|
|
5
|
+
* framework's response type `TRes` so the same core works for adapters that
|
|
6
|
+
* mutate a response object (Express) and adapters that return a `Response`
|
|
7
|
+
* (Hono/Next.js). Implementations are constructed per request by each adapter.
|
|
8
|
+
*
|
|
9
|
+
* This interface is public — third parties implement it to build adapters for
|
|
10
|
+
* other frameworks. Add new capabilities as optional members or via a separate
|
|
11
|
+
* extension interface; a new required member is a breaking change.
|
|
12
|
+
*/
|
|
13
|
+
export interface HttpPort<TRes> {
|
|
14
|
+
/** Read a request header by (case-insensitive) name. Synchronous. */
|
|
15
|
+
getHeader(name: string): string | undefined;
|
|
16
|
+
/** Resolve the parsed request body. Async (Express resolves `req.body`; others await `.json()`). */
|
|
17
|
+
getBody(): Promise<unknown>;
|
|
18
|
+
/** Read a raw query-string value by name (used by GET). */
|
|
19
|
+
getQueryParam(name: string): string | undefined;
|
|
20
|
+
/** Send a response with the given status and JSON body; returns the framework's response value. */
|
|
21
|
+
send(status: number, body: unknown): TRes;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Extension of {@link HttpPort} for the MCP POST handler, which needs to set
|
|
25
|
+
* response headers (WWW-Authenticate, MCP-Session-Id), emit a single-event SSE
|
|
26
|
+
* response, and send an empty-body acknowledgement (202 for notifications).
|
|
27
|
+
*
|
|
28
|
+
* Kept separate from the minimal REST port so third-party adapters only
|
|
29
|
+
* implement these when they wire up MCP. New required members on this interface
|
|
30
|
+
* are still a breaking change for MCP-capable adapters.
|
|
31
|
+
*/
|
|
32
|
+
export interface McpHttpPort<TRes> extends HttpPort<TRes> {
|
|
33
|
+
/** Set a response header. Must be called before `send`/`sendSse`/`sendEmpty`. */
|
|
34
|
+
setHeader(name: string, value: string): void;
|
|
35
|
+
/** Send a single-event SSE response (status 200): write the pre-serialized body, then end. */
|
|
36
|
+
sendSse(status: number, body: string): TRes;
|
|
37
|
+
/** Send an empty-body response (no JSON), e.g. a 202 notification acknowledgement. */
|
|
38
|
+
sendEmpty(status: number): TRes;
|
|
39
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public entry point for the framework-agnostic HTTP handler core.
|
|
3
|
+
*
|
|
4
|
+
* Third parties can build adapters for other frameworks by implementing
|
|
5
|
+
* {@link HttpPort} (REST) / {@link McpHttpPort} (MCP) and driving them with
|
|
6
|
+
* {@link createCubeHttpHandler}.
|
|
7
|
+
*/
|
|
8
|
+
export type { HttpPort, McpHttpPort } from './http-port.js';
|
|
9
|
+
export { withLocaleFromHeaders, resolveSecurityContext, type HeaderReader, type BaseSecurityContextThunk } from './security-context.js';
|
|
10
|
+
export { createCubeHttpHandler, type CubeHttpHandler, type CubeHttpHandlerOptions } from './cube-http-handler.js';
|
|
11
|
+
export type { RestHandlers } from './rest-handlers.js';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SemanticLayerCompiler } from '../../server/compiler.js';
|
|
2
|
+
import { MCPOptions } from '../utils.js';
|
|
3
|
+
import { McpHttpPort } from './http-port.js';
|
|
4
|
+
import { BaseSecurityContextThunk } from './security-context.js';
|
|
5
|
+
export interface McpPostHandler {
|
|
6
|
+
handleMcpPost<TRes>(port: McpHttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Build the MCP POST handler once. Resolves the static resources/prompts/
|
|
10
|
+
* instructions and app config from {@link MCPOptions} at setup time, mirroring
|
|
11
|
+
* the per-request plumbing the adapters used to do inline.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createMcpPostHandler(semanticLayer: SemanticLayerCompiler, mcp: MCPOptions): McpPostHandler;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SemanticLayerCompiler } from '../../server/compiler.js';
|
|
2
|
+
import { HttpPort } from './http-port.js';
|
|
3
|
+
import { BaseSecurityContextThunk } from './security-context.js';
|
|
4
|
+
/** REST handlers keyed by endpoint; each closes over the shared semantic layer. */
|
|
5
|
+
export interface RestHandlers {
|
|
6
|
+
handleMetaGet<TRes>(port: HttpPort<TRes>): TRes;
|
|
7
|
+
handleSqlGet<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
8
|
+
handleSqlPost<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
9
|
+
handleDryRunGet<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
10
|
+
handleDryRunPost<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
11
|
+
handleBatchPost<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
12
|
+
handleExplainPost<TRes>(port: HttpPort<TRes>, getBaseSecurityContext: BaseSecurityContextThunk): Promise<TRes>;
|
|
13
|
+
}
|
|
14
|
+
export declare function createRestHandlers(semanticLayer: SemanticLayerCompiler): RestHandlers;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SecurityContext } from '../../server/index.js';
|
|
2
|
+
/** Returns the base (pre-locale) security context for a request. */
|
|
3
|
+
export type BaseSecurityContextThunk = () => SecurityContext | Promise<SecurityContext>;
|
|
4
|
+
/** Reads a request header by (case-insensitive) name. */
|
|
5
|
+
export type HeaderReader = (name: string) => string | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Merge the request locale (from the `X-DC-Locale` header) into a base security
|
|
8
|
+
* context. Replaces the per-adapter `extractSecurityContextWithLocale` wrappers.
|
|
9
|
+
*/
|
|
10
|
+
export declare function withLocaleFromHeaders(base: SecurityContext, readHeader: HeaderReader): SecurityContext;
|
|
11
|
+
/**
|
|
12
|
+
* Resolve the base security context and merge the request locale in one step —
|
|
13
|
+
* the standard preamble for every authenticated core handler.
|
|
14
|
+
*/
|
|
15
|
+
export declare function resolveSecurityContext(getBaseSecurityContext: BaseSecurityContextThunk, readHeader: HeaderReader): Promise<SecurityContext>;
|
|
16
|
+
/** Strip CR/LF from a thrown value for single-line logging (log-injection guard). */
|
|
17
|
+
export declare function sanitizeForLog(error: unknown): string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { NextRequest } from 'next/server';
|
|
2
2
|
import { SemanticQuery, SecurityContext, DatabaseExecutor, DrizzleDatabase, Cube, CacheConfig, RLSSetupFn } from '../../server/index.js';
|
|
3
3
|
import { AgentConfig } from '../../server/agent/types.js';
|
|
4
|
+
import { SemanticLayerCompiler } from '../../server/compiler.js';
|
|
4
5
|
import { PostgresJsDatabase } from 'drizzle-orm/postgres-js';
|
|
5
6
|
import { MySql2Database } from 'drizzle-orm/mysql2';
|
|
6
7
|
import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
|
|
@@ -100,6 +101,15 @@ export interface NextAdapterOptions {
|
|
|
100
101
|
* to configure RLS (e.g., set JWT claims and switch Postgres roles), then runs the query.
|
|
101
102
|
*/
|
|
102
103
|
rlsSetup?: RLSSetupFn;
|
|
104
|
+
/**
|
|
105
|
+
* Pre-built semantic layer to reuse across handlers.
|
|
106
|
+
* When provided, the adapter reuses this compiler instead of constructing a
|
|
107
|
+
* new one (and skips cube registration — register cubes on it yourself).
|
|
108
|
+
* `createCubeHandlers` sets this internally so every handler it returns shares
|
|
109
|
+
* one compiler, keeping metadata/result caches consistent. Mirrors the Hono
|
|
110
|
+
* adapter's `semanticLayer` option.
|
|
111
|
+
*/
|
|
112
|
+
semanticLayer?: SemanticLayerCompiler;
|
|
103
113
|
}
|
|
104
114
|
export interface RouteContext {
|
|
105
115
|
params?: Record<string, string | string[]>;
|
|
@@ -120,7 +130,7 @@ export interface CubeHandlers {
|
|
|
120
130
|
*/
|
|
121
131
|
export declare function createOptionsHandler(corsOptions: NextCorsOptions): RouteHandler;
|
|
122
132
|
/**
|
|
123
|
-
* Create load handler - Execute queries
|
|
133
|
+
* Create load handler - Execute queries (GET + POST via the core)
|
|
124
134
|
*/
|
|
125
135
|
export declare function createLoadHandler(options: NextAdapterOptions): RouteHandler;
|
|
126
136
|
/**
|
|
@@ -128,21 +138,19 @@ export declare function createLoadHandler(options: NextAdapterOptions): RouteHan
|
|
|
128
138
|
*/
|
|
129
139
|
export declare function createMetaHandler(options: NextAdapterOptions): RouteHandler;
|
|
130
140
|
/**
|
|
131
|
-
* Create SQL handler - Generate SQL without execution
|
|
141
|
+
* Create SQL handler - Generate SQL without execution (GET + POST via the core)
|
|
132
142
|
*/
|
|
133
143
|
export declare function createSqlHandler(options: NextAdapterOptions): RouteHandler;
|
|
134
144
|
/**
|
|
135
|
-
* Create dry-run handler - Validate queries without execution
|
|
145
|
+
* Create dry-run handler - Validate queries without execution (GET + POST via the core)
|
|
136
146
|
*/
|
|
137
147
|
export declare function createDryRunHandler(options: NextAdapterOptions): RouteHandler;
|
|
138
148
|
/**
|
|
139
|
-
* Create batch handler - Execute multiple queries in a single request
|
|
140
|
-
* Optimizes network overhead for dashboards with many portlets
|
|
149
|
+
* Create batch handler - Execute multiple queries in a single request (POST via the core)
|
|
141
150
|
*/
|
|
142
151
|
export declare function createBatchHandler(options: NextAdapterOptions): RouteHandler;
|
|
143
152
|
/**
|
|
144
|
-
* Create explain handler - Get execution plan for a query
|
|
145
|
-
* Returns normalized EXPLAIN output across PostgreSQL, MySQL, and SQLite
|
|
153
|
+
* Create explain handler - Get execution plan for a query (POST via the core)
|
|
146
154
|
*/
|
|
147
155
|
export declare function createExplainHandler(options: NextAdapterOptions): RouteHandler;
|
|
148
156
|
/**
|
|
@@ -164,13 +172,14 @@ export declare function createValidateHandler(options: NextAdapterOptions): Rout
|
|
|
164
172
|
export declare function createMcpLoadHandler(options: NextAdapterOptions): RouteHandler;
|
|
165
173
|
/**
|
|
166
174
|
* Create MCP Streamable HTTP handler (JSON-RPC 2.0 + optional SSE)
|
|
167
|
-
* Implements MCP 2025-11-25 spec
|
|
175
|
+
* Implements MCP 2025-11-25 spec. POST is dispatched via the core; the GET
|
|
176
|
+
* streaming connection and DELETE lifecycle stay inline (transport-bound).
|
|
168
177
|
*/
|
|
169
178
|
export declare function createMcpRpcHandler(options: NextAdapterOptions): RouteHandler;
|
|
170
179
|
/**
|
|
171
180
|
* Create agent chat handler - Agentic AI notebook chat
|
|
172
181
|
* Streams SSE events as the agent discovers data, executes queries,
|
|
173
|
-
* and creates visualizations.
|
|
182
|
+
* and creates visualizations. Inherently transport-bound, so it stays inline.
|
|
174
183
|
*/
|
|
175
184
|
export declare function createAgentChatHandler(options: NextAdapterOptions): RouteHandler;
|
|
176
185
|
/**
|
|
@@ -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;
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
import { ComponentType, LazyExoticComponent } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ChartType, ChartProps } from '../types.js';
|
|
3
3
|
export type LazyChartComponent = ComponentType<ChartProps>;
|
|
4
4
|
export declare const chartLoaderCache: Map<ChartType, LazyExoticComponent<LazyChartComponent>>;
|
|
5
5
|
export declare const failedChartTypes: Set<ChartType>;
|
|
6
6
|
export declare const customChartMap: Map<string, LazyExoticComponent<LazyChartComponent>>;
|
|
7
|
-
/**
|
|
8
|
-
* Maps chart types to their optional peer dependencies.
|
|
9
|
-
* Charts not listed here have no external dependencies (table, KPIs, markdown).
|
|
10
|
-
*/
|
|
11
|
-
export declare const chartDependencyMap: Partial<Record<BuiltInChartType, {
|
|
12
|
-
packageName: string;
|
|
13
|
-
installCommand: string;
|
|
14
|
-
}>>;
|
|
15
7
|
/**
|
|
16
8
|
* Creates a fallback component for an unknown/unregistered chart type.
|
|
17
9
|
*/
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { ChartTypeConfig, ChartConfigRegistry } from './chartConfigs.js';
|
|
2
2
|
/**
|
|
3
|
-
* Registry of all chart type configurations
|
|
3
|
+
* Registry of all chart type configurations (the eager / full / server source).
|
|
4
|
+
*
|
|
5
|
+
* Every built-in is composed from its `chartRegistry` entry's metadata (single
|
|
6
|
+
* source of truth) laid over its full config shape. Drop zones / display options
|
|
7
|
+
* stay here in full because the server agent reads them synchronously.
|
|
4
8
|
*/
|
|
5
9
|
export declare const chartConfigRegistry: ChartConfigRegistry;
|
|
6
10
|
/**
|
|
@@ -37,7 +37,6 @@ export interface ChartDefinition {
|
|
|
37
37
|
declare class ChartPluginRegistry {
|
|
38
38
|
private customCharts;
|
|
39
39
|
private builtInBackups;
|
|
40
|
-
private iconMap;
|
|
41
40
|
private version;
|
|
42
41
|
private listeners;
|
|
43
42
|
/**
|
|
@@ -51,7 +50,7 @@ declare class ChartPluginRegistry {
|
|
|
51
50
|
* If the chart type was a built-in override, the original built-in is restored.
|
|
52
51
|
*/
|
|
53
52
|
unregister(type: string): void;
|
|
54
|
-
/** Get the custom icon for a chart type, if registered */
|
|
53
|
+
/** Get the custom icon component for a chart type, if one was registered. */
|
|
55
54
|
getIcon(type: string): ComponentType<IconProps> | undefined;
|
|
56
55
|
/** Get all registered custom chart type strings */
|
|
57
56
|
getCustomTypes(): string[];
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { ComponentType } from 'react';
|
|
2
|
+
import { BuiltInChartType } from '../types.js';
|
|
3
|
+
import { IconName, IconProps } from '../icons/types.js';
|
|
4
|
+
import { ChartTypeConfig, ChartAvailabilityContext, ChartAvailability } from './chartConfigs.js';
|
|
5
|
+
/**
|
|
6
|
+
* The single source of truth for one chart type's DOM-free metadata: the eager
|
|
7
|
+
* picker fields, the lazy config thunk, the icon name, and dependency info.
|
|
8
|
+
*
|
|
9
|
+
* The React component thunk is deliberately NOT part of the entry — it is the
|
|
10
|
+
* one DOM-bearing piece and is owned by the client loader, keeping this entry
|
|
11
|
+
* (and its consumers, incl. the server agent) free of the chart component graph.
|
|
12
|
+
*/
|
|
13
|
+
export interface ChartRegistryEntry {
|
|
14
|
+
/** Display label for the picker — an i18n key, resolved at render time. */
|
|
15
|
+
label: string;
|
|
16
|
+
/**
|
|
17
|
+
* The chart's icon. Built-ins use an `IconName` resolved via the icon registry
|
|
18
|
+
* (override-able via registerIcons/setIcon). Plugins may instead supply a
|
|
19
|
+
* ready-made icon component — both flow through the same entry field so custom
|
|
20
|
+
* and built-in charts resolve their icon along one path.
|
|
21
|
+
*/
|
|
22
|
+
icon: IconName | ComponentType<IconProps>;
|
|
23
|
+
/** Brief description — i18n key. */
|
|
24
|
+
description?: string;
|
|
25
|
+
/** When to use this chart — i18n key. */
|
|
26
|
+
useCase?: string;
|
|
27
|
+
/** Whether the chart can render with the current query shape. */
|
|
28
|
+
isAvailable?: (ctx: ChartAvailabilityContext) => ChartAvailability;
|
|
29
|
+
/** Optional peer dependency — shows install instructions if the import fails. */
|
|
30
|
+
dependencies?: {
|
|
31
|
+
packageName: string;
|
|
32
|
+
installCommand: string;
|
|
33
|
+
};
|
|
34
|
+
/** Lazy config import — resolves the config OBJECT directly (client lazy path). */
|
|
35
|
+
config: () => Promise<ChartTypeConfig>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The unified registry — one entry per built-in chart type, the single source of
|
|
39
|
+
* truth for its DOM-free metadata. The eager config registry, the lazy config
|
|
40
|
+
* registry, the icon lookup, and the dependency lookup all derive from this map.
|
|
41
|
+
*
|
|
42
|
+
* Adding a chart is now one entry here plus its component/config files.
|
|
43
|
+
*/
|
|
44
|
+
export declare const chartRegistry: Record<BuiltInChartType, ChartRegistryEntry>;
|
|
45
|
+
/**
|
|
46
|
+
* The single, unified chart-entry lookup. Custom plugin entries take precedence
|
|
47
|
+
* over built-ins, so a plugin override of a built-in type resolves through the
|
|
48
|
+
* same path. Returns `undefined` for unknown types.
|
|
49
|
+
*
|
|
50
|
+
* Every entry-shaped consumer (icon resolution, dependency fallback, plugin
|
|
51
|
+
* icon API) reads through this so built-in and custom charts flow as one.
|
|
52
|
+
*/
|
|
53
|
+
export declare function getChartEntry(chartType: string): ChartRegistryEntry | undefined;
|
|
54
|
+
/** Register a custom chart's entry (plugin system). */
|
|
55
|
+
export declare function registerCustomChartEntry(chartType: string, entry: ChartRegistryEntry): void;
|
|
56
|
+
/** Remove a custom chart's entry, falling back to the built-in if one exists. */
|
|
57
|
+
export declare function unregisterCustomChartEntry(chartType: string): void;
|
|
58
|
+
/** The custom entry for a type, if one is registered (no built-in fallback). */
|
|
59
|
+
export declare function getCustomChartEntry(chartType: string): ChartRegistryEntry | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Composes a migrated chart's full `ChartTypeConfig` from its entry: the entry's
|
|
62
|
+
* metadata (its single declaration site) laid over the chart's config shape
|
|
63
|
+
* (`base` — drop zones, display options, clickable elements, validation).
|
|
64
|
+
*
|
|
65
|
+
* Used by BOTH derivation paths so they return the same full shape as a
|
|
66
|
+
* non-migrated chart's `*.config.ts`:
|
|
67
|
+
* - eager `chartConfigRegistry` (server/full source — read synchronously for the
|
|
68
|
+
* picker AND by the server agent's chart validation + tool guidance), with
|
|
69
|
+
* `base` = the statically-imported config;
|
|
70
|
+
* - lazy `getChartConfigAsync` (client code-split path), with `base` = the
|
|
71
|
+
* config resolved from the entry's `config` thunk.
|
|
72
|
+
*/
|
|
73
|
+
export declare function composeChartConfig(entry: ChartRegistryEntry, base: ChartTypeConfig): ChartTypeConfig;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* AI Assistant utilities export
|
|
3
3
|
*
|
|
4
4
|
* Note: AIAssistantModal has been deprecated and removed.
|
|
5
|
-
* The inline AI panel in AnalysisBuilder
|
|
6
|
-
* depends on these utilities.
|
|
5
|
+
* The inline AI panel in AnalysisBuilder is driven by useAnalysisEffects
|
|
6
|
+
* (the AI section of the useAnalysisBuilder facade), which depends on these utilities.
|
|
7
7
|
*/
|
|
8
8
|
export * from './types.js';
|
|
9
9
|
export * from './constants.js';
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import { Filter } from '../../../types.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Recursively searches filters (including nested and/or groups)
|
|
5
|
-
* Handles both UI format ({type: 'and'/'or', filters: [...]}) and simple filters
|
|
6
|
-
*/
|
|
7
|
-
export declare function findDateFilterForField(filters: Filter[], field: string): {
|
|
8
|
-
dateRange: string | string[];
|
|
9
|
-
} | undefined;
|
|
2
|
+
import { findDateFilterForField } from '../../../shared/filters/index.js';
|
|
3
|
+
export { findDateFilterForField };
|
|
10
4
|
/**
|
|
11
5
|
* Build compareDateRange for a time dimension based on its date filter
|
|
12
6
|
* When comparison is enabled, returns [[currentStart, currentEnd], [priorStart, priorEnd]]
|
|
13
7
|
*/
|
|
14
8
|
export declare function buildCompareDateRangeFromFilter(timeDimensionField: string, filters: Filter[]): [string, string][] | undefined;
|
|
15
9
|
/**
|
|
16
|
-
* Remove
|
|
17
|
-
* Returns a new array with the filter removed (immutable)
|
|
10
|
+
* Remove the inDateRange filter for a specific field from a filters array.
|
|
11
|
+
* Returns a new array with the filter removed (immutable).
|
|
18
12
|
*/
|
|
19
13
|
export declare function removeComparisonDateFilter(filters: Filter[], field: string): Filter[];
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ChartTypeConfig } from '../../charts/chartConfigs.js';
|
|
2
2
|
/**
|
|
3
|
-
* Configuration for the activity grid chart type
|
|
3
|
+
* Configuration for the activity grid chart type.
|
|
4
|
+
*
|
|
5
|
+
* Eager metadata (`label`, `description`, `useCase`, `isAvailable`) lives in the
|
|
6
|
+
* unified `chartRegistry` entry (the single source of truth) — see
|
|
7
|
+
* `src/client/charts/chartRegistry.ts`. This file owns the lazy-loaded shape:
|
|
8
|
+
* drop zones, display options, clickable elements, validation.
|
|
4
9
|
*/
|
|
5
10
|
export declare const activityGridChartConfig: ChartTypeConfig;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ChartTypeConfig } from '../../charts/chartConfigs.js';
|
|
2
2
|
/**
|
|
3
|
-
* Configuration for the area chart type
|
|
3
|
+
* Configuration for the area chart type.
|
|
4
|
+
*
|
|
5
|
+
* Eager metadata (`label`, `description`, `useCase`, `isAvailable`) lives in the
|
|
6
|
+
* unified `chartRegistry` entry (the single source of truth) — see
|
|
7
|
+
* `src/client/charts/chartRegistry.ts`. This file owns the lazy-loaded shape:
|
|
8
|
+
* drop zones, display options, clickable elements, validation.
|
|
4
9
|
*/
|
|
5
10
|
export declare const areaChartConfig: ChartTypeConfig;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ChartTypeConfig } from '../../charts/chartConfigs.js';
|
|
2
2
|
/**
|
|
3
|
-
* Configuration for the bar chart type
|
|
3
|
+
* Configuration for the bar chart type.
|
|
4
|
+
*
|
|
5
|
+
* Eager metadata (`label`, `description`, `useCase`, `isAvailable`) lives in the
|
|
6
|
+
* unified `chartRegistry` entry (the single source of truth) — see
|
|
7
|
+
* `src/client/charts/chartRegistry.ts`. This file owns the lazy-loaded shape:
|
|
8
|
+
* drop zones, display options, clickable elements, validation.
|
|
4
9
|
*/
|
|
5
10
|
export declare const barChartConfig: ChartTypeConfig;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ChartTypeConfig } from '../../charts/chartConfigs.js';
|
|
2
2
|
/**
|
|
3
|
-
* Configuration for the box plot chart type
|
|
3
|
+
* Configuration for the box plot chart type.
|
|
4
|
+
*
|
|
5
|
+
* Eager metadata (`label`, `description`, `useCase`, `isAvailable`) lives in the
|
|
6
|
+
* unified `chartRegistry` entry (the single source of truth) — see
|
|
7
|
+
* `src/client/charts/chartRegistry.ts`. This file owns the lazy-loaded shape:
|
|
8
|
+
* drop zones, display options, clickable elements, validation.
|
|
4
9
|
*/
|
|
5
10
|
export declare const boxPlotChartConfig: ChartTypeConfig;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ChartTypeConfig } from '../../charts/chartConfigs.js';
|
|
2
2
|
/**
|
|
3
|
-
* Configuration for the bubble chart type
|
|
3
|
+
* Configuration for the bubble chart type.
|
|
4
|
+
*
|
|
5
|
+
* Eager metadata (`label`, `description`, `useCase`, `isAvailable`) lives in the
|
|
6
|
+
* unified `chartRegistry` entry (the single source of truth) — see
|
|
7
|
+
* `src/client/charts/chartRegistry.ts`. This file owns the lazy-loaded shape:
|
|
8
|
+
* drop zones, display options, clickable elements, validation.
|
|
4
9
|
*/
|
|
5
10
|
export declare const bubbleChartConfig: ChartTypeConfig;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ChartTypeConfig } from '../../charts/chartConfigs.js';
|
|
2
2
|
/**
|
|
3
|
-
* Configuration for the candlestick chart type
|
|
3
|
+
* Configuration for the candlestick chart type.
|
|
4
|
+
*
|
|
5
|
+
* Eager metadata (`label`, `description`, `useCase`, `isAvailable`) lives in the
|
|
6
|
+
* unified `chartRegistry` entry (the single source of truth) — see
|
|
7
|
+
* `src/client/charts/chartRegistry.ts`. This file owns the lazy-loaded shape:
|
|
8
|
+
* drop zones, display options, clickable elements, validation.
|
|
4
9
|
*/
|
|
5
10
|
export declare const candlestickChartConfig: ChartTypeConfig;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { ChartTypeConfig } from '../../charts/chartConfigs.js';
|
|
2
2
|
/**
|
|
3
|
-
* Configuration for the data table type
|
|
3
|
+
* Configuration for the data table type.
|
|
4
|
+
*
|
|
5
|
+
* Eager metadata (`label`, `description`, `useCase`, `isAvailable`) lives in the
|
|
6
|
+
* unified `chartRegistry` entry (the single source of truth) — see
|
|
7
|
+
* `src/client/charts/chartRegistry.ts`. This file owns the lazy-loaded shape:
|
|
8
|
+
* drop zones, display options, clickable elements, validation.
|
|
4
9
|
*/
|
|
5
10
|
export declare const dataTableConfig: ChartTypeConfig;
|