drizzle-cube 0.4.28 → 0.4.30
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/anthropic-BIva8k1r.cjs +1 -0
- package/dist/adapters/anthropic-B_rg0BhK.js +140 -0
- package/dist/adapters/dist-Boc63-1q.cjs +2 -0
- package/dist/adapters/dist-De5fzUEM.js +581 -0
- package/dist/adapters/express/index.cjs +2 -10
- package/dist/adapters/express/index.js +232 -342
- package/dist/adapters/fastify/index.cjs +2 -10
- package/dist/adapters/fastify/index.js +275 -424
- package/dist/adapters/google-CT4kgmBf.js +154 -0
- package/dist/adapters/google-Dgo9-Kb5.cjs +2 -0
- package/dist/adapters/handler-B8vuFQYP.cjs +25 -0
- package/dist/adapters/handler-D-2-6uLM.js +2951 -0
- package/dist/adapters/hono/index.cjs +2 -10
- package/dist/adapters/hono/index.js +307 -402
- package/dist/adapters/mcp-prompts-BAutSQYA.js +344 -0
- package/dist/adapters/mcp-prompts-DsAkafVn.cjs +5 -0
- package/dist/adapters/mcp-transport-CuugoG8t.js +7821 -0
- package/dist/adapters/mcp-transport-Dpp6hdZe.cjs +253 -0
- package/dist/adapters/nextjs/index.cjs +1 -9
- package/dist/adapters/nextjs/index.js +377 -600
- package/dist/adapters/openai-CjBvA6mK.js +4114 -0
- package/dist/adapters/openai-DhLE0A9Z.cjs +1 -0
- package/dist/adapters/openai-Zjw4Zo4R.js +153 -0
- package/dist/adapters/openai-eJBw3LfQ.cjs +16 -0
- package/dist/adapters/types.cjs +0 -1
- package/dist/adapters/types.js +0 -1
- package/dist/adapters/utils-ChhNGUOF.js +5396 -0
- package/dist/adapters/utils-CwJplXR5.cjs +15 -0
- package/dist/adapters/utils.cjs +1 -19
- package/dist/adapters/utils.js +2 -21333
- package/dist/client/charts.js +15 -186
- package/dist/client/chunks/DashboardEditModal-C076pscL.js +6678 -0
- package/dist/client/chunks/DashboardEditModal-C076pscL.js.map +1 -0
- package/dist/client/chunks/FieldSearchModal-C0DjSWk3.js +2631 -0
- package/dist/client/chunks/FieldSearchModal-C0DjSWk3.js.map +1 -0
- package/dist/client/chunks/RetentionCombinedChart-DuGXc-AP.js +270 -0
- package/dist/client/chunks/RetentionCombinedChart-DuGXc-AP.js.map +1 -0
- package/dist/client/chunks/RetentionCombinedChart.config-DprbXd1N.js +56 -0
- package/dist/client/chunks/RetentionCombinedChart.config-DprbXd1N.js.map +1 -0
- package/dist/client/chunks/RetentionHeatmap-BoGY6mlZ.js +193 -0
- package/dist/client/chunks/RetentionHeatmap-BoGY6mlZ.js.map +1 -0
- package/dist/client/chunks/RetentionHeatmap.config-cbaNExVy.js +25 -0
- package/dist/client/chunks/RetentionHeatmap.config-cbaNExVy.js.map +1 -0
- package/dist/client/chunks/analysis-builder-DF0XntqC.js +6111 -0
- package/dist/client/chunks/analysis-builder-DF0XntqC.js.map +1 -0
- package/dist/client/chunks/analysis-builder-shared-2QhKYbs6.js +3114 -0
- package/dist/client/chunks/analysis-builder-shared-2QhKYbs6.js.map +1 -0
- package/dist/client/chunks/chart-activity-grid-CNES9VBk.js +803 -0
- package/dist/client/chunks/chart-activity-grid-CNES9VBk.js.map +1 -0
- package/dist/client/chunks/chart-area-CRJc3KOu.js +449 -0
- package/dist/client/chunks/chart-area-CRJc3KOu.js.map +1 -0
- package/dist/client/chunks/chart-bar-DD2PjJ5n.js +270 -0
- package/dist/client/chunks/chart-bar-DD2PjJ5n.js.map +1 -0
- package/dist/client/chunks/chart-box-plot-BcqleldJ.js +377 -0
- package/dist/client/chunks/chart-box-plot-BcqleldJ.js.map +1 -0
- package/dist/client/chunks/chart-bubble-BmQkVk4K.js +273 -0
- package/dist/client/chunks/chart-bubble-BmQkVk4K.js.map +1 -0
- package/dist/client/chunks/chart-candlestick-C3Rep469.js +306 -0
- package/dist/client/chunks/chart-candlestick-C3Rep469.js.map +1 -0
- package/dist/client/chunks/chart-config-activity-grid-USo7JrPh.js +51 -0
- package/dist/client/chunks/chart-config-activity-grid-USo7JrPh.js.map +1 -0
- package/dist/client/chunks/chart-config-area-D_ZufYzg.js +93 -0
- package/dist/client/chunks/chart-config-area-D_ZufYzg.js.map +1 -0
- package/dist/client/chunks/chart-config-bar-BCi2Wmd6.js +87 -0
- package/dist/client/chunks/chart-config-bar-BCi2Wmd6.js.map +1 -0
- package/dist/client/chunks/chart-config-box-plot-afKLzJSp.js +35 -0
- package/dist/client/chunks/chart-config-box-plot-afKLzJSp.js.map +1 -0
- package/dist/client/chunks/chart-config-bubble-CgbBjPv8.js +82 -0
- package/dist/client/chunks/chart-config-bubble-CgbBjPv8.js.map +1 -0
- package/dist/client/chunks/chart-config-candlestick-7boGjZ-A.js +72 -0
- package/dist/client/chunks/chart-config-candlestick-7boGjZ-A.js.map +1 -0
- package/dist/client/chunks/chart-config-data-table-Cl7sBasW.js +30 -0
- package/dist/client/chunks/chart-config-data-table-Cl7sBasW.js.map +1 -0
- package/dist/client/chunks/chart-config-funnel-CXPYQtTl.js +93 -0
- package/dist/client/chunks/chart-config-funnel-CXPYQtTl.js.map +1 -0
- package/dist/client/chunks/chart-config-gauge-DUNEUCvh.js +64 -0
- package/dist/client/chunks/chart-config-gauge-DUNEUCvh.js.map +1 -0
- package/dist/client/chunks/chart-config-heat-map-BFf1tO11.js +91 -0
- package/dist/client/chunks/chart-config-heat-map-BFf1tO11.js.map +1 -0
- package/dist/client/chunks/chart-config-kpi-delta-C5k2waIJ.js +94 -0
- package/dist/client/chunks/chart-config-kpi-delta-C5k2waIJ.js.map +1 -0
- package/dist/client/chunks/chart-config-kpi-number-DptOyhk0.js +75 -0
- package/dist/client/chunks/chart-config-kpi-number-DptOyhk0.js.map +1 -0
- package/dist/client/chunks/chart-config-kpi-text-D9DdVWqd.js +47 -0
- package/dist/client/chunks/chart-config-kpi-text-D9DdVWqd.js.map +1 -0
- package/dist/client/chunks/chart-config-line-B3NgLF7K.js +104 -0
- package/dist/client/chunks/chart-config-line-B3NgLF7K.js.map +1 -0
- package/dist/client/chunks/chart-config-markdown-tlfivQTt.js +117 -0
- package/dist/client/chunks/chart-config-markdown-tlfivQTt.js.map +1 -0
- package/dist/client/chunks/chart-config-measure-profile-D7XDwrU2.js +82 -0
- package/dist/client/chunks/chart-config-measure-profile-D7XDwrU2.js.map +1 -0
- package/dist/client/chunks/chart-config-pie-wY0B52PC.js +68 -0
- package/dist/client/chunks/chart-config-pie-wY0B52PC.js.map +1 -0
- package/dist/client/chunks/chart-config-radar-DRpJBy1M.js +49 -0
- package/dist/client/chunks/chart-config-radar-DRpJBy1M.js.map +1 -0
- package/dist/client/chunks/chart-config-radial-bar-DCUpXv9G.js +38 -0
- package/dist/client/chunks/chart-config-radial-bar-DCUpXv9G.js.map +1 -0
- package/dist/client/chunks/chart-config-sankey-CdOhlm4h.js +66 -0
- package/dist/client/chunks/chart-config-sankey-CdOhlm4h.js.map +1 -0
- package/dist/client/chunks/chart-config-scatter-B2su_x8f.js +61 -0
- package/dist/client/chunks/chart-config-scatter-B2su_x8f.js.map +1 -0
- package/dist/client/chunks/chart-config-sunburst-BPdjbk18.js +45 -0
- package/dist/client/chunks/chart-config-sunburst-BPdjbk18.js.map +1 -0
- package/dist/client/chunks/chart-config-tree-map-Cbsh2fe2.js +51 -0
- package/dist/client/chunks/chart-config-tree-map-Cbsh2fe2.js.map +1 -0
- package/dist/client/chunks/chart-config-waterfall-DGmuZfQF.js +59 -0
- package/dist/client/chunks/chart-config-waterfall-DGmuZfQF.js.map +1 -0
- package/dist/client/chunks/chart-data-table-DehW1C1G.js +4088 -0
- package/dist/client/chunks/chart-data-table-DehW1C1G.js.map +1 -0
- package/dist/client/chunks/chart-funnel-BjkpnG5g.js +447 -0
- package/dist/client/chunks/chart-funnel-BjkpnG5g.js.map +1 -0
- package/dist/client/chunks/chart-gauge-BWW_HEfg.js +424 -0
- package/dist/client/chunks/chart-gauge-BWW_HEfg.js.map +1 -0
- package/dist/client/chunks/chart-heat-map-BWuOuDcm.js +236 -0
- package/dist/client/chunks/chart-heat-map-BWuOuDcm.js.map +1 -0
- package/dist/client/chunks/chart-kpi-delta-D5OHtDJx.js +343 -0
- package/dist/client/chunks/chart-kpi-delta-D5OHtDJx.js.map +1 -0
- package/dist/client/chunks/chart-kpi-number-C9zH-aKC.js +326 -0
- package/dist/client/chunks/chart-kpi-number-C9zH-aKC.js.map +1 -0
- package/dist/client/chunks/chart-kpi-text-ChVn3S7j.js +149 -0
- package/dist/client/chunks/chart-kpi-text-ChVn3S7j.js.map +1 -0
- package/dist/client/chunks/chart-line-DOIMkP0b.js +431 -0
- package/dist/client/chunks/chart-line-DOIMkP0b.js.map +1 -0
- package/dist/client/chunks/chart-markdown-DXxc43w1.js +3457 -0
- package/dist/client/chunks/chart-markdown-DXxc43w1.js.map +1 -0
- package/dist/client/chunks/chart-measure-profile-C6wrr9il.js +179 -0
- package/dist/client/chunks/chart-measure-profile-C6wrr9il.js.map +1 -0
- package/dist/client/chunks/chart-pie-BU_FgwDc.js +172 -0
- package/dist/client/chunks/chart-pie-BU_FgwDc.js.map +1 -0
- package/dist/client/chunks/chart-radar-DlufwnAX.js +154 -0
- package/dist/client/chunks/chart-radar-DlufwnAX.js.map +1 -0
- package/dist/client/chunks/chart-radial-bar-B5vS_Aw5.js +148 -0
- package/dist/client/chunks/chart-radial-bar-B5vS_Aw5.js.map +1 -0
- package/dist/client/chunks/chart-sankey-FChb26UX.js +222 -0
- package/dist/client/chunks/chart-sankey-FChb26UX.js.map +1 -0
- package/dist/client/chunks/chart-scatter-DW0cAZ2H.js +255 -0
- package/dist/client/chunks/chart-scatter-DW0cAZ2H.js.map +1 -0
- package/dist/client/chunks/chart-sunburst-Clf-6WxW.js +221 -0
- package/dist/client/chunks/chart-sunburst-Clf-6WxW.js.map +1 -0
- package/dist/client/chunks/chart-tree-map-p_VwUJPF.js +298 -0
- package/dist/client/chunks/chart-tree-map-p_VwUJPF.js.map +1 -0
- package/dist/client/chunks/chart-waterfall-jt44IQ-w.js +237 -0
- package/dist/client/chunks/chart-waterfall-jt44IQ-w.js.map +1 -0
- package/dist/client/chunks/charts-core-CUVzf4cV.js +215 -0
- package/dist/client/chunks/charts-core-CUVzf4cV.js.map +1 -0
- package/dist/client/chunks/charts-loader-AGpph8_I.js +259 -0
- package/dist/client/chunks/charts-loader-AGpph8_I.js.map +1 -0
- package/dist/client/chunks/core-D1TOj17W.js +845 -0
- package/dist/client/chunks/core-D1TOj17W.js.map +1 -0
- package/dist/client/chunks/dist-DDBeV_JI.js +847 -0
- package/dist/client/chunks/dist-DDBeV_JI.js.map +1 -0
- package/dist/client/chunks/javascript-BBwTSo6e.js +438 -0
- package/dist/client/chunks/javascript-BBwTSo6e.js.map +1 -0
- package/dist/client/chunks/json-BpTrLZSh.js +38 -0
- package/dist/client/chunks/json-BpTrLZSh.js.map +1 -0
- package/dist/client/chunks/lazyChartConfigRegistry-BjhxDaSf.js +149 -0
- package/dist/client/chunks/lazyChartConfigRegistry-BjhxDaSf.js.map +1 -0
- package/dist/client/chunks/providers-DX3Vw5kc.js +7 -0
- package/dist/client/chunks/providers-DX3Vw5kc.js.map +1 -0
- package/dist/client/chunks/retention-UEXlSdZ-.js +132 -0
- package/dist/client/chunks/retention-UEXlSdZ-.js.map +1 -0
- package/dist/client/chunks/rolldown-runtime-lc2dmIiU.js +20 -0
- package/dist/client/chunks/schema-visualization-ZugB4Io9.js +1073 -0
- package/dist/client/chunks/schema-visualization-ZugB4Io9.js.map +1 -0
- package/dist/client/chunks/sql-B0chxcEK.js +120 -0
- package/dist/client/chunks/sql-B0chxcEK.js.map +1 -0
- package/dist/client/chunks/syntaxHighlighting-87bOwTxj.js +30 -0
- package/dist/client/chunks/syntaxHighlighting-87bOwTxj.js.map +1 -0
- package/dist/client/chunks/useDebounce-BQjNWndQ.js +1394 -0
- package/dist/client/chunks/useDebounce-BQjNWndQ.js.map +1 -0
- package/dist/client/chunks/useDirtyStateTracking-CgKZWkel.js +66 -0
- package/dist/client/chunks/useDirtyStateTracking-CgKZWkel.js.map +1 -0
- package/dist/client/chunks/useExplainAI-c_bHxZe5.js +203 -0
- package/dist/client/chunks/useExplainAI-c_bHxZe5.js.map +1 -0
- package/dist/client/chunks/useNotebookLayout-BFZ_33Kb.js +37 -0
- package/dist/client/chunks/useNotebookLayout-BFZ_33Kb.js.map +1 -0
- package/dist/client/chunks/utils-A54Ny29G.js +128 -0
- package/dist/client/chunks/utils-A54Ny29G.js.map +1 -0
- package/dist/client/chunks/vendor-CoPBRumI.js +828 -0
- package/dist/client/chunks/vendor-CoPBRumI.js.map +1 -0
- package/dist/client/components.js +4 -18
- package/dist/client/hooks.js +6 -58
- package/dist/client/icons.js +2 -15
- package/dist/client/index.js +1061 -1295
- package/dist/client/index.js.map +1 -1
- package/dist/client/providers.js +3 -9
- package/dist/client/styles.css +2 -1
- package/dist/client/types.d.ts +1 -0
- package/dist/client/utils.js +7 -74
- package/dist/client-bundle-stats.html +1 -1
- package/dist/server/anthropic-BsNspi1r.js +140 -0
- package/dist/server/anthropic-DsCEX6Fm.cjs +1 -0
- package/dist/server/dist-CMWZC51B.js +581 -0
- package/dist/server/dist-DxegvyZF.cjs +2 -0
- package/dist/server/google-BXwMolCu.js +154 -0
- package/dist/server/google-DzQWXFwF.cjs +2 -0
- package/dist/server/index.cjs +109 -127
- package/dist/server/index.d.ts +13 -4
- package/dist/server/index.js +15089 -34349
- package/dist/server/openai-BPhmb8mi.js +4114 -0
- package/dist/server/openai-CLsoLaue.cjs +1 -0
- package/dist/server/openai-D1kZ5sdM.js +153 -0
- package/dist/server/openai-DkOKbVLC.cjs +16 -0
- package/package.json +5 -5
- package/dist/adapters/anthropic-BTkjgFpT.cjs +0 -1
- package/dist/adapters/anthropic-CTu9E801.js +0 -126
- package/dist/adapters/google-BAK9pnQf.cjs +0 -2
- package/dist/adapters/google-DficVAsJ.js +0 -146
- package/dist/adapters/handler-BV2_dul8.js +0 -2713
- package/dist/adapters/handler-LMRPeTNJ.cjs +0 -39
- package/dist/adapters/index-BgCeQBuN.cjs +0 -2
- package/dist/adapters/index-C3PskWTr.js +0 -5353
- package/dist/adapters/index-C45_meK_.js +0 -719
- package/dist/adapters/index-ht4NPca9.cjs +0 -23
- package/dist/adapters/mcp-transport-B6ZudTSk.js +0 -11010
- package/dist/adapters/mcp-transport-DCiSGtp1.cjs +0 -257
- package/dist/adapters/openai-BvA6eLs8.cjs +0 -1
- package/dist/adapters/openai-mcE24du8.js +0 -131
- package/dist/client/charts.js.map +0 -1
- package/dist/client/chunks/RetentionCombinedChart--SnU4Y_I.js +0 -256
- package/dist/client/chunks/RetentionCombinedChart--SnU4Y_I.js.map +0 -1
- package/dist/client/chunks/RetentionCombinedChart.config-Bbp2ghim.js +0 -48
- package/dist/client/chunks/RetentionCombinedChart.config-Bbp2ghim.js.map +0 -1
- package/dist/client/chunks/RetentionHeatmap-BHYU8MXY.js +0 -178
- package/dist/client/chunks/RetentionHeatmap-BHYU8MXY.js.map +0 -1
- package/dist/client/chunks/RetentionHeatmap.config-BWf_-vdj.js +0 -29
- package/dist/client/chunks/RetentionHeatmap.config-BWf_-vdj.js.map +0 -1
- package/dist/client/chunks/analysis-builder-DMFoAkjT.js +0 -6203
- package/dist/client/chunks/analysis-builder-DMFoAkjT.js.map +0 -1
- package/dist/client/chunks/analysis-builder-shared-CunrT3gi.js +0 -3140
- package/dist/client/chunks/analysis-builder-shared-CunrT3gi.js.map +0 -1
- package/dist/client/chunks/chart-activity-grid-DCznpK6N.js +0 -347
- package/dist/client/chunks/chart-activity-grid-DCznpK6N.js.map +0 -1
- package/dist/client/chunks/chart-area-CqKRIUpj.js +0 -234
- package/dist/client/chunks/chart-area-CqKRIUpj.js.map +0 -1
- package/dist/client/chunks/chart-bar-Bl5jvrU_.js +0 -267
- package/dist/client/chunks/chart-bar-Bl5jvrU_.js.map +0 -1
- package/dist/client/chunks/chart-box-plot-CzMb00z_.js +0 -322
- package/dist/client/chunks/chart-box-plot-CzMb00z_.js.map +0 -1
- package/dist/client/chunks/chart-bubble-BF8Z52eW.js +0 -249
- package/dist/client/chunks/chart-bubble-BF8Z52eW.js.map +0 -1
- package/dist/client/chunks/chart-candlestick-ByWS945g.js +0 -269
- package/dist/client/chunks/chart-candlestick-ByWS945g.js.map +0 -1
- package/dist/client/chunks/chart-config-activity-grid-CmOqDuOT.js +0 -50
- package/dist/client/chunks/chart-config-activity-grid-CmOqDuOT.js.map +0 -1
- package/dist/client/chunks/chart-config-area-CK_GVApT.js +0 -77
- package/dist/client/chunks/chart-config-area-CK_GVApT.js.map +0 -1
- package/dist/client/chunks/chart-config-bar-C8uzktxl.js +0 -71
- package/dist/client/chunks/chart-config-bar-C8uzktxl.js.map +0 -1
- package/dist/client/chunks/chart-config-box-plot-D_E_SSc2.js +0 -38
- package/dist/client/chunks/chart-config-box-plot-D_E_SSc2.js.map +0 -1
- package/dist/client/chunks/chart-config-bubble-q3DoQX5F.js +0 -71
- package/dist/client/chunks/chart-config-bubble-q3DoQX5F.js.map +0 -1
- package/dist/client/chunks/chart-config-candlestick-CRCpD43-.js +0 -70
- package/dist/client/chunks/chart-config-candlestick-CRCpD43-.js.map +0 -1
- package/dist/client/chunks/chart-config-data-table-B20Y5JCm.js +0 -28
- package/dist/client/chunks/chart-config-data-table-B20Y5JCm.js.map +0 -1
- package/dist/client/chunks/chart-config-funnel-3eYnGg8M.js +0 -92
- package/dist/client/chunks/chart-config-funnel-3eYnGg8M.js.map +0 -1
- package/dist/client/chunks/chart-config-gauge-CQx9w3d4.js +0 -64
- package/dist/client/chunks/chart-config-gauge-CQx9w3d4.js.map +0 -1
- package/dist/client/chunks/chart-config-heat-map-_wEnTnRA.js +0 -77
- package/dist/client/chunks/chart-config-heat-map-_wEnTnRA.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-delta-DLGZ2A3X.js +0 -97
- package/dist/client/chunks/chart-config-kpi-delta-DLGZ2A3X.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-number-K-wzviXF.js +0 -75
- package/dist/client/chunks/chart-config-kpi-number-K-wzviXF.js.map +0 -1
- package/dist/client/chunks/chart-config-kpi-text-BjYqwqaJ.js +0 -47
- package/dist/client/chunks/chart-config-kpi-text-BjYqwqaJ.js.map +0 -1
- package/dist/client/chunks/chart-config-line-JNagi9tf.js +0 -88
- package/dist/client/chunks/chart-config-line-JNagi9tf.js.map +0 -1
- package/dist/client/chunks/chart-config-markdown-BWQSjJpy.js +0 -97
- package/dist/client/chunks/chart-config-markdown-BWQSjJpy.js.map +0 -1
- package/dist/client/chunks/chart-config-measure-profile-ZYaMrtws.js +0 -70
- package/dist/client/chunks/chart-config-measure-profile-ZYaMrtws.js.map +0 -1
- package/dist/client/chunks/chart-config-pie-CNLXb-fr.js +0 -39
- package/dist/client/chunks/chart-config-pie-CNLXb-fr.js.map +0 -1
- package/dist/client/chunks/chart-config-radar-oxHfRAa3.js +0 -44
- package/dist/client/chunks/chart-config-radar-oxHfRAa3.js.map +0 -1
- package/dist/client/chunks/chart-config-radial-bar-_Aw3jAEm.js +0 -37
- package/dist/client/chunks/chart-config-radial-bar-_Aw3jAEm.js.map +0 -1
- package/dist/client/chunks/chart-config-sankey-C8FX9hGF.js +0 -61
- package/dist/client/chunks/chart-config-sankey-C8FX9hGF.js.map +0 -1
- package/dist/client/chunks/chart-config-scatter-DFKM80eO.js +0 -53
- package/dist/client/chunks/chart-config-scatter-DFKM80eO.js.map +0 -1
- package/dist/client/chunks/chart-config-sunburst-BmC0NLTU.js +0 -50
- package/dist/client/chunks/chart-config-sunburst-BmC0NLTU.js.map +0 -1
- package/dist/client/chunks/chart-config-tree-map-DGMbNTaa.js +0 -47
- package/dist/client/chunks/chart-config-tree-map-DGMbNTaa.js.map +0 -1
- package/dist/client/chunks/chart-config-waterfall-DTyXV_fo.js +0 -60
- package/dist/client/chunks/chart-config-waterfall-DTyXV_fo.js.map +0 -1
- package/dist/client/chunks/chart-data-table-HwfF-Ujv.js +0 -293
- package/dist/client/chunks/chart-data-table-HwfF-Ujv.js.map +0 -1
- package/dist/client/chunks/chart-funnel-WmuoWlCq.js +0 -259
- package/dist/client/chunks/chart-funnel-WmuoWlCq.js.map +0 -1
- package/dist/client/chunks/chart-gauge-Cot4By-w.js +0 -374
- package/dist/client/chunks/chart-gauge-Cot4By-w.js.map +0 -1
- package/dist/client/chunks/chart-heat-map-bGNtsZMr.js +0 -231
- package/dist/client/chunks/chart-heat-map-bGNtsZMr.js.map +0 -1
- package/dist/client/chunks/chart-kpi-delta-DeyKMxgq.js +0 -351
- package/dist/client/chunks/chart-kpi-delta-DeyKMxgq.js.map +0 -1
- package/dist/client/chunks/chart-kpi-number-D1z1gxXO.js +0 -476
- package/dist/client/chunks/chart-kpi-number-D1z1gxXO.js.map +0 -1
- package/dist/client/chunks/chart-kpi-text-b7q6KWc0.js +0 -165
- package/dist/client/chunks/chart-kpi-text-b7q6KWc0.js.map +0 -1
- package/dist/client/chunks/chart-line-3Nf-EPqJ.js +0 -450
- package/dist/client/chunks/chart-line-3Nf-EPqJ.js.map +0 -1
- package/dist/client/chunks/chart-markdown-BT_-MBq1.js +0 -2721
- package/dist/client/chunks/chart-markdown-BT_-MBq1.js.map +0 -1
- package/dist/client/chunks/chart-measure-profile-BVjUonqU.js +0 -114
- package/dist/client/chunks/chart-measure-profile-BVjUonqU.js.map +0 -1
- package/dist/client/chunks/chart-pie-DblG6w7g.js +0 -137
- package/dist/client/chunks/chart-pie-DblG6w7g.js.map +0 -1
- package/dist/client/chunks/chart-radar-BHZbeeTg.js +0 -129
- package/dist/client/chunks/chart-radar-BHZbeeTg.js.map +0 -1
- package/dist/client/chunks/chart-radial-bar-AlEJC1Jo.js +0 -119
- package/dist/client/chunks/chart-radial-bar-AlEJC1Jo.js.map +0 -1
- package/dist/client/chunks/chart-sankey-E8vYKjQF.js +0 -189
- package/dist/client/chunks/chart-sankey-E8vYKjQF.js.map +0 -1
- package/dist/client/chunks/chart-scatter-Bbxqi0iw.js +0 -202
- package/dist/client/chunks/chart-scatter-Bbxqi0iw.js.map +0 -1
- package/dist/client/chunks/chart-sunburst-BgnTKolT.js +0 -188
- package/dist/client/chunks/chart-sunburst-BgnTKolT.js.map +0 -1
- package/dist/client/chunks/chart-tree-map-i9LGCLwl.js +0 -284
- package/dist/client/chunks/chart-tree-map-i9LGCLwl.js.map +0 -1
- package/dist/client/chunks/chart-waterfall-BeIhCm83.js +0 -191
- package/dist/client/chunks/chart-waterfall-BeIhCm83.js.map +0 -1
- package/dist/client/chunks/charts-core-BUUO36OM.js +0 -692
- package/dist/client/chunks/charts-core-BUUO36OM.js.map +0 -1
- package/dist/client/chunks/charts-loader-goTYnavu.js +0 -258
- package/dist/client/chunks/charts-loader-goTYnavu.js.map +0 -1
- package/dist/client/chunks/components-BFgYvFq6.js +0 -10066
- package/dist/client/chunks/components-BFgYvFq6.js.map +0 -1
- package/dist/client/chunks/core-Y9e-sNfb.js +0 -1068
- package/dist/client/chunks/core-Y9e-sNfb.js.map +0 -1
- package/dist/client/chunks/flow-utils-CjQZG5qq.js +0 -16
- package/dist/client/chunks/flow-utils-CjQZG5qq.js.map +0 -1
- package/dist/client/chunks/funnel-utils-CyonoNeC.js +0 -135
- package/dist/client/chunks/funnel-utils-CyonoNeC.js.map +0 -1
- package/dist/client/chunks/icons-CwvgmdIP.js +0 -1636
- package/dist/client/chunks/icons-CwvgmdIP.js.map +0 -1
- package/dist/client/chunks/index-CApFCBF9.js +0 -81
- package/dist/client/chunks/index-CApFCBF9.js.map +0 -1
- package/dist/client/chunks/index-_2PSgbkC.js +0 -1046
- package/dist/client/chunks/index-_2PSgbkC.js.map +0 -1
- package/dist/client/chunks/javascript-DII1YQGr.js +0 -659
- package/dist/client/chunks/javascript-DII1YQGr.js.map +0 -1
- package/dist/client/chunks/json-C_6Prymp.js +0 -39
- package/dist/client/chunks/json-C_6Prymp.js.map +0 -1
- package/dist/client/chunks/providers-Ds7DRmnO.js +0 -554
- package/dist/client/chunks/providers-Ds7DRmnO.js.map +0 -1
- package/dist/client/chunks/retention-CzCo8262.js +0 -120
- package/dist/client/chunks/retention-CzCo8262.js.map +0 -1
- package/dist/client/chunks/schema-visualization-B97a1Ybu.js +0 -772
- package/dist/client/chunks/schema-visualization-B97a1Ybu.js.map +0 -1
- package/dist/client/chunks/sql-IeKX8fQ8.js +0 -616
- package/dist/client/chunks/sql-IeKX8fQ8.js.map +0 -1
- package/dist/client/chunks/syntaxHighlighting-DAMSW_A6.js +0 -34
- package/dist/client/chunks/syntaxHighlighting-DAMSW_A6.js.map +0 -1
- package/dist/client/chunks/theme-Dp3hFed1.js +0 -112
- package/dist/client/chunks/theme-Dp3hFed1.js.map +0 -1
- package/dist/client/chunks/useDirtyStateTracking-CyAXd07d.js +0 -1231
- package/dist/client/chunks/useDirtyStateTracking-CyAXd07d.js.map +0 -1
- package/dist/client/chunks/useExplainAI-CfQ_JmF1.js +0 -182
- package/dist/client/chunks/useExplainAI-CfQ_JmF1.js.map +0 -1
- package/dist/client/chunks/vendor-B2EH3V58.js +0 -2892
- package/dist/client/chunks/vendor-B2EH3V58.js.map +0 -1
- package/dist/client/components.js.map +0 -1
- package/dist/client/hooks.js.map +0 -1
- package/dist/client/icons.js.map +0 -1
- package/dist/client/providers.js.map +0 -1
- package/dist/client/utils.js.map +0 -1
- package/dist/server/anthropic-BTkjgFpT.cjs +0 -1
- package/dist/server/anthropic-CTu9E801.js +0 -126
- package/dist/server/google-BAK9pnQf.cjs +0 -2
- package/dist/server/google-DficVAsJ.js +0 -146
- package/dist/server/index-BgCeQBuN.cjs +0 -2
- package/dist/server/index-C3PskWTr.js +0 -5353
- package/dist/server/index-C45_meK_.js +0 -719
- package/dist/server/index-ht4NPca9.cjs +0 -23
- package/dist/server/openai-BvA6eLs8.cjs +0 -1
- package/dist/server/openai-mcE24du8.js +0 -131
|
@@ -0,0 +1,581 @@
|
|
|
1
|
+
//#region node_modules/@google/generative-ai/dist/index.mjs
|
|
2
|
+
var e;
|
|
3
|
+
(function(e) {
|
|
4
|
+
e.STRING = "string", e.NUMBER = "number", e.INTEGER = "integer", e.BOOLEAN = "boolean", e.ARRAY = "array", e.OBJECT = "object";
|
|
5
|
+
})(e ||= {});
|
|
6
|
+
var t;
|
|
7
|
+
(function(e) {
|
|
8
|
+
e.LANGUAGE_UNSPECIFIED = "language_unspecified", e.PYTHON = "python";
|
|
9
|
+
})(t ||= {});
|
|
10
|
+
var n;
|
|
11
|
+
(function(e) {
|
|
12
|
+
e.OUTCOME_UNSPECIFIED = "outcome_unspecified", e.OUTCOME_OK = "outcome_ok", e.OUTCOME_FAILED = "outcome_failed", e.OUTCOME_DEADLINE_EXCEEDED = "outcome_deadline_exceeded";
|
|
13
|
+
})(n ||= {});
|
|
14
|
+
var r = [
|
|
15
|
+
"user",
|
|
16
|
+
"model",
|
|
17
|
+
"function",
|
|
18
|
+
"system"
|
|
19
|
+
], i;
|
|
20
|
+
(function(e) {
|
|
21
|
+
e.HARM_CATEGORY_UNSPECIFIED = "HARM_CATEGORY_UNSPECIFIED", e.HARM_CATEGORY_HATE_SPEECH = "HARM_CATEGORY_HATE_SPEECH", e.HARM_CATEGORY_SEXUALLY_EXPLICIT = "HARM_CATEGORY_SEXUALLY_EXPLICIT", e.HARM_CATEGORY_HARASSMENT = "HARM_CATEGORY_HARASSMENT", e.HARM_CATEGORY_DANGEROUS_CONTENT = "HARM_CATEGORY_DANGEROUS_CONTENT", e.HARM_CATEGORY_CIVIC_INTEGRITY = "HARM_CATEGORY_CIVIC_INTEGRITY";
|
|
22
|
+
})(i ||= {});
|
|
23
|
+
var a;
|
|
24
|
+
(function(e) {
|
|
25
|
+
e.HARM_BLOCK_THRESHOLD_UNSPECIFIED = "HARM_BLOCK_THRESHOLD_UNSPECIFIED", e.BLOCK_LOW_AND_ABOVE = "BLOCK_LOW_AND_ABOVE", e.BLOCK_MEDIUM_AND_ABOVE = "BLOCK_MEDIUM_AND_ABOVE", e.BLOCK_ONLY_HIGH = "BLOCK_ONLY_HIGH", e.BLOCK_NONE = "BLOCK_NONE";
|
|
26
|
+
})(a ||= {});
|
|
27
|
+
var o;
|
|
28
|
+
(function(e) {
|
|
29
|
+
e.HARM_PROBABILITY_UNSPECIFIED = "HARM_PROBABILITY_UNSPECIFIED", e.NEGLIGIBLE = "NEGLIGIBLE", e.LOW = "LOW", e.MEDIUM = "MEDIUM", e.HIGH = "HIGH";
|
|
30
|
+
})(o ||= {});
|
|
31
|
+
var s;
|
|
32
|
+
(function(e) {
|
|
33
|
+
e.BLOCKED_REASON_UNSPECIFIED = "BLOCKED_REASON_UNSPECIFIED", e.SAFETY = "SAFETY", e.OTHER = "OTHER";
|
|
34
|
+
})(s ||= {});
|
|
35
|
+
var c;
|
|
36
|
+
(function(e) {
|
|
37
|
+
e.FINISH_REASON_UNSPECIFIED = "FINISH_REASON_UNSPECIFIED", e.STOP = "STOP", e.MAX_TOKENS = "MAX_TOKENS", e.SAFETY = "SAFETY", e.RECITATION = "RECITATION", e.LANGUAGE = "LANGUAGE", e.BLOCKLIST = "BLOCKLIST", e.PROHIBITED_CONTENT = "PROHIBITED_CONTENT", e.SPII = "SPII", e.MALFORMED_FUNCTION_CALL = "MALFORMED_FUNCTION_CALL", e.OTHER = "OTHER";
|
|
38
|
+
})(c ||= {});
|
|
39
|
+
var l;
|
|
40
|
+
(function(e) {
|
|
41
|
+
e.TASK_TYPE_UNSPECIFIED = "TASK_TYPE_UNSPECIFIED", e.RETRIEVAL_QUERY = "RETRIEVAL_QUERY", e.RETRIEVAL_DOCUMENT = "RETRIEVAL_DOCUMENT", e.SEMANTIC_SIMILARITY = "SEMANTIC_SIMILARITY", e.CLASSIFICATION = "CLASSIFICATION", e.CLUSTERING = "CLUSTERING";
|
|
42
|
+
})(l ||= {});
|
|
43
|
+
var u;
|
|
44
|
+
(function(e) {
|
|
45
|
+
e.MODE_UNSPECIFIED = "MODE_UNSPECIFIED", e.AUTO = "AUTO", e.ANY = "ANY", e.NONE = "NONE";
|
|
46
|
+
})(u ||= {});
|
|
47
|
+
var d;
|
|
48
|
+
(function(e) {
|
|
49
|
+
e.MODE_UNSPECIFIED = "MODE_UNSPECIFIED", e.MODE_DYNAMIC = "MODE_DYNAMIC";
|
|
50
|
+
})(d ||= {});
|
|
51
|
+
var f = class extends Error {
|
|
52
|
+
constructor(e) {
|
|
53
|
+
super(`[GoogleGenerativeAI Error]: ${e}`);
|
|
54
|
+
}
|
|
55
|
+
}, p = class extends f {
|
|
56
|
+
constructor(e, t) {
|
|
57
|
+
super(e), this.response = t;
|
|
58
|
+
}
|
|
59
|
+
}, m = class extends f {
|
|
60
|
+
constructor(e, t, n, r) {
|
|
61
|
+
super(e), this.status = t, this.statusText = n, this.errorDetails = r;
|
|
62
|
+
}
|
|
63
|
+
}, h = class extends f {}, g = class extends f {}, ee = "https://generativelanguage.googleapis.com", _ = "v1beta", v = "0.24.1", te = "genai-js", y;
|
|
64
|
+
(function(e) {
|
|
65
|
+
e.GENERATE_CONTENT = "generateContent", e.STREAM_GENERATE_CONTENT = "streamGenerateContent", e.COUNT_TOKENS = "countTokens", e.EMBED_CONTENT = "embedContent", e.BATCH_EMBED_CONTENTS = "batchEmbedContents";
|
|
66
|
+
})(y ||= {});
|
|
67
|
+
var b = class {
|
|
68
|
+
constructor(e, t, n, r, i) {
|
|
69
|
+
this.model = e, this.task = t, this.apiKey = n, this.stream = r, this.requestOptions = i;
|
|
70
|
+
}
|
|
71
|
+
toString() {
|
|
72
|
+
let e = this.requestOptions?.apiVersion || _, t = `${this.requestOptions?.baseUrl || ee}/${e}/${this.model}:${this.task}`;
|
|
73
|
+
return this.stream && (t += "?alt=sse"), t;
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
function x(e) {
|
|
77
|
+
let t = [];
|
|
78
|
+
return e?.apiClient && t.push(e.apiClient), t.push(`${te}/${v}`), t.join(" ");
|
|
79
|
+
}
|
|
80
|
+
async function S(e) {
|
|
81
|
+
let t = new Headers();
|
|
82
|
+
t.append("Content-Type", "application/json"), t.append("x-goog-api-client", x(e.requestOptions)), t.append("x-goog-api-key", e.apiKey);
|
|
83
|
+
let n = e.requestOptions?.customHeaders;
|
|
84
|
+
if (n) {
|
|
85
|
+
if (!(n instanceof Headers)) try {
|
|
86
|
+
n = new Headers(n);
|
|
87
|
+
} catch (e) {
|
|
88
|
+
throw new h(`unable to convert customHeaders value ${JSON.stringify(n)} to Headers: ${e.message}`);
|
|
89
|
+
}
|
|
90
|
+
for (let [e, r] of n.entries()) {
|
|
91
|
+
if (e === "x-goog-api-key") throw new h(`Cannot set reserved header name ${e}`);
|
|
92
|
+
if (e === "x-goog-api-client") throw new h(`Header name ${e} can only be set using the apiClient field`);
|
|
93
|
+
t.append(e, r);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return t;
|
|
97
|
+
}
|
|
98
|
+
async function ne(e, t, n, r, i, a) {
|
|
99
|
+
let o = new b(e, t, n, r, a);
|
|
100
|
+
return {
|
|
101
|
+
url: o.toString(),
|
|
102
|
+
fetchOptions: Object.assign(Object.assign({}, D(a)), {
|
|
103
|
+
method: "POST",
|
|
104
|
+
headers: await S(o),
|
|
105
|
+
body: i
|
|
106
|
+
})
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
async function C(e, t, n, r, i, a = {}, o = fetch) {
|
|
110
|
+
let { url: s, fetchOptions: c } = await ne(e, t, n, r, i, a);
|
|
111
|
+
return w(s, c, o);
|
|
112
|
+
}
|
|
113
|
+
async function w(e, t, n = fetch) {
|
|
114
|
+
let r;
|
|
115
|
+
try {
|
|
116
|
+
r = await n(e, t);
|
|
117
|
+
} catch (t) {
|
|
118
|
+
T(t, e);
|
|
119
|
+
}
|
|
120
|
+
return r.ok || await E(r, e), r;
|
|
121
|
+
}
|
|
122
|
+
function T(e, t) {
|
|
123
|
+
let n = e;
|
|
124
|
+
throw n.name === "AbortError" ? (n = new g(`Request aborted when fetching ${t.toString()}: ${e.message}`), n.stack = e.stack) : e instanceof m || e instanceof h || (n = new f(`Error fetching from ${t.toString()}: ${e.message}`), n.stack = e.stack), n;
|
|
125
|
+
}
|
|
126
|
+
async function E(e, t) {
|
|
127
|
+
let n = "", r;
|
|
128
|
+
try {
|
|
129
|
+
let t = await e.json();
|
|
130
|
+
n = t.error.message, t.error.details && (n += ` ${JSON.stringify(t.error.details)}`, r = t.error.details);
|
|
131
|
+
} catch {}
|
|
132
|
+
throw new m(`Error fetching from ${t.toString()}: [${e.status} ${e.statusText}] ${n}`, e.status, e.statusText, r);
|
|
133
|
+
}
|
|
134
|
+
function D(e) {
|
|
135
|
+
let t = {};
|
|
136
|
+
if (e?.signal !== void 0 || e?.timeout >= 0) {
|
|
137
|
+
let n = new AbortController();
|
|
138
|
+
e?.timeout >= 0 && setTimeout(() => n.abort(), e.timeout), e?.signal && e.signal.addEventListener("abort", () => {
|
|
139
|
+
n.abort();
|
|
140
|
+
}), t.signal = n.signal;
|
|
141
|
+
}
|
|
142
|
+
return t;
|
|
143
|
+
}
|
|
144
|
+
function O(e) {
|
|
145
|
+
return e.text = () => {
|
|
146
|
+
if (e.candidates && e.candidates.length > 0) {
|
|
147
|
+
if (e.candidates.length > 1 && console.warn(`This response had ${e.candidates.length} candidates. Returning text from the first candidate only. Access response.candidates directly to use the other candidates.`), j(e.candidates[0])) throw new p(`${M(e)}`, e);
|
|
148
|
+
return k(e);
|
|
149
|
+
} else if (e.promptFeedback) throw new p(`Text not available. ${M(e)}`, e);
|
|
150
|
+
return "";
|
|
151
|
+
}, e.functionCall = () => {
|
|
152
|
+
if (e.candidates && e.candidates.length > 0) {
|
|
153
|
+
if (e.candidates.length > 1 && console.warn(`This response had ${e.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`), j(e.candidates[0])) throw new p(`${M(e)}`, e);
|
|
154
|
+
return console.warn("response.functionCall() is deprecated. Use response.functionCalls() instead."), A(e)[0];
|
|
155
|
+
} else if (e.promptFeedback) throw new p(`Function call not available. ${M(e)}`, e);
|
|
156
|
+
}, e.functionCalls = () => {
|
|
157
|
+
if (e.candidates && e.candidates.length > 0) {
|
|
158
|
+
if (e.candidates.length > 1 && console.warn(`This response had ${e.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`), j(e.candidates[0])) throw new p(`${M(e)}`, e);
|
|
159
|
+
return A(e);
|
|
160
|
+
} else if (e.promptFeedback) throw new p(`Function call not available. ${M(e)}`, e);
|
|
161
|
+
}, e;
|
|
162
|
+
}
|
|
163
|
+
function k(e) {
|
|
164
|
+
let t = [];
|
|
165
|
+
if (e.candidates?.[0].content?.parts) for (let n of e.candidates?.[0].content?.parts) n.text && t.push(n.text), n.executableCode && t.push("\n```" + n.executableCode.language + "\n" + n.executableCode.code + "\n```\n"), n.codeExecutionResult && t.push("\n```\n" + n.codeExecutionResult.output + "\n```\n");
|
|
166
|
+
return t.length > 0 ? t.join("") : "";
|
|
167
|
+
}
|
|
168
|
+
function A(e) {
|
|
169
|
+
let t = [];
|
|
170
|
+
if (e.candidates?.[0].content?.parts) for (let n of e.candidates?.[0].content?.parts) n.functionCall && t.push(n.functionCall);
|
|
171
|
+
if (t.length > 0) return t;
|
|
172
|
+
}
|
|
173
|
+
var re = [
|
|
174
|
+
c.RECITATION,
|
|
175
|
+
c.SAFETY,
|
|
176
|
+
c.LANGUAGE
|
|
177
|
+
];
|
|
178
|
+
function j(e) {
|
|
179
|
+
return !!e.finishReason && re.includes(e.finishReason);
|
|
180
|
+
}
|
|
181
|
+
function M(e) {
|
|
182
|
+
let t = "";
|
|
183
|
+
if ((!e.candidates || e.candidates.length === 0) && e.promptFeedback) t += "Response was blocked", e.promptFeedback?.blockReason && (t += ` due to ${e.promptFeedback.blockReason}`), e.promptFeedback?.blockReasonMessage && (t += `: ${e.promptFeedback.blockReasonMessage}`);
|
|
184
|
+
else if (e.candidates?.[0]) {
|
|
185
|
+
let n = e.candidates[0];
|
|
186
|
+
j(n) && (t += `Candidate was blocked due to ${n.finishReason}`, n.finishMessage && (t += `: ${n.finishMessage}`));
|
|
187
|
+
}
|
|
188
|
+
return t;
|
|
189
|
+
}
|
|
190
|
+
function N(e) {
|
|
191
|
+
return this instanceof N ? (this.v = e, this) : new N(e);
|
|
192
|
+
}
|
|
193
|
+
function P(e, t, n) {
|
|
194
|
+
if (!Symbol.asyncIterator) throw TypeError("Symbol.asyncIterator is not defined.");
|
|
195
|
+
var r = n.apply(e, t || []), i, a = [];
|
|
196
|
+
return i = {}, o("next"), o("throw"), o("return"), i[Symbol.asyncIterator] = function() {
|
|
197
|
+
return this;
|
|
198
|
+
}, i;
|
|
199
|
+
function o(e) {
|
|
200
|
+
r[e] && (i[e] = function(t) {
|
|
201
|
+
return new Promise(function(n, r) {
|
|
202
|
+
a.push([
|
|
203
|
+
e,
|
|
204
|
+
t,
|
|
205
|
+
n,
|
|
206
|
+
r
|
|
207
|
+
]) > 1 || s(e, t);
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function s(e, t) {
|
|
212
|
+
try {
|
|
213
|
+
c(r[e](t));
|
|
214
|
+
} catch (e) {
|
|
215
|
+
d(a[0][3], e);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function c(e) {
|
|
219
|
+
e.value instanceof N ? Promise.resolve(e.value.v).then(l, u) : d(a[0][2], e);
|
|
220
|
+
}
|
|
221
|
+
function l(e) {
|
|
222
|
+
s("next", e);
|
|
223
|
+
}
|
|
224
|
+
function u(e) {
|
|
225
|
+
s("throw", e);
|
|
226
|
+
}
|
|
227
|
+
function d(e, t) {
|
|
228
|
+
e(t), a.shift(), a.length && s(a[0][0], a[0][1]);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
var F = /^data\: (.*)(?:\n\n|\r\r|\r\n\r\n)/;
|
|
232
|
+
function I(e) {
|
|
233
|
+
let [t, n] = z(e.body.pipeThrough(new TextDecoderStream("utf8", { fatal: !0 }))).tee();
|
|
234
|
+
return {
|
|
235
|
+
stream: R(t),
|
|
236
|
+
response: L(n)
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
async function L(e) {
|
|
240
|
+
let t = [], n = e.getReader();
|
|
241
|
+
for (;;) {
|
|
242
|
+
let { done: e, value: r } = await n.read();
|
|
243
|
+
if (e) return O(B(t));
|
|
244
|
+
t.push(r);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
function R(e) {
|
|
248
|
+
return P(this, arguments, function* () {
|
|
249
|
+
let t = e.getReader();
|
|
250
|
+
for (;;) {
|
|
251
|
+
let { value: e, done: n } = yield N(t.read());
|
|
252
|
+
if (n) break;
|
|
253
|
+
yield yield N(O(e));
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
function z(e) {
|
|
258
|
+
let t = e.getReader();
|
|
259
|
+
return new ReadableStream({ start(e) {
|
|
260
|
+
let n = "";
|
|
261
|
+
return r();
|
|
262
|
+
function r() {
|
|
263
|
+
return t.read().then(({ value: t, done: i }) => {
|
|
264
|
+
if (i) {
|
|
265
|
+
if (n.trim()) {
|
|
266
|
+
e.error(new f("Failed to parse stream"));
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
e.close();
|
|
270
|
+
return;
|
|
271
|
+
}
|
|
272
|
+
n += t;
|
|
273
|
+
let a = n.match(F), o;
|
|
274
|
+
for (; a;) {
|
|
275
|
+
try {
|
|
276
|
+
o = JSON.parse(a[1]);
|
|
277
|
+
} catch {
|
|
278
|
+
e.error(new f(`Error parsing JSON response: "${a[1]}"`));
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
e.enqueue(o), n = n.substring(a[0].length), a = n.match(F);
|
|
282
|
+
}
|
|
283
|
+
return r();
|
|
284
|
+
}).catch((e) => {
|
|
285
|
+
let t = e;
|
|
286
|
+
throw t.stack = e.stack, t = t.name === "AbortError" ? new g("Request aborted when reading from the stream") : new f("Error reading from the stream"), t;
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
} });
|
|
290
|
+
}
|
|
291
|
+
function B(e) {
|
|
292
|
+
let t = { promptFeedback: e[e.length - 1]?.promptFeedback };
|
|
293
|
+
for (let n of e) {
|
|
294
|
+
if (n.candidates) {
|
|
295
|
+
let e = 0;
|
|
296
|
+
for (let r of n.candidates) if (t.candidates ||= [], t.candidates[e] || (t.candidates[e] = { index: e }), t.candidates[e].citationMetadata = r.citationMetadata, t.candidates[e].groundingMetadata = r.groundingMetadata, t.candidates[e].finishReason = r.finishReason, t.candidates[e].finishMessage = r.finishMessage, t.candidates[e].safetyRatings = r.safetyRatings, r.content && r.content.parts) {
|
|
297
|
+
t.candidates[e].content || (t.candidates[e].content = {
|
|
298
|
+
role: r.content.role || "user",
|
|
299
|
+
parts: []
|
|
300
|
+
});
|
|
301
|
+
let n = {};
|
|
302
|
+
for (let i of r.content.parts) i.text && (n.text = i.text), i.functionCall && (n.functionCall = i.functionCall), i.executableCode && (n.executableCode = i.executableCode), i.codeExecutionResult && (n.codeExecutionResult = i.codeExecutionResult), Object.keys(n).length === 0 && (n.text = ""), t.candidates[e].content.parts.push(n);
|
|
303
|
+
}
|
|
304
|
+
e++;
|
|
305
|
+
}
|
|
306
|
+
n.usageMetadata && (t.usageMetadata = n.usageMetadata);
|
|
307
|
+
}
|
|
308
|
+
return t;
|
|
309
|
+
}
|
|
310
|
+
async function V(e, t, n, r) {
|
|
311
|
+
return I(await C(t, y.STREAM_GENERATE_CONTENT, e, !0, JSON.stringify(n), r));
|
|
312
|
+
}
|
|
313
|
+
async function H(e, t, n, r) {
|
|
314
|
+
return { response: O(await (await C(t, y.GENERATE_CONTENT, e, !1, JSON.stringify(n), r)).json()) };
|
|
315
|
+
}
|
|
316
|
+
function U(e) {
|
|
317
|
+
if (e != null) {
|
|
318
|
+
if (typeof e == "string") return {
|
|
319
|
+
role: "system",
|
|
320
|
+
parts: [{ text: e }]
|
|
321
|
+
};
|
|
322
|
+
if (e.text) return {
|
|
323
|
+
role: "system",
|
|
324
|
+
parts: [e]
|
|
325
|
+
};
|
|
326
|
+
if (e.parts) return e.role ? e : {
|
|
327
|
+
role: "system",
|
|
328
|
+
parts: e.parts
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
function W(e) {
|
|
333
|
+
let t = [];
|
|
334
|
+
if (typeof e == "string") t = [{ text: e }];
|
|
335
|
+
else for (let n of e) typeof n == "string" ? t.push({ text: n }) : t.push(n);
|
|
336
|
+
return G(t);
|
|
337
|
+
}
|
|
338
|
+
function G(e) {
|
|
339
|
+
let t = {
|
|
340
|
+
role: "user",
|
|
341
|
+
parts: []
|
|
342
|
+
}, n = {
|
|
343
|
+
role: "function",
|
|
344
|
+
parts: []
|
|
345
|
+
}, r = !1, i = !1;
|
|
346
|
+
for (let a of e) "functionResponse" in a ? (n.parts.push(a), i = !0) : (t.parts.push(a), r = !0);
|
|
347
|
+
if (r && i) throw new f("Within a single message, FunctionResponse cannot be mixed with other type of part in the request for sending chat message.");
|
|
348
|
+
if (!r && !i) throw new f("No content is provided for sending chat message.");
|
|
349
|
+
return r ? t : n;
|
|
350
|
+
}
|
|
351
|
+
function K(e, t) {
|
|
352
|
+
let n = {
|
|
353
|
+
model: t?.model,
|
|
354
|
+
generationConfig: t?.generationConfig,
|
|
355
|
+
safetySettings: t?.safetySettings,
|
|
356
|
+
tools: t?.tools,
|
|
357
|
+
toolConfig: t?.toolConfig,
|
|
358
|
+
systemInstruction: t?.systemInstruction,
|
|
359
|
+
cachedContent: t?.cachedContent?.name,
|
|
360
|
+
contents: []
|
|
361
|
+
}, r = e.generateContentRequest != null;
|
|
362
|
+
if (e.contents) {
|
|
363
|
+
if (r) throw new h("CountTokensRequest must have one of contents or generateContentRequest, not both.");
|
|
364
|
+
n.contents = e.contents;
|
|
365
|
+
} else if (r) n = Object.assign(Object.assign({}, n), e.generateContentRequest);
|
|
366
|
+
else {
|
|
367
|
+
let t = W(e);
|
|
368
|
+
n.contents = [t];
|
|
369
|
+
}
|
|
370
|
+
return { generateContentRequest: n };
|
|
371
|
+
}
|
|
372
|
+
function q(e) {
|
|
373
|
+
let t;
|
|
374
|
+
return t = e.contents ? e : { contents: [W(e)] }, e.systemInstruction && (t.systemInstruction = U(e.systemInstruction)), t;
|
|
375
|
+
}
|
|
376
|
+
function J(e) {
|
|
377
|
+
return typeof e == "string" || Array.isArray(e) ? { content: W(e) } : e;
|
|
378
|
+
}
|
|
379
|
+
var Y = [
|
|
380
|
+
"text",
|
|
381
|
+
"inlineData",
|
|
382
|
+
"functionCall",
|
|
383
|
+
"functionResponse",
|
|
384
|
+
"executableCode",
|
|
385
|
+
"codeExecutionResult"
|
|
386
|
+
], ie = {
|
|
387
|
+
user: ["text", "inlineData"],
|
|
388
|
+
function: ["functionResponse"],
|
|
389
|
+
model: [
|
|
390
|
+
"text",
|
|
391
|
+
"functionCall",
|
|
392
|
+
"executableCode",
|
|
393
|
+
"codeExecutionResult"
|
|
394
|
+
],
|
|
395
|
+
system: ["text"]
|
|
396
|
+
};
|
|
397
|
+
function ae(e) {
|
|
398
|
+
let t = !1;
|
|
399
|
+
for (let n of e) {
|
|
400
|
+
let { role: e, parts: i } = n;
|
|
401
|
+
if (!t && e !== "user") throw new f(`First content should be with role 'user', got ${e}`);
|
|
402
|
+
if (!r.includes(e)) throw new f(`Each item should include role field. Got ${e} but valid roles are: ${JSON.stringify(r)}`);
|
|
403
|
+
if (!Array.isArray(i)) throw new f("Content should have 'parts' property with an array of Parts");
|
|
404
|
+
if (i.length === 0) throw new f("Each Content should have at least one part");
|
|
405
|
+
let a = {
|
|
406
|
+
text: 0,
|
|
407
|
+
inlineData: 0,
|
|
408
|
+
functionCall: 0,
|
|
409
|
+
functionResponse: 0,
|
|
410
|
+
fileData: 0,
|
|
411
|
+
executableCode: 0,
|
|
412
|
+
codeExecutionResult: 0
|
|
413
|
+
};
|
|
414
|
+
for (let e of i) for (let t of Y) t in e && (a[t] += 1);
|
|
415
|
+
let o = ie[e];
|
|
416
|
+
for (let t of Y) if (!o.includes(t) && a[t] > 0) throw new f(`Content with role '${e}' can't contain '${t}' part`);
|
|
417
|
+
t = !0;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
function X(e) {
|
|
421
|
+
if (e.candidates === void 0 || e.candidates.length === 0) return !1;
|
|
422
|
+
let t = e.candidates[0]?.content;
|
|
423
|
+
if (t === void 0 || t.parts === void 0 || t.parts.length === 0) return !1;
|
|
424
|
+
for (let e of t.parts) if (e === void 0 || Object.keys(e).length === 0 || e.text !== void 0 && e.text === "") return !1;
|
|
425
|
+
return !0;
|
|
426
|
+
}
|
|
427
|
+
var Z = "SILENT_ERROR", Q = class {
|
|
428
|
+
constructor(e, t, n, r = {}) {
|
|
429
|
+
this.model = t, this.params = n, this._requestOptions = r, this._history = [], this._sendPromise = Promise.resolve(), this._apiKey = e, n?.history && (ae(n.history), this._history = n.history);
|
|
430
|
+
}
|
|
431
|
+
async getHistory() {
|
|
432
|
+
return await this._sendPromise, this._history;
|
|
433
|
+
}
|
|
434
|
+
async sendMessage(e, t = {}) {
|
|
435
|
+
await this._sendPromise;
|
|
436
|
+
let n = W(e), r = {
|
|
437
|
+
safetySettings: this.params?.safetySettings,
|
|
438
|
+
generationConfig: this.params?.generationConfig,
|
|
439
|
+
tools: this.params?.tools,
|
|
440
|
+
toolConfig: this.params?.toolConfig,
|
|
441
|
+
systemInstruction: this.params?.systemInstruction,
|
|
442
|
+
cachedContent: this.params?.cachedContent,
|
|
443
|
+
contents: [...this._history, n]
|
|
444
|
+
}, i = Object.assign(Object.assign({}, this._requestOptions), t), a;
|
|
445
|
+
return this._sendPromise = this._sendPromise.then(() => H(this._apiKey, this.model, r, i)).then((e) => {
|
|
446
|
+
if (X(e.response)) {
|
|
447
|
+
this._history.push(n);
|
|
448
|
+
let t = Object.assign({
|
|
449
|
+
parts: [],
|
|
450
|
+
role: "model"
|
|
451
|
+
}, e.response.candidates?.[0].content);
|
|
452
|
+
this._history.push(t);
|
|
453
|
+
} else {
|
|
454
|
+
let t = M(e.response);
|
|
455
|
+
t && console.warn(`sendMessage() was unsuccessful. ${t}. Inspect response object for details.`);
|
|
456
|
+
}
|
|
457
|
+
a = e;
|
|
458
|
+
}).catch((e) => {
|
|
459
|
+
throw this._sendPromise = Promise.resolve(), e;
|
|
460
|
+
}), await this._sendPromise, a;
|
|
461
|
+
}
|
|
462
|
+
async sendMessageStream(e, t = {}) {
|
|
463
|
+
await this._sendPromise;
|
|
464
|
+
let n = W(e), r = {
|
|
465
|
+
safetySettings: this.params?.safetySettings,
|
|
466
|
+
generationConfig: this.params?.generationConfig,
|
|
467
|
+
tools: this.params?.tools,
|
|
468
|
+
toolConfig: this.params?.toolConfig,
|
|
469
|
+
systemInstruction: this.params?.systemInstruction,
|
|
470
|
+
cachedContent: this.params?.cachedContent,
|
|
471
|
+
contents: [...this._history, n]
|
|
472
|
+
}, i = Object.assign(Object.assign({}, this._requestOptions), t), a = V(this._apiKey, this.model, r, i);
|
|
473
|
+
return this._sendPromise = this._sendPromise.then(() => a).catch((e) => {
|
|
474
|
+
throw Error(Z);
|
|
475
|
+
}).then((e) => e.response).then((e) => {
|
|
476
|
+
if (X(e)) {
|
|
477
|
+
this._history.push(n);
|
|
478
|
+
let t = Object.assign({}, e.candidates[0].content);
|
|
479
|
+
t.role ||= "model", this._history.push(t);
|
|
480
|
+
} else {
|
|
481
|
+
let t = M(e);
|
|
482
|
+
t && console.warn(`sendMessageStream() was unsuccessful. ${t}. Inspect response object for details.`);
|
|
483
|
+
}
|
|
484
|
+
}).catch((e) => {
|
|
485
|
+
e.message !== Z && console.error(e);
|
|
486
|
+
}), a;
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
async function oe(e, t, n, r) {
|
|
490
|
+
return (await C(t, y.COUNT_TOKENS, e, !1, JSON.stringify(n), r)).json();
|
|
491
|
+
}
|
|
492
|
+
async function se(e, t, n, r) {
|
|
493
|
+
return (await C(t, y.EMBED_CONTENT, e, !1, JSON.stringify(n), r)).json();
|
|
494
|
+
}
|
|
495
|
+
async function ce(e, t, n, r) {
|
|
496
|
+
let i = n.requests.map((e) => Object.assign(Object.assign({}, e), { model: t }));
|
|
497
|
+
return (await C(t, y.BATCH_EMBED_CONTENTS, e, !1, JSON.stringify({ requests: i }), r)).json();
|
|
498
|
+
}
|
|
499
|
+
var $ = class {
|
|
500
|
+
constructor(e, t, n = {}) {
|
|
501
|
+
this.apiKey = e, this._requestOptions = n, t.model.includes("/") ? this.model = t.model : this.model = `models/${t.model}`, this.generationConfig = t.generationConfig || {}, this.safetySettings = t.safetySettings || [], this.tools = t.tools, this.toolConfig = t.toolConfig, this.systemInstruction = U(t.systemInstruction), this.cachedContent = t.cachedContent;
|
|
502
|
+
}
|
|
503
|
+
async generateContent(e, t = {}) {
|
|
504
|
+
let n = q(e), r = Object.assign(Object.assign({}, this._requestOptions), t);
|
|
505
|
+
return H(this.apiKey, this.model, Object.assign({
|
|
506
|
+
generationConfig: this.generationConfig,
|
|
507
|
+
safetySettings: this.safetySettings,
|
|
508
|
+
tools: this.tools,
|
|
509
|
+
toolConfig: this.toolConfig,
|
|
510
|
+
systemInstruction: this.systemInstruction,
|
|
511
|
+
cachedContent: this.cachedContent?.name
|
|
512
|
+
}, n), r);
|
|
513
|
+
}
|
|
514
|
+
async generateContentStream(e, t = {}) {
|
|
515
|
+
let n = q(e), r = Object.assign(Object.assign({}, this._requestOptions), t);
|
|
516
|
+
return V(this.apiKey, this.model, Object.assign({
|
|
517
|
+
generationConfig: this.generationConfig,
|
|
518
|
+
safetySettings: this.safetySettings,
|
|
519
|
+
tools: this.tools,
|
|
520
|
+
toolConfig: this.toolConfig,
|
|
521
|
+
systemInstruction: this.systemInstruction,
|
|
522
|
+
cachedContent: this.cachedContent?.name
|
|
523
|
+
}, n), r);
|
|
524
|
+
}
|
|
525
|
+
startChat(e) {
|
|
526
|
+
return new Q(this.apiKey, this.model, Object.assign({
|
|
527
|
+
generationConfig: this.generationConfig,
|
|
528
|
+
safetySettings: this.safetySettings,
|
|
529
|
+
tools: this.tools,
|
|
530
|
+
toolConfig: this.toolConfig,
|
|
531
|
+
systemInstruction: this.systemInstruction,
|
|
532
|
+
cachedContent: this.cachedContent?.name
|
|
533
|
+
}, e), this._requestOptions);
|
|
534
|
+
}
|
|
535
|
+
async countTokens(e, t = {}) {
|
|
536
|
+
let n = K(e, {
|
|
537
|
+
model: this.model,
|
|
538
|
+
generationConfig: this.generationConfig,
|
|
539
|
+
safetySettings: this.safetySettings,
|
|
540
|
+
tools: this.tools,
|
|
541
|
+
toolConfig: this.toolConfig,
|
|
542
|
+
systemInstruction: this.systemInstruction,
|
|
543
|
+
cachedContent: this.cachedContent
|
|
544
|
+
}), r = Object.assign(Object.assign({}, this._requestOptions), t);
|
|
545
|
+
return oe(this.apiKey, this.model, n, r);
|
|
546
|
+
}
|
|
547
|
+
async embedContent(e, t = {}) {
|
|
548
|
+
let n = J(e), r = Object.assign(Object.assign({}, this._requestOptions), t);
|
|
549
|
+
return se(this.apiKey, this.model, n, r);
|
|
550
|
+
}
|
|
551
|
+
async batchEmbedContents(e, t = {}) {
|
|
552
|
+
let n = Object.assign(Object.assign({}, this._requestOptions), t);
|
|
553
|
+
return ce(this.apiKey, this.model, e, n);
|
|
554
|
+
}
|
|
555
|
+
}, le = class {
|
|
556
|
+
constructor(e) {
|
|
557
|
+
this.apiKey = e;
|
|
558
|
+
}
|
|
559
|
+
getGenerativeModel(e, t) {
|
|
560
|
+
if (!e.model) throw new f("Must provide a model name. Example: genai.getGenerativeModel({ model: 'my-model-name' })");
|
|
561
|
+
return new $(this.apiKey, e, t);
|
|
562
|
+
}
|
|
563
|
+
getGenerativeModelFromCachedContent(e, t, n) {
|
|
564
|
+
if (!e.name) throw new h("Cached content must contain a `name` field.");
|
|
565
|
+
if (!e.model) throw new h("Cached content must contain a `model` field.");
|
|
566
|
+
for (let n of ["model", "systemInstruction"]) if (t?.[n] && e[n] && t?.[n] !== e[n]) {
|
|
567
|
+
if (n === "model" && (t.model.startsWith("models/") ? t.model.replace("models/", "") : t.model) === (e.model.startsWith("models/") ? e.model.replace("models/", "") : e.model)) continue;
|
|
568
|
+
throw new h(`Different value for "${n}" specified in modelParams (${t[n]}) and cachedContent (${e[n]})`);
|
|
569
|
+
}
|
|
570
|
+
let r = Object.assign(Object.assign({}, t), {
|
|
571
|
+
model: e.model,
|
|
572
|
+
tools: e.tools,
|
|
573
|
+
toolConfig: e.toolConfig,
|
|
574
|
+
systemInstruction: e.systemInstruction,
|
|
575
|
+
cachedContent: e
|
|
576
|
+
});
|
|
577
|
+
return new $(this.apiKey, r, n);
|
|
578
|
+
}
|
|
579
|
+
};
|
|
580
|
+
//#endregion
|
|
581
|
+
export { s as BlockReason, Q as ChatSession, d as DynamicRetrievalMode, t as ExecutableCodeLanguage, c as FinishReason, u as FunctionCallingMode, $ as GenerativeModel, le as GoogleGenerativeAI, g as GoogleGenerativeAIAbortError, f as GoogleGenerativeAIError, m as GoogleGenerativeAIFetchError, h as GoogleGenerativeAIRequestInputError, p as GoogleGenerativeAIResponseError, a as HarmBlockThreshold, i as HarmCategory, o as HarmProbability, n as Outcome, r as POSSIBLE_ROLES, e as SchemaType, l as TaskType };
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../utils-CwJplXR5.cjs`),t=require(`../mcp-transport-Dpp6hdZe.cjs`);let n=require(`express`);n=e.g(n);let r=require(`cors`);r=e.g(r);function i(i){let{cubes:a,drizzle:o,schema:s,extractSecurityContext:c,engineType:l,cors:u,basePath:d=`/cubejs-api/v1`,jsonLimit:f=`10mb`,cache:p,mcp:m={enabled:!0},agent:h}=i;if(!a||a.length===0)throw Error(`At least one cube must be provided in the cubes array`);let g=(0,n.Router)();u&&g.use((0,r.default)(u)),g.use(n.default.json({limit:f})),g.use(n.default.urlencoded({extended:!0,limit:f}));let _=new t.h({drizzle:o,schema:s,engineType:l,cache:p});if(a.forEach(e=>{_.registerCube(e)}),g.post(`${d}/load`,async(t,n)=>{try{let r=t.body.query||t.body,i=await c(t,n),a=_.validateQuery(r);if(!a.isValid)return n.status(400).json(e.i(`Query validation failed: ${a.errors.join(`, `)}`,400));let o=t.headers[`x-cache-control`]===`no-cache`,s=await _.executeMultiCubeQuery(r,i,{skipCache:o});n.json(e.r(r,s,_))}catch(t){console.error(`Query execution error:`,t),n.status(500).json(e.i(t instanceof Error?t.message:`Query execution failed`,500))}}),g.get(`${d}/load`,async(t,n)=>{try{let r=t.query.query;if(!r)return n.status(400).json(e.i(`Query parameter is required`,400));let i;try{i=JSON.parse(r)}catch{return n.status(400).json(e.i(`Invalid JSON in query parameter`,400))}let a=await c(t,n),o=_.validateQuery(i);if(!o.isValid)return n.status(400).json(e.i(`Query validation failed: ${o.errors.join(`, `)}`,400));let s=t.headers[`x-cache-control`]===`no-cache`,l=await _.executeMultiCubeQuery(i,a,{skipCache:s});n.json(e.r(i,l,_))}catch(t){console.error(`Query execution error:`,t),n.status(500).json(e.i(t instanceof Error?t.message:`Query execution failed`,500))}}),g.post(`${d}/batch`,async(t,n)=>{try{let{queries:r}=t.body;if(!r||!Array.isArray(r))return n.status(400).json(e.i(`Request body must contain a "queries" array`,400));if(r.length===0)return n.status(400).json(e.i(`Queries array cannot be empty`,400));let i=await e.u(r,await c(t,n),_,{skipCache:t.headers[`x-cache-control`]===`no-cache`});n.json(i)}catch(t){console.error(`Batch execution error:`,t),n.status(500).json(e.i(t instanceof Error?t.message:`Batch execution failed`,500))}}),g.get(`${d}/meta`,(t,n)=>{try{let t=_.getMetadata();n.json(e.a(t))}catch(t){console.error(`Metadata error:`,t),n.status(500).json(e.i(t instanceof Error?t.message:`Failed to fetch metadata`,500))}}),g.post(`${d}/sql`,async(t,n)=>{try{let r=t.body,i=await c(t,n),a=_.validateQuery(r);if(!a.isValid)return n.status(400).json(e.i(`Query validation failed: ${a.errors.join(`, `)}`,400));let o=r.measures?.[0]||r.dimensions?.[0];if(!o)return n.status(400).json(e.i(`No measures or dimensions specified`,400));let s=o.split(`.`)[0],l=await _.generateSQL(s,r,i);n.json(e.o(r,l))}catch(t){console.error(`SQL generation error:`,t),n.status(500).json(e.i(t instanceof Error?t.message:`SQL generation failed`,500))}}),g.get(`${d}/sql`,async(t,n)=>{try{let r=t.query.query;if(!r)return n.status(400).json(e.i(`Query parameter is required`,400));let i=JSON.parse(r),a=await c(t,n),o=_.validateQuery(i);if(!o.isValid)return n.status(400).json(e.i(`Query validation failed: ${o.errors.join(`, `)}`,400));let s=i.measures?.[0]||i.dimensions?.[0];if(!s)return n.status(400).json(e.i(`No measures or dimensions specified`,400));let l=s.split(`.`)[0],u=await _.generateSQL(l,i,a);n.json(e.o(i,u))}catch(t){console.error(`SQL generation error:`,t),n.status(500).json(e.i(t instanceof Error?t.message:`SQL generation failed`,500))}}),g.post(`${d}/dry-run`,async(t,n)=>{try{let r=await e.f(t.body.query||t.body,await c(t,n),_);n.json(r)}catch(e){console.error(`Dry-run error:`,e),n.status(400).json({error:e instanceof Error?e.message:`Dry-run validation failed`,valid:!1})}}),g.get(`${d}/dry-run`,async(t,n)=>{try{let r=t.query.query;if(!r)return n.status(400).json({error:`Query parameter is required`,valid:!1});let i=await e.f(JSON.parse(r),await c(t,n),_);n.json(i)}catch(e){console.error(`Dry-run error:`,e),n.status(400).json({error:e instanceof Error?e.message:`Dry-run validation failed`,valid:!1})}}),g.post(`${d}/explain`,async(e,t)=>{try{let n=e.body.query||e.body,r=e.body.options||{},i=await c(e,t),a=_.validateQuery(n);if(!a.isValid)return t.status(400).json({error:`Query validation failed: ${a.errors.join(`, `)}`});let o=await _.explainQuery(n,i,r);t.json(o)}catch(e){console.error(`Explain error:`,e),t.status(500).json({error:e instanceof Error?e.message:`Explain query failed`})}}),h&&g.post(`${d}/agent/chat`,async(e,t)=>{try{let{handleAgentChat:n}=await Promise.resolve().then(()=>require(`../handler-B8vuFQYP.cjs`)),{message:r,sessionId:i,history:a}=e.body;if(!r||typeof r!=`string`)return t.status(400).json({error:`message is required and must be a string`});let o=(h.apiKey||``).trim();if(h.allowClientApiKey){let t=e.headers[`x-agent-api-key`];t&&(o=t.trim())}if(!o)return t.status(401).json({error:`No API key configured. Set agent.apiKey in server config or send X-Agent-Api-Key header.`});let s=h.allowClientApiKey?e.headers[`x-agent-provider`]:void 0,l=h.allowClientApiKey?e.headers[`x-agent-model`]:void 0,u=h.allowClientApiKey?e.headers[`x-agent-provider-endpoint`]:void 0,d=await c(e,t),f=h.buildSystemContext?.(d);t.writeHead(200,{"Content-Type":`text/event-stream`,"Cache-Control":`no-cache`,Connection:`keep-alive`});try{let e=n({message:r,sessionId:i,history:a,semanticLayer:_,securityContext:d,agentConfig:h,apiKey:o,systemContext:f,providerOverride:s,modelOverride:l,baseURLOverride:u});for await(let n of e)t.write(`data: ${JSON.stringify(n)}\n\n`)}catch(e){let n={type:`error`,data:{message:e instanceof Error?e.message:`Stream failed`}};t.write(`data: ${JSON.stringify(n)}\n\n`)}finally{t.end()}}catch(e){console.error(`Agent chat error:`,e),t.headersSent||t.status(500).json({error:e instanceof Error?e.message:`Agent chat failed`})}}),m.enabled!==!1){let e=m.basePath??`/mcp`;g.post(`${e}`,async(e,n)=>{let r=t.p(e.headers.origin,m.allowedOrigins?{allowedOrigins:m.allowedOrigins}:{});if(!r.valid)return n.status(403).json(t.n(null,-32600,r.reason));let i=e.headers.accept;if(!t.f(i))return n.status(400).json(t.n(null,-32600,`Accept header must include both application/json and text/event-stream`));let a=t.c(e.headers);if(!a.ok)return n.status(426).json({error:`Unsupported MCP protocol version`,supported:a.supported});let o=t.l(e.body);if(!o)return n.status(400).json(t.n(null,-32600,`Invalid JSON-RPC 2.0 request`));let s=t.m(i),l=o.method===`initialize`;try{let r=await t.i(o.method,o.params,{semanticLayer:_,extractSecurityContext:c,rawRequest:e,rawResponse:n,negotiatedProtocol:a.negotiated});if(t.s(o))return n.status(202).end();let i=l&&r&&typeof r==`object`&&`sessionId`in r?r.sessionId:void 0;i&&n.setHeader(t.t,i);let u=t.r(o.id??null,r);if(s){let e=t.u();return n.status(200),n.setHeader(`Content-Type`,`text/event-stream`),n.setHeader(`Cache-Control`,`no-cache`),n.setHeader(`Connection`,`keep-alive`),n.write(`id: ${e}\n\n`),n.write(t.d(u,e)),n.end()}return n.json(u)}catch(e){if(t.s(o))return console.error(`MCP notification processing error:`,e),n.status(202).end();console.error(`MCP RPC error:`,e);let r=e?.code??-32603,i=e?.data,a=e.message||`MCP request failed`,c=t.n(o.id??null,r,a,i);if(s){let e=t.u();return n.status(200),n.setHeader(`Content-Type`,`text/event-stream`),n.setHeader(`Cache-Control`,`no-cache`),n.setHeader(`Connection`,`keep-alive`),n.write(`id: ${e}\n\n`),n.write(t.d(c,e)),n.end()}return n.status(200).json(c)}}),g.get(`${e}`,async(e,n)=>{let r=t.u();n.status(200),n.setHeader(`Content-Type`,`text/event-stream`),n.setHeader(`Cache-Control`,`no-cache`),n.setHeader(`Connection`,`keep-alive`),n.write(t.d({jsonrpc:`2.0`,method:`mcp/ready`,params:{protocol:`streamable-http`}},r,15e3));let i=setInterval(()=>{n.write(`: keep-alive
|
|
2
2
|
|
|
3
|
-
`)}
|
|
4
|
-
|
|
5
|
-
`)}finally{t.end()}}catch(e){console.error("Agent chat error:",e),t.headersSent||t.status(500).json({error:e instanceof Error?e.message:"Agent chat failed"})}}),E.enabled!==!1){const r=E.basePath??"/mcp";d.post(`${r}`,async(t,e)=>{const o=c.validateOriginHeader(t.headers.origin,E.allowedOrigins?{allowedOrigins:E.allowedOrigins}:{});if(!o.valid)return e.status(403).json(c.buildJsonRpcError(null,-32600,o.reason));const s=t.headers.accept;if(!c.validateAcceptHeader(s))return e.status(400).json(c.buildJsonRpcError(null,-32600,"Accept header must include both application/json and text/event-stream"));const a=c.negotiateProtocol(t.headers);if(!a.ok)return e.status(426).json({error:"Unsupported MCP protocol version",supported:a.supported});const i=c.parseJsonRpc(t.body);if(!i)return e.status(400).json(c.buildJsonRpcError(null,-32600,"Invalid JSON-RPC 2.0 request"));const m=c.wantsEventStream(s),R=i.method==="initialize";try{const l=await c.dispatchMcpMethod(i.method,i.params,{semanticLayer:u,extractSecurityContext:y,rawRequest:t,rawResponse:e,negotiatedProtocol:a.negotiated});if(c.isNotification(i))return e.status(202).end();const g=R&&l&&typeof l=="object"&&"sessionId"in l?l.sessionId:void 0;g&&e.setHeader(c.MCP_SESSION_ID_HEADER,g);const b=c.buildJsonRpcResult(i.id??null,l);if(m){const p=c.primeEventId();return e.status(200),e.setHeader("Content-Type","text/event-stream"),e.setHeader("Cache-Control","no-cache"),e.setHeader("Connection","keep-alive"),e.write(`id: ${p}
|
|
6
|
-
|
|
7
|
-
`),e.write(c.serializeSseEvent(b,p)),e.end()}return e.json(b)}catch(l){if(c.isNotification(i))return console.error("MCP notification processing error:",l),e.status(202).end();console.error("MCP RPC error:",l);const g=l?.code??-32603,b=l?.data,p=l.message||"MCP request failed",j=c.buildJsonRpcError(i.id??null,g,p,b);if(m){const q=c.primeEventId();return e.status(200),e.setHeader("Content-Type","text/event-stream"),e.setHeader("Cache-Control","no-cache"),e.setHeader("Connection","keep-alive"),e.write(`id: ${q}
|
|
8
|
-
|
|
9
|
-
`),e.write(c.serializeSseEvent(j,q)),e.end()}return e.status(200).json(j)}}),d.get(`${r}`,async(t,e)=>{const o=c.primeEventId();e.status(200),e.setHeader("Content-Type","text/event-stream"),e.setHeader("Cache-Control","no-cache"),e.setHeader("Connection","keep-alive"),e.write(c.serializeSseEvent({jsonrpc:"2.0",method:"mcp/ready",params:{protocol:"streamable-http"}},o,15e3));const s=setInterval(()=>{e.write(`: keep-alive
|
|
10
|
-
|
|
11
|
-
`)},15e3);t.on("close",()=>{clearInterval(s)})}),d.delete(`${r}`,(t,e)=>e.status(405).json({error:"Session termination not supported"}))}return d.use((r,t,e,o)=>{console.error("Express adapter error:",r),e.headersSent||e.status(500).json(n.formatErrorResponse(r,500))}),d}function A(C,v){const x=$(v);return C.use("/",x),C}function M(C){const v=w();return A(v,C)}exports.createCubeApp=M;exports.createCubeRouter=$;exports.mountCubeRoutes=A;
|
|
3
|
+
`)},15e3);e.on(`close`,()=>{clearInterval(i)})}),g.delete(`${e}`,(e,t)=>t.status(405).json({error:`Session termination not supported`}))}return g.use((t,n,r,i)=>{console.error(`Express adapter error:`,t),r.headersSent||r.status(500).json(e.i(t,500))}),g}function a(e,t){let n=i(t);return e.use(`/`,n),e}function o(e){return a((0,n.default)(),e)}exports.createCubeApp=o,exports.createCubeRouter=i,exports.mountCubeRoutes=a;
|