drizzle-cube 0.8.2 → 0.9.0

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 (295) hide show
  1. package/dist/adapters/ActivityGridChart.config-DfyZh3He.js +2 -0
  2. package/dist/adapters/ActivityGridChart.config-DgOwl51m.cjs +1 -0
  3. package/dist/adapters/AreaChart.config-BL_ZpMsg.js +2 -0
  4. package/dist/adapters/AreaChart.config-rc1phjmI.cjs +1 -0
  5. package/dist/adapters/BarChart.config-C6k4BxhM.cjs +1 -0
  6. package/dist/adapters/BarChart.config-CBACR7Z-.js +2 -0
  7. package/dist/adapters/BoxPlotChart.config-Bvg6yFn2.js +2 -0
  8. package/dist/adapters/BoxPlotChart.config-CAlLRM0v.cjs +1 -0
  9. package/dist/adapters/BubbleChart.config-22qXNskY.js +2 -0
  10. package/dist/adapters/BubbleChart.config-BkB3P6Bi.cjs +1 -0
  11. package/dist/adapters/CandlestickChart.config-DuZb-y6d.cjs +1 -0
  12. package/dist/adapters/CandlestickChart.config-G78UbuwS.js +2 -0
  13. package/dist/adapters/DataTable.config-BXkpzOC2.js +2 -0
  14. package/dist/adapters/DataTable.config-CwPlSht6.cjs +1 -0
  15. package/dist/adapters/DotStripChart.config-Bw9Ww5zY.cjs +1 -0
  16. package/dist/adapters/DotStripChart.config-D5sbLAqA.js +2 -0
  17. package/dist/adapters/FunnelChart.config-CUs1rqN2.cjs +1 -0
  18. package/dist/adapters/FunnelChart.config-Cw9qrC2C.js +2 -0
  19. package/dist/adapters/GaugeChart.config-CjGtJVoO.cjs +1 -0
  20. package/dist/adapters/GaugeChart.config-F5SA5Oi3.js +2 -0
  21. package/dist/adapters/HeatMapChart.config-CvgmSiuY.cjs +1 -0
  22. package/dist/adapters/HeatMapChart.config-DrvQrPHT.js +2 -0
  23. package/dist/adapters/KpiDelta.config-B-UJWdJ5.cjs +1 -0
  24. package/dist/adapters/KpiDelta.config-C00mTZYy.js +2 -0
  25. package/dist/adapters/KpiNumber.config-CB0kTeoV.cjs +1 -0
  26. package/dist/adapters/KpiNumber.config-D3CogH8j.js +2 -0
  27. package/dist/adapters/KpiText.config-B0LbKRCf.js +2 -0
  28. package/dist/adapters/KpiText.config-Dv4TNprC.cjs +1 -0
  29. package/dist/adapters/LineChart.config-CdONxSLL.js +2 -0
  30. package/dist/adapters/LineChart.config-DBHsfIYG.cjs +1 -0
  31. package/dist/adapters/MarkdownChart.config-AYKXdpuw.cjs +1 -0
  32. package/dist/adapters/MarkdownChart.config-CngxD_Lc.js +2 -0
  33. package/dist/adapters/MeasureProfileChart.config-B0a5sUk6.cjs +1 -0
  34. package/dist/adapters/MeasureProfileChart.config-ByW5F1Ey.js +2 -0
  35. package/dist/adapters/PieChart.config-Csx1ctk4.js +2 -0
  36. package/dist/adapters/PieChart.config-Dfw66Xab.cjs +1 -0
  37. package/dist/adapters/ProportionBarChart.config-BaeYznc1.cjs +1 -0
  38. package/dist/adapters/ProportionBarChart.config-DCOizSVs.js +2 -0
  39. package/dist/adapters/RadarChart.config-AxQh97rB.js +2 -0
  40. package/dist/adapters/RadarChart.config-BjP-zEGW.cjs +1 -0
  41. package/dist/adapters/RadialBarChart.config-D5EwyJ0G.cjs +1 -0
  42. package/dist/adapters/RadialBarChart.config-DMaEJYM_.js +2 -0
  43. package/dist/adapters/RecordsTable.config-BdN0kZ8b.js +2 -0
  44. package/dist/adapters/RecordsTable.config-CWRvGDbi.cjs +1 -0
  45. package/dist/adapters/RetentionCombinedChart.config-BpciOTeX.cjs +1 -0
  46. package/dist/adapters/RetentionCombinedChart.config-CY8TDzuy.js +2 -0
  47. package/dist/adapters/RetentionHeatmap.config-BZPRoVpF.cjs +1 -0
  48. package/dist/adapters/RetentionHeatmap.config-YMZt-u-T.js +2 -0
  49. package/dist/adapters/SankeyChart.config-BdSA-Jlp.cjs +1 -0
  50. package/dist/adapters/SankeyChart.config-Dlgi5_DA.js +2 -0
  51. package/dist/adapters/ScatterChart.config-VJ0xG0Ak.cjs +1 -0
  52. package/dist/adapters/ScatterChart.config-oOd1Jplx.js +2 -0
  53. package/dist/adapters/SunburstChart.config-Cllhyjy4.js +2 -0
  54. package/dist/adapters/SunburstChart.config-DU11BAei.cjs +1 -0
  55. package/dist/adapters/TreeMapChart.config--EB8bQTo.js +2 -0
  56. package/dist/adapters/TreeMapChart.config-BPmMLBH1.cjs +1 -0
  57. package/dist/adapters/WaterfallChart.config-E99Fl6uM.cjs +1 -0
  58. package/dist/adapters/WaterfallChart.config-xz3DaoMQ.js +2 -0
  59. package/dist/adapters/{anthropic-DG4r1LSm.cjs → anthropic-CqLkud62.cjs} +1 -1
  60. package/dist/adapters/{anthropic-CZh4hB-m.js → anthropic-MQlafOZv.js} +3 -0
  61. package/dist/adapters/compiler-BdVMQ3Xj.cjs +166 -0
  62. package/dist/adapters/{compiler-BFLAXV7W.js → compiler-SBDjxyQ3.js} +1231 -1231
  63. package/dist/adapters/core/index.cjs +1 -1
  64. package/dist/adapters/core/index.js +1 -1
  65. package/dist/adapters/{core-CrJu6vJY.cjs → core-CSt8MGbw.cjs} +1 -1
  66. package/dist/adapters/{core-l3KMTu9u.js → core-CXrxqh7l.js} +2 -2
  67. package/dist/adapters/express/index.cjs +1 -1
  68. package/dist/adapters/express/index.js +5 -5
  69. package/dist/adapters/fastify/index.cjs +1 -1
  70. package/dist/adapters/fastify/index.js +23 -23
  71. package/dist/{server/google-PsZzwedr.cjs → adapters/google-6pofxIfm.cjs} +1 -1
  72. package/dist/{server/google-DRY7jnOh.js → adapters/google-BBBP1Dhs.js} +3 -0
  73. package/dist/adapters/{handler-DESp4wPg.js → handler-Cppe-aqH.js} +569 -374
  74. package/dist/adapters/handler-_u5krbOj.cjs +26 -0
  75. package/dist/adapters/hono/index.cjs +1 -1
  76. package/dist/adapters/hono/index.js +4 -4
  77. package/dist/adapters/mcp-tools.cjs +1 -1
  78. package/dist/adapters/mcp-tools.js +2 -2
  79. package/dist/adapters/mcp-transport-CpF7usmR.js +754 -0
  80. package/dist/adapters/mcp-transport-DXIfb0p-.cjs +42 -0
  81. package/dist/adapters/nextjs/index.cjs +1 -1
  82. package/dist/adapters/nextjs/index.js +5 -5
  83. package/dist/adapters/{openai-DK_KWiI7.js → openai-62sEF0Ev.js} +10 -4
  84. package/dist/adapters/{openai-BJyU4kvE.js → openai-BIoIunc7.js} +2 -2
  85. package/dist/adapters/openai-CaxNY6TC.cjs +1 -0
  86. package/dist/adapters/{openai-GO3M7Hwi.cjs → openai-EBTQKJnV.cjs} +2 -2
  87. package/dist/adapters/{utils-BhlkVCzZ.js → utils-C_RKaP0n.js} +2 -1
  88. package/dist/adapters/utils-DXWQUJbD.cjs +128 -0
  89. package/dist/adapters/utils.cjs +1 -1
  90. package/dist/adapters/utils.js +2 -2
  91. package/dist/cjs/client/components/AgenticNotebook/chatMessageParts.d.ts +0 -2
  92. package/dist/cjs/client/components/PortletGroupCard.d.ts +3 -1
  93. package/dist/cjs/client/components/RowManagedLayout.d.ts +5 -2
  94. package/dist/cjs/client/components/dashboardPortletCard/cardStyles.d.ts +7 -3
  95. package/dist/cjs/client/components/markdownOverrides.d.ts +202 -0
  96. package/dist/cjs/client/components/rowManagedLayout/sections.d.ts +46 -0
  97. package/dist/cjs/client/hooks/agentChatStream.d.ts +3 -2
  98. package/dist/cjs/client/hooks/useAgentChat.d.ts +1 -0
  99. package/dist/cjs/server/agent/agent-prompts.d.ts +14 -0
  100. package/dist/cjs/server/agent/chart-validation.d.ts +14 -0
  101. package/dist/cjs/server/agent/data-shape.d.ts +41 -0
  102. package/dist/cjs/server/agent/providers/anthropic.d.ts +1 -0
  103. package/dist/cjs/server/agent/providers/google.d.ts +1 -0
  104. package/dist/cjs/server/agent/providers/openai.d.ts +1 -0
  105. package/dist/cjs/server/agent/providers/types.d.ts +13 -0
  106. package/dist/cjs/server/agent/tools.d.ts +18 -4
  107. package/dist/cjs/server/agent/types.d.ts +5 -1
  108. package/dist/cjs/server/ai/chart-schema.d.ts +37 -0
  109. package/dist/client/charts.js +12 -12
  110. package/dist/client/chunks/{DashboardEditModal-BliiIHcI.js → DashboardEditModal-DjMGNTUa.js} +878 -785
  111. package/dist/client/chunks/DashboardEditModal-DjMGNTUa.js.map +1 -0
  112. package/dist/client/chunks/{DotStripChart-ChwsVeRU.js → DotStripChart-EEtJyV1v.js} +3 -3
  113. package/dist/client/chunks/{DotStripChart-ChwsVeRU.js.map → DotStripChart-EEtJyV1v.js.map} +1 -1
  114. package/dist/client/chunks/{ProportionBarChart-D-Qt9nkF.js → ProportionBarChart-3r7ZPX-V.js} +3 -3
  115. package/dist/client/chunks/{ProportionBarChart-D-Qt9nkF.js.map → ProportionBarChart-3r7ZPX-V.js.map} +1 -1
  116. package/dist/client/chunks/{RecordsTable-aG-QYXOH.js → RecordsTable-DvMXV6F6.js} +4 -4
  117. package/dist/client/chunks/{RecordsTable-aG-QYXOH.js.map → RecordsTable-DvMXV6F6.js.map} +1 -1
  118. package/dist/client/chunks/{RetentionCombinedChart-BRZ9w7ah.js → RetentionCombinedChart-DbxB86fj.js} +3 -3
  119. package/dist/client/chunks/{RetentionCombinedChart-BRZ9w7ah.js.map → RetentionCombinedChart-DbxB86fj.js.map} +1 -1
  120. package/dist/client/chunks/{RetentionHeatmap-LkTt89pK.js → RetentionHeatmap-CE3rxhAU.js} +2 -2
  121. package/dist/client/chunks/{RetentionHeatmap-LkTt89pK.js.map → RetentionHeatmap-CE3rxhAU.js.map} +1 -1
  122. package/dist/client/chunks/{analysis-builder-C0gJ3kDD.js → analysis-builder-lQk_qJBQ.js} +9 -9
  123. package/dist/client/chunks/{analysis-builder-C0gJ3kDD.js.map → analysis-builder-lQk_qJBQ.js.map} +1 -1
  124. package/dist/client/chunks/{analysis-builder-shared-dqcpl_WL.js → analysis-builder-shared-C_pLSXJR.js} +9 -9
  125. package/dist/client/chunks/{analysis-builder-shared-dqcpl_WL.js.map → analysis-builder-shared-C_pLSXJR.js.map} +1 -1
  126. package/dist/client/chunks/{chart-activity-grid-CJzxC18G.js → chart-activity-grid-UZIp9_2E.js} +3 -2
  127. package/dist/client/chunks/chart-activity-grid-UZIp9_2E.js.map +1 -0
  128. package/dist/client/chunks/{chart-area-C66dgy84.js → chart-area-CEBcvCcn.js} +2 -2
  129. package/dist/client/chunks/{chart-area-C66dgy84.js.map → chart-area-CEBcvCcn.js.map} +1 -1
  130. package/dist/client/chunks/{chart-bar-D9kiSOCT.js → chart-bar-DGh7cpU-.js} +3 -3
  131. package/dist/client/chunks/{chart-bar-D9kiSOCT.js.map → chart-bar-DGh7cpU-.js.map} +1 -1
  132. package/dist/client/chunks/{chart-box-plot-FsLIMisc.js → chart-box-plot-CeqoKPFa.js} +2 -2
  133. package/dist/client/chunks/{chart-box-plot-FsLIMisc.js.map → chart-box-plot-CeqoKPFa.js.map} +1 -1
  134. package/dist/client/chunks/{chart-bubble-BzyvrqKs.js → chart-bubble-8uH_JKNt.js} +2 -2
  135. package/dist/client/chunks/{chart-bubble-BzyvrqKs.js.map → chart-bubble-8uH_JKNt.js.map} +1 -1
  136. package/dist/client/chunks/{chart-candlestick-6lD35bLw.js → chart-candlestick-DogklMg1.js} +2 -2
  137. package/dist/client/chunks/{chart-candlestick-6lD35bLw.js.map → chart-candlestick-DogklMg1.js.map} +1 -1
  138. package/dist/client/chunks/{chart-data-table-Cou9qOab.js → chart-data-table-CCvvgeG_.js} +2 -2
  139. package/dist/client/chunks/{chart-data-table-Cou9qOab.js.map → chart-data-table-CCvvgeG_.js.map} +1 -1
  140. package/dist/client/chunks/{chart-funnel-B0775aaT.js → chart-funnel-D2vGQhaz.js} +2 -2
  141. package/dist/client/chunks/{chart-funnel-B0775aaT.js.map → chart-funnel-D2vGQhaz.js.map} +1 -1
  142. package/dist/client/chunks/{chart-gauge-pf-2E8w9.js → chart-gauge-DbU0rxqv.js} +3 -3
  143. package/dist/client/chunks/{chart-gauge-pf-2E8w9.js.map → chart-gauge-DbU0rxqv.js.map} +1 -1
  144. package/dist/client/chunks/{chart-heat-map-EzVGe6fl.js → chart-heat-map-x6aQq91x.js} +3 -3
  145. package/dist/client/chunks/{chart-heat-map-EzVGe6fl.js.map → chart-heat-map-x6aQq91x.js.map} +1 -1
  146. package/dist/client/chunks/{chart-kpi-delta-lfskDdx4.js → chart-kpi-delta-B2-m16QC.js} +3 -3
  147. package/dist/client/chunks/{chart-kpi-delta-lfskDdx4.js.map → chart-kpi-delta-B2-m16QC.js.map} +1 -1
  148. package/dist/client/chunks/{chart-kpi-number-BnsofbTf.js → chart-kpi-number-DggvlYT_.js} +5 -5
  149. package/dist/client/chunks/{chart-kpi-number-BnsofbTf.js.map → chart-kpi-number-DggvlYT_.js.map} +1 -1
  150. package/dist/client/chunks/{chart-kpi-text-U5EdmdkV.js → chart-kpi-text-BFy-m1NP.js} +3 -3
  151. package/dist/client/chunks/{chart-kpi-text-U5EdmdkV.js.map → chart-kpi-text-BFy-m1NP.js.map} +1 -1
  152. package/dist/client/chunks/{chart-line-IwXqPY80.js → chart-line-C4r44HWi.js} +3 -3
  153. package/dist/client/chunks/{chart-line-IwXqPY80.js.map → chart-line-C4r44HWi.js.map} +1 -1
  154. package/dist/client/chunks/{chart-markdown-yxN_xBP9.js → chart-markdown-b0qPZ617.js} +3 -3
  155. package/dist/client/chunks/chart-markdown-b0qPZ617.js.map +1 -0
  156. package/dist/client/chunks/{chart-measure-profile-Bs4vhBJQ.js → chart-measure-profile-Dc-d82kF.js} +3 -3
  157. package/dist/client/chunks/{chart-measure-profile-Bs4vhBJQ.js.map → chart-measure-profile-Dc-d82kF.js.map} +1 -1
  158. package/dist/client/chunks/{chart-pie-LDJfDXfX.js → chart-pie-BHrPxga2.js} +3 -3
  159. package/dist/client/chunks/{chart-pie-LDJfDXfX.js.map → chart-pie-BHrPxga2.js.map} +1 -1
  160. package/dist/client/chunks/{chart-radar-BZY6TP9m.js → chart-radar-I9sOFbG5.js} +3 -3
  161. package/dist/client/chunks/{chart-radar-BZY6TP9m.js.map → chart-radar-I9sOFbG5.js.map} +1 -1
  162. package/dist/client/chunks/{chart-radial-bar-aga05X7h.js → chart-radial-bar-DeDMMf9P.js} +3 -3
  163. package/dist/client/chunks/{chart-radial-bar-aga05X7h.js.map → chart-radial-bar-DeDMMf9P.js.map} +1 -1
  164. package/dist/client/chunks/{chart-sankey-MRCoWFd4.js → chart-sankey-1qB7yWHq.js} +2 -2
  165. package/dist/client/chunks/{chart-sankey-MRCoWFd4.js.map → chart-sankey-1qB7yWHq.js.map} +1 -1
  166. package/dist/client/chunks/{chart-scatter-DP-nn9hH.js → chart-scatter-BHttSxcc.js} +3 -3
  167. package/dist/client/chunks/{chart-scatter-DP-nn9hH.js.map → chart-scatter-BHttSxcc.js.map} +1 -1
  168. package/dist/client/chunks/{chart-sunburst-DE4EX7zi.js → chart-sunburst-Cmzol8kR.js} +3 -3
  169. package/dist/client/chunks/{chart-sunburst-DE4EX7zi.js.map → chart-sunburst-Cmzol8kR.js.map} +1 -1
  170. package/dist/client/chunks/{chart-tree-map-C3O6uQcP.js → chart-tree-map-CdSwr_zI.js} +3 -3
  171. package/dist/client/chunks/{chart-tree-map-C3O6uQcP.js.map → chart-tree-map-CdSwr_zI.js.map} +1 -1
  172. package/dist/client/chunks/{chart-waterfall-DU2Fg_7P.js → chart-waterfall-BN3B5luW.js} +3 -3
  173. package/dist/client/chunks/{chart-waterfall-DU2Fg_7P.js.map → chart-waterfall-BN3B5luW.js.map} +1 -1
  174. package/dist/client/chunks/{charts-core-DnirPG1F.js → charts-core-DIneMirc.js} +2 -2
  175. package/dist/client/chunks/{charts-core-DnirPG1F.js.map → charts-core-DIneMirc.js.map} +1 -1
  176. package/dist/client/chunks/charts-loader-OHpTBq8c.js +87 -0
  177. package/dist/client/chunks/{charts-loader-tCSbqT7H.js.map → charts-loader-OHpTBq8c.js.map} +1 -1
  178. package/dist/client/chunks/{nl-NL-B9VnaVAm.js → nl-NL-dk-kC0sL.js} +2 -1
  179. package/dist/client/chunks/nl-NL-dk-kC0sL.js.map +1 -0
  180. package/dist/client/chunks/{schema-visualization-o1zzuMQy.js → schema-visualization-PYa578pV.js} +3 -3
  181. package/dist/client/chunks/{schema-visualization-o1zzuMQy.js.map → schema-visualization-PYa578pV.js.map} +1 -1
  182. package/dist/client/chunks/{useDirtyStateTracking-DTYbmRBn.js → useDirtyStateTracking-BQupC3wJ.js} +4 -4
  183. package/dist/client/chunks/{useDirtyStateTracking-DTYbmRBn.js.map → useDirtyStateTracking-BQupC3wJ.js.map} +1 -1
  184. package/dist/client/chunks/{useExplainAI-MuC9jBn-.js → useExplainAI-DORnTynt.js} +4 -4
  185. package/dist/client/chunks/{useExplainAI-MuC9jBn-.js.map → useExplainAI-DORnTynt.js.map} +1 -1
  186. package/dist/client/chunks/{vendor-XQT9APIq.js → vendor-DDo8nSGP.js} +2 -2
  187. package/dist/client/chunks/{vendor-XQT9APIq.js.map → vendor-DDo8nSGP.js.map} +1 -1
  188. package/dist/client/components/AgenticNotebook/chatMessageParts.d.ts +0 -2
  189. package/dist/client/components/PortletGroupCard.d.ts +3 -1
  190. package/dist/client/components/RowManagedLayout.d.ts +5 -2
  191. package/dist/client/components/dashboardPortletCard/cardStyles.d.ts +7 -3
  192. package/dist/client/components/markdownOverrides.d.ts +202 -0
  193. package/dist/client/components/rowManagedLayout/sections.d.ts +46 -0
  194. package/dist/client/components.js +1 -1
  195. package/dist/client/hooks/agentChatStream.d.ts +3 -2
  196. package/dist/client/hooks/useAgentChat.d.ts +1 -0
  197. package/dist/client/hooks.js +3 -3
  198. package/dist/client/icons.js +1 -1
  199. package/dist/client/index.js +474 -471
  200. package/dist/client/index.js.map +1 -1
  201. package/dist/client/providers.js +1 -1
  202. package/dist/client/schema.js +1 -1
  203. package/dist/client/styles.css +1 -1
  204. package/dist/client/utils.js +4 -4
  205. package/dist/client-bundle-stats.html +1 -1
  206. package/dist/mcp-app/mcp-app.html +4 -4
  207. package/dist/server/agent/agent-prompts.d.ts +14 -0
  208. package/dist/server/agent/chart-validation.d.ts +14 -0
  209. package/dist/server/agent/data-shape.d.ts +41 -0
  210. package/dist/server/agent/providers/anthropic.d.ts +1 -0
  211. package/dist/server/agent/providers/google.d.ts +1 -0
  212. package/dist/server/agent/providers/openai.d.ts +1 -0
  213. package/dist/server/agent/providers/types.d.ts +13 -0
  214. package/dist/server/agent/tools.d.ts +18 -4
  215. package/dist/server/agent/types.d.ts +5 -1
  216. package/dist/server/ai/chart-schema.d.ts +37 -0
  217. package/dist/server/{anthropic-DG4r1LSm.cjs → anthropic-CqLkud62.cjs} +1 -1
  218. package/dist/server/{anthropic-CZh4hB-m.js → anthropic-MQlafOZv.js} +3 -0
  219. package/dist/{adapters/google-PsZzwedr.cjs → server/google-6pofxIfm.cjs} +1 -1
  220. package/dist/{adapters/google-DRY7jnOh.js → server/google-BBBP1Dhs.js} +3 -0
  221. package/dist/server/index.cjs +44 -43
  222. package/dist/server/index.js +2069 -1857
  223. package/dist/server/{openai-6uUf7h-5.js → openai-nBhuSFd3.js} +9 -3
  224. package/dist/server/openai-rF50ZEiR.cjs +1 -0
  225. package/package.json +4 -4
  226. package/dist/adapters/ActivityGridChart.config-Bc7mPqcf.cjs +0 -1
  227. package/dist/adapters/ActivityGridChart.config-Dd2YDeaM.js +0 -2
  228. package/dist/adapters/AreaChart.config-BqNusnpg.js +0 -2
  229. package/dist/adapters/AreaChart.config-dI84V34B.cjs +0 -1
  230. package/dist/adapters/BarChart.config-B9MQjgLJ.cjs +0 -1
  231. package/dist/adapters/BarChart.config-Cq_qcxBA.js +0 -2
  232. package/dist/adapters/BoxPlotChart.config-XmtRN2xq.cjs +0 -1
  233. package/dist/adapters/BoxPlotChart.config-Zc-JGV-W.js +0 -2
  234. package/dist/adapters/BubbleChart.config-CU_18uxb.js +0 -2
  235. package/dist/adapters/BubbleChart.config-CbhOzA6-.cjs +0 -1
  236. package/dist/adapters/CandlestickChart.config-Bwo3uaa-.js +0 -2
  237. package/dist/adapters/CandlestickChart.config-CmRBlWFv.cjs +0 -1
  238. package/dist/adapters/DataTable.config-7JNSj6qQ.js +0 -2
  239. package/dist/adapters/DataTable.config-DNxm1sYk.cjs +0 -1
  240. package/dist/adapters/DotStripChart.config-B7Dl-T1h.js +0 -2
  241. package/dist/adapters/DotStripChart.config-Co4g1fpZ.cjs +0 -1
  242. package/dist/adapters/FunnelChart.config-D1TpuGtL.cjs +0 -1
  243. package/dist/adapters/FunnelChart.config-vuZScOHQ.js +0 -2
  244. package/dist/adapters/GaugeChart.config-BMgUHKhC.cjs +0 -1
  245. package/dist/adapters/GaugeChart.config-zdpFydo6.js +0 -2
  246. package/dist/adapters/HeatMapChart.config-4XMab1zq.js +0 -2
  247. package/dist/adapters/HeatMapChart.config-C-Ns6QBq.cjs +0 -1
  248. package/dist/adapters/KpiDelta.config-BGdqsHcc.js +0 -2
  249. package/dist/adapters/KpiDelta.config-DuNxrGIi.cjs +0 -1
  250. package/dist/adapters/KpiNumber.config-CkPWpcSz.js +0 -2
  251. package/dist/adapters/KpiNumber.config-DMGmuA3i.cjs +0 -1
  252. package/dist/adapters/KpiText.config-Bvtuv8vE.js +0 -2
  253. package/dist/adapters/KpiText.config-DOMLO16U.cjs +0 -1
  254. package/dist/adapters/LineChart.config-CJmTSmZ1.js +0 -2
  255. package/dist/adapters/LineChart.config-CrkGu0aa.cjs +0 -1
  256. package/dist/adapters/MarkdownChart.config-BgY5Xc97.cjs +0 -1
  257. package/dist/adapters/MarkdownChart.config-Cm6G4Yuh.js +0 -2
  258. package/dist/adapters/MeasureProfileChart.config-BYwDo_ox.cjs +0 -1
  259. package/dist/adapters/MeasureProfileChart.config-Dt7npubZ.js +0 -2
  260. package/dist/adapters/PieChart.config-BRbPctBN.cjs +0 -1
  261. package/dist/adapters/PieChart.config-HZofeody.js +0 -2
  262. package/dist/adapters/ProportionBarChart.config-B_rTtGZr.cjs +0 -1
  263. package/dist/adapters/ProportionBarChart.config-ChCSoM0L.js +0 -2
  264. package/dist/adapters/RadarChart.config-B9OdMEib.js +0 -2
  265. package/dist/adapters/RadarChart.config-BOgPD2Kz.cjs +0 -1
  266. package/dist/adapters/RadialBarChart.config-CeP7jEbq.js +0 -2
  267. package/dist/adapters/RadialBarChart.config-sivA1Jmo.cjs +0 -1
  268. package/dist/adapters/RecordsTable.config-BInSgo-G.js +0 -2
  269. package/dist/adapters/RecordsTable.config-CVmxLdjz.cjs +0 -1
  270. package/dist/adapters/RetentionCombinedChart.config-8ry7gh6X.cjs +0 -1
  271. package/dist/adapters/RetentionCombinedChart.config-Bxtxnlcf.js +0 -2
  272. package/dist/adapters/RetentionHeatmap.config-DCtOD8dO.js +0 -2
  273. package/dist/adapters/RetentionHeatmap.config-i-LgmmIT.cjs +0 -1
  274. package/dist/adapters/SankeyChart.config-DfpeHfNT.cjs +0 -1
  275. package/dist/adapters/SankeyChart.config-hfM0ACm1.js +0 -2
  276. package/dist/adapters/ScatterChart.config-BD2vfOZ6.js +0 -2
  277. package/dist/adapters/ScatterChart.config-CdpvRueF.cjs +0 -1
  278. package/dist/adapters/SunburstChart.config-Boyt88L_.cjs +0 -1
  279. package/dist/adapters/SunburstChart.config-BvrofzMv.js +0 -2
  280. package/dist/adapters/TreeMapChart.config-DBrqwtqT.js +0 -2
  281. package/dist/adapters/TreeMapChart.config-KcRLlZAG.cjs +0 -1
  282. package/dist/adapters/WaterfallChart.config-CuCGaIl5.cjs +0 -1
  283. package/dist/adapters/WaterfallChart.config-DZ8H0V2L.js +0 -2
  284. package/dist/adapters/compiler-DG6dLFQU.cjs +0 -166
  285. package/dist/adapters/handler-CRGZ8gd2.cjs +0 -25
  286. package/dist/adapters/mcp-transport-BqdBHmXL.js +0 -730
  287. package/dist/adapters/mcp-transport-D8xZJLPD.cjs +0 -42
  288. package/dist/adapters/openai-DH9MtcLA.cjs +0 -1
  289. package/dist/adapters/utils-C1JpSDOX.cjs +0 -128
  290. package/dist/client/chunks/DashboardEditModal-BliiIHcI.js.map +0 -1
  291. package/dist/client/chunks/chart-activity-grid-CJzxC18G.js.map +0 -1
  292. package/dist/client/chunks/chart-markdown-yxN_xBP9.js.map +0 -1
  293. package/dist/client/chunks/charts-loader-tCSbqT7H.js +0 -87
  294. package/dist/client/chunks/nl-NL-B9VnaVAm.js.map +0 -1
  295. package/dist/server/openai-BBe1XbZd.cjs +0 -1
