drizzle-cube 0.4.29 → 0.4.31
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.d.ts +1 -1
- package/dist/adapters/express/index.js +232 -342
- package/dist/adapters/fastify/index.cjs +2 -10
- package/dist/adapters/fastify/index.d.ts +1 -1
- 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-BiVT5Sa4.js +2951 -0
- package/dist/adapters/handler-GLMhjuwG.cjs +25 -0
- package/dist/adapters/hono/index.cjs +2 -10
- package/dist/adapters/hono/index.d.ts +1 -1
- 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-Cs6gEFCi.js +8127 -0
- package/dist/adapters/mcp-transport-nyTtswLM.cjs +254 -0
- package/dist/adapters/nextjs/index.cjs +1 -9
- package/dist/adapters/nextjs/index.d.ts +1 -1
- package/dist/adapters/nextjs/index.js +377 -600
- package/dist/adapters/openai-C5Brybjm.cjs +1 -0
- package/dist/adapters/openai-D1zCEi6A.cjs +16 -0
- package/dist/adapters/openai-DPuFtYsB.js +4136 -0
- package/dist/adapters/openai-wU05wYGL.js +153 -0
- package/dist/adapters/types.cjs +0 -1
- package/dist/adapters/types.js +0 -1
- package/dist/adapters/utils-Dj1adfDc.js +5399 -0
- package/dist/adapters/utils-cb6OWP7J.cjs +15 -0
- package/dist/adapters/utils.cjs +1 -19
- package/dist/adapters/utils.d.ts +1 -1
- package/dist/adapters/utils.js +2 -21333
- package/dist/client/charts.js +15 -186
- package/dist/client/chunks/DashboardEditModal-DenRJiYr.js +6678 -0
- package/dist/client/chunks/DashboardEditModal-DenRJiYr.js.map +1 -0
- package/dist/client/chunks/FieldSearchModal-BQS1v1up.js +2631 -0
- package/dist/client/chunks/FieldSearchModal-BQS1v1up.js.map +1 -0
- package/dist/client/chunks/RetentionCombinedChart-D4Yf1TnQ.js +270 -0
- package/dist/client/chunks/RetentionCombinedChart-D4Yf1TnQ.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-DG38V1gO.js +6105 -0
- package/dist/client/chunks/analysis-builder-DG38V1gO.js.map +1 -0
- package/dist/client/chunks/analysis-builder-shared-DaFu78dk.js +3116 -0
- package/dist/client/chunks/analysis-builder-shared-DaFu78dk.js.map +1 -0
- package/dist/client/chunks/chart-activity-grid-wR2Twpo7.js +806 -0
- package/dist/client/chunks/chart-activity-grid-wR2Twpo7.js.map +1 -0
- package/dist/client/chunks/chart-area-e9ysnatQ.js +449 -0
- package/dist/client/chunks/chart-area-e9ysnatQ.js.map +1 -0
- package/dist/client/chunks/chart-bar-Bx4oKlqo.js +270 -0
- package/dist/client/chunks/chart-bar-Bx4oKlqo.js.map +1 -0
- package/dist/client/chunks/chart-box-plot-CVIi1aM5.js +377 -0
- package/dist/client/chunks/chart-box-plot-CVIi1aM5.js.map +1 -0
- package/dist/client/chunks/chart-bubble-DvyG15UB.js +273 -0
- package/dist/client/chunks/chart-bubble-DvyG15UB.js.map +1 -0
- package/dist/client/chunks/chart-candlestick-caHyxB9O.js +306 -0
- package/dist/client/chunks/chart-candlestick-caHyxB9O.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-B2m_6EZe.js +4088 -0
- package/dist/client/chunks/chart-data-table-B2m_6EZe.js.map +1 -0
- package/dist/client/chunks/chart-funnel-C9JRW79j.js +447 -0
- package/dist/client/chunks/chart-funnel-C9JRW79j.js.map +1 -0
- package/dist/client/chunks/chart-gauge-BLLJqeXo.js +424 -0
- package/dist/client/chunks/chart-gauge-BLLJqeXo.js.map +1 -0
- package/dist/client/chunks/chart-heat-map-f2fM2mDC.js +236 -0
- package/dist/client/chunks/chart-heat-map-f2fM2mDC.js.map +1 -0
- package/dist/client/chunks/chart-kpi-delta-S6qDEoJO.js +343 -0
- package/dist/client/chunks/chart-kpi-delta-S6qDEoJO.js.map +1 -0
- package/dist/client/chunks/chart-kpi-number-CEUBsVW2.js +326 -0
- package/dist/client/chunks/chart-kpi-number-CEUBsVW2.js.map +1 -0
- package/dist/client/chunks/chart-kpi-text-DgRig_jQ.js +149 -0
- package/dist/client/chunks/chart-kpi-text-DgRig_jQ.js.map +1 -0
- package/dist/client/chunks/chart-line-CPhQRMZ7.js +432 -0
- package/dist/client/chunks/chart-line-CPhQRMZ7.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-CVlqGslU.js +179 -0
- package/dist/client/chunks/chart-measure-profile-CVlqGslU.js.map +1 -0
- package/dist/client/chunks/chart-pie-DafSc9sE.js +172 -0
- package/dist/client/chunks/chart-pie-DafSc9sE.js.map +1 -0
- package/dist/client/chunks/chart-radar-Dz9F5k-B.js +154 -0
- package/dist/client/chunks/chart-radar-Dz9F5k-B.js.map +1 -0
- package/dist/client/chunks/chart-radial-bar-N3MNUL7o.js +148 -0
- package/dist/client/chunks/chart-radial-bar-N3MNUL7o.js.map +1 -0
- package/dist/client/chunks/chart-sankey-8nRYnupt.js +222 -0
- package/dist/client/chunks/chart-sankey-8nRYnupt.js.map +1 -0
- package/dist/client/chunks/chart-scatter-J2JNi88S.js +255 -0
- package/dist/client/chunks/chart-scatter-J2JNi88S.js.map +1 -0
- package/dist/client/chunks/chart-sunburst-D1NFQjqk.js +221 -0
- package/dist/client/chunks/chart-sunburst-D1NFQjqk.js.map +1 -0
- package/dist/client/chunks/chart-tree-map-CbYjko2s.js +298 -0
- package/dist/client/chunks/chart-tree-map-CbYjko2s.js.map +1 -0
- package/dist/client/chunks/chart-waterfall-Z65TGMUO.js +237 -0
- package/dist/client/chunks/chart-waterfall-Z65TGMUO.js.map +1 -0
- package/dist/client/chunks/charts-core-CJlGzwsW.js +215 -0
- package/dist/client/chunks/charts-core-CJlGzwsW.js.map +1 -0
- package/dist/client/chunks/charts-loader-BI07yxaQ.js +259 -0
- package/dist/client/chunks/charts-loader-BI07yxaQ.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-DPL5_Tkh.js +1073 -0
- package/dist/client/chunks/schema-visualization-DPL5_Tkh.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-DkuM7nQk.js +1394 -0
- package/dist/client/chunks/useDebounce-DkuM7nQk.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-RflLTDVL.js +203 -0
- package/dist/client/chunks/useExplainAI-RflLTDVL.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--32ZtfbZ.js +128 -0
- package/dist/client/chunks/utils--32ZtfbZ.js.map +1 -0
- package/dist/client/chunks/vendor-CZX7UVzM.js +828 -0
- package/dist/client/chunks/vendor-CZX7UVzM.js.map +1 -0
- package/dist/client/components/AnalysisBuilder/AnalysisModeErrorBoundary.d.ts +0 -1
- 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 +110 -129
- package/dist/server/index.d.ts +43 -9
- package/dist/server/index.js +15398 -34394
- package/dist/server/openai-CucrxPHM.cjs +16 -0
- package/dist/server/openai-DiyuZ3ds.cjs +1 -0
- package/dist/server/openai-nZJcAzON.js +4136 -0
- package/dist/server/openai-owPdq1yN.js +153 -0
- package/package.json +18 -8
- 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-BHguLZOY.js +0 -2713
- package/dist/adapters/handler-DOIyiFPg.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-CWGqDQSI.cjs +0 -259
- package/dist/adapters/mcp-transport-CyeHMDPl.js +0 -11055
- 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,153 @@
|
|
|
1
|
+
//#region src/server/agent/providers/openai.ts
|
|
2
|
+
var e = class {
|
|
3
|
+
client;
|
|
4
|
+
apiKey;
|
|
5
|
+
baseURL;
|
|
6
|
+
initialized = !1;
|
|
7
|
+
constructor(e, t) {
|
|
8
|
+
this.apiKey = e, this.baseURL = t?.baseURL;
|
|
9
|
+
}
|
|
10
|
+
async ensureClient() {
|
|
11
|
+
if (this.initialized) return;
|
|
12
|
+
let e;
|
|
13
|
+
try {
|
|
14
|
+
let t = await import(
|
|
15
|
+
/* webpackIgnore: true */
|
|
16
|
+
"./openai-nZJcAzON.js"
|
|
17
|
+
);
|
|
18
|
+
e = t.default || t.OpenAI || t;
|
|
19
|
+
} catch {
|
|
20
|
+
throw Error("openai is required for the OpenAI provider. Install it with: npm install openai");
|
|
21
|
+
}
|
|
22
|
+
let t = { apiKey: this.apiKey };
|
|
23
|
+
this.baseURL && (t.baseURL = this.baseURL), this.client = new e(t), this.initialized = !0;
|
|
24
|
+
}
|
|
25
|
+
async createStream(e) {
|
|
26
|
+
await this.ensureClient();
|
|
27
|
+
let { messages: t } = this.formatMessages(e.messages, e.system);
|
|
28
|
+
return this.client.chat.completions.create({
|
|
29
|
+
model: e.model,
|
|
30
|
+
max_completion_tokens: e.maxTokens,
|
|
31
|
+
tools: this.formatTools(e.tools),
|
|
32
|
+
messages: t,
|
|
33
|
+
stream: !0,
|
|
34
|
+
stream_options: { include_usage: !0 }
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
async *parseStreamEvents(e) {
|
|
38
|
+
let t = /* @__PURE__ */ new Map();
|
|
39
|
+
for await (let n of e) {
|
|
40
|
+
let e = n;
|
|
41
|
+
e.usage && (yield {
|
|
42
|
+
type: "message_meta",
|
|
43
|
+
inputTokens: e.usage.prompt_tokens,
|
|
44
|
+
outputTokens: e.usage.completion_tokens,
|
|
45
|
+
stopReason: ""
|
|
46
|
+
});
|
|
47
|
+
let r = e.choices?.[0];
|
|
48
|
+
if (!r) continue;
|
|
49
|
+
let i = r.delta;
|
|
50
|
+
if (i) {
|
|
51
|
+
if (i.content && (yield {
|
|
52
|
+
type: "text_delta",
|
|
53
|
+
text: i.content
|
|
54
|
+
}), i.tool_calls) for (let e of i.tool_calls) {
|
|
55
|
+
let n = e.index ?? 0;
|
|
56
|
+
if (e.id && (t.set(n, {
|
|
57
|
+
id: e.id,
|
|
58
|
+
name: e.function?.name || "",
|
|
59
|
+
arguments: ""
|
|
60
|
+
}), yield {
|
|
61
|
+
type: "tool_use_start",
|
|
62
|
+
id: e.id,
|
|
63
|
+
name: e.function?.name || ""
|
|
64
|
+
}), e.function?.name && t.has(n)) {
|
|
65
|
+
let r = t.get(n);
|
|
66
|
+
r.name ||= e.function.name;
|
|
67
|
+
}
|
|
68
|
+
if (e.function?.arguments) {
|
|
69
|
+
let r = t.get(n);
|
|
70
|
+
r && (r.arguments += e.function.arguments, yield {
|
|
71
|
+
type: "tool_input_delta",
|
|
72
|
+
json: e.function.arguments
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (r.finish_reason) {
|
|
77
|
+
for (let [e, n] of t) {
|
|
78
|
+
let r = {};
|
|
79
|
+
try {
|
|
80
|
+
n.arguments && (r = JSON.parse(n.arguments));
|
|
81
|
+
} catch {}
|
|
82
|
+
yield {
|
|
83
|
+
type: "tool_use_end",
|
|
84
|
+
id: n.id,
|
|
85
|
+
input: r
|
|
86
|
+
}, t.delete(e);
|
|
87
|
+
}
|
|
88
|
+
yield {
|
|
89
|
+
type: "message_meta",
|
|
90
|
+
stopReason: r.finish_reason
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
formatTools(e) {
|
|
97
|
+
return e.map((e) => ({
|
|
98
|
+
type: "function",
|
|
99
|
+
function: {
|
|
100
|
+
name: e.name,
|
|
101
|
+
description: e.description,
|
|
102
|
+
parameters: e.parameters
|
|
103
|
+
}
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
formatMessages(e, t) {
|
|
107
|
+
let n = [{
|
|
108
|
+
role: "system",
|
|
109
|
+
content: t
|
|
110
|
+
}];
|
|
111
|
+
for (let t of e) if (t.role === "user") n.push({
|
|
112
|
+
role: "user",
|
|
113
|
+
content: typeof t.content == "string" ? t.content : JSON.stringify(t.content)
|
|
114
|
+
});
|
|
115
|
+
else if (t.role === "assistant") if (typeof t.content == "string") n.push({
|
|
116
|
+
role: "assistant",
|
|
117
|
+
content: t.content
|
|
118
|
+
});
|
|
119
|
+
else {
|
|
120
|
+
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) => ({
|
|
121
|
+
id: e.id,
|
|
122
|
+
type: "function",
|
|
123
|
+
function: {
|
|
124
|
+
name: e.name,
|
|
125
|
+
arguments: JSON.stringify(e.input || {})
|
|
126
|
+
}
|
|
127
|
+
})), a = { role: "assistant" };
|
|
128
|
+
r && (a.content = r), i.length > 0 && (a.tool_calls = i), n.push(a);
|
|
129
|
+
}
|
|
130
|
+
else t.role === "tool" ? n.push(t) : t.role === "tool_result" && n.push({
|
|
131
|
+
role: "user",
|
|
132
|
+
content: typeof t.content == "string" ? t.content : JSON.stringify(t.content)
|
|
133
|
+
});
|
|
134
|
+
return { messages: n };
|
|
135
|
+
}
|
|
136
|
+
formatToolResults(e) {
|
|
137
|
+
return e.map((e) => ({
|
|
138
|
+
role: "tool",
|
|
139
|
+
tool_call_id: e.toolUseId,
|
|
140
|
+
content: e.content
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
143
|
+
shouldContinue(e) {
|
|
144
|
+
return e === "tool_calls";
|
|
145
|
+
}
|
|
146
|
+
formatError(e) {
|
|
147
|
+
if (!e || !(e instanceof Error)) return "Something went wrong. Please try again.";
|
|
148
|
+
let t = e.message || "", n = e;
|
|
149
|
+
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;
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
//#endregion
|
|
153
|
+
export { e as OpenAIProvider };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "drizzle-cube",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.31",
|
|
4
4
|
"description": "Drizzle ORM-first semantic layer with Cube.js compatibility. Type-safe analytics and dashboards with SQL injection protection.",
|
|
5
5
|
"main": "./dist/server/index.js",
|
|
6
6
|
"types": "./dist/server/index.d.ts",
|
|
@@ -103,7 +103,8 @@
|
|
|
103
103
|
"test:coverage:mysql": "TEST_DB_TYPE=mysql COVERAGE_DIR=./coverage/mysql vitest run --coverage --config vitest.config.server.ts",
|
|
104
104
|
"test:coverage:sqlite": "TEST_DB_TYPE=sqlite COVERAGE_DIR=./coverage/sqlite vitest run --coverage --config vitest.config.server.ts",
|
|
105
105
|
"test:coverage:duckdb": "TEST_DB_TYPE=duckdb COVERAGE_DIR=./coverage/duckdb vitest run --coverage --config vitest.config.server.ts",
|
|
106
|
-
"test:coverage:
|
|
106
|
+
"test:coverage:databend": "TEST_DB_TYPE=databend COVERAGE_DIR=./coverage/databend vitest run --coverage --config vitest.config.server.ts",
|
|
107
|
+
"test:coverage:all": "npm run test:coverage:postgres && npm run test:coverage:mysql && npm run test:coverage:sqlite && npm run test:coverage:duckdb && npm run test:coverage:databend && npm run coverage:index",
|
|
107
108
|
"test:coverage:complete": "npm run test:coverage:all && npm run test:client:coverage && npm run coverage:index",
|
|
108
109
|
"test:client": "vitest run --config vitest.config.client.ts",
|
|
109
110
|
"test:client:watch": "vitest --watch --config vitest.config.client.ts",
|
|
@@ -119,7 +120,8 @@
|
|
|
119
120
|
"test:mysql": "TEST_DB_TYPE=mysql vitest run --config vitest.config.server.ts",
|
|
120
121
|
"test:sqlite": "TEST_DB_TYPE=sqlite vitest run --config vitest.config.server.ts",
|
|
121
122
|
"test:duckdb": "TEST_DB_TYPE=duckdb vitest run --config vitest.config.server.ts",
|
|
122
|
-
"test:
|
|
123
|
+
"test:databend": "TEST_DB_TYPE=databend vitest run --config vitest.config.server.ts",
|
|
124
|
+
"test:all": "vitest run && TEST_DB_TYPE=mysql vitest run --config vitest.config.server.ts && TEST_DB_TYPE=sqlite vitest run --config vitest.config.server.ts && TEST_DB_TYPE=duckdb vitest run --config vitest.config.server.ts && TEST_DB_TYPE=databend vitest run --config vitest.config.server.ts",
|
|
123
125
|
"test:setup": "docker-compose up -d",
|
|
124
126
|
"test:teardown": "docker-compose down",
|
|
125
127
|
"typecheck": "tsc --noEmit",
|
|
@@ -164,7 +166,6 @@
|
|
|
164
166
|
},
|
|
165
167
|
"peerDependencies": {
|
|
166
168
|
"@anthropic-ai/sdk": ">=0.30.0",
|
|
167
|
-
"elkjs": "^0.9.0 || ^0.11.1",
|
|
168
169
|
"@google/generative-ai": ">=0.21.0",
|
|
169
170
|
"@neondatabase/serverless": "^1.0.1",
|
|
170
171
|
"@nivo/heatmap": "^0.99.0",
|
|
@@ -172,6 +173,7 @@
|
|
|
172
173
|
"cors": "^2.8.5",
|
|
173
174
|
"d3": "^7.9.0",
|
|
174
175
|
"drizzle-orm": "^0.45.0",
|
|
176
|
+
"elkjs": "^0.9.0 || ^0.11.1",
|
|
175
177
|
"express": "^5.0.0",
|
|
176
178
|
"fastify": "^5.0.0",
|
|
177
179
|
"hono": "^4.0.0",
|
|
@@ -229,6 +231,12 @@
|
|
|
229
231
|
"@leonardovida-md/drizzle-neo-duckdb": {
|
|
230
232
|
"optional": true
|
|
231
233
|
},
|
|
234
|
+
"databend-driver": {
|
|
235
|
+
"optional": true
|
|
236
|
+
},
|
|
237
|
+
"drizzle-databend": {
|
|
238
|
+
"optional": true
|
|
239
|
+
},
|
|
232
240
|
"@anthropic-ai/sdk": {
|
|
233
241
|
"optional": true
|
|
234
242
|
},
|
|
@@ -250,8 +258,7 @@
|
|
|
250
258
|
"@leonardovida-md/drizzle-neo-duckdb": "^1.2.2"
|
|
251
259
|
},
|
|
252
260
|
"devDependencies": {
|
|
253
|
-
"@anthropic-ai/sdk": "^0.
|
|
254
|
-
"elkjs": "^0.11.1",
|
|
261
|
+
"@anthropic-ai/sdk": "^0.79.0",
|
|
255
262
|
"@eslint/eslintrc": "^3.3.1",
|
|
256
263
|
"@eslint/js": "^10.0.0",
|
|
257
264
|
"@fastify/cors": "^11.1.0",
|
|
@@ -280,7 +287,7 @@
|
|
|
280
287
|
"@types/supertest": "^7.0.0",
|
|
281
288
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
282
289
|
"@typescript-eslint/parser": "^8.0.0",
|
|
283
|
-
"@vitejs/plugin-react": "^
|
|
290
|
+
"@vitejs/plugin-react": "^6.0.0",
|
|
284
291
|
"@vitest/coverage-v8": "^4.0.0",
|
|
285
292
|
"@vitest/ui": "^4.0.0",
|
|
286
293
|
"@xyflow/react": "^12.10.1",
|
|
@@ -288,9 +295,12 @@
|
|
|
288
295
|
"concurrently": "^9.0.0",
|
|
289
296
|
"cors": "^2.8.5",
|
|
290
297
|
"d3": "^7.9.0",
|
|
298
|
+
"databend-driver": "^0.33.6",
|
|
291
299
|
"dotenv": "^17.2.3",
|
|
300
|
+
"drizzle-databend": "^0.1.12",
|
|
292
301
|
"drizzle-kit": "^0.31.8",
|
|
293
302
|
"drizzle-orm": "^0.45.0",
|
|
303
|
+
"elkjs": "^0.11.1",
|
|
294
304
|
"eslint": "^10.0.0",
|
|
295
305
|
"eslint-plugin-react-hooks": "^7.0.1",
|
|
296
306
|
"express": "^5.1.0",
|
|
@@ -318,7 +328,7 @@
|
|
|
318
328
|
"tailwindcss": "^4.1.12",
|
|
319
329
|
"tsx": "^4.20.5",
|
|
320
330
|
"typescript": "^5.0.0",
|
|
321
|
-
"vite": "^
|
|
331
|
+
"vite": "^8.0.0",
|
|
322
332
|
"vite-plugin-dts": "^4.0.0",
|
|
323
333
|
"vitest": "^4.0.0",
|
|
324
334
|
"zod": "^4.0.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var l=Object.create;var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var p=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty;var y=(o,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of u(e))!d.call(o,t)&&t!==r&&i(o,t,{get:()=>e[t],enumerable:!(s=c(e,t))||s.enumerable});return o};var m=(o,e,r)=>(r=o!=null?l(p(o)):{},y(e||!o||!o.__esModule?i(r,"default",{value:o,enumerable:!0}):r,o));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class _{client;constructor(e){this.apiKey=e}apiKey;initialized=!1;async ensureClient(){if(this.initialized)return;let e;try{const r=await import("@anthropic-ai/sdk");e=r.default||r.Anthropic||r}catch{throw new Error("@anthropic-ai/sdk is required for the Anthropic provider. Install it with: npm install @anthropic-ai/sdk")}this.client=new e({apiKey:this.apiKey}),this.initialized=!0}async createStream(e){await this.ensureClient();const{messages:r,system:s}=this.formatMessages(e.messages,e.system);return this.client.messages.create({model:e.model,max_tokens:e.maxTokens,system:s,tools:this.formatTools(e.tools),messages:r,stream:!0})}async*parseStreamEvents(e){for await(const r of e){const s=r;switch(s.type){case"content_block_start":{const t=s.content_block;t.type==="tool_use"&&(yield{type:"tool_use_start",id:t.id,name:t.name});break}case"content_block_delta":{const t=s.delta;t.type==="text_delta"&&t.text?yield{type:"text_delta",text:t.text}:t.type==="input_json_delta"&&t.partial_json&&(yield{type:"tool_input_delta",json:t.partial_json});break}case"content_block_stop":{yield{type:"tool_use_end"};break}case"message_start":{const t=s.message;t?.usage?.input_tokens!=null&&(yield{type:"message_meta",inputTokens:t.usage.input_tokens,stopReason:""});break}case"message_delta":{const t=s.usage,a=s.delta?.stop_reason||"";yield{type:"message_meta",outputTokens:t?.output_tokens,stopReason:a};break}}}}formatTools(e){return e.map(r=>({name:r.name,description:r.description,input_schema:r.parameters}))}formatMessages(e,r){return{messages:e.map(t=>t.role==="tool_result"?{role:"user",content:t.content}:{role:t.role,content:t.content}),system:r}}formatToolResults(e){return{role:"user",content:e.map(r=>({type:"tool_result",tool_use_id:r.toolUseId,content:r.content,...r.isError?{is_error:!0}:{}}))}}shouldContinue(e){return e==="tool_use"}formatError(e){if(!e||!(e instanceof Error))return"Something went wrong. Please try again.";const r=e.message||"",s={overloaded_error:"The AI service is temporarily overloaded. Please try again in a moment.",rate_limit_error:"Too many requests. Please wait a moment and try again.",api_error:"The AI service encountered an error. Please try again.",authentication_error:"Authentication failed. Please check your API key configuration.",invalid_request_error:"There was a problem with the request. Please try again."},t=e;if(t.status||t.type){const a=t.error?.type||t.type||"";if(s[a])return s[a]}if(r.startsWith("{")||r.startsWith("Error: {")){try{const a=JSON.parse(r.replace(/^Error:\s*/,"")),n=a.error?.type||a.type||"";if(s[n])return s[n]}catch{}return"The AI service encountered an error. Please try again."}return r}}exports.AnthropicProvider=_;
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
class i {
|
|
2
|
-
client;
|
|
3
|
-
constructor(e) {
|
|
4
|
-
this.apiKey = e;
|
|
5
|
-
}
|
|
6
|
-
apiKey;
|
|
7
|
-
initialized = !1;
|
|
8
|
-
async ensureClient() {
|
|
9
|
-
if (this.initialized) return;
|
|
10
|
-
let e;
|
|
11
|
-
try {
|
|
12
|
-
const r = await import(
|
|
13
|
-
/* webpackIgnore: true */
|
|
14
|
-
"@anthropic-ai/sdk"
|
|
15
|
-
);
|
|
16
|
-
e = r.default || r.Anthropic || r;
|
|
17
|
-
} catch {
|
|
18
|
-
throw new Error("@anthropic-ai/sdk is required for the Anthropic provider. Install it with: npm install @anthropic-ai/sdk");
|
|
19
|
-
}
|
|
20
|
-
this.client = new e({ apiKey: this.apiKey }), this.initialized = !0;
|
|
21
|
-
}
|
|
22
|
-
async createStream(e) {
|
|
23
|
-
await this.ensureClient();
|
|
24
|
-
const { messages: r, system: s } = this.formatMessages(e.messages, e.system);
|
|
25
|
-
return this.client.messages.create({
|
|
26
|
-
model: e.model,
|
|
27
|
-
max_tokens: e.maxTokens,
|
|
28
|
-
system: s,
|
|
29
|
-
tools: this.formatTools(e.tools),
|
|
30
|
-
messages: r,
|
|
31
|
-
stream: !0
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
async *parseStreamEvents(e) {
|
|
35
|
-
for await (const r of e) {
|
|
36
|
-
const s = r;
|
|
37
|
-
switch (s.type) {
|
|
38
|
-
case "content_block_start": {
|
|
39
|
-
const t = s.content_block;
|
|
40
|
-
t.type === "tool_use" && (yield { type: "tool_use_start", id: t.id, name: t.name });
|
|
41
|
-
break;
|
|
42
|
-
}
|
|
43
|
-
case "content_block_delta": {
|
|
44
|
-
const t = s.delta;
|
|
45
|
-
t.type === "text_delta" && t.text ? yield { type: "text_delta", text: t.text } : t.type === "input_json_delta" && t.partial_json && (yield { type: "tool_input_delta", json: t.partial_json });
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
case "content_block_stop": {
|
|
49
|
-
yield { type: "tool_use_end" };
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
case "message_start": {
|
|
53
|
-
const t = s.message;
|
|
54
|
-
t?.usage?.input_tokens != null && (yield {
|
|
55
|
-
type: "message_meta",
|
|
56
|
-
inputTokens: t.usage.input_tokens,
|
|
57
|
-
stopReason: ""
|
|
58
|
-
});
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
case "message_delta": {
|
|
62
|
-
const t = s.usage, o = s.delta?.stop_reason || "";
|
|
63
|
-
yield {
|
|
64
|
-
type: "message_meta",
|
|
65
|
-
outputTokens: t?.output_tokens,
|
|
66
|
-
stopReason: o
|
|
67
|
-
};
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
formatTools(e) {
|
|
74
|
-
return e.map((r) => ({
|
|
75
|
-
name: r.name,
|
|
76
|
-
description: r.description,
|
|
77
|
-
input_schema: r.parameters
|
|
78
|
-
}));
|
|
79
|
-
}
|
|
80
|
-
formatMessages(e, r) {
|
|
81
|
-
return { messages: e.map((t) => t.role === "tool_result" ? { role: "user", content: t.content } : { role: t.role, content: t.content }), system: r };
|
|
82
|
-
}
|
|
83
|
-
formatToolResults(e) {
|
|
84
|
-
return {
|
|
85
|
-
role: "user",
|
|
86
|
-
content: e.map((r) => ({
|
|
87
|
-
type: "tool_result",
|
|
88
|
-
tool_use_id: r.toolUseId,
|
|
89
|
-
content: r.content,
|
|
90
|
-
...r.isError ? { is_error: !0 } : {}
|
|
91
|
-
}))
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
shouldContinue(e) {
|
|
95
|
-
return e === "tool_use";
|
|
96
|
-
}
|
|
97
|
-
formatError(e) {
|
|
98
|
-
if (!e || !(e instanceof Error))
|
|
99
|
-
return "Something went wrong. Please try again.";
|
|
100
|
-
const r = e.message || "", s = {
|
|
101
|
-
overloaded_error: "The AI service is temporarily overloaded. Please try again in a moment.",
|
|
102
|
-
rate_limit_error: "Too many requests. Please wait a moment and try again.",
|
|
103
|
-
api_error: "The AI service encountered an error. Please try again.",
|
|
104
|
-
authentication_error: "Authentication failed. Please check your API key configuration.",
|
|
105
|
-
invalid_request_error: "There was a problem with the request. Please try again."
|
|
106
|
-
}, t = e;
|
|
107
|
-
if (t.status || t.type) {
|
|
108
|
-
const o = t.error?.type || t.type || "";
|
|
109
|
-
if (s[o])
|
|
110
|
-
return s[o];
|
|
111
|
-
}
|
|
112
|
-
if (r.startsWith("{") || r.startsWith("Error: {")) {
|
|
113
|
-
try {
|
|
114
|
-
const o = JSON.parse(r.replace(/^Error:\s*/, "")), a = o.error?.type || o.type || "";
|
|
115
|
-
if (s[a])
|
|
116
|
-
return s[a];
|
|
117
|
-
} catch {
|
|
118
|
-
}
|
|
119
|
-
return "The AI service encountered an error. Please try again.";
|
|
120
|
-
}
|
|
121
|
-
return r;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
export {
|
|
125
|
-
i as AnthropicProvider
|
|
126
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function l(u){const e={};for(const[t,s]of Object.entries(u))if(t==="type"&&typeof s=="string")e[t]=s.toUpperCase();else if(t==="properties"&&typeof s=="object"&&s!==null){const n={};for(const[a,o]of Object.entries(s))typeof o=="object"&&o!==null?n[a]=l(o):n[a]=o;e[t]=n}else t==="items"&&typeof s=="object"&&s!==null?e[t]=l(s):e[t]=s;return e}class p{apiKey;sdk;initialized=!1;constructor(e){this.apiKey=e}async ensureSDK(){if(!this.initialized){try{this.sdk=await Promise.resolve().then(()=>require("./index-BgCeQBuN.cjs"))}catch{throw new Error("@google/generative-ai is required for the Google provider. Install it with: npm install @google/generative-ai")}this.initialized=!0}}async createStream(e){await this.ensureSDK();const{GoogleGenerativeAI:t}=this.sdk,n=new t(this.apiKey).getGenerativeModel({model:e.model,systemInstruction:e.system,generationConfig:{maxOutputTokens:e.maxTokens}}),{messages:a}=this.formatMessages(e.messages,e.system),o=this.formatTools(e.tools);return(await n.generateContentStream({contents:a,tools:o.length>0?[{functionDeclarations:o}]:void 0})).stream}async*parseStreamEvents(e){let t="stop",s=!1;for await(const n of e){const a=n;a.usageMetadata&&(yield{type:"message_meta",inputTokens:a.usageMetadata.promptTokenCount,outputTokens:a.usageMetadata.candidatesTokenCount,stopReason:""});const o=a.candidates?.[0];if(!o)continue;o.finishReason&&(o.finishReason==="STOP"?t="stop":o.finishReason==="MAX_TOKENS"?t="max_tokens":t=o.finishReason);const i=o.content?.parts;if(i){for(const r of i)if(r.text&&!r.thought&&(yield{type:"text_delta",text:r.text}),r.functionCall){s=!0;const f=`gemini-tc-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,c=r.thoughtSignature?{thoughtSignature:r.thoughtSignature}:void 0;yield{type:"tool_use_start",id:f,name:r.functionCall.name,...c?{metadata:c}:{}},yield{type:"tool_input_delta",json:JSON.stringify(r.functionCall.args||{})},yield{type:"tool_use_end"}}}}yield{type:"message_meta",stopReason:s?"tool_use":t}}formatTools(e){return e.map(t=>({name:t.name,description:t.description,parameters:l(t.parameters)}))}formatMessages(e,t){const s=[];for(const n of e)if(n.role==="tool_result"){const a=n._toolResults;if(a&&a.length>0)s.push({role:"user",parts:a.map(o=>({functionResponse:{name:o.toolName||o.toolUseId,response:{content:o.content,isError:o.isError||!1}}}))});else{const o=typeof n.content=="string"?n.content:JSON.stringify(n.content);o&&s.push({role:"user",parts:[{text:o}]})}}else if(n.role==="user"){const a=typeof n.content=="string"?n.content:JSON.stringify(n.content);s.push({role:"user",parts:[{text:a}]})}else if(n.role==="assistant")if(typeof n.content=="string")s.push({role:"model",parts:[{text:n.content}]});else{const a=n.content,o=[];for(const i of a)if(i.type==="text"&&i.text)o.push({text:i.text});else if(i.type==="tool_use"){const r={functionCall:{name:i.name,args:i.input||{}}};i.metadata?.thoughtSignature&&(r.thoughtSignature=i.metadata.thoughtSignature),o.push(r)}o.length>0&&s.push({role:"model",parts:o})}return{messages:s}}formatToolResults(e){return{role:"tool_result",content:e.map(t=>`${t.toolName||t.toolUseId}: ${t.content}`).join(`
|
|
2
|
-
`),_toolResults:e}}shouldContinue(e){return e==="tool_use"}formatError(e){if(!e||!(e instanceof Error))return"Something went wrong. Please try again.";const t=e.message||"",s=e;return s.status===429?"Too many requests. Please wait a moment and try again.":s.status===403||s.status===401?"Authentication failed. Please check your API key configuration.":s.status===503||s.status===500?"The AI service is temporarily unavailable. Please try again in a moment.":t.includes("SAFETY")?"The request was blocked by safety filters. Please rephrase your request.":t.includes("RECITATION")?"The response was blocked due to recitation concerns. Please try a different query.":t.startsWith("{")||t.startsWith("[")?"The AI service encountered an error. Please try again.":t}}exports.GoogleProvider=p;
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
function l(u) {
|
|
2
|
-
const t = {};
|
|
3
|
-
for (const [e, s] of Object.entries(u))
|
|
4
|
-
if (e === "type" && typeof s == "string")
|
|
5
|
-
t[e] = s.toUpperCase();
|
|
6
|
-
else if (e === "properties" && typeof s == "object" && s !== null) {
|
|
7
|
-
const n = {};
|
|
8
|
-
for (const [a, o] of Object.entries(s))
|
|
9
|
-
typeof o == "object" && o !== null ? n[a] = l(o) : n[a] = o;
|
|
10
|
-
t[e] = n;
|
|
11
|
-
} else e === "items" && typeof s == "object" && s !== null ? t[e] = l(s) : t[e] = s;
|
|
12
|
-
return t;
|
|
13
|
-
}
|
|
14
|
-
class p {
|
|
15
|
-
apiKey;
|
|
16
|
-
sdk;
|
|
17
|
-
initialized = !1;
|
|
18
|
-
constructor(t) {
|
|
19
|
-
this.apiKey = t;
|
|
20
|
-
}
|
|
21
|
-
async ensureSDK() {
|
|
22
|
-
if (!this.initialized) {
|
|
23
|
-
try {
|
|
24
|
-
this.sdk = await import(
|
|
25
|
-
/* webpackIgnore: true */
|
|
26
|
-
"./index-C45_meK_.js"
|
|
27
|
-
);
|
|
28
|
-
} catch {
|
|
29
|
-
throw new Error("@google/generative-ai is required for the Google provider. Install it with: npm install @google/generative-ai");
|
|
30
|
-
}
|
|
31
|
-
this.initialized = !0;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
async createStream(t) {
|
|
35
|
-
await this.ensureSDK();
|
|
36
|
-
const { GoogleGenerativeAI: e } = this.sdk, n = new e(this.apiKey).getGenerativeModel({
|
|
37
|
-
model: t.model,
|
|
38
|
-
systemInstruction: t.system,
|
|
39
|
-
generationConfig: {
|
|
40
|
-
maxOutputTokens: t.maxTokens
|
|
41
|
-
}
|
|
42
|
-
}), { messages: a } = this.formatMessages(t.messages, t.system), o = this.formatTools(t.tools);
|
|
43
|
-
return (await n.generateContentStream({
|
|
44
|
-
contents: a,
|
|
45
|
-
tools: o.length > 0 ? [{ functionDeclarations: o }] : void 0
|
|
46
|
-
})).stream;
|
|
47
|
-
}
|
|
48
|
-
async *parseStreamEvents(t) {
|
|
49
|
-
let e = "stop", s = !1;
|
|
50
|
-
for await (const n of t) {
|
|
51
|
-
const a = n;
|
|
52
|
-
a.usageMetadata && (yield {
|
|
53
|
-
type: "message_meta",
|
|
54
|
-
inputTokens: a.usageMetadata.promptTokenCount,
|
|
55
|
-
outputTokens: a.usageMetadata.candidatesTokenCount,
|
|
56
|
-
stopReason: ""
|
|
57
|
-
});
|
|
58
|
-
const o = a.candidates?.[0];
|
|
59
|
-
if (!o) continue;
|
|
60
|
-
o.finishReason && (o.finishReason === "STOP" ? e = "stop" : o.finishReason === "MAX_TOKENS" ? e = "max_tokens" : e = o.finishReason);
|
|
61
|
-
const i = o.content?.parts;
|
|
62
|
-
if (i) {
|
|
63
|
-
for (const r of i)
|
|
64
|
-
if (r.text && !r.thought && (yield { type: "text_delta", text: r.text }), r.functionCall) {
|
|
65
|
-
s = !0;
|
|
66
|
-
const f = `gemini-tc-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`, c = r.thoughtSignature ? { thoughtSignature: r.thoughtSignature } : void 0;
|
|
67
|
-
yield { type: "tool_use_start", id: f, name: r.functionCall.name, ...c ? { metadata: c } : {} }, yield { type: "tool_input_delta", json: JSON.stringify(r.functionCall.args || {}) }, yield { type: "tool_use_end" };
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
yield {
|
|
72
|
-
type: "message_meta",
|
|
73
|
-
stopReason: s ? "tool_use" : e
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
formatTools(t) {
|
|
77
|
-
return t.map((e) => ({
|
|
78
|
-
name: e.name,
|
|
79
|
-
description: e.description,
|
|
80
|
-
parameters: l(e.parameters)
|
|
81
|
-
}));
|
|
82
|
-
}
|
|
83
|
-
formatMessages(t, e) {
|
|
84
|
-
const s = [];
|
|
85
|
-
for (const n of t)
|
|
86
|
-
if (n.role === "tool_result") {
|
|
87
|
-
const a = n._toolResults;
|
|
88
|
-
if (a && a.length > 0)
|
|
89
|
-
s.push({
|
|
90
|
-
role: "user",
|
|
91
|
-
parts: a.map((o) => ({
|
|
92
|
-
functionResponse: {
|
|
93
|
-
name: o.toolName || o.toolUseId,
|
|
94
|
-
response: { content: o.content, isError: o.isError || !1 }
|
|
95
|
-
}
|
|
96
|
-
}))
|
|
97
|
-
});
|
|
98
|
-
else {
|
|
99
|
-
const o = typeof n.content == "string" ? n.content : JSON.stringify(n.content);
|
|
100
|
-
o && s.push({ role: "user", parts: [{ text: o }] });
|
|
101
|
-
}
|
|
102
|
-
} else if (n.role === "user") {
|
|
103
|
-
const a = typeof n.content == "string" ? n.content : JSON.stringify(n.content);
|
|
104
|
-
s.push({ role: "user", parts: [{ text: a }] });
|
|
105
|
-
} else if (n.role === "assistant")
|
|
106
|
-
if (typeof n.content == "string")
|
|
107
|
-
s.push({ role: "model", parts: [{ text: n.content }] });
|
|
108
|
-
else {
|
|
109
|
-
const a = n.content, o = [];
|
|
110
|
-
for (const i of a)
|
|
111
|
-
if (i.type === "text" && i.text)
|
|
112
|
-
o.push({ text: i.text });
|
|
113
|
-
else if (i.type === "tool_use") {
|
|
114
|
-
const r = {
|
|
115
|
-
functionCall: {
|
|
116
|
-
name: i.name,
|
|
117
|
-
args: i.input || {}
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
i.metadata?.thoughtSignature && (r.thoughtSignature = i.metadata.thoughtSignature), o.push(r);
|
|
121
|
-
}
|
|
122
|
-
o.length > 0 && s.push({ role: "model", parts: o });
|
|
123
|
-
}
|
|
124
|
-
return { messages: s };
|
|
125
|
-
}
|
|
126
|
-
formatToolResults(t) {
|
|
127
|
-
return {
|
|
128
|
-
role: "tool_result",
|
|
129
|
-
content: t.map((e) => `${e.toolName || e.toolUseId}: ${e.content}`).join(`
|
|
130
|
-
`),
|
|
131
|
-
_toolResults: t
|
|
132
|
-
};
|
|
133
|
-
}
|
|
134
|
-
shouldContinue(t) {
|
|
135
|
-
return t === "tool_use";
|
|
136
|
-
}
|
|
137
|
-
formatError(t) {
|
|
138
|
-
if (!t || !(t instanceof Error))
|
|
139
|
-
return "Something went wrong. Please try again.";
|
|
140
|
-
const e = t.message || "", s = t;
|
|
141
|
-
return s.status === 429 ? "Too many requests. Please wait a moment and try again." : s.status === 403 || s.status === 401 ? "Authentication failed. Please check your API key configuration." : s.status === 503 || s.status === 500 ? "The AI service is temporarily unavailable. Please try again in a moment." : e.includes("SAFETY") ? "The request was blocked by safety filters. Please rephrase your request." : e.includes("RECITATION") ? "The response was blocked due to recitation concerns. Please try a different query." : e.startsWith("{") || e.startsWith("[") ? "The AI service encountered an error. Please try again." : e;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
export {
|
|
145
|
-
p as GoogleProvider
|
|
146
|
-
};
|