drizzle-cube 0.4.29 → 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.
Files changed (381) hide show
  1. package/dist/adapters/anthropic-BIva8k1r.cjs +1 -0
  2. package/dist/adapters/anthropic-B_rg0BhK.js +140 -0
  3. package/dist/adapters/dist-Boc63-1q.cjs +2 -0
  4. package/dist/adapters/dist-De5fzUEM.js +581 -0
  5. package/dist/adapters/express/index.cjs +2 -10
  6. package/dist/adapters/express/index.js +232 -342
  7. package/dist/adapters/fastify/index.cjs +2 -10
  8. package/dist/adapters/fastify/index.js +275 -424
  9. package/dist/adapters/google-CT4kgmBf.js +154 -0
  10. package/dist/adapters/google-Dgo9-Kb5.cjs +2 -0
  11. package/dist/adapters/handler-B8vuFQYP.cjs +25 -0
  12. package/dist/adapters/handler-D-2-6uLM.js +2951 -0
  13. package/dist/adapters/hono/index.cjs +2 -10
  14. package/dist/adapters/hono/index.js +307 -402
  15. package/dist/adapters/mcp-prompts-BAutSQYA.js +344 -0
  16. package/dist/adapters/mcp-prompts-DsAkafVn.cjs +5 -0
  17. package/dist/adapters/mcp-transport-CuugoG8t.js +7821 -0
  18. package/dist/adapters/mcp-transport-Dpp6hdZe.cjs +253 -0
  19. package/dist/adapters/nextjs/index.cjs +1 -9
  20. package/dist/adapters/nextjs/index.js +377 -600
  21. package/dist/adapters/openai-CjBvA6mK.js +4114 -0
  22. package/dist/adapters/openai-DhLE0A9Z.cjs +1 -0
  23. package/dist/adapters/openai-Zjw4Zo4R.js +153 -0
  24. package/dist/adapters/openai-eJBw3LfQ.cjs +16 -0
  25. package/dist/adapters/types.cjs +0 -1
  26. package/dist/adapters/types.js +0 -1
  27. package/dist/adapters/utils-ChhNGUOF.js +5396 -0
  28. package/dist/adapters/utils-CwJplXR5.cjs +15 -0
  29. package/dist/adapters/utils.cjs +1 -19
  30. package/dist/adapters/utils.js +2 -21333
  31. package/dist/client/charts.js +15 -186
  32. package/dist/client/chunks/DashboardEditModal-C076pscL.js +6678 -0
  33. package/dist/client/chunks/DashboardEditModal-C076pscL.js.map +1 -0
  34. package/dist/client/chunks/FieldSearchModal-C0DjSWk3.js +2631 -0
  35. package/dist/client/chunks/FieldSearchModal-C0DjSWk3.js.map +1 -0
  36. package/dist/client/chunks/RetentionCombinedChart-DuGXc-AP.js +270 -0
  37. package/dist/client/chunks/RetentionCombinedChart-DuGXc-AP.js.map +1 -0
  38. package/dist/client/chunks/RetentionCombinedChart.config-DprbXd1N.js +56 -0
  39. package/dist/client/chunks/RetentionCombinedChart.config-DprbXd1N.js.map +1 -0
  40. package/dist/client/chunks/RetentionHeatmap-BoGY6mlZ.js +193 -0
  41. package/dist/client/chunks/RetentionHeatmap-BoGY6mlZ.js.map +1 -0
  42. package/dist/client/chunks/RetentionHeatmap.config-cbaNExVy.js +25 -0
  43. package/dist/client/chunks/RetentionHeatmap.config-cbaNExVy.js.map +1 -0
  44. package/dist/client/chunks/analysis-builder-DF0XntqC.js +6111 -0
  45. package/dist/client/chunks/analysis-builder-DF0XntqC.js.map +1 -0
  46. package/dist/client/chunks/analysis-builder-shared-2QhKYbs6.js +3114 -0
  47. package/dist/client/chunks/analysis-builder-shared-2QhKYbs6.js.map +1 -0
  48. package/dist/client/chunks/chart-activity-grid-CNES9VBk.js +803 -0
  49. package/dist/client/chunks/chart-activity-grid-CNES9VBk.js.map +1 -0
  50. package/dist/client/chunks/chart-area-CRJc3KOu.js +449 -0
  51. package/dist/client/chunks/chart-area-CRJc3KOu.js.map +1 -0
  52. package/dist/client/chunks/chart-bar-DD2PjJ5n.js +270 -0
  53. package/dist/client/chunks/chart-bar-DD2PjJ5n.js.map +1 -0
  54. package/dist/client/chunks/chart-box-plot-BcqleldJ.js +377 -0
  55. package/dist/client/chunks/chart-box-plot-BcqleldJ.js.map +1 -0
  56. package/dist/client/chunks/chart-bubble-BmQkVk4K.js +273 -0
  57. package/dist/client/chunks/chart-bubble-BmQkVk4K.js.map +1 -0
  58. package/dist/client/chunks/chart-candlestick-C3Rep469.js +306 -0
  59. package/dist/client/chunks/chart-candlestick-C3Rep469.js.map +1 -0
  60. package/dist/client/chunks/chart-config-activity-grid-USo7JrPh.js +51 -0
  61. package/dist/client/chunks/chart-config-activity-grid-USo7JrPh.js.map +1 -0
  62. package/dist/client/chunks/chart-config-area-D_ZufYzg.js +93 -0
  63. package/dist/client/chunks/chart-config-area-D_ZufYzg.js.map +1 -0
  64. package/dist/client/chunks/chart-config-bar-BCi2Wmd6.js +87 -0
  65. package/dist/client/chunks/chart-config-bar-BCi2Wmd6.js.map +1 -0
  66. package/dist/client/chunks/chart-config-box-plot-afKLzJSp.js +35 -0
  67. package/dist/client/chunks/chart-config-box-plot-afKLzJSp.js.map +1 -0
  68. package/dist/client/chunks/chart-config-bubble-CgbBjPv8.js +82 -0
  69. package/dist/client/chunks/chart-config-bubble-CgbBjPv8.js.map +1 -0
  70. package/dist/client/chunks/chart-config-candlestick-7boGjZ-A.js +72 -0
  71. package/dist/client/chunks/chart-config-candlestick-7boGjZ-A.js.map +1 -0
  72. package/dist/client/chunks/chart-config-data-table-Cl7sBasW.js +30 -0
  73. package/dist/client/chunks/chart-config-data-table-Cl7sBasW.js.map +1 -0
  74. package/dist/client/chunks/chart-config-funnel-CXPYQtTl.js +93 -0
  75. package/dist/client/chunks/chart-config-funnel-CXPYQtTl.js.map +1 -0
  76. package/dist/client/chunks/chart-config-gauge-DUNEUCvh.js +64 -0
  77. package/dist/client/chunks/chart-config-gauge-DUNEUCvh.js.map +1 -0
  78. package/dist/client/chunks/chart-config-heat-map-BFf1tO11.js +91 -0
  79. package/dist/client/chunks/chart-config-heat-map-BFf1tO11.js.map +1 -0
  80. package/dist/client/chunks/chart-config-kpi-delta-C5k2waIJ.js +94 -0
  81. package/dist/client/chunks/chart-config-kpi-delta-C5k2waIJ.js.map +1 -0
  82. package/dist/client/chunks/chart-config-kpi-number-DptOyhk0.js +75 -0
  83. package/dist/client/chunks/chart-config-kpi-number-DptOyhk0.js.map +1 -0
  84. package/dist/client/chunks/chart-config-kpi-text-D9DdVWqd.js +47 -0
  85. package/dist/client/chunks/chart-config-kpi-text-D9DdVWqd.js.map +1 -0
  86. package/dist/client/chunks/chart-config-line-B3NgLF7K.js +104 -0
  87. package/dist/client/chunks/chart-config-line-B3NgLF7K.js.map +1 -0
  88. package/dist/client/chunks/chart-config-markdown-tlfivQTt.js +117 -0
  89. package/dist/client/chunks/chart-config-markdown-tlfivQTt.js.map +1 -0
  90. package/dist/client/chunks/chart-config-measure-profile-D7XDwrU2.js +82 -0
  91. package/dist/client/chunks/chart-config-measure-profile-D7XDwrU2.js.map +1 -0
  92. package/dist/client/chunks/chart-config-pie-wY0B52PC.js +68 -0
  93. package/dist/client/chunks/chart-config-pie-wY0B52PC.js.map +1 -0
  94. package/dist/client/chunks/chart-config-radar-DRpJBy1M.js +49 -0
  95. package/dist/client/chunks/chart-config-radar-DRpJBy1M.js.map +1 -0
  96. package/dist/client/chunks/chart-config-radial-bar-DCUpXv9G.js +38 -0
  97. package/dist/client/chunks/chart-config-radial-bar-DCUpXv9G.js.map +1 -0
  98. package/dist/client/chunks/chart-config-sankey-CdOhlm4h.js +66 -0
  99. package/dist/client/chunks/chart-config-sankey-CdOhlm4h.js.map +1 -0
  100. package/dist/client/chunks/chart-config-scatter-B2su_x8f.js +61 -0
  101. package/dist/client/chunks/chart-config-scatter-B2su_x8f.js.map +1 -0
  102. package/dist/client/chunks/chart-config-sunburst-BPdjbk18.js +45 -0
  103. package/dist/client/chunks/chart-config-sunburst-BPdjbk18.js.map +1 -0
  104. package/dist/client/chunks/chart-config-tree-map-Cbsh2fe2.js +51 -0
  105. package/dist/client/chunks/chart-config-tree-map-Cbsh2fe2.js.map +1 -0
  106. package/dist/client/chunks/chart-config-waterfall-DGmuZfQF.js +59 -0
  107. package/dist/client/chunks/chart-config-waterfall-DGmuZfQF.js.map +1 -0
  108. package/dist/client/chunks/chart-data-table-DehW1C1G.js +4088 -0
  109. package/dist/client/chunks/chart-data-table-DehW1C1G.js.map +1 -0
  110. package/dist/client/chunks/chart-funnel-BjkpnG5g.js +447 -0
  111. package/dist/client/chunks/chart-funnel-BjkpnG5g.js.map +1 -0
  112. package/dist/client/chunks/chart-gauge-BWW_HEfg.js +424 -0
  113. package/dist/client/chunks/chart-gauge-BWW_HEfg.js.map +1 -0
  114. package/dist/client/chunks/chart-heat-map-BWuOuDcm.js +236 -0
  115. package/dist/client/chunks/chart-heat-map-BWuOuDcm.js.map +1 -0
  116. package/dist/client/chunks/chart-kpi-delta-D5OHtDJx.js +343 -0
  117. package/dist/client/chunks/chart-kpi-delta-D5OHtDJx.js.map +1 -0
  118. package/dist/client/chunks/chart-kpi-number-C9zH-aKC.js +326 -0
  119. package/dist/client/chunks/chart-kpi-number-C9zH-aKC.js.map +1 -0
  120. package/dist/client/chunks/chart-kpi-text-ChVn3S7j.js +149 -0
  121. package/dist/client/chunks/chart-kpi-text-ChVn3S7j.js.map +1 -0
  122. package/dist/client/chunks/chart-line-DOIMkP0b.js +431 -0
  123. package/dist/client/chunks/chart-line-DOIMkP0b.js.map +1 -0
  124. package/dist/client/chunks/chart-markdown-DXxc43w1.js +3457 -0
  125. package/dist/client/chunks/chart-markdown-DXxc43w1.js.map +1 -0
  126. package/dist/client/chunks/chart-measure-profile-C6wrr9il.js +179 -0
  127. package/dist/client/chunks/chart-measure-profile-C6wrr9il.js.map +1 -0
  128. package/dist/client/chunks/chart-pie-BU_FgwDc.js +172 -0
  129. package/dist/client/chunks/chart-pie-BU_FgwDc.js.map +1 -0
  130. package/dist/client/chunks/chart-radar-DlufwnAX.js +154 -0
  131. package/dist/client/chunks/chart-radar-DlufwnAX.js.map +1 -0
  132. package/dist/client/chunks/chart-radial-bar-B5vS_Aw5.js +148 -0
  133. package/dist/client/chunks/chart-radial-bar-B5vS_Aw5.js.map +1 -0
  134. package/dist/client/chunks/chart-sankey-FChb26UX.js +222 -0
  135. package/dist/client/chunks/chart-sankey-FChb26UX.js.map +1 -0
  136. package/dist/client/chunks/chart-scatter-DW0cAZ2H.js +255 -0
  137. package/dist/client/chunks/chart-scatter-DW0cAZ2H.js.map +1 -0
  138. package/dist/client/chunks/chart-sunburst-Clf-6WxW.js +221 -0
  139. package/dist/client/chunks/chart-sunburst-Clf-6WxW.js.map +1 -0
  140. package/dist/client/chunks/chart-tree-map-p_VwUJPF.js +298 -0
  141. package/dist/client/chunks/chart-tree-map-p_VwUJPF.js.map +1 -0
  142. package/dist/client/chunks/chart-waterfall-jt44IQ-w.js +237 -0
  143. package/dist/client/chunks/chart-waterfall-jt44IQ-w.js.map +1 -0
  144. package/dist/client/chunks/charts-core-CUVzf4cV.js +215 -0
  145. package/dist/client/chunks/charts-core-CUVzf4cV.js.map +1 -0
  146. package/dist/client/chunks/charts-loader-AGpph8_I.js +259 -0
  147. package/dist/client/chunks/charts-loader-AGpph8_I.js.map +1 -0
  148. package/dist/client/chunks/core-D1TOj17W.js +845 -0
  149. package/dist/client/chunks/core-D1TOj17W.js.map +1 -0
  150. package/dist/client/chunks/dist-DDBeV_JI.js +847 -0
  151. package/dist/client/chunks/dist-DDBeV_JI.js.map +1 -0
  152. package/dist/client/chunks/javascript-BBwTSo6e.js +438 -0
  153. package/dist/client/chunks/javascript-BBwTSo6e.js.map +1 -0
  154. package/dist/client/chunks/json-BpTrLZSh.js +38 -0
  155. package/dist/client/chunks/json-BpTrLZSh.js.map +1 -0
  156. package/dist/client/chunks/lazyChartConfigRegistry-BjhxDaSf.js +149 -0
  157. package/dist/client/chunks/lazyChartConfigRegistry-BjhxDaSf.js.map +1 -0
  158. package/dist/client/chunks/providers-DX3Vw5kc.js +7 -0
  159. package/dist/client/chunks/providers-DX3Vw5kc.js.map +1 -0
  160. package/dist/client/chunks/retention-UEXlSdZ-.js +132 -0
  161. package/dist/client/chunks/retention-UEXlSdZ-.js.map +1 -0
  162. package/dist/client/chunks/rolldown-runtime-lc2dmIiU.js +20 -0
  163. package/dist/client/chunks/schema-visualization-ZugB4Io9.js +1073 -0
  164. package/dist/client/chunks/schema-visualization-ZugB4Io9.js.map +1 -0
  165. package/dist/client/chunks/sql-B0chxcEK.js +120 -0
  166. package/dist/client/chunks/sql-B0chxcEK.js.map +1 -0
  167. package/dist/client/chunks/syntaxHighlighting-87bOwTxj.js +30 -0
  168. package/dist/client/chunks/syntaxHighlighting-87bOwTxj.js.map +1 -0
  169. package/dist/client/chunks/useDebounce-BQjNWndQ.js +1394 -0
  170. package/dist/client/chunks/useDebounce-BQjNWndQ.js.map +1 -0
  171. package/dist/client/chunks/useDirtyStateTracking-CgKZWkel.js +66 -0
  172. package/dist/client/chunks/useDirtyStateTracking-CgKZWkel.js.map +1 -0
  173. package/dist/client/chunks/useExplainAI-c_bHxZe5.js +203 -0
  174. package/dist/client/chunks/useExplainAI-c_bHxZe5.js.map +1 -0
  175. package/dist/client/chunks/useNotebookLayout-BFZ_33Kb.js +37 -0
  176. package/dist/client/chunks/useNotebookLayout-BFZ_33Kb.js.map +1 -0
  177. package/dist/client/chunks/utils-A54Ny29G.js +128 -0
  178. package/dist/client/chunks/utils-A54Ny29G.js.map +1 -0
  179. package/dist/client/chunks/vendor-CoPBRumI.js +828 -0
  180. package/dist/client/chunks/vendor-CoPBRumI.js.map +1 -0
  181. package/dist/client/components.js +4 -18
  182. package/dist/client/hooks.js +6 -58
  183. package/dist/client/icons.js +2 -15
  184. package/dist/client/index.js +1061 -1295
  185. package/dist/client/index.js.map +1 -1
  186. package/dist/client/providers.js +3 -9
  187. package/dist/client/styles.css +2 -1
  188. package/dist/client/types.d.ts +1 -0
  189. package/dist/client/utils.js +7 -74
  190. package/dist/client-bundle-stats.html +1 -1
  191. package/dist/server/anthropic-BsNspi1r.js +140 -0
  192. package/dist/server/anthropic-DsCEX6Fm.cjs +1 -0
  193. package/dist/server/dist-CMWZC51B.js +581 -0
  194. package/dist/server/dist-DxegvyZF.cjs +2 -0
  195. package/dist/server/google-BXwMolCu.js +154 -0
  196. package/dist/server/google-DzQWXFwF.cjs +2 -0
  197. package/dist/server/index.cjs +109 -129
  198. package/dist/server/index.js +15089 -34394
  199. package/dist/server/openai-BPhmb8mi.js +4114 -0
  200. package/dist/server/openai-CLsoLaue.cjs +1 -0
  201. package/dist/server/openai-D1kZ5sdM.js +153 -0
  202. package/dist/server/openai-DkOKbVLC.cjs +16 -0
  203. package/package.json +5 -5
  204. package/dist/adapters/anthropic-BTkjgFpT.cjs +0 -1
  205. package/dist/adapters/anthropic-CTu9E801.js +0 -126
  206. package/dist/adapters/google-BAK9pnQf.cjs +0 -2
  207. package/dist/adapters/google-DficVAsJ.js +0 -146
  208. package/dist/adapters/handler-BHguLZOY.js +0 -2713
  209. package/dist/adapters/handler-DOIyiFPg.cjs +0 -39
  210. package/dist/adapters/index-BgCeQBuN.cjs +0 -2
  211. package/dist/adapters/index-C3PskWTr.js +0 -5353
  212. package/dist/adapters/index-C45_meK_.js +0 -719
  213. package/dist/adapters/index-ht4NPca9.cjs +0 -23
  214. package/dist/adapters/mcp-transport-CWGqDQSI.cjs +0 -259
  215. package/dist/adapters/mcp-transport-CyeHMDPl.js +0 -11055
  216. package/dist/adapters/openai-BvA6eLs8.cjs +0 -1
  217. package/dist/adapters/openai-mcE24du8.js +0 -131
  218. package/dist/client/charts.js.map +0 -1
  219. package/dist/client/chunks/RetentionCombinedChart--SnU4Y_I.js +0 -256
  220. package/dist/client/chunks/RetentionCombinedChart--SnU4Y_I.js.map +0 -1
  221. package/dist/client/chunks/RetentionCombinedChart.config-Bbp2ghim.js +0 -48
  222. package/dist/client/chunks/RetentionCombinedChart.config-Bbp2ghim.js.map +0 -1
  223. package/dist/client/chunks/RetentionHeatmap-BHYU8MXY.js +0 -178
  224. package/dist/client/chunks/RetentionHeatmap-BHYU8MXY.js.map +0 -1
  225. package/dist/client/chunks/RetentionHeatmap.config-BWf_-vdj.js +0 -29
  226. package/dist/client/chunks/RetentionHeatmap.config-BWf_-vdj.js.map +0 -1
  227. package/dist/client/chunks/analysis-builder-DMFoAkjT.js +0 -6203
  228. package/dist/client/chunks/analysis-builder-DMFoAkjT.js.map +0 -1
  229. package/dist/client/chunks/analysis-builder-shared-CunrT3gi.js +0 -3140
  230. package/dist/client/chunks/analysis-builder-shared-CunrT3gi.js.map +0 -1
  231. package/dist/client/chunks/chart-activity-grid-DCznpK6N.js +0 -347
  232. package/dist/client/chunks/chart-activity-grid-DCznpK6N.js.map +0 -1
  233. package/dist/client/chunks/chart-area-CqKRIUpj.js +0 -234
  234. package/dist/client/chunks/chart-area-CqKRIUpj.js.map +0 -1
  235. package/dist/client/chunks/chart-bar-Bl5jvrU_.js +0 -267
  236. package/dist/client/chunks/chart-bar-Bl5jvrU_.js.map +0 -1
  237. package/dist/client/chunks/chart-box-plot-CzMb00z_.js +0 -322
  238. package/dist/client/chunks/chart-box-plot-CzMb00z_.js.map +0 -1
  239. package/dist/client/chunks/chart-bubble-BF8Z52eW.js +0 -249
  240. package/dist/client/chunks/chart-bubble-BF8Z52eW.js.map +0 -1
  241. package/dist/client/chunks/chart-candlestick-ByWS945g.js +0 -269
  242. package/dist/client/chunks/chart-candlestick-ByWS945g.js.map +0 -1
  243. package/dist/client/chunks/chart-config-activity-grid-CmOqDuOT.js +0 -50
  244. package/dist/client/chunks/chart-config-activity-grid-CmOqDuOT.js.map +0 -1
  245. package/dist/client/chunks/chart-config-area-CK_GVApT.js +0 -77
  246. package/dist/client/chunks/chart-config-area-CK_GVApT.js.map +0 -1
  247. package/dist/client/chunks/chart-config-bar-C8uzktxl.js +0 -71
  248. package/dist/client/chunks/chart-config-bar-C8uzktxl.js.map +0 -1
  249. package/dist/client/chunks/chart-config-box-plot-D_E_SSc2.js +0 -38
  250. package/dist/client/chunks/chart-config-box-plot-D_E_SSc2.js.map +0 -1
  251. package/dist/client/chunks/chart-config-bubble-q3DoQX5F.js +0 -71
  252. package/dist/client/chunks/chart-config-bubble-q3DoQX5F.js.map +0 -1
  253. package/dist/client/chunks/chart-config-candlestick-CRCpD43-.js +0 -70
  254. package/dist/client/chunks/chart-config-candlestick-CRCpD43-.js.map +0 -1
  255. package/dist/client/chunks/chart-config-data-table-B20Y5JCm.js +0 -28
  256. package/dist/client/chunks/chart-config-data-table-B20Y5JCm.js.map +0 -1
  257. package/dist/client/chunks/chart-config-funnel-3eYnGg8M.js +0 -92
  258. package/dist/client/chunks/chart-config-funnel-3eYnGg8M.js.map +0 -1
  259. package/dist/client/chunks/chart-config-gauge-CQx9w3d4.js +0 -64
  260. package/dist/client/chunks/chart-config-gauge-CQx9w3d4.js.map +0 -1
  261. package/dist/client/chunks/chart-config-heat-map-_wEnTnRA.js +0 -77
  262. package/dist/client/chunks/chart-config-heat-map-_wEnTnRA.js.map +0 -1
  263. package/dist/client/chunks/chart-config-kpi-delta-DLGZ2A3X.js +0 -97
  264. package/dist/client/chunks/chart-config-kpi-delta-DLGZ2A3X.js.map +0 -1
  265. package/dist/client/chunks/chart-config-kpi-number-K-wzviXF.js +0 -75
  266. package/dist/client/chunks/chart-config-kpi-number-K-wzviXF.js.map +0 -1
  267. package/dist/client/chunks/chart-config-kpi-text-BjYqwqaJ.js +0 -47
  268. package/dist/client/chunks/chart-config-kpi-text-BjYqwqaJ.js.map +0 -1
  269. package/dist/client/chunks/chart-config-line-JNagi9tf.js +0 -88
  270. package/dist/client/chunks/chart-config-line-JNagi9tf.js.map +0 -1
  271. package/dist/client/chunks/chart-config-markdown-BWQSjJpy.js +0 -97
  272. package/dist/client/chunks/chart-config-markdown-BWQSjJpy.js.map +0 -1
  273. package/dist/client/chunks/chart-config-measure-profile-ZYaMrtws.js +0 -70
  274. package/dist/client/chunks/chart-config-measure-profile-ZYaMrtws.js.map +0 -1
  275. package/dist/client/chunks/chart-config-pie-CNLXb-fr.js +0 -39
  276. package/dist/client/chunks/chart-config-pie-CNLXb-fr.js.map +0 -1
  277. package/dist/client/chunks/chart-config-radar-oxHfRAa3.js +0 -44
  278. package/dist/client/chunks/chart-config-radar-oxHfRAa3.js.map +0 -1
  279. package/dist/client/chunks/chart-config-radial-bar-_Aw3jAEm.js +0 -37
  280. package/dist/client/chunks/chart-config-radial-bar-_Aw3jAEm.js.map +0 -1
  281. package/dist/client/chunks/chart-config-sankey-C8FX9hGF.js +0 -61
  282. package/dist/client/chunks/chart-config-sankey-C8FX9hGF.js.map +0 -1
  283. package/dist/client/chunks/chart-config-scatter-DFKM80eO.js +0 -53
  284. package/dist/client/chunks/chart-config-scatter-DFKM80eO.js.map +0 -1
  285. package/dist/client/chunks/chart-config-sunburst-BmC0NLTU.js +0 -50
  286. package/dist/client/chunks/chart-config-sunburst-BmC0NLTU.js.map +0 -1
  287. package/dist/client/chunks/chart-config-tree-map-DGMbNTaa.js +0 -47
  288. package/dist/client/chunks/chart-config-tree-map-DGMbNTaa.js.map +0 -1
  289. package/dist/client/chunks/chart-config-waterfall-DTyXV_fo.js +0 -60
  290. package/dist/client/chunks/chart-config-waterfall-DTyXV_fo.js.map +0 -1
  291. package/dist/client/chunks/chart-data-table-HwfF-Ujv.js +0 -293
  292. package/dist/client/chunks/chart-data-table-HwfF-Ujv.js.map +0 -1
  293. package/dist/client/chunks/chart-funnel-WmuoWlCq.js +0 -259
  294. package/dist/client/chunks/chart-funnel-WmuoWlCq.js.map +0 -1
  295. package/dist/client/chunks/chart-gauge-Cot4By-w.js +0 -374
  296. package/dist/client/chunks/chart-gauge-Cot4By-w.js.map +0 -1
  297. package/dist/client/chunks/chart-heat-map-bGNtsZMr.js +0 -231
  298. package/dist/client/chunks/chart-heat-map-bGNtsZMr.js.map +0 -1
  299. package/dist/client/chunks/chart-kpi-delta-DeyKMxgq.js +0 -351
  300. package/dist/client/chunks/chart-kpi-delta-DeyKMxgq.js.map +0 -1
  301. package/dist/client/chunks/chart-kpi-number-D1z1gxXO.js +0 -476
  302. package/dist/client/chunks/chart-kpi-number-D1z1gxXO.js.map +0 -1
  303. package/dist/client/chunks/chart-kpi-text-b7q6KWc0.js +0 -165
  304. package/dist/client/chunks/chart-kpi-text-b7q6KWc0.js.map +0 -1
  305. package/dist/client/chunks/chart-line-3Nf-EPqJ.js +0 -450
  306. package/dist/client/chunks/chart-line-3Nf-EPqJ.js.map +0 -1
  307. package/dist/client/chunks/chart-markdown-BT_-MBq1.js +0 -2721
  308. package/dist/client/chunks/chart-markdown-BT_-MBq1.js.map +0 -1
  309. package/dist/client/chunks/chart-measure-profile-BVjUonqU.js +0 -114
  310. package/dist/client/chunks/chart-measure-profile-BVjUonqU.js.map +0 -1
  311. package/dist/client/chunks/chart-pie-DblG6w7g.js +0 -137
  312. package/dist/client/chunks/chart-pie-DblG6w7g.js.map +0 -1
  313. package/dist/client/chunks/chart-radar-BHZbeeTg.js +0 -129
  314. package/dist/client/chunks/chart-radar-BHZbeeTg.js.map +0 -1
  315. package/dist/client/chunks/chart-radial-bar-AlEJC1Jo.js +0 -119
  316. package/dist/client/chunks/chart-radial-bar-AlEJC1Jo.js.map +0 -1
  317. package/dist/client/chunks/chart-sankey-E8vYKjQF.js +0 -189
  318. package/dist/client/chunks/chart-sankey-E8vYKjQF.js.map +0 -1
  319. package/dist/client/chunks/chart-scatter-Bbxqi0iw.js +0 -202
  320. package/dist/client/chunks/chart-scatter-Bbxqi0iw.js.map +0 -1
  321. package/dist/client/chunks/chart-sunburst-BgnTKolT.js +0 -188
  322. package/dist/client/chunks/chart-sunburst-BgnTKolT.js.map +0 -1
  323. package/dist/client/chunks/chart-tree-map-i9LGCLwl.js +0 -284
  324. package/dist/client/chunks/chart-tree-map-i9LGCLwl.js.map +0 -1
  325. package/dist/client/chunks/chart-waterfall-BeIhCm83.js +0 -191
  326. package/dist/client/chunks/chart-waterfall-BeIhCm83.js.map +0 -1
  327. package/dist/client/chunks/charts-core-BUUO36OM.js +0 -692
  328. package/dist/client/chunks/charts-core-BUUO36OM.js.map +0 -1
  329. package/dist/client/chunks/charts-loader-goTYnavu.js +0 -258
  330. package/dist/client/chunks/charts-loader-goTYnavu.js.map +0 -1
  331. package/dist/client/chunks/components-BFgYvFq6.js +0 -10066
  332. package/dist/client/chunks/components-BFgYvFq6.js.map +0 -1
  333. package/dist/client/chunks/core-Y9e-sNfb.js +0 -1068
  334. package/dist/client/chunks/core-Y9e-sNfb.js.map +0 -1
  335. package/dist/client/chunks/flow-utils-CjQZG5qq.js +0 -16
  336. package/dist/client/chunks/flow-utils-CjQZG5qq.js.map +0 -1
  337. package/dist/client/chunks/funnel-utils-CyonoNeC.js +0 -135
  338. package/dist/client/chunks/funnel-utils-CyonoNeC.js.map +0 -1
  339. package/dist/client/chunks/icons-CwvgmdIP.js +0 -1636
  340. package/dist/client/chunks/icons-CwvgmdIP.js.map +0 -1
  341. package/dist/client/chunks/index-CApFCBF9.js +0 -81
  342. package/dist/client/chunks/index-CApFCBF9.js.map +0 -1
  343. package/dist/client/chunks/index-_2PSgbkC.js +0 -1046
  344. package/dist/client/chunks/index-_2PSgbkC.js.map +0 -1
  345. package/dist/client/chunks/javascript-DII1YQGr.js +0 -659
  346. package/dist/client/chunks/javascript-DII1YQGr.js.map +0 -1
  347. package/dist/client/chunks/json-C_6Prymp.js +0 -39
  348. package/dist/client/chunks/json-C_6Prymp.js.map +0 -1
  349. package/dist/client/chunks/providers-Ds7DRmnO.js +0 -554
  350. package/dist/client/chunks/providers-Ds7DRmnO.js.map +0 -1
  351. package/dist/client/chunks/retention-CzCo8262.js +0 -120
  352. package/dist/client/chunks/retention-CzCo8262.js.map +0 -1
  353. package/dist/client/chunks/schema-visualization-B97a1Ybu.js +0 -772
  354. package/dist/client/chunks/schema-visualization-B97a1Ybu.js.map +0 -1
  355. package/dist/client/chunks/sql-IeKX8fQ8.js +0 -616
  356. package/dist/client/chunks/sql-IeKX8fQ8.js.map +0 -1
  357. package/dist/client/chunks/syntaxHighlighting-DAMSW_A6.js +0 -34
  358. package/dist/client/chunks/syntaxHighlighting-DAMSW_A6.js.map +0 -1
  359. package/dist/client/chunks/theme-Dp3hFed1.js +0 -112
  360. package/dist/client/chunks/theme-Dp3hFed1.js.map +0 -1
  361. package/dist/client/chunks/useDirtyStateTracking-CyAXd07d.js +0 -1231
  362. package/dist/client/chunks/useDirtyStateTracking-CyAXd07d.js.map +0 -1
  363. package/dist/client/chunks/useExplainAI-CfQ_JmF1.js +0 -182
  364. package/dist/client/chunks/useExplainAI-CfQ_JmF1.js.map +0 -1
  365. package/dist/client/chunks/vendor-B2EH3V58.js +0 -2892
  366. package/dist/client/chunks/vendor-B2EH3V58.js.map +0 -1
  367. package/dist/client/components.js.map +0 -1
  368. package/dist/client/hooks.js.map +0 -1
  369. package/dist/client/icons.js.map +0 -1
  370. package/dist/client/providers.js.map +0 -1
  371. package/dist/client/utils.js.map +0 -1
  372. package/dist/server/anthropic-BTkjgFpT.cjs +0 -1
  373. package/dist/server/anthropic-CTu9E801.js +0 -126
  374. package/dist/server/google-BAK9pnQf.cjs +0 -2
  375. package/dist/server/google-DficVAsJ.js +0 -146
  376. package/dist/server/index-BgCeQBuN.cjs +0 -2
  377. package/dist/server/index-C3PskWTr.js +0 -5353
  378. package/dist/server/index-C45_meK_.js +0 -719
  379. package/dist/server/index-ht4NPca9.cjs +0 -23
  380. package/dist/server/openai-BvA6eLs8.cjs +0 -1
  381. package/dist/server/openai-mcE24du8.js +0 -131