@@ -1,8 +1,30 @@
1
- import { A as e, _ as t, g as n, h as r, k as i, m as a, p as o, v as s, x as c } from "./utils-BhlkVCzZ.js";
2
- import { E as l, T as u } from "./mcp-transport-BqdBHmXL.js";
3
- import { a as d, c as f, d as p, i as m, l as h, n as g, o as _, r as v, s as y, t as b, u as x } from "./chartConfigHelpers-BsnbxA2c.js";
1
+ import { O as e, _ as t, b as n, g as r, h as i, k as a, m as o, p as s } from "./utils-C_RKaP0n.js";
2
+ import { D as c, E as l, O as u, T as d } from "./mcp-transport-CpF7usmR.js";
3
+ import { a as f, c as p, d as m, i as h, l as g, n as _, o as v, r as y, s as b, t as x, u as S } from "./chartConfigHelpers-BsnbxA2c.js";
4
+ //#region src/server/agent/agent-prompts.ts
5
+ var ee = [
6
+ "You are an analyst agent working in a notebook backed by a drizzle-cube semantic layer.",
7
+ "",
8
+ "Your tools, in the order you normally use them:",
9
+ "1) `discover_cubes` {topic|intent} — find cubes and understand the schema. Call this first.",
10
+ "2) `get_cube_metadata` — full measure/dimension detail for every cube, when discover is not enough.",
11
+ "3) `execute_query` — run a query and get results back, along with a `dataShape` summary.",
12
+ "4) `add_markdown` — write the finding into the notebook.",
13
+ "5) `add_portlet` — add the chart that shows it.",
14
+ "6) `update_portlet` — amend a chart you already added, instead of adding a second one.",
15
+ "7) `save_as_dashboard` — only when the user explicitly asks for a dashboard.",
16
+ "",
17
+ "CROSS-CUBE JOINS:",
18
+ "The \"joins\" property in discover results shows relationships between cubes.",
19
+ "You can include dimensions from ANY related cube in your query — the system auto-joins.",
20
+ "Example: If Productivity joins to Employees, query:",
21
+ "{ \"measures\": [\"Productivity.totalPullRequests\"], \"dimensions\": [\"Employees.name\"] }",
22
+ "",
23
+ "Do NOT hallucinate cube/field names — always use discover_cubes first."
24
+ ].join("\n");
25
+ //#endregion
4
26
  //#region src/server/agent/system-prompt.ts