@@ -1,406 +1,311 @@
1
- import { Hono as J } from "hono";
2
- import { S as K, v as V, b as $, a as B, n as z, p as _, w as U, d as F, g as G, f as X, i as I, c as W, M as Y, e as N, s as T } from "../mcp-transport-CyeHMDPl.js";
3
- import { formatCubeResponse as L, handleBatchRequest as Z, formatMetaResponse as ee, formatSqlResponse as k, handleDryRun as D } from "../utils.js";
4
- var re = (g) => {
5
- const d = {
6
- ...{
7
- origin: "*",
8
- allowMethods: ["GET", "HEAD", "PUT", "POST", "DELETE", "PATCH"],
9
- allowHeaders: [],
10
- exposeHeaders: []
11
- },
12
- ...g
13
- }, M = /* @__PURE__ */ ((l) => typeof l == "string" ? l === "*" ? () => l : (i) => l === i ? i : null : typeof l == "function" ? l : (i) => l.includes(i) ? i : null)(d.origin), m = ((l) => typeof l == "function" ? l : Array.isArray(l) ? () => l : () => [])(d.allowMethods);
14
- return async function(i, h) {
15
- function j(p, a) {
16
- i.res.headers.set(p, a);
17
- }
18
- const b = await M(i.req.header("origin") || "", i);
19
- if (b && j("Access-Control-Allow-Origin", b), d.credentials && j("Access-Control-Allow-Credentials", "true"), d.exposeHeaders?.length && j("Access-Control-Expose-Headers", d.exposeHeaders.join(",")), i.req.method === "OPTIONS") {
20
- d.origin !== "*" && j("Vary", "Origin"), d.maxAge != null && j("Access-Control-Max-Age", d.maxAge.toString());
21
- const p = await m(i.req.header("origin") || "", i);
22
- p.length && j("Access-Control-Allow-Methods", p.join(","));
23
- let a = d.allowHeaders;
24
- if (!a?.length) {
25
- const s = i.req.header("Access-Control-Request-Headers");
26
- s && (a = s.split(/\s*,\s*/));
27
- }
28
- return a?.length && (j("Access-Control-Allow-Headers", a.join(",")), i.res.headers.append("Vary", "Access-Control-Request-Headers")), i.res.headers.delete("Content-Length"), i.res.headers.delete("Content-Type"), new Response(null, {
29
- headers: i.res.headers,
30
- status: 204,
31
- statusText: "No Content"
32
- });
33
- }
34
- await h(), d.origin !== "*" && i.header("Vary", "Origin", { append: !0 });
35
- };
1
+ import { a as e, f as t, o as n, r, u as i } from "../utils-ChhNGUOF.js";
2
+ import { a, c as o, d as s, f as c, h as l, i as u, l as d, m as f, n as p, o as m, p as h, r as g, s as _, t as v, u as y } from "../mcp-transport-CuugoG8t.js";
3
+ import { Hono as b } from "hono";
4
+ //#region node_modules/hono/dist/middleware/cors/index.js
5
+ var x = (e) => {
6
+ let t = {
7
+ origin: "*",
8
+ allowMethods: [
9
+ "GET",
10
+ "HEAD",
11
+ "PUT",
12
+ "POST",
13
+ "DELETE",
14
+ "PATCH"
15
+ ],
16
+ allowHeaders: [],
17
+ exposeHeaders: [],
18
+ ...e
19
+ }, n = ((e) => typeof e == "string" ? e === "*" ? () => e : (t) => e === t ? t : null : typeof e == "function" ? e : (t) => e.includes(t) ? t : null)(t.origin), r = ((e) => typeof e == "function" ? e : Array.isArray(e) ? () => e : () => [])(t.allowMethods);
20
+ return async function(e, i) {
21
+ function a(t, n) {
22
+ e.res.headers.set(t, n);
23
+ }
24
+ let o = await n(e.req.header("origin") || "", e);
25
+ if (o && a("Access-Control-Allow-Origin", o), t.credentials && a("Access-Control-Allow-Credentials", "true"), t.exposeHeaders?.length && a("Access-Control-Expose-Headers", t.exposeHeaders.join(",")), e.req.method === "OPTIONS") {
26
+ t.origin !== "*" && a("Vary", "Origin"), t.maxAge != null && a("Access-Control-Max-Age", t.maxAge.toString());
27
+ let n = await r(e.req.header("origin") || "", e);
28
+ n.length && a("Access-Control-Allow-Methods", n.join(","));
29
+ let i = t.allowHeaders;
30
+ if (!i?.length) {
31
+ let t = e.req.header("Access-Control-Request-Headers");
32
+ t && (i = t.split(/\s*,\s*/));
33
+ }
34
+ return i?.length && (a("Access-Control-Allow-Headers", i.join(",")), e.res.headers.append("Vary", "Access-Control-Request-Headers")), e.res.headers.delete("Content-Length"), e.res.headers.delete("Content-Type"), new Response(null, {
35
+ headers: e.res.headers,
36
+ status: 204,
37
+ statusText: "No Content"
38
+ });
39
+ }
40
+ await i(), t.origin !== "*" && e.header("Vary", "Origin", { append: !0 });
41
+ };
36
42
  };
37
- function te(g) {
38
- const {
39
- cubes: v,
40
- drizzle: d,
41
- schema: M,
42
- extractSecurityContext: m,
43
- engineType: l,
44
- cors: i,
45
- basePath: h = "/cubejs-api/v1",
46
- cache: j,
47
- mcp: b = { enabled: !0 },
48
- agent: p
49
- } = g;
50
- if (!g.semanticLayer && (!v || v.length === 0))
51
- throw new Error("Either semanticLayer or a non-empty cubes array must be provided");
52
- const a = new J();
53
- i && a.use("/*", re(i));
54
- const s = g.semanticLayer ?? new K({
55
- drizzle: d,
56
- schema: M,
57
- engineType: l,
58
- cache: j
59
- });
60
- if (!g.semanticLayer && v && v.forEach((e) => {
61
- s.registerCube(e);
62
- }), a.post(`${h}/load`, async (e) => {
63
- try {
64
- const r = await e.req.json(), n = r.query || r, o = await m(e), t = s.validateQuery(n);
65
- if (!t.isValid)
66
- return e.json({
67
- error: `Query validation failed: ${t.errors.join(", ")}`
68
- }, 400);
69
- const c = e.req.header("x-cache-control") === "no-cache", u = await s.executeMultiCubeQuery(n, o, { skipCache: c });
70
- return e.json(L(n, u, s));
71
- } catch (r) {
72
- return console.error("Query execution error:", r), e.json({
73
- error: r instanceof Error ? r.message : "Query execution failed"
74
- }, 500);
75
- }
76
- }), a.get(`${h}/load`, async (e) => {
77
- try {
78
- const r = e.req.query("query");
79
- if (!r)
80
- return e.json({
81
- error: "Query parameter is required"
82
- }, 400);
83
- let n;
84
- try {
85
- n = JSON.parse(r);
86
- } catch {
87
- return e.json({
88
- error: "Invalid JSON in query parameter"
89
- }, 400);
90
- }
91
- const o = await m(e), t = s.validateQuery(n);
92
- if (!t.isValid)
93
- return e.json({
94
- error: `Query validation failed: ${t.errors.join(", ")}`
95
- }, 400);
96
- const c = e.req.header("x-cache-control") === "no-cache", u = await s.executeMultiCubeQuery(n, o, { skipCache: c });
97
- return e.json(L(n, u, s));
98
- } catch (r) {
99
- return console.error("Query execution error:", r), e.json({
100
- error: r instanceof Error ? r.message : "Query execution failed"
101
- }, 500);
102
- }
103
- }), a.post(`${h}/batch`, async (e) => {
104
- try {
105
- const r = await e.req.json(), { queries: n } = r;
106
- if (!n || !Array.isArray(n))
107
- return e.json({
108
- error: 'Request body must contain a "queries" array'
109
- }, 400);
110
- if (n.length === 0)
111
- return e.json({
112
- error: "Queries array cannot be empty"
113
- }, 400);
114
- const o = await m(e), t = e.req.header("x-cache-control") === "no-cache", c = await Z(n, o, s, { skipCache: t });
115
- return e.json(c);
116
- } catch (r) {
117
- return console.error("Batch execution error:", r), e.json({
118
- error: r instanceof Error ? r.message : "Batch execution failed"
119
- }, 500);
120
- }
121
- }), a.get(`${h}/meta`, (e) => {
122
- try {
123
- const r = s.getMetadata();
124
- return e.json(ee(r));
125
- } catch (r) {
126
- return console.error("Metadata error:", r), e.json({
127
- error: r instanceof Error ? r.message : "Failed to fetch metadata"
128
- }, 500);
129
- }
130
- }), a.post(`${h}/sql`, async (e) => {
131
- try {
132
- const r = await e.req.json(), n = await m(e), o = s.validateQuery(r);
133
- if (!o.isValid)
134
- return e.json({
135
- error: `Query validation failed: ${o.errors.join(", ")}`
136
- }, 400);
137
- const t = r.measures?.[0] || r.dimensions?.[0];
138
- if (!t)
139
- return e.json({
140
- error: "No measures or dimensions specified"
141
- }, 400);
142
- const c = t.split(".")[0], u = await s.generateSQL(c, r, n);
143
- return e.json(k(r, u));
144
- } catch (r) {
145
- return console.error("SQL generation error:", r), e.json({
146
- error: r instanceof Error ? r.message : "SQL generation failed"
147
- }, 500);
148
- }
149
- }), a.get(`${h}/sql`, async (e) => {
150
- try {
151
- const r = e.req.query("query");
152
- if (!r)
153
- return e.json({
154
- error: "Query parameter is required"
155
- }, 400);
156
- const n = JSON.parse(r), o = await m(e), t = s.validateQuery(n);
157
- if (!t.isValid)
158
- return e.json({
159
- error: `Query validation failed: ${t.errors.join(", ")}`
160
- }, 400);
161
- const c = n.measures?.[0] || n.dimensions?.[0];
162
- if (!c)
163
- return e.json({
164
- error: "No measures or dimensions specified"
165
- }, 400);
166
- const u = c.split(".")[0], w = await s.generateSQL(u, n, o);
167
- return e.json(k(n, w));
168
- } catch (r) {
169
- return console.error("SQL generation error:", r), e.json({
170
- error: r instanceof Error ? r.message : "SQL generation failed"
171
- }, 500);
172
- }
173
- }), a.post(`${h}/dry-run`, async (e) => {
174
- try {
175
- const r = await e.req.json(), n = r.query || r, o = await m(e), t = await D(n, o, s);
176
- return e.json(t);
177
- } catch (r) {
178
- return console.error("Dry-run error:", r), e.json({
179
- error: r instanceof Error ? r.message : "Dry-run validation failed",
180
- valid: !1
181
- }, 400);
182
- }
183
- }), a.get(`${h}/dry-run`, async (e) => {
184
- try {
185
- const r = e.req.query("query");
186
- if (!r)
187
- return e.json({
188
- error: "Query parameter is required",
189
- valid: !1
190
- }, 400);
191
- const n = JSON.parse(r), o = await m(e), t = await D(n, o, s);
192
- return e.json(t);
193
- } catch (r) {
194
- return console.error("Dry-run error:", r), e.json({
195
- error: r instanceof Error ? r.message : "Dry-run validation failed",
196
- valid: !1
197
- }, 400);
198
- }
199
- }), a.post(`${h}/explain`, async (e) => {
200
- try {
201
- const r = await e.req.json(), n = r.query || r, o = r.options || {}, t = await m(e), c = s.validateQuery(n);
202
- if (!c.isValid)
203
- return e.json({
204
- error: `Query validation failed: ${c.errors.join(", ")}`
205
- }, 400);
206
- const u = await s.explainQuery(n, t, o);
207
- return e.json(u);
208
- } catch (r) {
209
- return console.error("Explain error:", r), e.json({
210
- error: r instanceof Error ? r.message : "Explain query failed"
211
- }, 500);
212
- }
213
- }), p && a.post(`${h}/agent/chat`, async (e) => {
214
- try {
215
- const { handleAgentChat: r } = await import("../handler-BHguLZOY.js"), n = await e.req.json(), { message: o, sessionId: t, history: c } = n;
216
- if (!o || typeof o != "string")
217
- return e.json({ error: "message is required and must be a string" }, 400);
218
- let u = (p.apiKey || "").trim();
219
- if (p.allowClientApiKey) {
220
- const q = e.req.header("x-agent-api-key");
221
- q && (u = q.trim());
222
- }
223
- if (!u)
224
- return e.json({
225
- error: "No API key configured. Set agent.apiKey in server config or send X-Agent-Api-Key header."
226
- }, 401);
227
- const w = p.allowClientApiKey ? e.req.header("x-agent-provider") : void 0, A = p.allowClientApiKey ? e.req.header("x-agent-model") : void 0, f = p.allowClientApiKey ? e.req.header("x-agent-provider-endpoint") : void 0, E = await m(e), O = p.buildSystemContext?.(E), y = new TextEncoder(), S = new ReadableStream({
228
- async start(q) {
229
- try {
230
- const C = r({
231
- message: o,
232
- sessionId: t,
233
- history: c,
234
- semanticLayer: s,
235
- securityContext: E,
236
- agentConfig: p,
237
- apiKey: u,
238
- systemContext: O,
239
- providerOverride: w,
240
- modelOverride: A,
241
- baseURLOverride: f
242
- });
243
- for await (const x of C) {
244
- const R = `data: ${JSON.stringify(x)}
245
-
246
- `;
247
- q.enqueue(y.encode(R));
248
- }
249
- } catch (C) {
250
- const x = {
251
- type: "error",
252
- data: { message: C instanceof Error ? C.message : "Stream failed" }
253
- };
254
- q.enqueue(y.encode(`data: ${JSON.stringify(x)}
255
-
256
- `));
257
- } finally {
258
- q.close();
259
- }
260
- }
261
- });
262
- return new Response(S, {
263
- status: 200,
264
- headers: {
265
- "Content-Type": "text/event-stream",
266
- "Cache-Control": "no-cache",
267
- Connection: "keep-alive"
268
- }
269
- });
270
- } catch (r) {
271
- return console.error("Agent chat error:", r), e.json({
272
- error: r instanceof Error ? r.message : "Agent chat failed"
273
- }, 500);
274
- }
275
- }), b.enabled !== !1) {
276
- const e = {
277
- uri: "drizzle-cube://schema",
278
- name: "Cube Schema",
279
- description: "Current cube metadata as JSON",
280
- mimeType: "application/json",
281
- text: JSON.stringify(s.getMetadata(), null, 2)
282
- }, r = [...X(), e], n = G(), o = b.basePath ?? "/mcp";
283
- a.post(`${o}`, async (t) => {
284
- const c = V(
285
- t.req.header("origin"),
286
- b.allowedOrigins ? { allowedOrigins: b.allowedOrigins } : {}
287
- );
288
- if (!c.valid)
289
- return t.json($(null, -32600, c.reason), 403);
290
- const u = t.req.header("accept");
291
- if (!B(u))
292
- return t.json($(null, -32600, "Accept header must include both application/json and text/event-stream"), 400);
293
- const w = z(t.req.header());
294
- if (!w.ok)
295
- return t.json({
296
- error: "Unsupported MCP protocol version",
297
- supported: w.supported
298
- }, 426);
299
- const A = await t.req.json().catch(() => null), f = _(A);
300
- if (!f)
301
- return t.json($(null, -32600, "Invalid JSON-RPC 2.0 request"), 400);
302
- const E = U(u), O = f.method === "initialize";
303
- try {
304
- const y = await F(
305
- f.method,
306
- f.params,
307
- {
308
- semanticLayer: s,
309
- extractSecurityContext: m,
310
- rawRequest: t,
311
- rawResponse: null,
312
- negotiatedProtocol: w.negotiated,
313
- resources: r,
314
- prompts: n
315
- }
316
- );
317
- if (I(f))
318
- return t.body(null, 202);
319
- const S = W(f.id ?? null, y), q = O && y && typeof y == "object" && "sessionId" in y ? y.sessionId : void 0, C = {};
320
- if (q && (C[Y] = q), E) {
321
- const x = new TextEncoder(), R = N(), P = new ReadableStream({
322
- start(Q) {
323
- Q.enqueue(x.encode(`id: ${R}
324
-
325
- `)), Q.enqueue(x.encode(T(S, R))), Q.close();
326
- }
327
- });
328
- return new Response(P, {
329
- status: 200,
330
- headers: {
331
- "Content-Type": "text/event-stream",
332
- "Cache-Control": "no-cache",
333
- Connection: "keep-alive",
334
- ...C
335
- }
336
- });
337
- }
338
- return t.json(S, 200, C);
339
- } catch (y) {
340
- if (I(f))
341
- return console.error("MCP notification processing error:", y), t.body(null, 202);
342
- console.error("MCP RPC error:", y);
343
- const S = y?.code ?? -32603, q = y?.data, C = y.message || "MCP request failed", x = $(f.id ?? null, S, C, q);
344
- if (E) {
345
- const R = new TextEncoder(), P = N(), Q = new ReadableStream({
346
- start(H) {
347
- H.enqueue(R.encode(`id: ${P}
348
-
349
- `)), H.enqueue(R.encode(T(x, P))), H.close();
350
- }
351
- });
352
- return new Response(Q, {
353
- status: 200,
354
- headers: {
355
- "Content-Type": "text/event-stream",
356
- "Cache-Control": "no-cache",
357
- Connection: "keep-alive"
358
- }
359
- });
360
- }
361
- return t.json(x, 200);
362
- }
363
- }), a.delete(`${o}`, (t) => t.json({ error: "Session termination not supported" }, 405)), a.get(`${o}`, (t) => {
364
- const c = new TextEncoder(), u = N();
365
- let w;
366
- const A = new ReadableStream({
367
- start(f) {
368
- f.enqueue(c.encode(T({
369
- jsonrpc: "2.0",
370
- method: "mcp/ready",
371
- params: { protocol: "streamable-http" }
372
- }, u, 15e3))), w = setInterval(() => {
373
- f.enqueue(c.encode(`: keep-alive
374
-
375
- `));
376
- }, 15e3);
377
- },
378
- cancel() {
379
- clearInterval(w);
380
- }
381
- });
382
- return new Response(A, {
383
- status: 200,
384
- headers: {
385
- "Content-Type": "text/event-stream",
386
- "Cache-Control": "no-cache",
387
- Connection: "keep-alive"
388
- }
389
- });
390
- });
391
- }
392
- return a;
43
+ //#endregion
44
+ //#region src/adapters/hono/index.ts
45
+ function S(S) {
46
+ let { cubes: C, drizzle: w, schema: T, extractSecurityContext: E, engineType: D, cors: O, basePath: k = "/cubejs-api/v1", cache: A, mcp: j = { enabled: !0 }, agent: M } = S;
47
+ if (!S.semanticLayer && (!C || C.length === 0)) throw Error("Either semanticLayer or a non-empty cubes array must be provided");
48
+ let N = new b();
49
+ O && N.use("/*", x(O));
50
+ let P = S.semanticLayer ?? new l({
51
+ drizzle: w,
52
+ schema: T,
53
+ engineType: D,
54
+ cache: A
55
+ });
56
+ if (!S.semanticLayer && C && C.forEach((e) => {
57
+ P.registerCube(e);
58
+ }), N.post(`${k}/load`, async (e) => {
59
+ try {
60
+ let t = await e.req.json(), n = t.query || t, i = await E(e), a = P.validateQuery(n);
61
+ if (!a.isValid) return e.json({ error: `Query validation failed: ${a.errors.join(", ")}` }, 400);
62
+ let o = e.req.header("x-cache-control") === "no-cache", s = await P.executeMultiCubeQuery(n, i, { skipCache: o });
63
+ return e.json(r(n, s, P));
64
+ } catch (t) {
65
+ return console.error("Query execution error:", t), e.json({ error: t instanceof Error ? t.message : "Query execution failed" }, 500);
66
+ }
67
+ }), N.get(`${k}/load`, async (e) => {
68
+ try {
69
+ let t = e.req.query("query");
70
+ if (!t) return e.json({ error: "Query parameter is required" }, 400);
71
+ let n;
72
+ try {
73
+ n = JSON.parse(t);
74
+ } catch {
75
+ return e.json({ error: "Invalid JSON in query parameter" }, 400);
76
+ }
77
+ let i = await E(e), a = P.validateQuery(n);
78
+ if (!a.isValid) return e.json({ error: `Query validation failed: ${a.errors.join(", ")}` }, 400);
79
+ let o = e.req.header("x-cache-control") === "no-cache", s = await P.executeMultiCubeQuery(n, i, { skipCache: o });
80
+ return e.json(r(n, s, P));
81
+ } catch (t) {
82
+ return console.error("Query execution error:", t), e.json({ error: t instanceof Error ? t.message : "Query execution failed" }, 500);
83
+ }
84
+ }), N.post(`${k}/batch`, async (e) => {
85
+ try {
86
+ let { queries: t } = await e.req.json();
87
+ if (!t || !Array.isArray(t)) return e.json({ error: "Request body must contain a \"queries\" array" }, 400);
88
+ if (t.length === 0) return e.json({ error: "Queries array cannot be empty" }, 400);
89
+ let n = await i(t, await E(e), P, { skipCache: e.req.header("x-cache-control") === "no-cache" });
90
+ return e.json(n);
91
+ } catch (t) {
92
+ return console.error("Batch execution error:", t), e.json({ error: t instanceof Error ? t.message : "Batch execution failed" }, 500);
93
+ }
94
+ }), N.get(`${k}/meta`, (t) => {
95
+ try {
96
+ let n = P.getMetadata();
97
+ return t.json(e(n));
98
+ } catch (e) {
99
+ return console.error("Metadata error:", e), t.json({ error: e instanceof Error ? e.message : "Failed to fetch metadata" }, 500);
100
+ }
101
+ }), N.post(`${k}/sql`, async (e) => {
102
+ try {
103
+ let t = await e.req.json(), r = await E(e), i = P.validateQuery(t);
104
+ if (!i.isValid) return e.json({ error: `Query validation failed: ${i.errors.join(", ")}` }, 400);
105
+ let a = t.measures?.[0] || t.dimensions?.[0];
106
+ if (!a) return e.json({ error: "No measures or dimensions specified" }, 400);
107
+ let o = a.split(".")[0], s = await P.generateSQL(o, t, r);
108
+ return e.json(n(t, s));
109
+ } catch (t) {
110
+ return console.error("SQL generation error:", t), e.json({ error: t instanceof Error ? t.message : "SQL generation failed" }, 500);
111
+ }
112
+ }), N.get(`${k}/sql`, async (e) => {
113
+ try {
114
+ let t = e.req.query("query");
115
+ if (!t) return e.json({ error: "Query parameter is required" }, 400);
116
+ let r = JSON.parse(t), i = await E(e), a = P.validateQuery(r);
117
+ if (!a.isValid) return e.json({ error: `Query validation failed: ${a.errors.join(", ")}` }, 400);
118
+ let o = r.measures?.[0] || r.dimensions?.[0];
119
+ if (!o) return e.json({ error: "No measures or dimensions specified" }, 400);
120
+ let s = o.split(".")[0], c = await P.generateSQL(s, r, i);
121
+ return e.json(n(r, c));
122
+ } catch (t) {
123
+ return console.error("SQL generation error:", t), e.json({ error: t instanceof Error ? t.message : "SQL generation failed" }, 500);
124
+ }
125
+ }), N.post(`${k}/dry-run`, async (e) => {
126
+ try {
127
+ let n = await e.req.json(), r = await t(n.query || n, await E(e), P);
128
+ return e.json(r);
129
+ } catch (t) {
130
+ return console.error("Dry-run error:", t), e.json({
131
+ error: t instanceof Error ? t.message : "Dry-run validation failed",
132
+ valid: !1
133
+ }, 400);
134
+ }
135
+ }), N.get(`${k}/dry-run`, async (e) => {
136
+ try {
137
+ let n = e.req.query("query");
138
+ if (!n) return e.json({
139
+ error: "Query parameter is required",
140
+ valid: !1
141
+ }, 400);
142
+ let r = await t(JSON.parse(n), await E(e), P);
143
+ return e.json(r);
144
+ } catch (t) {
145
+ return console.error("Dry-run error:", t), e.json({
146
+ error: t instanceof Error ? t.message : "Dry-run validation failed",
147
+ valid: !1
148
+ }, 400);
149
+ }
150
+ }), N.post(`${k}/explain`, async (e) => {
151
+ try {
152
+ let t = await e.req.json(), n = t.query || t, r = t.options || {}, i = await E(e), a = P.validateQuery(n);
153
+ if (!a.isValid) return e.json({ error: `Query validation failed: ${a.errors.join(", ")}` }, 400);
154
+ let o = await P.explainQuery(n, i, r);
155
+ return e.json(o);
156
+ } catch (t) {
157
+ return console.error("Explain error:", t), e.json({ error: t instanceof Error ? t.message : "Explain query failed" }, 500);
158
+ }
159
+ }), M && N.post(`${k}/agent/chat`, async (e) => {
160
+ try {
161
+ let { handleAgentChat: t } = await import("../handler-D-2-6uLM.js"), { message: n, sessionId: r, history: i } = await e.req.json();
162
+ if (!n || typeof n != "string") return e.json({ error: "message is required and must be a string" }, 400);
163
+ let a = (M.apiKey || "").trim();
164
+ if (M.allowClientApiKey) {
165
+ let t = e.req.header("x-agent-api-key");
166
+ t && (a = t.trim());
167
+ }
168
+ if (!a) return e.json({ error: "No API key configured. Set agent.apiKey in server config or send X-Agent-Api-Key header." }, 401);
169
+ let o = M.allowClientApiKey ? e.req.header("x-agent-provider") : void 0, s = M.allowClientApiKey ? e.req.header("x-agent-model") : void 0, c = M.allowClientApiKey ? e.req.header("x-agent-provider-endpoint") : void 0, l = await E(e), u = M.buildSystemContext?.(l), d = new TextEncoder(), f = new ReadableStream({ async start(e) {
170
+ try {
171
+ let f = t({
172
+ message: n,
173
+ sessionId: r,
174
+ history: i,
175
+ semanticLayer: P,
176
+ securityContext: l,
177
+ agentConfig: M,
178
+ apiKey: a,
179
+ systemContext: u,
180
+ providerOverride: o,
181
+ modelOverride: s,
182
+ baseURLOverride: c
183
+ });
184
+ for await (let t of f) {
185
+ let n = `data: ${JSON.stringify(t)}\n\n`;
186
+ e.enqueue(d.encode(n));
187
+ }
188
+ } catch (t) {
189
+ let n = {
190
+ type: "error",
191
+ data: { message: t instanceof Error ? t.message : "Stream failed" }
192
+ };
193
+ e.enqueue(d.encode(`data: ${JSON.stringify(n)}\n\n`));
194
+ } finally {
195
+ e.close();
196
+ }
197
+ } });
198
+ return new Response(f, {
199
+ status: 200,
200
+ headers: {
201
+ "Content-Type": "text/event-stream",
202
+ "Cache-Control": "no-cache",
203
+ Connection: "keep-alive"
204
+ }
205
+ });
206
+ } catch (t) {
207
+ return console.error("Agent chat error:", t), e.json({ error: t instanceof Error ? t.message : "Agent chat failed" }, 500);
208
+ }
209
+ }), j.enabled !== !1) {
210
+ let e = {
211
+ uri: "drizzle-cube://schema",
212
+ name: "Cube Schema",
213
+ description: "Current cube metadata as JSON",
214
+ mimeType: "application/json",
215
+ text: JSON.stringify(P.getMetadata(), null, 2)
216
+ }, t = [...m(), e], n = a(), r = j.basePath ?? "/mcp";
217
+ N.post(`${r}`, async (e) => {
218
+ let r = h(e.req.header("origin"), j.allowedOrigins ? { allowedOrigins: j.allowedOrigins } : {});
219
+ if (!r.valid) return e.json(p(null, -32600, r.reason), 403);
220
+ let i = e.req.header("accept");
221
+ if (!c(i)) return e.json(p(null, -32600, "Accept header must include both application/json and text/event-stream"), 400);
222
+ let a = o(e.req.header());
223
+ if (!a.ok) return e.json({
224
+ error: "Unsupported MCP protocol version",
225
+ supported: a.supported
226
+ }, 426);
227
+ let l = d(await e.req.json().catch(() => null));
228
+ if (!l) return e.json(p(null, -32600, "Invalid JSON-RPC 2.0 request"), 400);
229
+ let m = f(i), b = l.method === "initialize";
230
+ try {
231
+ let r = await u(l.method, l.params, {
232
+ semanticLayer: P,
233
+ extractSecurityContext: E,
234
+ rawRequest: e,
235
+ rawResponse: null,
236
+ negotiatedProtocol: a.negotiated,
237
+ resources: t,
238
+ prompts: n
239
+ });
240
+ if (_(l)) return e.body(null, 202);
241
+ let i = g(l.id ?? null, r), o = b && r && typeof r == "object" && "sessionId" in r ? r.sessionId : void 0, c = {};
242
+ if (o && (c[v] = o), m) {
243
+ let e = new TextEncoder(), t = y(), n = new ReadableStream({ start(n) {
244
+ n.enqueue(e.encode(`id: ${t}\n\n`)), n.enqueue(e.encode(s(i, t))), n.close();
245
+ } });
246
+ return new Response(n, {
247
+ status: 200,
248
+ headers: {
249
+ "Content-Type": "text/event-stream",
250
+ "Cache-Control": "no-cache",
251
+ Connection: "keep-alive",
252
+ ...c
253
+ }
254
+ });
255
+ }
256
+ return e.json(i, 200, c);
257
+ } catch (t) {
258
+ if (_(l)) return console.error("MCP notification processing error:", t), e.body(null, 202);
259
+ console.error("MCP RPC error:", t);
260
+ let n = t?.code ?? -32603, r = t?.data, i = t.message || "MCP request failed", a = p(l.id ?? null, n, i, r);
261
+ if (m) {
262
+ let e = new TextEncoder(), t = y(), n = new ReadableStream({ start(n) {
263
+ n.enqueue(e.encode(`id: ${t}\n\n`)), n.enqueue(e.encode(s(a, t))), n.close();
264
+ } });
265
+ return new Response(n, {
266
+ status: 200,
267
+ headers: {
268
+ "Content-Type": "text/event-stream",
269
+ "Cache-Control": "no-cache",
270
+ Connection: "keep-alive"
271
+ }
272
+ });
273
+ }
274
+ return e.json(a, 200);
275
+ }
276
+ }), N.delete(`${r}`, (e) => e.json({ error: "Session termination not supported" }, 405)), N.get(`${r}`, (e) => {
277
+ let t = new TextEncoder(), n = y(), r, i = new ReadableStream({
278
+ start(e) {
279
+ e.enqueue(t.encode(s({
280
+ jsonrpc: "2.0",
281
+ method: "mcp/ready",
282
+ params: { protocol: "streamable-http" }
283
+ }, n, 15e3))), r = setInterval(() => {
284
+ e.enqueue(t.encode(": keep-alive\n\n"));
285
+ }, 15e3);
286
+ },
287
+ cancel() {
288
+ clearInterval(r);
289
+ }
290
+ });
291
+ return new Response(i, {
292
+ status: 200,
293
+ headers: {
294
+ "Content-Type": "text/event-stream",
295
+ "Cache-Control": "no-cache",
296
+ Connection: "keep-alive"
297
+ }
298
+ });
299
+ });
300
+ }
301
+ return N;
393
302
  }
394
- function ne(g, v) {
395
- const d = te(v);
396
- return g.route("/", d), g;
303
+ function C(e, t) {
304
+ let n = S(t);
305
+ return e.route("/", n), e;
397
306
  }
398
- function ie(g) {
399
- const v = new J();
400
- return ne(v, g);
307
+ function w(e) {
308
+ return C(new b(), e);
401
309
  }
402
- export {
403
- ie as createCubeApp,
404
- te as createCubeRoutes,
405
- ne as mountCubeRoutes
406
- };
310
+ //#endregion
311
+ export { w as createCubeApp, S as createCubeRoutes, C as mountCubeRoutes };