5
- function S(e, t) {
27
+ function te(e, t) {
6
28
  if (!(!t.measures || t.measures.length === 0)) {
7
29
  e.push(""), e.push("**Measures:**");
8
30
  for (let n of t.measures) {
@@ -11,7 +33,7 @@ function S(e, t) {
11
33
  }
12
34
  }
13
35
  }
14
- function ee(e, t) {
36
+ function ne(e, t) {
15
37
  if (!(!t.dimensions || t.dimensions.length === 0)) {
16
38
  e.push(""), e.push("**Dimensions:**");
17
39
  for (let n of t.dimensions) {
@@ -20,25 +42,25 @@ function ee(e, t) {
20
42
  }
21
43
  }
22
44
  }
23
- function te(e, t) {
45
+ function re(e, t) {
24
46
  if (!(!t.relationships || t.relationships.length === 0)) {
25
47
  e.push(""), e.push("**Joins:**");
26
48
  for (let n of t.relationships) e.push(`- → \`${n.targetCube}\` (${n.relationship})`);
27
49
  }
28
50
  }
29
- function ne(e, t) {
51
+ function ie(e, t) {
30
52
  t.meta?.eventStream && (e.push(""), e.push("**Event Stream:** Yes (supports funnel, flow, retention queries)"), t.meta.eventStream.bindingKey && e.push(`- Binding key: \`${t.name}.${t.meta.eventStream.bindingKey}\``), t.meta.eventStream.timeDimension && e.push(`- Time dimension: \`${t.name}.${t.meta.eventStream.timeDimension}\``));
31
53
  }
32
- function re(e) {
54
+ function ae(e) {
33
55
  if (e.length === 0) return "No cubes are currently available.";
34
56
  let t = ["## Available Cubes", ""];
35
- for (let n of e) t.push(`### ${n.name}`), n.description && t.push(n.description), S(t, n), ee(t, n), te(t, n), ne(t, n), t.push("");
57
+ for (let n of e) t.push(`### ${n.name}`), n.description && t.push(n.description), te(t, n), ne(t, n), re(t, n), ie(t, n), t.push("");
36
58
  return t.join("\n");
37
59
  }
38
60
  function C(e) {
39
61
  return e.messages.map((e) => e.content.text).join("\n\n");
40
62
  }
41
- function ie(e) {
63
+ function oe(e) {
42
64
  return [
43
65
  "# Drizzle Cube Analytics Agent",
44
66
  "",
@@ -65,7 +87,7 @@ function ie(e) {
65
87
  " WRONG patterns that WILL FAIL: `Teams.Teams.name` (double-prefixed), `PullRequests.PullRequests.count` (double-prefixed), `PullRequests` (bare cube), `Teams_count` (underscore). Use the EXACT field names from discover results — copy them verbatim, do not prefix them again.",
66
88
  "- Order keys MUST be one of the measures or dimensions already listed in that query. You CANNOT order by a field that is not in measures or dimensions — add it to measures first, or remove it from order.",
67
89
  "- After EVERY `execute_query`, IMMEDIATELY call `add_markdown` and `add_portlet` in the SAME turn — never defer visualizations to a later turn",
68
- "- Choose appropriate chart types: bar for categories, line for trends, table for detailed data",
90
+ "- Choose the chart type from the Chart Selection Guide below — match the chart to the question being asked, and vary chart types across the notebook",
69
91
  "- If a query fails, explain the error and try an alternative approach",
70
92
  "",
71
93
  "## Output Format Rules",
@@ -92,27 +114,51 @@ function ie(e) {
92
114
  "- Before each `add_portlet`, ALWAYS call `add_markdown` first to explain WHY you are adding this visualization and what it shows",
93
115
  "- Before calling `add_portlet`, verify the query is valid: all fields in `order` must also appear in `measures` or `dimensions`",
94
116
  "- Never put data tables in markdown blocks — use `add_portlet` with chartType \"table\" instead",
117
+ "- If a chart you already added is wrong, or the user asks to change one, call `update_portlet` with its id — do NOT add a second chart of the same data",
95
118
  "- Think out loud in the notebook: use `add_markdown` to share your reasoning at each step so users can follow along",
96
119
  "- NEVER use emojis in text responses or markdown content — no 📊, 📈, ✅, 🔍, etc. Write in plain, professional language.",
97
120
  "",
121
+ "### Analysis Depth and Layout",
122
+ "",
123
+ "- A good notebook answers the question and then earns its keep: aim for 4-6 distinct insights unless the user asked something narrow.",
124
+ "- Vary the angle, not just the chart: overall level → breakdown by a dimension → trend over time → outliers or concentration → a caveat about the data.",
125
+ "- Actively look for the surprising thing: the biggest mover, the outlier, the category carrying most of the total, the segment moving against the trend. Say so in the markdown, plainly.",
126
+ "- Never add a chart that restates the previous chart with a different chart type.",
127
+ "- Structure the notebook like a short report: a scene-setting markdown block, then alternating markdown/chart pairs, then a closing block with the takeaways and what you could NOT determine from the available data.",
128
+ "- If a result is boring — flat, evenly distributed, or too few rows to mean anything — say that in the markdown and move to a different angle rather than charting it.",
129
+ "",
98
130
  "## Chart Selection Guide",
99
131
  "",
100
- "Choose the chart type that best communicates the answer to the user's question. Think about what the data represents and what insight the user needs — do NOT default to the first option in this table. Consider the number of data points, whether values are categorical or temporal, and whether the user is comparing, trending, or summarizing.",
132
+ "Pick the chart that answers the question, not the one that is easiest. Consider how many rows came back, whether the values are categorical or temporal, and whether the user is comparing, trending, or summarising. Do NOT default to the first option in this table.",
133
+ "",
134
+ "`execute_query` returns a `dataShape` summary alongside the rows — use it. `distinctCount` on the dimension you are charting is the single most useful signal: 2-7 favours a part-of-whole treatment, 8-25 a ranking, and above that take a top-N with `order` + `limit` or show a table instead. Widely different `min`/`max` across measures means you need `yAxisAssignment`.",
135
+ "",
136
+ "Only the first rows are returned to you. When `truncated` is true the chart is still correct — the portlet re-runs the query itself — but do NOT state totals, counts or extremes you cannot see; use `rowCount` and `dataShape`, or run a narrower query.",
101
137
  "",
102
- "| Intent / Data Shape | Chart Type |",
138
+ "| Question the user is asking | Chart |",
103
139
  "|---|---|",
104
140
  "| Compare discrete categories or rankings | `bar` |",
105
141
  "| Trend over time (one or few series) | `line` |",
106
142
  "| Trend over time showing volume/magnitude | `area` |",
107
- "| Part-of-whole breakdown | `pie` (7 slices) |",
143
+ "| Part-of-whole breakdown | `pie` (2-7 slices) or `proportionBar` (one stacked bar, easier to read) |",
144
+ "| Contributions summing to a total, with signed ups and downs | `waterfall` (deltas only, never raw totals) |",
145
+ "| Long tail or nested breakdown, many categories | `treemap` |",
146
+ "| Categories as compact circular progress | `radialBar` |",
108
147
  "| Correlation between two measures | `scatter` |",
109
- "| Correlation with size/color third dimension | `bubble` |",
110
- "| Intensity across two categorical dimensions | `heatmap` |",
148
+ "| Correlation with size/colour third dimension | `bubble` |",
149
+ "| Intensity across two categorical dimensions | `heatmap` (set `valueField`) |",
150
+ "| Activity per day across weeks or months | `activityGrid` (needs a `day`-granularity time dimension; set `dateField` and `valueField`) |",
111
151
  "| Multi-variable comparison across categories | `radar` |",
112
- "| Distribution/spread of values | `boxPlot` |",
113
- "| Detailed row-level data or many columns | `table` |",
152
+ "| Distribution/spread, summarised | `boxPlot` |",
153
+ "| Distribution/spread, every individual value | `dotStrip` |",
154
+ "| A shape across ordered measures (e.g. -2m, at event, +2h) | `measureProfile` (2+ measures on a comparable scale) |",
155
+ "| Detailed row-level data or many columns | `table` (aggregates) or `recordsTable` (one row per record) |",
156
+ "| Progress toward a known target or limit | `gauge` (ALWAYS set `maxValue`, or it scales to the data and reads as 100%) |",
157
+ "| Open/high/low/close price or range data | `candlestick` (put the measures in `yAxis` in OHLC order) |",
158
+ "| Narrative, caveats, methodology | `markdown` |",
114
159
  "| Single headline number — ONLY when user explicitly asks for a KPI card or single number | `kpiNumber` |",
115
160
  "| Headline metric with period-over-period change — ONLY when user asks about change in a single metric | `kpiDelta` |",
161
+ "| Headline number inside a sentence — same restraint as kpiNumber | `kpiText` |",
116
162
  "",
117
163
  "Analysis-mode-specific chart types (require the corresponding analysis mode):",
118
164
  "",
@@ -124,11 +170,13 @@ function ie(e) {
124
170
  "| Retention | `retentionHeatmap` | Cohort × period retention matrix |",
125
171
  "| Retention | `retentionCombined` | Retention with line chart, heatmap, or combined modes |",
126
172
  "",
127
- "**Chart selection priorities:** Default to `bar` for categories, `line` for time series, `table` for exploratory data. Use `kpiNumber`/`kpiDelta` only as a last resort — they are appropriate only when the user explicitly asks for a single headline number or KPI card. If the query returns multiple rows or the user asks a general question like \"show me revenue\", prefer `bar` or `table` over `kpiNumber`.",
173
+ "**Vary the chart types across a notebook.** A notebook of nothing but bars and tables is a failure even when every chart is individually valid. `kpiNumber`/`kpiDelta`/`kpiText` are a last resort — use them only when the user explicitly asks for a single headline number, never for a multi-row result.",
174
+ "",
175
+ "`recordsTable` lists one row per record, so its query MUST set `\"ungrouped\": true` — which also means one cube plus its to-one joins, since an ungrouped query cannot span a hasMany relationship.",
128
176
  "",
129
177
  "## Chart Axis Configuration Rules",
130
178
  "",
131
- "**Bar charts MUST have an xAxis.** Put a dimension in `chartConfig.xAxis` so bars have category labels. If your query has no dimensions, add one or use `table` instead.",
179
+ "**Bar charts need an xAxis dimension.** A bar chart over a measures-only query has no category axis to label its bars; if you send one it is converted to a `table` (or `kpiNumber` for a single measure) and you are told so. To get a real bar chart, put the category in the query's `dimensions` and use a single measure. To compare several measures as an ordered shape, use `measureProfile`.",
132
180
  "",
133
181
  "**Never duplicate xAxis in series.** Putting the same dimension in both `xAxis` and `series` creates a sparse, broken-looking chart. The `series` field is ONLY for splitting bars into grouped/stacked sub-series by a SECOND dimension.",
134
182
  "",
@@ -179,15 +227,15 @@ function ie(e) {
179
227
  "",
180
228
  "---",
181
229
  "",
182
- C(t),
230
+ ee,
183
231
  "",
184
232
  "---",
185
233
  "",
186
- C(s),
234
+ C(t),
187
235
  "",
188
236
  "---",
189
237
  "",
190
- C(n),
238
+ C(r),
191
239
  "",
192
240
  "---",
193
241
  "",
@@ -242,12 +290,12 @@ function ie(e) {
242
290
  "",
243
291
  "---",
244
292
  "",
245
- re(e)
293
+ ae(e)
246
294
  ].join("\n");
247
295
  }
248
296
  //#endregion
249
297
  //#region src/client/components/charts/BarChart.config.ts
250
- var ae = {
298
+ var w = {
251
299
  clickableElements: { bar: !0 },
252
300
  dropZones: [
253
301
  {
@@ -284,12 +332,12 @@ var ae = {
284
332
  "hideHeader"
285
333
  ],
286
334
  displayOptionsConfig: [
287
- h("chart.configText.how_to_stack_multiple_bar_series"),
288
- x,
289
- v,
290
- _
335
+ g("chart.configText.how_to_stack_multiple_bar_series"),
336
+ S,
337
+ y,
338
+ v
291
339
  ]
292
- }, oe = {
340
+ }, T = {
293
341
  clickableElements: { point: !0 },
294
342
  dropZones: [
295
343
  {
@@ -326,10 +374,10 @@ var ae = {
326
374
  "hideHeader"
327
375
  ],
328
376
  displayOptionsConfig: [
329
- f,
330
- y(),
331
- b,
377
+ p,
378
+ b(),
332
379
  x,
380
+ S,
333
381
  {
334
382
  key: "priorPeriodStyle",
335
383
  label: "chart.option.priorPeriodStyle.label",
@@ -361,10 +409,10 @@ var ae = {
361
409
  step: .1,
362
410
  description: "chart.option.priorPeriodOpacity.description"
363
411
  },
364
- v,
365
- _
412
+ y,
413
+ v
366
414
  ]
367
- }, w = {
415
+ }, se = {
368
416
  dropZones: [
369
417
  {
370
418
  key: "xAxis",
@@ -400,15 +448,15 @@ var ae = {
400
448
  "hideHeader"
401
449
  ],
402
450
  displayOptionsConfig: [
403
- f,
404
- y(!1),
405
- h("chart.configText.how_to_stack_multiple_area_series"),
406
- b,
451
+ p,
452
+ b(!1),
453
+ g("chart.configText.how_to_stack_multiple_area_series"),
407
454
  x,
408
- v,
409
- _
455
+ S,
456
+ y,
457
+ v
410
458
  ]
411
- }, T = {
459
+ }, E = {
412
460
  clickableElements: { slice: !0 },
413
461
  dropZones: [{
414
462
  key: "xAxis",
@@ -460,8 +508,8 @@ var ae = {
460
508
  label: "chart.configText.80_percent"
461
509
  }
462
510
  ]
463
- }, p()]
464
- }, E = {
511
+ }, m()]
512
+ }, D = {
465
513
  dropZones: [
466
514
  {
467
515
  key: "xAxis",
@@ -512,7 +560,7 @@ var ae = {
512
560
  type: "axisFormat",
513
561
  description: "chart.option.yAxisFormat.description"
514
562
  }]
515
- }, D = {
563
+ }, O = {
516
564
  dropZones: [
517
565
  {
518
566
  key: "xAxis",
@@ -584,7 +632,7 @@ var ae = {
584
632
  type: "axisFormat",
585
633
  description: "chart.configText.number_formatting_for_y_axis_and_values"
586
634
  }]
587
- }, O = {
635
+ }, k = {
588
636
  dropZones: [
589
637
  {
590
638
  key: "xAxis",
@@ -617,8 +665,8 @@ var ae = {
617
665
  "showTooltip",
618
666
  "hideHeader"
619
667
  ],
620
- displayOptionsConfig: [p()]
621
- }, k = {
668
+ displayOptionsConfig: [m()]
669
+ }, A = {
622
670
  dropZones: [{
623
671
  key: "xAxis",
624
672
  label: "chart.configText.categories",
@@ -640,8 +688,8 @@ var ae = {
640
688
  "showTooltip",
641
689
  "hideHeader"
642
690
  ],
643
- displayOptionsConfig: [p()]
644
- }, A = {
691
+ displayOptionsConfig: [m()]
692
+ }, j = {
645
693
  dropZones: [
646
694
  {
647
695
  key: "xAxis",
@@ -675,9 +723,9 @@ var ae = {
675
723
  "showTooltip",
676
724
  "hideHeader"
677
725
  ],
678
- displayOptionsConfig: [p("chart.configText.number_formatting_for_size_values")],
726
+ displayOptionsConfig: [m("chart.configText.number_formatting_for_size_values")],
679
727
  clickableElements: { cell: !0 }
680
- }, j = {
728
+ }, M = {
681
729
  dropZones: [{
682
730
  key: "xAxis",
683
731
  label: "chart.configText.columns",
@@ -697,7 +745,7 @@ var ae = {
697
745
  type: "axisFormat",
698
746
  description: "chart.configText.number_formatting_for_numeric_values"
699
747
  }]
700
- }, M = {
748
+ }, N = {
701
749
  dropZones: [{
702
750
  key: "columns",
703
751
  label: "chart.recordsTable.dropZone.columns.label",
@@ -760,7 +808,7 @@ var ae = {
760
808
  ],
761
809
  clickableElements: { row: !0 },
762
810
  recordGrain: !0
763
- }, N = {
811
+ }, P = {
764
812
  dropZones: [{
765
813
  key: "dateField",
766
814
  label: "chart.configText.time_dimension",
@@ -801,7 +849,7 @@ var ae = {
801
849
  } : { isValid: !0 };
802
850
  },
803
851
  clickableElements: { cell: !0 }
804
- }, P = {
852
+ }, F = {
805
853
  dropZones: [{
806
854
  key: "yAxis",
807
855
  label: "chart.configText.value",
@@ -812,7 +860,7 @@ var ae = {
812
860
  emptyText: "chart.kpiNumber.dropZone.yAxis.empty"
813
861
  }],
814
862
  displayOptionsConfig: [
815
- g,
863
+ _,
816
864
  {
817
865
  key: "target",
818
866
  label: "chart.runtime.tooltip.targetValue",
@@ -867,7 +915,7 @@ var ae = {
867
915
  }
868
916
  ],
869
917
  displayOptions: ["hideHeader"]
870
- }, F = {
918
+ }, I = {
871
919
  dropZones: [{
872
920
  key: "yAxis",
873
921
  label: "chart.configText.value",
@@ -886,7 +934,7 @@ var ae = {
886
934
  emptyText: "chart.kpiDelta.dropZone.xAxis.empty"
887
935
  }],
888
936
  displayOptionsConfig: [
889
- g,
937
+ _,
890
938
  {
891
939
  key: "showBaseline",
892
940
  label: "chart.option.showBaseline.label",
@@ -959,7 +1007,7 @@ var ae = {
959
1007
  isValid: !1,
960
1008
  message: "chart.kpiDelta.validation.measureRequired"
961
1009
  } : { isValid: !0 }
962
- }, I = {
1010
+ }, L = {
963
1011
  dropZones: [{
964
1012
  key: "yAxis",
965
1013
  label: "chart.configText.value",
@@ -996,7 +1044,7 @@ var ae = {
996
1044
  }
997
1045
  ],
998
1046
  displayOptions: ["hideHeader"]
999
- }, L = {
1047
+ }, R = {
1000
1048
  skipQuery: !0,
1001
1049
  dropZones: [],
1002
1050
  displayOptionsConfig: [
@@ -1103,7 +1151,7 @@ var ae = {
1103
1151
  description: "chart.configText.add_an_accent_colored_border_on_one_side_of_the_content"
1104
1152
  }
1105
1153
  ]
1106
- }, R = {
1154
+ }, z = {
1107
1155
  dropZones: [{
1108
1156
  key: "xAxis",
1109
1157
  label: "chart.configText.step_name",
@@ -1186,7 +1234,7 @@ var ae = {
1186
1234
  description: "chart.option.showP90Time.description"
1187
1235
  }
1188
1236
  ]
1189
- }, z = {
1237
+ }, B = {
1190
1238
  dropZones: [{
1191
1239
  key: "xAxis",
1192
1240
  label: "chart.configText.event_type",
@@ -1242,7 +1290,7 @@ var ae = {
1242
1290
  description: "chart.configText.hide_the_statistics_footer_below_the_chart"
1243
1291
  }
1244
1292
  ]
1245
- }, se = {
1293
+ }, V = {
1246
1294
  dropZones: [{
1247
1295
  key: "xAxis",
1248
1296
  label: "chart.configText.event_type",
@@ -1277,7 +1325,7 @@ var ae = {
1277
1325
  defaultValue: !0,
1278
1326
  description: "chart.configText.hide_the_statistics_footer_below_the_chart"
1279
1327
  }]
1280
- }, B = {
1328
+ }, H = {
1281
1329
  dropZones: [
1282
1330
  {
1283
1331
  key: "xAxis",
@@ -1358,7 +1406,7 @@ var ae = {
1358
1406
  isValid: !1,
1359
1407
  message: "chart.heatmap.validation.xAxisRequired"
1360
1408
  }
1361
- }, V = {
1409
+ }, U = {
1362
1410
  dropZones: [],
1363
1411
  displayOptionsConfig: [{
1364
1412
  key: "showLegend",
@@ -1373,7 +1421,7 @@ var ae = {
1373
1421
  defaultValue: !0,
1374
1422
  description: "chart.option.showTooltip.description"
1375
1423
  }]
1376
- }, H = {
1424
+ }, W = {
1377
1425
  dropZones: [],
1378
1426
  displayOptionsConfig: [
1379
1427
  {
@@ -1419,7 +1467,7 @@ var ae = {
1419
1467
  description: "chart.option.showTooltip.description"
1420
1468
  }
1421
1469
  ]
1422
- }, U = {
1470
+ }, G = {
1423
1471
  displayOptions: ["hideHeader"],
1424
1472
  dropZones: [{
1425
1473
  key: "xAxis",
@@ -1444,7 +1492,7 @@ var ae = {
1444
1492
  type: "axisFormat",
1445
1493
  description: "chart.configText.number_formatting_for_the_value_axis"
1446
1494
  }]
1447
- }, W = {
1495
+ }, K = {
1448
1496
  displayOptions: [
1449
1497
  "showGrid",
1450
1498
  "showTooltip",
@@ -1555,7 +1603,7 @@ var ae = {
1555
1603
  description: "chart.option.xAxisFormat.description"
1556
1604
  }
1557
1605
  ]
1558
- }, G = {
1606
+ }, q = {
1559
1607
  clickableElements: { bar: !0 },
1560
1608
  displayOptions: ["showTooltip", "hideHeader"],
1561
1609
  dropZones: [{
@@ -1604,7 +1652,7 @@ var ae = {
1604
1652
  description: "chart.configText.number_formatting_for_the_y_axis"
1605
1653
  }
1606
1654
  ]
1607
- }, K = {
1655
+ }, ce = {
1608
1656
  clickableElements: { bar: !0 },
1609
1657
  displayOptions: ["hideHeader"],
1610
1658
  dropZones: [{
@@ -1666,7 +1714,7 @@ var ae = {
1666
1714
  description: "chart.configText.number_formatting_for_the_price_axis"
1667
1715
  }
1668
1716
  ]
1669
- }, q = {
1717
+ }, le = {
1670
1718
  displayOptions: [
1671
1719
  "showLegend",
1672
1720
  "showTooltip",
@@ -1738,7 +1786,7 @@ var ae = {
1738
1786
  description: "chart.configText.number_formatting_for_the_y_axis"
1739
1787
  }
1740
1788
  ]
1741
- }, J = {
1789
+ }, ue = {
1742
1790
  dropZones: [{
1743
1791
  key: "xAxis",
1744
1792
  label: "chart.configText.category",
@@ -1796,7 +1844,7 @@ var ae = {
1796
1844
  isValid: !1,
1797
1845
  message: "chart.proportionBar.validation.measureRequired"
1798
1846
  } : { isValid: !0 }
1799
- }, ce = {
1847
+ }, de = {
1800
1848
  clickableElements: {},
1801
1849
  displayOptions: ["hideHeader"],
1802
1850
  dropZones: [{
@@ -1849,45 +1897,45 @@ var ae = {
1849
1897
  description: "chart.configText.number_formatting_for_the_displayed_value_and_axis_labels"
1850
1898
  }
1851
1899
  ]
1852
- }, Y = {
1900
+ }, J = {
1853
1901
  packageName: "recharts",
1854
1902
  installCommand: "npm install recharts"
1855
- }, le = {
1903
+ }, fe = {
1856
1904
  bar: {
1857
1905
  label: "chart.bar.label",
1858
1906
  icon: "chartBar",
1859
1907
  description: "chart.bar.description",
1860
1908
  useCase: "chart.bar.useCase",
1861
- isAvailable: d,
1862
- dependencies: Y,
1863
- config: async () => (await import("./BarChart.config-Cq_qcxBA.js")).barChartConfig
1909
+ isAvailable: f,
1910
+ dependencies: J,
1911
+ config: async () => (await import("./BarChart.config-CBACR7Z-.js")).barChartConfig
1864
1912
  },
1865
1913
  line: {
1866
1914
  label: "chart.line.label",
1867
1915
  icon: "chartLine",
1868
1916
  description: "chart.line.description",
1869
1917
  useCase: "chart.line.useCase",
1870
- isAvailable: d,
1871
- dependencies: Y,
1872
- config: async () => (await import("./LineChart.config-CJmTSmZ1.js")).lineChartConfig
1918
+ isAvailable: f,
1919
+ dependencies: J,
1920
+ config: async () => (await import("./LineChart.config-CdONxSLL.js")).lineChartConfig
1873
1921
  },
1874
1922
  area: {
1875
1923
  label: "chart.area.label",
1876
1924
  icon: "chartArea",
1877
1925
  description: "chart.area.description",
1878
1926
  useCase: "chart.area.useCase",
1879
- isAvailable: d,
1880
- dependencies: Y,
1881
- config: async () => (await import("./AreaChart.config-BqNusnpg.js")).areaChartConfig
1927
+ isAvailable: f,
1928
+ dependencies: J,
1929
+ config: async () => (await import("./AreaChart.config-BL_ZpMsg.js")).areaChartConfig
1882
1930
  },
1883
1931
  pie: {
1884
1932
  label: "chart.pie.label",
1885
1933
  icon: "chartPie",
1886
1934
  description: "chart.pie.description",
1887
1935
  useCase: "chart.pie.useCase",
1888
- isAvailable: d,
1889
- dependencies: Y,
1890
- config: async () => (await import("./PieChart.config-HZofeody.js")).pieChartConfig
1936
+ isAvailable: f,
1937
+ dependencies: J,
1938
+ config: async () => (await import("./PieChart.config-Csx1ctk4.js")).pieChartConfig
1891
1939
  },
1892
1940
  scatter: {
1893
1941
  label: "chart.scatter.label",
@@ -1901,8 +1949,8 @@ var ae = {
1901
1949
  available: !1,
1902
1950
  reason: "chart.availability.scatter"
1903
1951
  } : { available: !0 },
1904
- dependencies: Y,
1905
- config: async () => (await import("./ScatterChart.config-BD2vfOZ6.js")).scatterChartConfig
1952
+ dependencies: J,
1953
+ config: async () => (await import("./ScatterChart.config-oOd1Jplx.js")).scatterChartConfig
1906
1954
  },
1907
1955
  bubble: {
1908
1956
  label: "chart.bubble.label",
@@ -1916,49 +1964,49 @@ var ae = {
1916
1964
  available: !1,
1917
1965
  reason: "chart.availability.bubble"
1918
1966
  } : { available: !0 },
1919
- dependencies: Y,
1920
- config: async () => (await import("./BubbleChart.config-CU_18uxb.js")).bubbleChartConfig
1967
+ dependencies: J,
1968
+ config: async () => (await import("./BubbleChart.config-22qXNskY.js")).bubbleChartConfig
1921
1969
  },
1922
1970
  radar: {
1923
1971
  label: "chart.radar.label",
1924
1972
  icon: "chartRadar",
1925
1973
  description: "chart.radar.description",
1926
1974
  useCase: "chart.radar.useCase",
1927
- isAvailable: d,
1928
- dependencies: Y,
1929
- config: async () => (await import("./RadarChart.config-B9OdMEib.js")).radarChartConfig
1975
+ isAvailable: f,
1976
+ dependencies: J,
1977
+ config: async () => (await import("./RadarChart.config-AxQh97rB.js")).radarChartConfig
1930
1978
  },
1931
1979
  radialBar: {
1932
1980
  label: "chart.radialBar.label",
1933
1981
  icon: "chartRadialBar",
1934
1982
  description: "chart.radialBar.description",
1935
1983
  useCase: "chart.radialBar.useCase",
1936
- isAvailable: d,
1937
- dependencies: Y,
1938
- config: async () => (await import("./RadialBarChart.config-CeP7jEbq.js")).radialBarChartConfig
1984
+ isAvailable: f,
1985
+ dependencies: J,
1986
+ config: async () => (await import("./RadialBarChart.config-DMaEJYM_.js")).radialBarChartConfig
1939
1987
  },
1940
1988
  treemap: {
1941
1989
  label: "chart.treemap.label",
1942
1990
  icon: "chartTreemap",
1943
1991
  description: "chart.treemap.description",
1944
1992
  useCase: "chart.treemap.useCase",
1945
- isAvailable: d,
1946
- dependencies: Y,
1947
- config: async () => (await import("./TreeMapChart.config-DBrqwtqT.js")).treemapChartConfig
1993
+ isAvailable: f,
1994
+ dependencies: J,
1995
+ config: async () => (await import("./TreeMapChart.config--EB8bQTo.js")).treemapChartConfig
1948
1996
  },
1949
1997
  table: {
1950
1998
  label: "chart.table.label",
1951
1999
  icon: "chartTable",
1952
2000
  description: "chart.table.description",
1953
2001
  useCase: "chart.table.useCase",
1954
- config: async () => (await import("./DataTable.config-7JNSj6qQ.js")).dataTableConfig
2002
+ config: async () => (await import("./DataTable.config-BXkpzOC2.js")).dataTableConfig
1955
2003
  },
1956
2004
  recordsTable: {
1957
2005
  label: "chart.recordsTable.label",
1958
2006
  icon: "chartRecordsTable",
1959
2007
  description: "chart.recordsTable.description",
1960
2008
  useCase: "chart.recordsTable.useCase",
1961
- config: async () => (await import("./RecordsTable.config-BInSgo-G.js")).recordsTableConfig
2009
+ config: async () => (await import("./RecordsTable.config-BdN0kZ8b.js")).recordsTableConfig
1962
2010
  },
1963
2011
  activityGrid: {
1964
2012
  label: "chart.activityGrid.label",
@@ -1972,62 +2020,62 @@ var ae = {
1972
2020
  available: !1,
1973
2021
  reason: "chart.availability.requiresTimeDimension"
1974
2022
  } : { available: !0 },
1975
- config: async () => (await import("./ActivityGridChart.config-Dd2YDeaM.js")).activityGridChartConfig
2023
+ config: async () => (await import("./ActivityGridChart.config-DfyZh3He.js")).activityGridChartConfig
1976
2024
  },
1977
2025
  kpiNumber: {
1978
2026
  label: "chart.kpiNumber.label",
1979
2027
  icon: "chartKpiNumber",
1980
2028
  description: "chart.kpiNumber.description",
1981
2029
  useCase: "chart.kpiNumber.useCase",
1982
- isAvailable: m,
1983
- config: async () => (await import("./KpiNumber.config-CkPWpcSz.js")).kpiNumberConfig
2030
+ isAvailable: h,
2031
+ config: async () => (await import("./KpiNumber.config-D3CogH8j.js")).kpiNumberConfig
1984
2032
  },
1985
2033
  kpiDelta: {
1986
2034
  label: "chart.kpiDelta.label",
1987
2035
  icon: "chartKpiDelta",
1988
2036
  description: "chart.kpiDelta.description",
1989
2037
  useCase: "chart.kpiDelta.useCase",
1990
- isAvailable: d,
1991
- config: async () => (await import("./KpiDelta.config-BGdqsHcc.js")).kpiDeltaConfig
2038
+ isAvailable: f,
2039
+ config: async () => (await import("./KpiDelta.config-C00mTZYy.js")).kpiDeltaConfig
1992
2040
  },
1993
2041
  kpiText: {
1994
2042
  label: "chart.kpiText.label",
1995
2043
  icon: "chartKpiText",
1996
2044
  description: "chart.kpiText.description",
1997
2045
  useCase: "chart.kpiText.useCase",
1998
- isAvailable: m,
1999
- config: async () => (await import("./KpiText.config-Bvtuv8vE.js")).kpiTextConfig
2046
+ isAvailable: h,
2047
+ config: async () => (await import("./KpiText.config-B0LbKRCf.js")).kpiTextConfig
2000
2048
  },
2001
2049
  markdown: {
2002
2050
  label: "chart.markdown.label",
2003
2051
  icon: "chartMarkdown",
2004
2052
  description: "chart.markdown.description",
2005
2053
  useCase: "chart.markdown.useCase",
2006
- config: async () => (await import("./MarkdownChart.config-Cm6G4Yuh.js")).markdownConfig
2054
+ config: async () => (await import("./MarkdownChart.config-CngxD_Lc.js")).markdownConfig
2007
2055
  },
2008
2056
  funnel: {
2009
2057
  label: "chart.funnel.label",
2010
2058
  icon: "chartFunnel",
2011
2059
  description: "chart.funnel.description",
2012
2060
  useCase: "chart.funnel.useCase",
2013
- dependencies: Y,
2014
- config: async () => (await import("./FunnelChart.config-vuZScOHQ.js")).funnelChartConfig
2061
+ dependencies: J,
2062
+ config: async () => (await import("./FunnelChart.config-Cw9qrC2C.js")).funnelChartConfig
2015
2063
  },
2016
2064
  sankey: {
2017
2065
  label: "chart.sankey.label",
2018
2066
  icon: "chartSankey",
2019
2067
  description: "chart.sankey.description",
2020
2068
  useCase: "chart.sankey.useCase",
2021
- dependencies: Y,
2022
- config: async () => (await import("./SankeyChart.config-hfM0ACm1.js")).sankeyChartConfig
2069
+ dependencies: J,
2070
+ config: async () => (await import("./SankeyChart.config-Dlgi5_DA.js")).sankeyChartConfig
2023
2071
  },
2024
2072
  sunburst: {
2025
2073
  label: "chart.sunburst.label",
2026
2074
  icon: "chartSunburst",
2027
2075
  description: "chart.sunburst.description",
2028
2076
  useCase: "chart.sunburst.useCase",
2029
- dependencies: Y,
2030
- config: async () => (await import("./SunburstChart.config-BvrofzMv.js")).sunburstChartConfig
2077
+ dependencies: J,
2078
+ config: async () => (await import("./SunburstChart.config-Cllhyjy4.js")).sunburstChartConfig
2031
2079
  },
2032
2080
  heatmap: {
2033
2081
  label: "chart.heatmap.label",
@@ -2045,46 +2093,46 @@ var ae = {
2045
2093
  packageName: "@nivo/heatmap",
2046
2094
  installCommand: "npm install @nivo/heatmap"
2047
2095
  },
2048
- config: async () => (await import("./HeatMapChart.config-4XMab1zq.js")).heatmapChartConfig
2096
+ config: async () => (await import("./HeatMapChart.config-DrvQrPHT.js")).heatmapChartConfig
2049
2097
  },
2050
2098
  retentionHeatmap: {
2051
2099
  label: "chart.retentionHeatmap.label",
2052
2100
  icon: "chartRetention",
2053
2101
  description: "chart.retentionHeatmap.description",
2054
2102
  useCase: "chart.retentionHeatmap.useCase",
2055
- config: async () => (await import("./RetentionHeatmap.config-DCtOD8dO.js")).retentionHeatmapConfig
2103
+ config: async () => (await import("./RetentionHeatmap.config-YMZt-u-T.js")).retentionHeatmapConfig
2056
2104
  },
2057
2105
  retentionCombined: {
2058
2106
  label: "chart.retentionCombined.label",
2059
2107
  icon: "chartRetention",
2060
2108
  description: "chart.retentionCombined.description",
2061
2109
  useCase: "chart.retentionCombined.useCase",
2062
- config: async () => (await import("./RetentionCombinedChart.config-Bxtxnlcf.js")).retentionCombinedConfig
2110
+ config: async () => (await import("./RetentionCombinedChart.config-CY8TDzuy.js")).retentionCombinedConfig
2063
2111
  },
2064
2112
  boxPlot: {
2065
2113
  label: "chart.boxPlot.label",
2066
2114
  icon: "chartBoxPlot",
2067
2115
  description: "chart.boxPlot.description",
2068
2116
  useCase: "chart.boxPlot.useCase",
2069
- isAvailable: d,
2070
- config: async () => (await import("./BoxPlotChart.config-Zc-JGV-W.js")).boxPlotChartConfig
2117
+ isAvailable: f,
2118
+ config: async () => (await import("./BoxPlotChart.config-Bvg6yFn2.js")).boxPlotChartConfig
2071
2119
  },
2072
2120
  dotStrip: {
2073
2121
  label: "chart.dotStrip.label",
2074
2122
  icon: "chartDotStrip",
2075
2123
  description: "chart.dotStrip.description",
2076
2124
  useCase: "chart.dotStrip.useCase",
2077
- isAvailable: d,
2078
- config: async () => (await import("./DotStripChart.config-B7Dl-T1h.js")).dotStripChartConfig
2125
+ isAvailable: f,
2126
+ config: async () => (await import("./DotStripChart.config-D5sbLAqA.js")).dotStripChartConfig
2079
2127
  },
2080
2128
  waterfall: {
2081
2129
  label: "chart.waterfall.label",
2082
2130
  icon: "chartWaterfall",
2083
2131
  description: "chart.waterfall.description",
2084
2132
  useCase: "chart.waterfall.useCase",
2085
- isAvailable: d,
2086
- dependencies: Y,
2087
- config: async () => (await import("./WaterfallChart.config-DZ8H0V2L.js")).waterfallChartConfig
2133
+ isAvailable: f,
2134
+ dependencies: J,
2135
+ config: async () => (await import("./WaterfallChart.config-xz3DaoMQ.js")).waterfallChartConfig
2088
2136
  },
2089
2137
  candlestick: {
2090
2138
  label: "chart.candlestick.label",
@@ -2098,7 +2146,7 @@ var ae = {
2098
2146
  available: !1,
2099
2147
  reason: "chart.availability.requiresDimension"
2100
2148
  } : { available: !0 },
2101
- config: async () => (await import("./CandlestickChart.config-Bwo3uaa-.js")).candlestickChartConfig
2149
+ config: async () => (await import("./CandlestickChart.config-G78UbuwS.js")).candlestickChartConfig
2102
2150
  },
2103
2151
  measureProfile: {
2104
2152
  label: "chart.measureProfile.label",
@@ -2109,31 +2157,31 @@ var ae = {
2109
2157
  available: !1,
2110
2158
  reason: "chart.availability.requiresTwoMeasures"
2111
2159
  } : { available: !0 },
2112
- dependencies: Y,
2113
- config: async () => (await import("./MeasureProfileChart.config-Dt7npubZ.js")).measureProfileChartConfig
2160
+ dependencies: J,
2161
+ config: async () => (await import("./MeasureProfileChart.config-ByW5F1Ey.js")).measureProfileChartConfig
2114
2162
  },
2115
2163
  proportionBar: {
2116
2164
  label: "chart.proportionBar.label",
2117
2165
  icon: "chartProportionBar",
2118
2166
  description: "chart.proportionBar.description",
2119
2167
  useCase: "chart.proportionBar.useCase",
2120
- isAvailable: d,
2121
- config: async () => (await import("./ProportionBarChart.config-ChCSoM0L.js")).proportionBarChartConfig
2168
+ isAvailable: f,
2169
+ config: async () => (await import("./ProportionBarChart.config-DCOizSVs.js")).proportionBarChartConfig
2122
2170
  },
2123
2171
  gauge: {
2124
2172
  label: "chart.gauge.label",
2125
2173
  icon: "chartGauge",
2126
2174
  description: "chart.gauge.description",
2127
2175
  useCase: "chart.gauge.useCase",
2128
- isAvailable: m,
2176
+ isAvailable: h,
2129
2177
  dependencies: {
2130
2178
  packageName: "d3-shape",
2131
2179
  installCommand: "npm install d3-shape"
2132
2180
  },
2133
- config: async () => (await import("./GaugeChart.config-zdpFydo6.js")).gaugeChartConfig
2181
+ config: async () => (await import("./GaugeChart.config-F5SA5Oi3.js")).gaugeChartConfig
2134
2182
  }
2135
2183
  };
2136
- function ue(e, t) {
2184
+ function pe(e, t) {
2137
2185
  return {
2138
2186
  ...t,
2139
2187
  label: e.label,
@@ -2144,86 +2192,96 @@ function ue(e, t) {
2144
2192
  }
2145
2193
  //#endregion
2146
2194
  //#region src/client/charts/chartConfigRegistry.ts
2147
- var de = {
2148
- bar: ae,
2149
- line: oe,
2150
- area: w,
2151
- pie: T,
2152
- scatter: E,
2153
- bubble: D,
2154
- radar: O,
2155
- radialBar: k,
2156
- treemap: A,
2157
- table: j,
2158
- recordsTable: M,
2159
- activityGrid: N,
2160
- kpiNumber: P,
2161
- kpiDelta: F,
2162
- kpiText: I,
2163
- markdown: L,
2164
- funnel: R,
2165
- sankey: z,
2166
- sunburst: se,
2167
- heatmap: B,
2168
- retentionHeatmap: V,
2169
- retentionCombined: H,
2170
- boxPlot: U,
2171
- dotStrip: W,
2172
- waterfall: G,
2173
- candlestick: K,
2174
- measureProfile: q,
2175
- proportionBar: J,
2176
- gauge: ce
2177
- }, X = Object.fromEntries(Object.keys(le).map((e) => [e, ue(le[e], de[e])]));
2178
- function fe(e) {
2179
- return X[e]?.recordGrain === !0;
2195
+ var me = {
2196
+ bar: w,
2197
+ line: T,
2198
+ area: se,
2199
+ pie: E,
2200
+ scatter: D,
2201
+ bubble: O,
2202
+ radar: k,
2203
+ radialBar: A,
2204
+ treemap: j,
2205
+ table: M,
2206
+ recordsTable: N,
2207
+ activityGrid: P,
2208
+ kpiNumber: F,
2209
+ kpiDelta: I,
2210
+ kpiText: L,
2211
+ markdown: R,
2212
+ funnel: z,
2213
+ sankey: B,
2214
+ sunburst: V,
2215
+ heatmap: H,
2216
+ retentionHeatmap: U,
2217
+ retentionCombined: W,
2218
+ boxPlot: G,
2219
+ dotStrip: K,
2220
+ waterfall: q,
2221
+ candlestick: ce,
2222
+ measureProfile: le,
2223
+ proportionBar: ue,
2224
+ gauge: de
2225
+ }, Y = Object.fromEntries(Object.keys(fe).map((e) => [e, pe(fe[e], me[e])]));
2226
+ function he(e) {
2227
+ return Y[e]?.recordGrain === !0;
2180
2228
  }
2181
2229
  //#endregion
2182
2230
  //#region src/server/agent/chart-validation.ts
2183
- function Z(e) {
2231
+ function X(e) {
2184
2232
  return Array.isArray(e) ? e.length > 0 : !!e;
2185
2233
  }
2186
- function pe(t, n, r, i) {
2187
- for (let a of t.dropZones) {
2188
- if (!a.mandatory || Z(r?.[a.key])) continue;
2189
- let t = a.acceptTypes?.join("/") ?? "fields";
2190
- i.push(e("server.validation.chart.dropZoneRequired", {
2191
- key: a.key,
2192
- chartType: n,
2193
- label: a.label,
2194
- acceptDesc: t
2234
+ function ge(e, t, n, r) {
2235
+ for (let i of e.dropZones) {
2236
+ if (!i.mandatory || X(n?.[i.key])) continue;
2237
+ let e = i.acceptTypes?.join("/") ?? "fields";
2238
+ r.push(a("server.validation.chart.dropZoneRequired", {
2239
+ key: i.key,
2240
+ chartType: t,
2241
+ label: i.label,
2242
+ acceptDesc: e
2195
2243
  }));
2196
2244
  }
2197
2245
  }
2198
- function me(t, n, r) {
2199
- if (Z(t?.xAxis)) return;
2200
- let i = n.dimensions ?? [], a = n.timeDimensions ?? [], o = i.length > 0 || a.length > 0;
2201
- r.push(e(o ? "server.validation.chart.barXAxisRequired" : "server.validation.chart.barNeedsDimension"));
2246
+ function _e(e, t, n) {
2247
+ if (X(e?.xAxis)) return;
2248
+ let r = t.dimensions ?? [], i = t.timeDimensions ?? [], o = r.length > 0 || i.length > 0;
2249
+ n.push(a(o ? "server.validation.chart.barXAxisRequired" : "server.validation.chart.barNeedsDimension"));
2202
2250
  }
2203
- function he(e) {
2251
+ function ve(e) {
2204
2252
  return Array.isArray(e) ? e : [e];
2205
2253
  }
2206
- function ge(t, n) {
2207
- if (!t?.xAxis || !t?.series) return;
2208
- let r = new Set(he(t.xAxis)), i = he(t.series).filter((e) => r.has(e));
2209
- i.length > 0 && n.push(e("server.validation.chart.seriesDuplicatesXAxis", { duplicates: i.join(", ") }));
2254
+ function ye(e, t) {
2255
+ if (!e?.xAxis || !e?.series) return;
2256
+ let n = new Set(ve(e.xAxis)), r = ve(e.series).filter((e) => n.has(e));
2257
+ r.length > 0 && t.push(a("server.validation.chart.seriesDuplicatesXAxis", { duplicates: r.join(", ") }));
2210
2258
  }
2211
- function _e(t, n, r) {
2212
- fe(t) && n.ungrouped !== !0 && r.push(e("server.validation.chart.recordGrainNeedsUngrouped", { chartType: t }));
2259
+ function be(e, t, n) {
2260
+ he(e) && t.ungrouped !== !0 && n.push(a("server.validation.chart.recordGrainNeedsUngrouped", { chartType: e }));
2213
2261
  }
2214
- function ve(e, t, n) {
2215
- let r = X[e];
2262
+ function xe(e, t, n) {
2263
+ let r = Y[e];
2216
2264
  if (!r || r.skipQuery) return {
2217
2265
  isValid: !0,
2218
2266
  errors: []
2219
2267
  };
2220
2268
  let i = [];
2221
- return pe(r, e, t, i), _e(e, n, i), e === "bar" && me(t, n, i), ge(t, i), {
2269
+ return ge(r, e, t, i), be(e, n, i), e === "bar" && _e(t, n, i), ye(t, i), {
2222
2270
  isValid: i.length === 0,
2223
2271
  errors: i
2224
2272
  };
2225
2273
  }
2226
- function ye(e, t, n, r) {
2274
+ function Se(e, t, n) {
2275
+ if (e !== "bar" || X(t?.xAxis)) return { chartType: e };
2276
+ let r = n.dimensions ?? [], i = n.timeDimensions ?? [];
2277
+ if (r.length > 0 || i.length > 0) return { chartType: e };
2278
+ let a = (n.measures ?? []).length === 1 ? "kpiNumber" : "table";
2279
+ return {
2280
+ chartType: a,
2281
+ note: `Note: chartType was changed from "bar" to "${a}" because the query has no dimension, so a bar chart would have no category axis to label its bars. For a real bar chart, put the category in the query's dimensions and use a single measure. To plot several measures as an ordered profile instead, use "measureProfile".`
2282
+ };
2283
+ }
2284
+ function Ce(e, t, n, r) {
2227
2285
  if (!(e.acceptTypes ?? []).includes("measure")) return;
2228
2286
  let i = /* @__PURE__ */ new Set();
2229
2287
  for (let r of t.dropZones) {
@@ -2234,37 +2292,42 @@ function ye(e, t, n, r) {
2234
2292
  let a = r.filter((e) => !i.has(e));
2235
2293
  a.length > 0 && (n[e.key] = a[0]);
2236
2294
  }
2237
- function be(e, t, n) {
2295
+ function we(e, t) {
2296
+ let n = /* @__PURE__ */ new Set();
2297
+ for (let [r, i] of Object.entries(e)) if (r !== t) {
2298
+ if (Array.isArray(i)) for (let e of i) typeof e == "string" && n.add(e);
2299
+ else typeof i == "string" && n.add(i);
2300
+ }
2301
+ return n;
2302
+ }
2303
+ function Te(e, t, n) {
2238
2304
  let r = e.acceptTypes ?? [], i = [];
2239
2305
  if (r.includes("dimension") && i.push(...n.dimensions), r.includes("timeDimension") && i.push(...n.timeDimFields), r.includes("measure") && i.push(...n.measures), i.length === 0) return;
2240
- let a = i;
2241
- if (e.key === "series") {
2242
- let e = new Set(Array.isArray(t.xAxis) ? t.xAxis : t.xAxis ? [t.xAxis] : []);
2243
- if (a = i.filter((t) => !e.has(t)), a.length === 0) return;
2244
- }
2245
- let o = e.maxItems ?? Infinity, s = a.slice(0, o);
2246
- s.length > 0 && (t[e.key] = s);
2306
+ let a = we(t, e.key), o = i.filter((e) => !a.has(e));
2307
+ if (o.length === 0) return;
2308
+ let s = e.maxItems ?? Infinity, c = o.slice(0, s);
2309
+ c.length > 0 && (t[e.key] = c);
2247
2310
  }
2248
- function xe(e, t, n) {
2249
- let r = X[e];
2311
+ function Ee(e, t, n) {
2312
+ let r = Y[e];
2250
2313
  if (!r) return t ?? {};
2251
2314
  let i = { ...t }, a = n.timeDimensions ?? [], o = {
2252
2315
  measures: n.measures ?? [],
2253
2316
  dimensions: n.dimensions ?? [],
2254
2317
  timeDimFields: a.map((e) => e.dimension)
2255
2318
  };
2256
- for (let e of r.dropZones) e.excludeFromInference || Z(i[e.key]) || (e.key === "sizeField" || e.key === "colorField" ? ye(e, r, i, o.measures) : be(e, i, o));
2319
+ for (let e of r.dropZones) e.excludeFromInference || X(i[e.key]) || (e.key === "sizeField" || e.key === "colorField" ? Ce(e, r, i, o.measures) : Te(e, i, o));
2257
2320
  return i;
2258
2321
  }
2259
- function Se(t) {
2260
- return t ? i(t) ? e(t) : t : "";
2322
+ function De(t) {
2323
+ return t ? e(t) ? a(t) : t : "";
2261
2324
  }
2262
- function Ce(e) {
2325
+ function Oe(e) {
2263
2326
  let t = ["\nChart config requirements by type:"];
2264
2327
  for (let n of e) {
2265
- let e = X[n];
2328
+ let e = Y[n];
2266
2329
  if (!e) continue;
2267
- let r = [Se(e.description), Se(e.useCase)].filter(Boolean).join(". "), i = r ? ` — ${r}.` : "", a = fe(n) ? " Query MUST set \"ungrouped\": true, which also means one cube plus its to-one joins — an ungrouped query cannot span a hasMany relationship." : "", o = e.dropZones.filter((e) => e.mandatory);
2330
+ let r = [De(e.description), De(e.useCase)].filter(Boolean).join(". "), i = r ? ` — ${r}.` : "", a = he(n) ? " Query MUST set \"ungrouped\": true, which also means one cube plus its to-one joins — an ungrouped query cannot span a hasMany relationship." : "", o = e.dropZones.filter((e) => e.mandatory);
2268
2331
  if (o.length === 0 && !e.skipQuery) {
2269
2332
  t.push(` ${n}${i}${a} chartConfig auto-inferred from query.`);
2270
2333
  continue;
@@ -2282,29 +2345,46 @@ function Ce(e) {
2282
2345
  return t.join("\n");
2283
2346
  }
2284
2347
  //#endregion
2348
+ //#region src/server/agent/data-shape.ts
2349
+ function ke(e, t, n, r) {
2350
+ let i = /* @__PURE__ */ new Set(), a = 0, o, s, c = !0;
2351
+ for (let n of e) {
2352
+ let e = n[t];
2353
+ if (e == null) {
2354
+ a++;
2355
+ continue;
2356
+ }
2357
+ i.add(e);
2358
+ let r = typeof e == "number" ? e : Number(e);
2359
+ typeof e == "boolean" || Number.isNaN(r) ? c = !1 : (o = o === void 0 || r < o ? r : o, s = s === void 0 || r > s ? r : s);
2360
+ }
2361
+ return {
2362
+ field: t,
2363
+ kind: n,
2364
+ ...r ? { type: r } : {},
2365
+ distinctCount: i.size,
2366
+ nullCount: a,
2367
+ ...c && o !== void 0 ? {
2368
+ min: o,
2369
+ max: s
2370
+ } : {}
2371
+ };
2372
+ }
2373
+ function Ae(e, t) {
2374
+ if (e.length === 0) return [];
2375
+ let n = [], r = /* @__PURE__ */ new Set(), i = [
2376
+ ["dimension", t?.dimensions],
2377
+ ["timeDimension", t?.timeDimensions],
2378
+ ["measure", t?.measures]
2379
+ ];
2380
+ for (let [t, a] of i) for (let [i, o] of Object.entries(a ?? {})) r.add(i), n.push(ke(e, i, t, o?.type));
2381
+ for (let t of Object.keys(e[0])) r.has(t) || n.push(ke(e, t, "dimension", void 0));
2382
+ return n;
2383
+ }
2384
+ //#endregion
2285
2385
  //#region src/server/agent/tools.ts
2286
- var Q = [
2287
- "bar",
2288
- "line",
2289
- "area",
2290
- "pie",
2291
- "scatter",
2292
- "radar",
2293
- "bubble",
2294
- "table",
2295
- "kpiNumber",
2296
- "kpiDelta",
2297
- "funnel",
2298
- "heatmap",
2299
- "sankey",
2300
- "sunburst",
2301
- "retentionHeatmap",
2302
- "retentionCombined",
2303
- "boxPlot",
2304
- "markdown",
2305
- "recordsTable"
2306
- ];
2307
- function we() {
2386
+ var Z = /* @__PURE__ */ "bar.line.area.pie.scatter.radar.bubble.table.kpiNumber.kpiDelta.kpiText.funnel.heatmap.sankey.sunburst.retentionHeatmap.retentionCombined.boxPlot.markdown.recordsTable.treemap.radialBar.proportionBar.dotStrip.waterfall.measureProfile.activityGrid.gauge.candlestick".split(".");
2387
+ function je() {
2308
2388
  return [
2309
2389
  {
2310
2390
  name: "discover_cubes",
@@ -2344,12 +2424,12 @@ function we() {
2344
2424
  description: "Execute a semantic query and return data results. Supports standard queries (measures/dimensions) and analysis modes (funnel/flow/retention). Only provide ONE mode per call.",
2345
2425
  parameters: {
2346
2426
  type: "object",
2347
- properties: c
2427
+ properties: n
2348
2428
  }
2349
2429
  },
2350
2430
  {
2351
2431
  name: "add_portlet",
2352
- description: "Add a chart visualization to the notebook.\n" + Ce(Q) + "\nThe query is validated before adding. The portlet fetches its own data.",
2432
+ description: "Add a chart visualization to the notebook.\n" + Oe(Z) + "\nThe query is validated before adding. The portlet fetches its own data.",
2353
2433
  parameters: {
2354
2434
  type: "object",
2355
2435
  properties: {
@@ -2363,7 +2443,7 @@ function we() {
2363
2443
  },
2364
2444
  chartType: {
2365
2445
  type: "string",
2366
- enum: Q,
2446
+ enum: Z,
2367
2447
  description: "Chart type to render"
2368
2448
  },
2369
2449
  chartConfig: {
@@ -2387,7 +2467,8 @@ function we() {
2387
2467
  type: "object",
2388
2468
  description: "Dual Y-axis: map measure fields to \"left\" or \"right\" axis. Only for bar, line, area charts with 2+ measures of different scales. Example: {\"Sales.revenue\": \"left\", \"Sales.conversionRate\": \"right\"}"
2389
2469
  },
2390
- ...u
2470
+ ...l,
2471
+ ...d
2391
2472
  },
2392
2473
  description: "Chart axis configuration"
2393
2474
  },
@@ -2402,7 +2483,8 @@ function we() {
2402
2483
  type: "string",
2403
2484
  enum: ["horizontal", "vertical"]
2404
2485
  },
2405
- ...l
2486
+ ...c,
2487
+ ...u
2406
2488
  },
2407
2489
  description: "Chart display configuration"
2408
2490
  }
@@ -2414,6 +2496,41 @@ function we() {
2414
2496
  ]
2415
2497
  }
2416
2498
  },
2499
+ {
2500
+ name: "update_portlet",
2501
+ description: "Amend a visualization you already added in this conversation, in place. Use this instead of add_portlet when a chart came back wrong or the user asks to change one — adding a second chart of the same data clutters the notebook. Only the fields you pass are changed; the rest are kept. The same validation as add_portlet applies. For a portlet added earlier in the conversation rather than this turn, pass the full `query` and `chartType` as well as the fields you are changing.",
2502
+ parameters: {
2503
+ type: "object",
2504
+ properties: {
2505
+ portletId: {
2506
+ type: "string",
2507
+ description: "The id returned by add_portlet"
2508
+ },
2509
+ title: {
2510
+ type: "string",
2511
+ description: "New title"
2512
+ },
2513
+ query: {
2514
+ type: "string",
2515
+ description: "Replacement query, as a JSON string (same shape as add_portlet)"
2516
+ },
2517
+ chartType: {
2518
+ type: "string",
2519
+ enum: Z,
2520
+ description: "Replacement chart type"
2521
+ },
2522
+ chartConfig: {
2523
+ type: "object",
2524
+ description: "Replacement chart axis configuration (replaces, does not merge)"
2525
+ },
2526
+ displayConfig: {
2527
+ type: "object",
2528
+ description: "Replacement chart display configuration (replaces, does not merge)"
2529
+ }
2530
+ },
2531
+ required: ["portletId"]
2532
+ }
2533
+ },
2417
2534
  {
2418
2535
  name: "add_markdown",
2419
2536
  description: "Add an explanation or analysis text block to the notebook. Use markdown formatting. Use this to explain findings, methodology, and insights alongside visualizations.",
@@ -2461,7 +2578,7 @@ function we() {
2461
2578
  },
2462
2579
  chartType: {
2463
2580
  type: "string",
2464
- enum: Q,
2581
+ enum: Z,
2465
2582
  description: "Chart type. Use \"markdown\" for section headers."
2466
2583
  },
2467
2584
  query: {
@@ -2485,14 +2602,18 @@ function we() {
2485
2602
  },
2486
2603
  sizeField: { type: "string" },
2487
2604
  colorField: { type: "string" },
2488
- ...u
2605
+ ...l,
2606
+ ...d
2489
2607
  },
2490
2608
  description: "Chart axis configuration"
2491
2609
  },
2492
2610
  displayConfig: {
2493
2611
  type: "object",
2494
2612
  description: "Chart display configuration (for markdown: { content, hideHeader, transparentBackground, autoHeight })",
2495
- properties: l
2613
+ properties: {
2614
+ ...c,
2615
+ ...u
2616
+ }
2496
2617
  },
2497
2618
  dashboardFilterMapping: {
2498
2619
  type: "array",
@@ -2600,10 +2721,10 @@ function we() {
2600
2721
  }
2601
2722
  ];
2602
2723
  }
2603
- function Te(e) {
2604
- let { semanticLayer: t, securityContext: n } = e, i = /* @__PURE__ */ new Map();
2605
- i.set("discover_cubes", async (e) => {
2606
- let r = { cubes: (await o(t, n, {
2724
+ function Me(e) {
2725
+ let { semanticLayer: t, securityContext: n } = e, r = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
2726
+ r.set("discover_cubes", async (e) => {
2727
+ let r = { cubes: (await s(t, n, {
2607
2728
  topic: e.topic,
2608
2729
  intent: e.intent,
2609
2730
  limit: e.limit,
@@ -2624,20 +2745,20 @@ function Te(e) {
2624
2745
  } } : {}
2625
2746
  })) };
2626
2747
  return { result: JSON.stringify(r) + "\n[IMPORTANT: Your next response MUST start with a brief text message BEFORE any tool calls.]" };
2627
- }), i.set("get_cube_metadata", async () => {
2748
+ }), r.set("get_cube_metadata", async () => {
2628
2749
  let e = t.getMetadata(n);
2629
2750
  return { result: JSON.stringify(e) };
2630
2751
  });
2631
- let s = /* @__PURE__ */ new Map();
2632
- for (let e of t.getMetadata(n)) s.set(e.name, {
2752
+ let c = /* @__PURE__ */ new Map();
2753
+ for (let e of t.getMetadata(n)) c.set(e.name, {
2633
2754
  measures: (e.measures || []).map((e) => e.name),
2634
2755
  dimensions: (e.dimensions || []).map((e) => e.name)
2635
2756
  });
2636
- let c = (e, t) => {
2637
- let n = s.get(e), r = t === "measures" ? n?.measures : n?.dimensions;
2757
+ let l = (e, t) => {
2758
+ let n = c.get(e), r = t === "measures" ? n?.measures : n?.dimensions;
2638
2759
  return !r || r.length === 0 ? "" : ` Available ${t}: ${r.slice(0, 5).map((e) => `"${e}"`).join(", ")}`;
2639
2760
  };
2640
- return i.set("execute_query", async (e) => {
2761
+ r.set("execute_query", async (e) => {
2641
2762
  try {
2642
2763
  let r = (e, t) => {
2643
2764
  if (!Array.isArray(e)) return;
@@ -2645,7 +2766,7 @@ function Te(e) {
2645
2766
  for (let r of e) {
2646
2767
  if (typeof r != "string") continue;
2647
2768
  let e = r.split(".");
2648
- e.length === 1 ? n.push(`"${r}" is not valid — must be "CubeName.fieldName".${c(r, t)}`) : e.length === 2 && e[0] === e[1] && n.push(`"${r}" is WRONG — "${e[0]}" is the cube name, not a ${t.replace(/s$/, "")}.${c(e[0], t)}`);
2769
+ e.length === 1 ? n.push(`"${r}" is not valid — must be "CubeName.fieldName".${l(r, t)}`) : e.length === 2 && e[0] === e[1] && n.push(`"${r}" is WRONG — "${e[0]}" is the cube name, not a ${t.replace(/s$/, "")}.${l(e[0], t)}`);
2649
2770
  }
2650
2771
  if (n.length > 0) throw Error(`Invalid ${t}:\n${n.join("\n")}`);
2651
2772
  };
@@ -2661,11 +2782,13 @@ function Te(e) {
2661
2782
  offset: e.offset,
2662
2783
  ungrouped: e.ungrouped
2663
2784
  };
2664
- let o = await a(t, n, { query: i });
2785
+ let a = await o(t, n, { query: i }), s = a.data.slice(0, 25);
2665
2786
  return { result: JSON.stringify({
2666
- rowCount: o.data.length,
2667
- data: o.data,
2668
- annotation: o.annotation
2787
+ rowCount: a.data.length,
2788
+ data: s,
2789
+ truncated: a.data.length > s.length,
2790
+ dataShape: Ae(s, a.annotation),
2791
+ annotation: a.annotation
2669
2792
  }) + "\n[IMPORTANT: Your next response MUST start with a brief text message BEFORE any tool calls. Now call add_markdown and add_portlet to visualize these results.]" };
2670
2793
  } catch (t) {
2671
2794
  let n = {
@@ -2684,112 +2807,157 @@ function Te(e) {
2684
2807
  isError: !0
2685
2808
  };
2686
2809
  }
2687
- }), i.set("add_portlet", async (e) => {
2688
- let i = {
2810
+ });
2811
+ function u(e) {
2812
+ let r = {
2689
2813
  number: "kpiNumber",
2690
2814
  retention: "retentionHeatmap"
2691
2815
  }[e.chartType] ?? e.chartType, a;
2692
2816
  try {
2693
2817
  a = JSON.parse(e.query);
2694
2818
  } catch {
2695
- return {
2696
- result: "Invalid query: could not parse JSON string. Ensure `query` is a valid JSON string.",
2697
- isError: !0
2698
- };
2819
+ return { error: "Invalid query: could not parse JSON string. Ensure `query` is a valid JSON string." };
2699
2820
  }
2700
- a = r(a);
2821
+ a = i(a);
2701
2822
  let o = t.validateQuery(a, n);
2702
- if (!o.isValid) return {
2703
- result: `Invalid query fix these errors and retry:\n${o.errors.join("\n")}\n\nAttempted query:\n${JSON.stringify(a, null, 2)}`,
2704
- isError: !0
2705
- };
2706
- let s = !!(a.funnel || a.flow || a.retention), c;
2823
+ if (!o.isValid) return { error: `Invalid query — fix these errors and retry:\n${o.errors.join("\n")}\n\nAttempted query:\n${JSON.stringify(a, null, 2)}` };
2824
+ let s = !!(a.funnel || a.flow || a.retention), c, l = r, u;
2707
2825
  if (s) c = e.chartConfig ?? {};
2708
2826
  else {
2709
- let t = xe(i, e.chartConfig, a), n = ve(i, t, a);
2710
- if (!n.isValid) return {
2711
- result: `Chart config invalid fix these errors and retry:\n${n.errors.join("\n")}`,
2712
- isError: !0
2713
- };
2714
- c = t;
2827
+ let t = Se(r, e.chartConfig, a);
2828
+ l = t.chartType, u = t.note;
2829
+ let n = Ee(l, e.chartConfig, a), i = xe(l, n, a);
2830
+ if (!i.isValid) return { error: `Chart config invalid — fix these errors and retry:\n${i.errors.join("\n")}\n\nchartType: ${l}\nAttempted chartConfig:\n${JSON.stringify(n, null, 2)}\n\nQuery:\n${JSON.stringify(a, null, 2)}` };
2831
+ c = n;
2715
2832
  }
2716
- let l = `portlet-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`, u = {
2717
- id: l,
2718
- title: e.title,
2719
- query: JSON.stringify(a),
2720
- chartType: i,
2721
- chartConfig: c,
2833
+ return {
2834
+ portlet: {
2835
+ query: JSON.stringify(a),
2836
+ chartType: l,
2837
+ chartConfig: c,
2838
+ displayConfig: e.displayConfig
2839
+ },
2840
+ ...u ? { note: u } : {}
2841
+ };
2842
+ }
2843
+ return r.set("add_portlet", async (e) => {
2844
+ let t = u({
2845
+ query: e.query,
2846
+ chartType: e.chartType,
2847
+ chartConfig: e.chartConfig,
2722
2848
  displayConfig: e.displayConfig
2849
+ });
2850
+ if ("error" in t) return {
2851
+ result: t.error,
2852
+ isError: !0
2723
2853
  };
2724
- return {
2725
- result: `Portlet "${e.title}" added to notebook (id: ${l}, chart: ${i}). [Reminder: in your next response, start with a brief sentence about what you will do next BEFORE making any tool calls.]`,
2854
+ let n = `portlet-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`, r = {
2855
+ id: n,
2856
+ title: e.title,
2857
+ ...t.portlet
2858
+ };
2859
+ return a.set(n, r), {
2860
+ result: `Portlet "${e.title}" added to notebook (id: ${n}, chart: ${r.chartType}).` + (t.note ? `\n${t.note}` : "") + " [Reminder: in your next response, start with a brief sentence about what you will do next BEFORE making any tool calls.]",
2726
2861
  sideEffect: {
2727
2862
  type: "add_portlet",
2728
- data: u
2863
+ data: r
2729
2864
  }
2730
2865
  };
2731
- }), i.set("add_markdown", async (e) => {
2732
- let t = `markdown-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`, n = e.content || e.text || e.markdown || "", r = {
2866
+ }), r.set("update_portlet", async (e) => {
2867
+ let t = e.portletId, n = t ? a.get(t) : void 0, r = e.query ?? n?.query, i = e.chartType ?? n?.chartType;
2868
+ if (!t || !r || !i) return {
2869
+ result: `Cannot update portlet "${t ?? ""}": it was not added in this conversation, so there is nothing to merge your change into. Call update_portlet again with the same portletId plus the full \`query\` and \`chartType\` for the chart you want.`,
2870
+ isError: !0
2871
+ };
2872
+ let o = u({
2873
+ query: r,
2874
+ chartType: i,
2875
+ chartConfig: e.chartConfig ?? n?.chartConfig,
2876
+ displayConfig: e.displayConfig ?? n?.displayConfig
2877
+ });
2878
+ if ("error" in o) return {
2879
+ result: o.error,
2880
+ isError: !0
2881
+ };
2882
+ let s = e.title ?? n?.title ?? "Untitled", c = {
2733
2883
  id: t,
2884
+ title: s,
2885
+ ...o.portlet
2886
+ };
2887
+ return a.set(t, c), {
2888
+ result: `Portlet "${s}" updated (id: ${t}, chart: ${c.chartType}).` + (o.note ? `\n${o.note}` : "") + " [Reminder: in your next response, start with a brief sentence about what you will do next BEFORE making any tool calls.]",
2889
+ sideEffect: {
2890
+ type: "update_portlet",
2891
+ data: c
2892
+ }
2893
+ };
2894
+ }), r.set("add_markdown", async (e) => {
2895
+ let t = e.content || e.text || e.markdown || "";
2896
+ if (typeof t != "string" || t.trim() === "") return {
2897
+ result: "add_markdown was called with no content, so no block was added. Call add_markdown again with the explanation text in the `content` field.",
2898
+ isError: !0
2899
+ };
2900
+ let n = `markdown-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`, r = {
2901
+ id: n,
2734
2902
  title: e.title,
2735
- content: n
2903
+ content: t
2736
2904
  };
2737
2905
  return {
2738
- result: `Markdown block added to notebook (id: ${t}). [Reminder: in your next response, start with a brief sentence about what you will do next BEFORE making any tool calls.]`,
2906
+ result: `Markdown block added to notebook (id: ${n}). [Reminder: in your next response, start with a brief sentence about what you will do next BEFORE making any tool calls.]`,
2739
2907
  sideEffect: {
2740
2908
  type: "add_markdown",
2741
2909
  data: r
2742
2910
  }
2743
2911
  };
2744
- }), i.set("save_as_dashboard", async (e) => {
2912
+ }), r.set("save_as_dashboard", async (e) => {
2745
2913
  try {
2746
- let i = e.portlets;
2747
- if (!i || i.length === 0) return {
2914
+ let r = e.portlets;
2915
+ if (!r || r.length === 0) return {
2748
2916
  result: "Dashboard must contain at least one portlet.",
2749
2917
  isError: !0
2750
2918
  };
2751
- let a = [], o = /* @__PURE__ */ new Map();
2752
- for (let e of i) {
2753
- let i = e.chartType;
2754
- if (i === "markdown") continue;
2755
- let s = e.query;
2756
- if (!s) {
2919
+ let a = [], o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
2920
+ for (let e of r) {
2921
+ let r = e.chartType;
2922
+ if (r === "markdown") continue;
2923
+ let c = e.query;
2924
+ if (!c) {
2757
2925
  a.push(`Portlet "${e.title}": missing query`);
2758
2926
  continue;
2759
2927
  }
2760
- let c;
2928
+ let l;
2761
2929
  try {
2762
- c = JSON.parse(s);
2930
+ l = JSON.parse(c);
2763
2931
  } catch {
2764
2932
  a.push(`Portlet "${e.title}": invalid JSON query`);
2765
2933
  continue;
2766
2934
  }
2767
- c = r(c);
2768
- let l = t.validateQuery(c, n);
2769
- if (!l.isValid) {
2770
- a.push(`Portlet "${e.title}": ${l.errors.join(", ")}`);
2935
+ l = i(l);
2936
+ let u = t.validateQuery(l, n);
2937
+ if (!u.isValid) {
2938
+ a.push(`Portlet "${e.title}": ${u.errors.join(", ")}`);
2771
2939
  continue;
2772
2940
  }
2773
- let u = xe(i, e.chartConfig, c), d = ve(i, u, c);
2774
- if (!d.isValid) {
2775
- a.push(`Portlet "${e.title}": ${d.errors.join(", ")}`);
2941
+ let d = Se(r, e.chartConfig, l).chartType, f = Ee(d, e.chartConfig, l), p = xe(d, f, l);
2942
+ if (!p.isValid) {
2943
+ a.push(`Portlet "${e.title}": ${p.errors.join(", ")}`);
2776
2944
  continue;
2777
2945
  }
2778
- o.set(e, u);
2946
+ o.set(e, f), s.set(e, d);
2779
2947
  }
2780
2948
  if (a.length > 0) return {
2781
2949
  result: `Dashboard has invalid portlets — fix these errors and retry:\n${a.join("\n")}`,
2782
2950
  isError: !0
2783
2951
  };
2784
- let s = {
2785
- portlets: i.map((e) => {
2786
- let t = e.chartType, n = t === "markdown", r = n ? "query" : e.analysisType || "query", i = r === "funnel" ? "funnel" : r === "flow" ? "flow" : r === "retention" ? "retention" : "query", a = e.query || "{}", s;
2952
+ let c = {
2953
+ portlets: r.map((e) => {
2954
+ let t = s.get(e) ?? e.chartType, n = t === "markdown", r = n ? "query" : e.analysisType || "query", i = r === "funnel" ? "funnel" : r === "flow" ? "flow" : r === "retention" ? "retention" : "query", a = e.query || "{}", c;
2787
2955
  try {
2788
- s = JSON.parse(a);
2956
+ c = JSON.parse(a);
2789
2957
  } catch {
2790
- s = {};
2958
+ c = {};
2791
2959
  }
2792
- let c = {
2960
+ let l = {
2793
2961
  version: 1,
2794
2962
  analysisType: i,
2795
2963
  activeView: "chart",
@@ -2798,12 +2966,12 @@ function Te(e) {
2798
2966
  chartConfig: o.get(e) ?? e.chartConfig ?? {},
2799
2967
  displayConfig: e.displayConfig || {}
2800
2968
  } },
2801
- query: n ? {} : s
2969
+ query: n ? {} : c
2802
2970
  };
2803
2971
  return {
2804
2972
  id: e.id,
2805
2973
  title: e.title,
2806
- analysisConfig: c,
2974
+ analysisConfig: l,
2807
2975
  dashboardFilterMapping: e.dashboardFilterMapping,
2808
2976
  w: e.w,
2809
2977
  h: e.h,
@@ -2813,15 +2981,15 @@ function Te(e) {
2813
2981
  }),
2814
2982
  filters: e.filters,
2815
2983
  colorPalette: e.colorPalette
2816
- }, c = e.title;
2984
+ }, l = e.title;
2817
2985
  return {
2818
- result: `Dashboard "${c}" created with ${s.portlets.length} portlets and ${s.filters?.length || 0} filters.`,
2986
+ result: `Dashboard "${l}" created with ${c.portlets.length} portlets and ${c.filters?.length || 0} filters.`,
2819
2987
  sideEffect: {
2820
2988
  type: "dashboard_saved",
2821
2989
  data: {
2822
- title: c,
2990
+ title: l,
2823
2991
  description: e.description,
2824
- dashboardConfig: s
2992
+ dashboardConfig: c
2825
2993
  }
2826
2994
  }
2827
2995
  };
@@ -2831,22 +2999,22 @@ function Te(e) {
2831
2999
  isError: !0
2832
3000
  };
2833
3001
  }
2834
- }), i;
3002
+ }), r;
2835
3003
  }
2836
3004
  //#endregion
2837
3005
  //#region src/server/agent/providers/factory.ts
2838
- async function Ee(e, t, n) {
3006
+ async function Ne(e, t, n) {
2839
3007
  switch (e) {
2840
3008
  case "anthropic": {
2841
- let { AnthropicProvider: e } = await import("./anthropic-CZh4hB-m.js");
3009
+ let { AnthropicProvider: e } = await import("./anthropic-MQlafOZv.js");
2842
3010
  return new e(t);
2843
3011
  }
2844
3012
  case "openai": {
2845
- let { OpenAIProvider: e } = await import("./openai-DK_KWiI7.js");
3013
+ let { OpenAIProvider: e } = await import("./openai-62sEF0Ev.js");
2846
3014
  return new e(t, n);
2847
3015
  }
2848
3016
  case "google": {
2849
- let { GoogleProvider: e } = await import("./google-DRY7jnOh.js");
3017
+ let { GoogleProvider: e } = await import("./google-BBBP1Dhs.js");
2850
3018
  return new e(t);
2851
3019
  }
2852
3020
  default: throw Error(`Unknown LLM provider: "${e}". Supported providers: anthropic, openai, google`);
@@ -2854,16 +3022,16 @@ async function Ee(e, t, n) {
2854
3022
  }
2855
3023
  //#endregion
2856
3024
  //#region src/server/agent/handler-steps.ts
2857
- function De(e, t) {
3025
+ function Pe(e, t) {
2858
3026
  if (Array.isArray(t)) for (let n of t) e.push(n);
2859
3027
  else e.push(t);
2860
3028
  }
2861
- function $(e) {
3029
+ function Q(e) {
2862
3030
  if (e) try {
2863
3031
  e();
2864
3032
  } catch {}
2865
3033
  }
2866
- function Oe(e, t) {
3034
+ function Fe(e, t) {
2867
3035
  let n = [];
2868
3036
  if (!e || e.length === 0) return n;
2869
3037
  for (let r of e) {
@@ -2896,7 +3064,7 @@ function Oe(e, t) {
2896
3064
  content: typeof e.result == "string" ? e.result : JSON.stringify(e.result ?? ""),
2897
3065
  isError: e.status === "error"
2898
3066
  }));
2899
- De(n, t.formatToolResults(i));
3067
+ Pe(n, t.formatToolResults(i));
2900
3068
  } else e.length > 0 && n.push({
2901
3069
  role: "assistant",
2902
3070
  content: r.content
@@ -2904,28 +3072,22 @@ function Oe(e, t) {
2904
3072
  }
2905
3073
  return n;
2906
3074
  }
2907
- function ke(e, t) {
3075
+ function $(e, t) {
2908
3076
  if (!(e?.type !== "tool_use" || !t)) try {
2909
3077
  e.input = JSON.parse(t);
2910
3078
  } catch {
2911
- e.input = {};
3079
+ e.input = {}, e.inputParseError = !0;
2912
3080
  }
2913
3081
  }
2914
- function Ae(e, t) {
3082
+ function Ie(e, t) {
2915
3083
  let n = e.contentBlocks[e.contentBlocks.length - 1];
2916
3084
  n && n.type === "text" ? n.text = (n.text || "") + t : e.contentBlocks.push({
2917
3085
  type: "text",
2918
3086
  text: t
2919
3087
  });
2920
3088
  }
2921
- function je(e, t) {
2922
- if (e.currentBlockIsToolUse && e.currentToolInputJson) {
2923
- let t = e.contentBlocks[e.contentBlocks.length - 1];
2924
- if (t?.type === "tool_use") try {
2925
- t.input = JSON.parse(e.currentToolInputJson);
2926
- } catch {}
2927
- }
2928
- e.contentBlocks.push({
3089
+ function Le(e, t) {
3090
+ e.currentBlockIsToolUse && e.currentToolInputJson && $(e.contentBlocks[e.contentBlocks.length - 1], e.currentToolInputJson), e.contentBlocks.push({
2929
3091
  type: "tool_use",
2930
3092
  id: t.id,
2931
3093
  name: t.name,
@@ -2933,16 +3095,16 @@ function je(e, t) {
2933
3095
  ...t.metadata ? { metadata: t.metadata } : {}
2934
3096
  }), e.currentToolInputJson = "", e.currentBlockIsToolUse = !0;
2935
3097
  }
2936
- function Me(e, t) {
3098
+ function Re(e, t) {
2937
3099
  if (t.id && t.input) {
2938
3100
  let n = e.contentBlocks.find((e) => e.type === "tool_use" && e.id === t.id);
2939
- n && (n.input = t.input);
3101
+ n && (n.input = t.input, t.parseError && (n.inputParseError = !0));
2940
3102
  } else if (e.currentBlockIsToolUse) {
2941
3103
  let t = e.contentBlocks[e.contentBlocks.length - 1];
2942
- t?.type === "tool_use" && e.currentToolInputJson && (ke(t, e.currentToolInputJson), e.currentToolInputJson = ""), e.currentBlockIsToolUse = !1;
3104
+ t?.type === "tool_use" && e.currentToolInputJson && ($(t, e.currentToolInputJson), e.currentToolInputJson = ""), e.currentBlockIsToolUse = !1;
2943
3105
  }
2944
3106
  }
2945
- async function* Ne(e, t) {
3107
+ async function* ze(e, t) {
2946
3108
  let n = {
2947
3109
  contentBlocks: [],
2948
3110
  currentToolInputJson: "",
@@ -2953,13 +3115,13 @@ async function* Ne(e, t) {
2953
3115
  let e = r;
2954
3116
  switch (e.type) {
2955
3117
  case "text_delta":
2956
- Ae(n, e.text), yield {
3118
+ Ie(n, e.text), yield {
2957
3119
  type: "text_delta",
2958
3120
  data: e.text
2959
3121
  };
2960
3122
  break;
2961
3123
  case "tool_use_start":
2962
- je(n, e), yield {
3124
+ Le(n, e), yield {
2963
3125
  type: "tool_use_start",
2964
3126
  data: {
2965
3127
  id: e.id,
@@ -2972,7 +3134,7 @@ async function* Ne(e, t) {
2972
3134
  n.currentToolInputJson += e.json;
2973
3135
  break;
2974
3136
  case "tool_use_end":
2975
- Me(n, e);
3137
+ Re(n, e);
2976
3138
  break;
2977
3139
  case "message_meta": e.inputTokens != null && (n.inputTokens = e.inputTokens), e.outputTokens != null && (n.outputTokens = e.outputTokens), e.stopReason && (n.stopReason = e.stopReason);
2978
3140
  }
@@ -2984,8 +3146,33 @@ async function* Ne(e, t) {
2984
3146
  outputTokens: n.outputTokens
2985
3147
  };
2986
3148
  }
2987
- async function* Pe(e, t) {
2988
- let { executor: n, observability: r, traceId: i, turn: a } = t, o = e.name, s = e.input || {}, c = e.id, l = n.get(o);
3149
+ async function* Be(e, t) {
3150
+ let { executor: n, observability: r, traceId: i, turn: a } = t, o = e.name, s = e.input || {}, c = e.id;
3151
+ if (e.inputParseError) {
3152
+ let e = `Could not parse the arguments you sent for ${o} — they were not valid JSON, so the tool was not run. Call it again with well-formed JSON arguments.`;
3153
+ return yield {
3154
+ type: "tool_use_result",
3155
+ data: {
3156
+ id: c,
3157
+ name: o,
3158
+ result: e,
3159
+ isError: !0
3160
+ }
3161
+ }, Q(() => r?.onToolEnd?.({
3162
+ traceId: i,
3163
+ turn: a,
3164
+ toolName: o,
3165
+ toolUseId: c,
3166
+ isError: !0,
3167
+ durationMs: 0
3168
+ })), {
3169
+ toolUseId: c,
3170
+ toolName: o,
3171
+ content: e,
3172
+ isError: !0
3173
+ };
3174
+ }
3175
+ let l = n.get(o);
2989
3176
  if (!l) return yield {
2990
3177
  type: "tool_use_result",
2991
3178
  data: {
@@ -3008,10 +3195,11 @@ async function* Pe(e, t) {
3008
3195
  data: {
3009
3196
  id: c,
3010
3197
  name: o,
3198
+ input: s,
3011
3199
  result: e.result,
3012
3200
  ...e.isError ? { isError: !0 } : {}
3013
3201
  }
3014
- }, $(() => r?.onToolEnd?.({
3202
+ }, Q(() => r?.onToolEnd?.({
3015
3203
  traceId: i,
3016
3204
  turn: a,
3017
3205
  toolName: o,
@@ -3034,7 +3222,7 @@ async function* Pe(e, t) {
3034
3222
  result: t,
3035
3223
  isError: !0
3036
3224
  }
3037
- }, $(() => r?.onToolEnd?.({
3225
+ }, Q(() => r?.onToolEnd?.({
3038
3226
  traceId: i,
3039
3227
  turn: a,
3040
3228
  toolName: o,
@@ -3049,48 +3237,48 @@ async function* Pe(e, t) {
3049
3237
  };
3050
3238
  }
3051
3239
  }
3052
- async function* Fe(e, t) {
3240
+ async function* Ve(e, t) {
3053
3241
  let n = [];
3054
3242
  for (let r of e) {
3055
3243
  if (r.type !== "tool_use") continue;
3056
- let e = yield* Pe(r, t);
3244
+ let e = yield* Be(r, t);
3057
3245
  n.push(e);
3058
3246
  }
3059
3247
  return n;
3060
3248
  }
3061
3249
  //#endregion
3062
3250
  //#region src/server/agent/handler.ts
3063
- var Ie = {
3251
+ var He = {
3064
3252
  anthropic: "claude-sonnet-4-6",
3065
3253
  openai: "gpt-4.1-mini",
3066
3254
  google: "gemini-3-flash-preview"
3067
3255
  };
3068
- async function* Le(t) {
3069
- let { message: n, history: r, semanticLayer: i, securityContext: a, agentConfig: o, apiKey: s } = t, c = t.sessionId || crypto.randomUUID(), l = o.observability, u = crypto.randomUUID(), d = Date.now(), f = t.providerOverride || o.provider || "anthropic", p = t.modelOverride || o.model || Ie[f] || "claude-sonnet-4-6", m = t.baseURLOverride || o.baseURL, h = o.maxTurns || 25, g = o.maxTokens || 4096, _;
3256
+ async function* Ue(e) {
3257
+ let { message: t, history: n, semanticLayer: r, securityContext: i, agentConfig: o, apiKey: s } = e, c = e.sessionId || crypto.randomUUID(), l = o.observability, u = crypto.randomUUID(), d = Date.now(), f = e.providerOverride || o.provider || "anthropic", p = e.modelOverride || o.model || He[f] || "claude-sonnet-4-6", m = e.baseURLOverride || o.baseURL, h = o.maxTurns || 25, g = o.maxTokens || 8192, _;
3070
3258
  try {
3071
- _ = await Ee(f, s, { baseURL: m });
3072
- } catch (t) {
3073
- console.error("[agent] Failed to create %s provider: %s", String(f).replace(/\n|\r/g, ""), String(t instanceof Error ? t.message : t).replace(/\n|\r/g, "")), yield {
3259
+ _ = await Ne(f, s, { baseURL: m });
3260
+ } catch (e) {
3261
+ console.error("[agent] Failed to create %s provider: %s", String(f).replace(/\n|\r/g, ""), String(e instanceof Error ? e.message : e).replace(/\n|\r/g, "")), yield {
3074
3262
  type: "error",
3075
- data: { message: t instanceof Error ? t.message : e("server.errors.llmInitFailed") }
3263
+ data: { message: e instanceof Error ? e.message : a("server.errors.llmInitFailed") }
3076
3264
  };
3077
3265
  return;
3078
3266
  }
3079
- let v = we(), y = Te({
3080
- semanticLayer: i,
3081
- securityContext: a
3082
- }), b = ie(i.getMetadata(a));
3083
- t.systemContext && (b += `\n\n## User Context\n\n${t.systemContext}`), $(() => l?.onChatStart?.({
3267
+ let v = je(), y = Me({
3268
+ semanticLayer: r,
3269
+ securityContext: i
3270
+ }), b = oe(r.getMetadata(i));
3271
+ e.systemContext && (b += `\n\n## User Context\n\n${e.systemContext}`), Q(() => l?.onChatStart?.({
3084
3272
  traceId: u,
3085
3273
  sessionId: c,
3086
- message: n,
3274
+ message: t,
3087
3275
  model: p,
3088
- historyLength: r?.length ?? 0
3276
+ historyLength: n?.length ?? 0
3089
3277
  }));
3090
- let x = Oe(r, _);
3278
+ let x = Fe(n, _);
3091
3279
  x.push({
3092
3280
  role: "user",
3093
- content: n
3281
+ content: t
3094
3282
  });
3095
3283
  let S = 0;
3096
3284
  try {
@@ -3102,22 +3290,29 @@ async function* Le(t) {
3102
3290
  system: b,
3103
3291
  tools: v,
3104
3292
  messages: x
3105
- }), n = Date.now(), { contentBlocks: r, stopReason: i, inputTokens: a, outputTokens: o } = yield* Ne(_, t);
3106
- if ($(() => l?.onGenerationEnd?.({
3293
+ }), n = Date.now(), { contentBlocks: r, stopReason: i, inputTokens: o, outputTokens: s } = yield* ze(_, t);
3294
+ if (Q(() => l?.onGenerationEnd?.({
3107
3295
  traceId: u,
3108
3296
  turn: e,
3109
3297
  model: p,
3110
3298
  stopReason: i,
3111
- inputTokens: a,
3112
- outputTokens: o,
3299
+ inputTokens: o,
3300
+ outputTokens: s,
3113
3301
  durationMs: Date.now() - n,
3114
3302
  input: x,
3115
3303
  output: r
3116
3304
  })), x.push({
3117
3305
  role: "assistant",
3118
3306
  content: r
3119
- }), !_.shouldContinue(i)) break;
3120
- let s = yield* Fe(r, {
3307
+ }), _.isTruncated(i)) {
3308
+ yield {
3309
+ type: "error",
3310
+ data: { message: a("server.errors.agentResponseTruncated") }
3311
+ };
3312
+ break;
3313
+ }
3314
+ if (!_.shouldContinue(i)) break;
3315
+ let c = yield* Ve(r, {
3121
3316
  executor: y,
3122
3317
  observability: l,
3123
3318
  traceId: u,
@@ -3126,9 +3321,9 @@ async function* Le(t) {
3126
3321
  yield {
3127
3322
  type: "turn_complete",
3128
3323
  data: {}
3129
- }, De(x, _.formatToolResults(s));
3324
+ }, Pe(x, _.formatToolResults(c));
3130
3325
  }
3131
- $(() => l?.onChatEnd?.({
3326
+ Q(() => l?.onChatEnd?.({
3132
3327
  traceId: u,
3133
3328
  sessionId: c,
3134
3329
  totalTurns: S,
@@ -3157,4 +3352,4 @@ async function* Le(t) {
3157
3352
  }
3158
3353
  }
3159
3354
  //#endregion
3160
- export { O as C, w as D, T as E, oe as O, k as S, E as T, P as _, G as a, j as b, H as c, se as d, z as f, F as g, I as h, Le as handleAgentChat, K as i, ae as k, V as l, L as m, J as n, W as o, R as p, q as r, U as s, ce as t, B as u, N as v, D as w, A as x, M as y };
3355
+ export { k as C, se as D, E, T as O, A as S, D as T, F as _, q as a, M as b, W as c, V as d, B as f, I as g, L as h, Ue as handleAgentChat, ce as i, w as k, U as l, R as m, ue as n, K as o, z as p, le as r, G as s, de as t, H as u, P as v, O as w, j as x, N as y };