@sqlrooms/mosaic 0.29.0-rc.4 → 0.29.0-rc.6

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 (334) hide show
  1. package/README.md +43 -39
  2. package/dist/DataPointLimitError.d.ts +9 -0
  3. package/dist/DataPointLimitError.d.ts.map +1 -0
  4. package/dist/DataPointLimitError.js +14 -0
  5. package/dist/DataPointLimitError.js.map +1 -0
  6. package/dist/MosaicSlice.d.ts.map +1 -1
  7. package/dist/MosaicSlice.js +3 -3
  8. package/dist/MosaicSlice.js.map +1 -1
  9. package/dist/VgPlotChart.d.ts +8 -11
  10. package/dist/VgPlotChart.d.ts.map +1 -1
  11. package/dist/VgPlotChart.js +74 -90
  12. package/dist/VgPlotChart.js.map +1 -1
  13. package/dist/VgPlotChartError.d.ts +7 -0
  14. package/dist/VgPlotChartError.d.ts.map +1 -0
  15. package/dist/VgPlotChartError.js +9 -0
  16. package/dist/VgPlotChartError.js.map +1 -0
  17. package/dist/ai.d.ts +103 -0
  18. package/dist/ai.d.ts.map +1 -0
  19. package/dist/ai.js +445 -0
  20. package/dist/ai.js.map +1 -0
  21. package/dist/boxplot/BoxPlotClient.d.ts +7 -0
  22. package/dist/boxplot/BoxPlotClient.d.ts.map +1 -1
  23. package/dist/boxplot/BoxPlotClient.js +22 -0
  24. package/dist/boxplot/BoxPlotClient.js.map +1 -1
  25. package/dist/chart/ChartRuntimeIssuePanel.d.ts +7 -0
  26. package/dist/chart/ChartRuntimeIssuePanel.d.ts.map +1 -0
  27. package/dist/chart/ChartRuntimeIssuePanel.js +10 -0
  28. package/dist/chart/ChartRuntimeIssuePanel.js.map +1 -0
  29. package/dist/chart/MosaicDashboardChart.d.ts +1 -1
  30. package/dist/chart/MosaicDashboardChart.d.ts.map +1 -1
  31. package/dist/chart/MosaicDashboardChart.js +1 -1
  32. package/dist/chart/MosaicDashboardChart.js.map +1 -1
  33. package/dist/chart/MosaicDashboardChartContent.d.ts +1 -1
  34. package/dist/chart/MosaicDashboardChartContent.d.ts.map +1 -1
  35. package/dist/chart/MosaicDashboardChartContent.js +29 -2
  36. package/dist/chart/MosaicDashboardChartContent.js.map +1 -1
  37. package/dist/chart/MosaicDashboardChartRenderer.d.ts +2 -1
  38. package/dist/chart/MosaicDashboardChartRenderer.d.ts.map +1 -1
  39. package/dist/chart/MosaicDashboardChartRenderer.js +2 -2
  40. package/dist/chart/MosaicDashboardChartRenderer.js.map +1 -1
  41. package/dist/chart/MosaicDashboardComponentChart.d.ts +5 -1
  42. package/dist/chart/MosaicDashboardComponentChart.d.ts.map +1 -1
  43. package/dist/chart/MosaicDashboardComponentChart.js +4 -1
  44. package/dist/chart/MosaicDashboardComponentChart.js.map +1 -1
  45. package/dist/chart/MosaicDashboardVgPlotChart.d.ts +4 -0
  46. package/dist/chart/MosaicDashboardVgPlotChart.d.ts.map +1 -1
  47. package/dist/chart/MosaicDashboardVgPlotChart.js +2 -2
  48. package/dist/chart/MosaicDashboardVgPlotChart.js.map +1 -1
  49. package/dist/chart/addChartPanelAction.d.ts +3 -0
  50. package/dist/chart/addChartPanelAction.d.ts.map +1 -0
  51. package/dist/chart/addChartPanelAction.js +14 -0
  52. package/dist/chart/addChartPanelAction.js.map +1 -0
  53. package/dist/chart/chart-settings/ChartSettings.d.ts.map +1 -1
  54. package/dist/chart/chart-settings/ChartSettings.js +7 -4
  55. package/dist/chart/chart-settings/ChartSettings.js.map +1 -1
  56. package/dist/chart/chart-settings/ChartSettingsContent.d.ts +1 -1
  57. package/dist/chart/chart-settings/ChartSettingsContent.d.ts.map +1 -1
  58. package/dist/chart/chart-settings/ChartSettingsContent.js.map +1 -1
  59. package/dist/chart/chart-settings/ChartSettingsContext.d.ts +0 -2
  60. package/dist/chart/chart-settings/ChartSettingsContext.d.ts.map +1 -1
  61. package/dist/chart/chart-settings/ChartSettingsContext.js +6 -7
  62. package/dist/chart/chart-settings/ChartSettingsContext.js.map +1 -1
  63. package/dist/chart/chart-settings/ChartSettingsPanel.d.ts +1 -1
  64. package/dist/chart/chart-settings/ChartSettingsPanel.d.ts.map +1 -1
  65. package/dist/chart/chart-settings/ChartSettingsPanel.js +1 -1
  66. package/dist/chart/chart-settings/ChartSettingsPanel.js.map +1 -1
  67. package/dist/chart/chart-settings/ChartTypeSelector.d.ts.map +1 -1
  68. package/dist/chart/chart-settings/ChartTypeSelector.js +5 -5
  69. package/dist/chart/chart-settings/ChartTypeSelector.js.map +1 -1
  70. package/dist/chart-builders/ColumnSelector.d.ts +0 -2
  71. package/dist/chart-builders/ColumnSelector.d.ts.map +1 -1
  72. package/dist/chart-builders/ColumnSelector.js +4 -5
  73. package/dist/chart-builders/ColumnSelector.js.map +1 -1
  74. package/dist/chart-builders/ColumnsContext.d.ts +13 -0
  75. package/dist/chart-builders/ColumnsContext.d.ts.map +1 -0
  76. package/dist/chart-builders/ColumnsContext.js +15 -0
  77. package/dist/chart-builders/ColumnsContext.js.map +1 -0
  78. package/dist/chart-builders/MultiFieldSelector.js +4 -4
  79. package/dist/chart-builders/MultiFieldSelector.js.map +1 -1
  80. package/dist/chart-builders/TableSelector.d.ts +14 -0
  81. package/dist/chart-builders/TableSelector.d.ts.map +1 -0
  82. package/dist/chart-builders/TableSelector.js +23 -0
  83. package/dist/chart-builders/TableSelector.js.map +1 -0
  84. package/dist/chart-runtime.d.ts +50 -0
  85. package/dist/chart-runtime.d.ts.map +1 -0
  86. package/dist/chart-runtime.js +76 -0
  87. package/dist/chart-runtime.js.map +1 -0
  88. package/dist/chart-types/base-types.d.ts +45 -25
  89. package/dist/chart-types/base-types.d.ts.map +1 -1
  90. package/dist/chart-types/base-types.js.map +1 -1
  91. package/dist/chart-types/box-plot/definition.d.ts.map +1 -1
  92. package/dist/chart-types/box-plot/definition.js +5 -0
  93. package/dist/chart-types/box-plot/definition.js.map +1 -1
  94. package/dist/chart-types/box-plot/renderer/BoxPlotPanelRenderer.d.ts.map +1 -1
  95. package/dist/chart-types/box-plot/renderer/BoxPlotPanelRenderer.js +4 -1
  96. package/dist/chart-types/box-plot/renderer/BoxPlotPanelRenderer.js.map +1 -1
  97. package/dist/chart-types/box-plot/renderer/useBoxPlotClient.d.ts +4 -0
  98. package/dist/chart-types/box-plot/renderer/useBoxPlotClient.d.ts.map +1 -1
  99. package/dist/chart-types/box-plot/renderer/useBoxPlotClient.js +13 -2
  100. package/dist/chart-types/box-plot/renderer/useBoxPlotClient.js.map +1 -1
  101. package/dist/chart-types/box-plot/schema.d.ts +5 -0
  102. package/dist/chart-types/box-plot/schema.d.ts.map +1 -1
  103. package/dist/chart-types/box-plot/schema.js +2 -0
  104. package/dist/chart-types/box-plot/schema.js.map +1 -1
  105. package/dist/chart-types/box-plot/tool.d.ts +5 -9
  106. package/dist/chart-types/box-plot/tool.d.ts.map +1 -1
  107. package/dist/chart-types/box-plot/tool.js +14 -6
  108. package/dist/chart-types/box-plot/tool.js.map +1 -1
  109. package/dist/chart-types/bubble-chart/definition.d.ts.map +1 -1
  110. package/dist/chart-types/bubble-chart/definition.js +5 -0
  111. package/dist/chart-types/bubble-chart/definition.js.map +1 -1
  112. package/dist/chart-types/bubble-chart/schema.d.ts +5 -0
  113. package/dist/chart-types/bubble-chart/schema.d.ts.map +1 -1
  114. package/dist/chart-types/bubble-chart/schema.js +2 -0
  115. package/dist/chart-types/bubble-chart/schema.js.map +1 -1
  116. package/dist/chart-types/bubble-chart/tool.d.ts +5 -9
  117. package/dist/chart-types/bubble-chart/tool.d.ts.map +1 -1
  118. package/dist/chart-types/bubble-chart/tool.js +17 -9
  119. package/dist/chart-types/bubble-chart/tool.js.map +1 -1
  120. package/dist/chart-types/chart-config.d.ts +46 -0
  121. package/dist/chart-types/chart-config.d.ts.map +1 -1
  122. package/dist/chart-types/chart-config.js +2 -0
  123. package/dist/chart-types/chart-config.js.map +1 -1
  124. package/dist/chart-types/count-plot/schema.d.ts +5 -0
  125. package/dist/chart-types/count-plot/schema.d.ts.map +1 -1
  126. package/dist/chart-types/count-plot/schema.js +2 -0
  127. package/dist/chart-types/count-plot/schema.js.map +1 -1
  128. package/dist/chart-types/count-plot/tool.d.ts +5 -9
  129. package/dist/chart-types/count-plot/tool.d.ts.map +1 -1
  130. package/dist/chart-types/count-plot/tool.js +14 -6
  131. package/dist/chart-types/count-plot/tool.js.map +1 -1
  132. package/dist/chart-types/custom-spec/definition.d.ts.map +1 -1
  133. package/dist/chart-types/custom-spec/definition.js +5 -0
  134. package/dist/chart-types/custom-spec/definition.js.map +1 -1
  135. package/dist/chart-types/custom-spec/schema.d.ts +5 -0
  136. package/dist/chart-types/custom-spec/schema.d.ts.map +1 -1
  137. package/dist/chart-types/custom-spec/schema.js +2 -0
  138. package/dist/chart-types/custom-spec/schema.js.map +1 -1
  139. package/dist/chart-types/data-policy-schema.d.ts +8 -0
  140. package/dist/chart-types/data-policy-schema.d.ts.map +1 -0
  141. package/dist/chart-types/data-policy-schema.js +7 -0
  142. package/dist/chart-types/data-policy-schema.js.map +1 -0
  143. package/dist/chart-types/heatmap/schema.d.ts +5 -0
  144. package/dist/chart-types/heatmap/schema.d.ts.map +1 -1
  145. package/dist/chart-types/heatmap/schema.js +2 -0
  146. package/dist/chart-types/heatmap/schema.js.map +1 -1
  147. package/dist/chart-types/heatmap/tool.d.ts +5 -9
  148. package/dist/chart-types/heatmap/tool.d.ts.map +1 -1
  149. package/dist/chart-types/heatmap/tool.js +16 -8
  150. package/dist/chart-types/heatmap/tool.js.map +1 -1
  151. package/dist/chart-types/histogram/HistogramSettings.d.ts.map +1 -1
  152. package/dist/chart-types/histogram/HistogramSettings.js +4 -2
  153. package/dist/chart-types/histogram/HistogramSettings.js.map +1 -1
  154. package/dist/chart-types/histogram/schema.d.ts +10 -0
  155. package/dist/chart-types/histogram/schema.d.ts.map +1 -1
  156. package/dist/chart-types/histogram/schema.js +13 -0
  157. package/dist/chart-types/histogram/schema.js.map +1 -1
  158. package/dist/chart-types/histogram/spec.d.ts +1 -1
  159. package/dist/chart-types/histogram/spec.d.ts.map +1 -1
  160. package/dist/chart-types/histogram/spec.js +4 -3
  161. package/dist/chart-types/histogram/spec.js.map +1 -1
  162. package/dist/chart-types/histogram/tool.d.ts +7 -9
  163. package/dist/chart-types/histogram/tool.d.ts.map +1 -1
  164. package/dist/chart-types/histogram/tool.js +17 -7
  165. package/dist/chart-types/histogram/tool.js.map +1 -1
  166. package/dist/chart-types/index.d.ts +45 -3
  167. package/dist/chart-types/index.d.ts.map +1 -1
  168. package/dist/chart-types/index.js +8 -2
  169. package/dist/chart-types/index.js.map +1 -1
  170. package/dist/chart-types/line-chart/LineChartSettings.d.ts.map +1 -1
  171. package/dist/chart-types/line-chart/LineChartSettings.js +3 -1
  172. package/dist/chart-types/line-chart/LineChartSettings.js.map +1 -1
  173. package/dist/chart-types/line-chart/definition.d.ts.map +1 -1
  174. package/dist/chart-types/line-chart/definition.js +7 -0
  175. package/dist/chart-types/line-chart/definition.js.map +1 -1
  176. package/dist/chart-types/line-chart/schema.d.ts +5 -0
  177. package/dist/chart-types/line-chart/schema.d.ts.map +1 -1
  178. package/dist/chart-types/line-chart/schema.js +2 -0
  179. package/dist/chart-types/line-chart/schema.js.map +1 -1
  180. package/dist/chart-types/line-chart/tool.d.ts +5 -9
  181. package/dist/chart-types/line-chart/tool.d.ts.map +1 -1
  182. package/dist/chart-types/line-chart/tool.js +16 -8
  183. package/dist/chart-types/line-chart/tool.js.map +1 -1
  184. package/dist/chart-types/list-panels-tool.d.ts +35 -0
  185. package/dist/chart-types/list-panels-tool.d.ts.map +1 -0
  186. package/dist/chart-types/list-panels-tool.js +66 -0
  187. package/dist/chart-types/list-panels-tool.js.map +1 -0
  188. package/dist/chart-types/profiler-tool.d.ts +40 -0
  189. package/dist/chart-types/profiler-tool.d.ts.map +1 -0
  190. package/dist/chart-types/profiler-tool.js +73 -0
  191. package/dist/chart-types/profiler-tool.js.map +1 -0
  192. package/dist/chart-types/remove-panel-tool.d.ts +31 -0
  193. package/dist/chart-types/remove-panel-tool.d.ts.map +1 -0
  194. package/dist/chart-types/remove-panel-tool.js +55 -0
  195. package/dist/chart-types/remove-panel-tool.js.map +1 -0
  196. package/dist/chart-types/text-panel-tool.d.ts +42 -0
  197. package/dist/chart-types/text-panel-tool.d.ts.map +1 -0
  198. package/dist/chart-types/text-panel-tool.js +71 -0
  199. package/dist/chart-types/text-panel-tool.js.map +1 -0
  200. package/dist/chart-types/tool-helpers.d.ts +44 -0
  201. package/dist/chart-types/tool-helpers.d.ts.map +1 -0
  202. package/dist/chart-types/tool-helpers.js +129 -0
  203. package/dist/chart-types/tool-helpers.js.map +1 -0
  204. package/dist/chart-types/tool-schemas.d.ts +1 -0
  205. package/dist/chart-types/tool-schemas.d.ts.map +1 -1
  206. package/dist/chart-types/tool-schemas.js +5 -1
  207. package/dist/chart-types/tool-schemas.js.map +1 -1
  208. package/dist/dashboard/MosaicDashboard.d.ts +5 -2
  209. package/dist/dashboard/MosaicDashboard.d.ts.map +1 -1
  210. package/dist/dashboard/MosaicDashboard.js +20 -39
  211. package/dist/dashboard/MosaicDashboard.js.map +1 -1
  212. package/dist/dashboard/MosaicDashboardContext.d.ts +2 -0
  213. package/dist/dashboard/MosaicDashboardContext.d.ts.map +1 -1
  214. package/dist/dashboard/MosaicDashboardContext.js.map +1 -1
  215. package/dist/dashboard/MosaicDashboardEmptyState.d.ts.map +1 -1
  216. package/dist/dashboard/MosaicDashboardEmptyState.js +8 -44
  217. package/dist/dashboard/MosaicDashboardEmptyState.js.map +1 -1
  218. package/dist/dashboard/MosaicDashboardPanel.d.ts.map +1 -1
  219. package/dist/dashboard/MosaicDashboardPanel.js +2 -5
  220. package/dist/dashboard/MosaicDashboardPanel.js.map +1 -1
  221. package/dist/dashboard/MosaicDashboardPanelHeader.d.ts +2 -2
  222. package/dist/dashboard/MosaicDashboardPanelHeader.d.ts.map +1 -1
  223. package/dist/dashboard/MosaicDashboardPanelHeader.js +2 -2
  224. package/dist/dashboard/MosaicDashboardPanelHeader.js.map +1 -1
  225. package/dist/dashboard/MosaicDashboardPanels.d.ts.map +1 -1
  226. package/dist/dashboard/MosaicDashboardPanels.js +3 -2
  227. package/dist/dashboard/MosaicDashboardPanels.js.map +1 -1
  228. package/dist/dashboard/MosaicDashboardSlice.d.ts +185 -107
  229. package/dist/dashboard/MosaicDashboardSlice.d.ts.map +1 -1
  230. package/dist/dashboard/MosaicDashboardSlice.js +80 -57
  231. package/dist/dashboard/MosaicDashboardSlice.js.map +1 -1
  232. package/dist/dashboard/action-types.d.ts +25 -0
  233. package/dist/dashboard/action-types.d.ts.map +1 -0
  234. package/dist/dashboard/action-types.js +5 -0
  235. package/dist/dashboard/action-types.js.map +1 -0
  236. package/dist/dashboard/core-types.d.ts +26 -0
  237. package/dist/dashboard/core-types.d.ts.map +1 -0
  238. package/dist/dashboard/core-types.js +21 -0
  239. package/dist/dashboard/core-types.js.map +1 -0
  240. package/dist/dashboard/dashboard-types.d.ts +491 -0
  241. package/dist/dashboard/dashboard-types.d.ts.map +1 -0
  242. package/dist/dashboard/dashboard-types.js +54 -0
  243. package/dist/dashboard/dashboard-types.js.map +1 -0
  244. package/dist/dashboard/defaultPanelActions.d.ts +3 -0
  245. package/dist/dashboard/defaultPanelActions.d.ts.map +1 -0
  246. package/dist/dashboard/defaultPanelActions.js +9 -0
  247. package/dist/dashboard/defaultPanelActions.js.map +1 -0
  248. package/dist/dashboard/defaultPanelRenderers.d.ts.map +1 -1
  249. package/dist/dashboard/defaultPanelRenderers.js +1 -1
  250. package/dist/dashboard/defaultPanelRenderers.js.map +1 -1
  251. package/dist/dashboard/initial-state/BuildDashboardManuallyPanel.d.ts +6 -0
  252. package/dist/dashboard/initial-state/BuildDashboardManuallyPanel.d.ts.map +1 -0
  253. package/dist/dashboard/initial-state/BuildDashboardManuallyPanel.js +46 -0
  254. package/dist/dashboard/initial-state/BuildDashboardManuallyPanel.js.map +1 -0
  255. package/dist/dashboard/initial-state/BuildDashboardWithAIPanel.d.ts +7 -0
  256. package/dist/dashboard/initial-state/BuildDashboardWithAIPanel.d.ts.map +1 -0
  257. package/dist/dashboard/initial-state/BuildDashboardWithAIPanel.js +29 -0
  258. package/dist/dashboard/initial-state/BuildDashboardWithAIPanel.js.map +1 -0
  259. package/dist/dashboard/initial-state/MosaicDashboardInitialState.d.ts +6 -0
  260. package/dist/dashboard/initial-state/MosaicDashboardInitialState.d.ts.map +1 -0
  261. package/dist/dashboard/initial-state/MosaicDashboardInitialState.js +9 -0
  262. package/dist/dashboard/initial-state/MosaicDashboardInitialState.js.map +1 -0
  263. package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.d.ts +7 -0
  264. package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.d.ts.map +1 -0
  265. package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.js +12 -0
  266. package/dist/dashboard/toolbar/MosaicDashboardAddPanelDropdown.js.map +1 -0
  267. package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.d.ts +7 -0
  268. package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.d.ts.map +1 -0
  269. package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.js +36 -0
  270. package/dist/dashboard/toolbar/MosaicDashboardResetFiltersButton.js.map +1 -0
  271. package/dist/dashboard/toolbar/MosaicDashboardToolbar.d.ts.map +1 -0
  272. package/dist/dashboard/toolbar/MosaicDashboardToolbar.js +15 -0
  273. package/dist/dashboard/toolbar/MosaicDashboardToolbar.js.map +1 -0
  274. package/dist/dashboard/useAddPanelActions.d.ts +10 -0
  275. package/dist/dashboard/useAddPanelActions.d.ts.map +1 -0
  276. package/dist/dashboard/useAddPanelActions.js +26 -0
  277. package/dist/dashboard/useAddPanelActions.js.map +1 -0
  278. package/dist/dashboard/useMosaicDashboardAddPanelActionContext.d.ts +3 -0
  279. package/dist/dashboard/useMosaicDashboardAddPanelActionContext.d.ts.map +1 -0
  280. package/dist/dashboard/useMosaicDashboardAddPanelActionContext.js +18 -0
  281. package/dist/dashboard/useMosaicDashboardAddPanelActionContext.js.map +1 -0
  282. package/dist/dashboard/useSelectedOrFirstTable.d.ts +10 -0
  283. package/dist/dashboard/useSelectedOrFirstTable.d.ts.map +1 -0
  284. package/dist/dashboard/useSelectedOrFirstTable.js +25 -0
  285. package/dist/dashboard/useSelectedOrFirstTable.js.map +1 -0
  286. package/dist/dashboard/useTablesWithColumns.d.ts +9 -0
  287. package/dist/dashboard/useTablesWithColumns.d.ts.map +1 -0
  288. package/dist/dashboard/useTablesWithColumns.js +13 -0
  289. package/dist/dashboard/useTablesWithColumns.js.map +1 -0
  290. package/dist/index.d.ts +25 -4
  291. package/dist/index.d.ts.map +1 -1
  292. package/dist/index.js +22 -2
  293. package/dist/index.js.map +1 -1
  294. package/dist/profiler/MosaicDashboardProfilerPanelRenderer.d.ts +2 -1
  295. package/dist/profiler/MosaicDashboardProfilerPanelRenderer.d.ts.map +1 -1
  296. package/dist/profiler/MosaicDashboardProfilerPanelRenderer.js +3 -3
  297. package/dist/profiler/MosaicDashboardProfilerPanelRenderer.js.map +1 -1
  298. package/dist/profiler/addProfilerPanelAction.d.ts +3 -0
  299. package/dist/profiler/addProfilerPanelAction.d.ts.map +1 -0
  300. package/dist/profiler/addProfilerPanelAction.js +9 -0
  301. package/dist/profiler/addProfilerPanelAction.js.map +1 -0
  302. package/dist/text/MosaicDashboardTextRenderer.d.ts +2 -1
  303. package/dist/text/MosaicDashboardTextRenderer.d.ts.map +1 -1
  304. package/dist/text/MosaicDashboardTextRenderer.js +4 -4
  305. package/dist/text/MosaicDashboardTextRenderer.js.map +1 -1
  306. package/dist/text/addTextPanelAction.d.ts +3 -0
  307. package/dist/text/addTextPanelAction.d.ts.map +1 -0
  308. package/dist/text/addTextPanelAction.js +9 -0
  309. package/dist/text/addTextPanelAction.js.map +1 -0
  310. package/dist/useMosaicClient.d.ts +4 -0
  311. package/dist/useMosaicClient.d.ts.map +1 -1
  312. package/dist/useMosaicClient.js +33 -3
  313. package/dist/useMosaicClient.js.map +1 -1
  314. package/dist/useVgPlotChartError.d.ts +13 -0
  315. package/dist/useVgPlotChartError.d.ts.map +1 -0
  316. package/dist/useVgPlotChartError.js +18 -0
  317. package/dist/useVgPlotChartError.js.map +1 -0
  318. package/dist/useVgPlotChartRender.d.ts +24 -0
  319. package/dist/useVgPlotChartRender.d.ts.map +1 -0
  320. package/dist/useVgPlotChartRender.js +152 -0
  321. package/dist/useVgPlotChartRender.js.map +1 -0
  322. package/dist/useVgPlotChartRetention.d.ts +21 -0
  323. package/dist/useVgPlotChartRetention.d.ts.map +1 -0
  324. package/dist/useVgPlotChartRetention.js +63 -0
  325. package/dist/useVgPlotChartRetention.js.map +1 -0
  326. package/dist/wrapCoordinatorWithValidation.d.ts +11 -0
  327. package/dist/wrapCoordinatorWithValidation.d.ts.map +1 -0
  328. package/dist/wrapCoordinatorWithValidation.js +23 -0
  329. package/dist/wrapCoordinatorWithValidation.js.map +1 -0
  330. package/package.json +31 -13
  331. package/dist/dashboard/MosaicDashboardToolbar.d.ts.map +0 -1
  332. package/dist/dashboard/MosaicDashboardToolbar.js +0 -86
  333. package/dist/dashboard/MosaicDashboardToolbar.js.map +0 -1
  334. /package/dist/dashboard/{MosaicDashboardToolbar.d.ts → toolbar/MosaicDashboardToolbar.d.ts} +0 -0
@@ -0,0 +1,40 @@
1
+ import { z } from 'zod';
2
+ import type { DashboardToolDeps } from './base-types';
3
+ export declare const ProfilerToolParameters: z.ZodObject<{
4
+ artifactId: z.ZodOptional<z.ZodString>;
5
+ tableName: z.ZodOptional<z.ZodString>;
6
+ createArtifactIfMissing: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
7
+ panelId: z.ZodOptional<z.ZodString>;
8
+ title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
9
+ config: z.ZodObject<{
10
+ pageSize: z.ZodOptional<z.ZodNumber>;
11
+ }, z.core.$strip>;
12
+ reasoning: z.ZodString;
13
+ }, z.core.$strip>;
14
+ export type ProfilerToolParams = z.infer<typeof ProfilerToolParameters>;
15
+ export declare function createProfilerTool(deps: DashboardToolDeps): import("ai").Tool<{
16
+ createArtifactIfMissing: boolean;
17
+ title: string;
18
+ config: {
19
+ pageSize?: number | undefined;
20
+ };
21
+ reasoning: string;
22
+ artifactId?: string | undefined;
23
+ tableName?: string | undefined;
24
+ panelId?: string | undefined;
25
+ }, {
26
+ llmResult: {
27
+ success: boolean;
28
+ details: string;
29
+ data: import("./tool-helpers").PanelResult;
30
+ errorMessage?: undefined;
31
+ };
32
+ } | {
33
+ llmResult: {
34
+ success: boolean;
35
+ errorMessage: string;
36
+ details?: undefined;
37
+ data?: undefined;
38
+ };
39
+ }>;
40
+ //# sourceMappingURL=profiler-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profiler-tool.d.ts","sourceRoot":"","sources":["../../src/chart-types/profiler-tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAIpD,eAAO,MAAM,sBAAsB;;;;;;;;;;iBA2BjC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAExE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;GA8CzD"}
@@ -0,0 +1,73 @@
1
+ import { tool } from 'ai';
2
+ import { z } from 'zod';
3
+ import { createOrUpdateProfilerPanel } from './tool-helpers';
4
+ import { ProfilerPanelConfig } from '../dashboard/core-types';
5
+ export const ProfilerToolParameters = z.object({
6
+ artifactId: z
7
+ .string()
8
+ .optional()
9
+ .describe('Optional dashboard artifact ID. Defaults to current dashboard.'),
10
+ tableName: z
11
+ .string()
12
+ .optional()
13
+ .describe('Optional table name. Use when no table is selected yet.'),
14
+ createArtifactIfMissing: z
15
+ .boolean()
16
+ .optional()
17
+ .default(true)
18
+ .describe('If true, create dashboard artifact if missing.'),
19
+ panelId: z
20
+ .string()
21
+ .optional()
22
+ .describe('Optional panel ID. If provided, updates the existing panel instead of creating new one.'),
23
+ title: z
24
+ .string()
25
+ .optional()
26
+ .default('Profiler')
27
+ .describe('Title for the profiler panel.'),
28
+ config: ProfilerPanelConfig,
29
+ reasoning: z.string().describe('Brief rationale for creating the profiler.'),
30
+ });
31
+ export function createProfilerTool(deps) {
32
+ return tool({
33
+ description: `Data profiler: displays table schema and statistics for all columns (count, distinct values, min/max, etc.).
34
+
35
+ Use when: user asks to "profile the data", "show table statistics", "what's in this table", "summarize columns", "give me an overview of the data".
36
+
37
+ Useful for: quick data exploration, understanding data quality, finding missing values, identifying column types.
38
+
39
+ To UPDATE an existing profiler: provide the panelId parameter. Otherwise creates new panel.`,
40
+ inputSchema: ProfilerToolParameters,
41
+ execute: async (params) => {
42
+ try {
43
+ const artifactId = deps.resolveArtifact(params.artifactId, params.createArtifactIfMissing);
44
+ const { tableName } = deps.resolveTable(artifactId, params.tableName);
45
+ const result = createOrUpdateProfilerPanel(deps, {
46
+ panelId: params.panelId,
47
+ dashboardId: artifactId,
48
+ tableName,
49
+ title: params.title || 'Profiler',
50
+ config: params.config,
51
+ });
52
+ return {
53
+ llmResult: {
54
+ success: true,
55
+ details: params.panelId
56
+ ? `Updated profiler "${result.title}".`
57
+ : `Created profiler "${result.title}".`,
58
+ data: result,
59
+ },
60
+ };
61
+ }
62
+ catch (error) {
63
+ return {
64
+ llmResult: {
65
+ success: false,
66
+ errorMessage: error instanceof Error ? error.message : String(error),
67
+ },
68
+ };
69
+ }
70
+ },
71
+ });
72
+ }
73
+ //# sourceMappingURL=profiler-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profiler-tool.js","sourceRoot":"","sources":["../../src/chart-types/profiler-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AACxB,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAC,2BA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IAAI,EAAE;oBAC/C,OAAO,EAAE,MAAM,CAAC,OAAO;oBACvB,WAAW,EAAE,UAAU;oBACvB,SAAS;oBACT,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,UAAU;oBACjC,MAAM,EAAE,MAAM,CAAC,MAAM;iBACtB,CAAC,CAAC;gBAEH,OAAO;oBACL,SAAS,EAAE;wBACT,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,MAAM,CAAC,OAAO;4BACrB,CAAC,CAAC,qBAAqB,MAAM,CAAC,KAAK,IAAI;4BACvC,CAAC,CAAC,qBAAqB,MAAM,CAAC,KAAK,IAAI;wBACzC,IAAI,EAAE,MAAM;qBACb;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO;oBACL,SAAS,EAAE;wBACT,OAAO,EAAE,KAAK;wBACd,YAAY,EACV,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;qBACzD;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {tool} from 'ai';\nimport {z} from 'zod';\nimport type {DashboardToolDeps} from './base-types';\nimport {createOrUpdateProfilerPanel} from './tool-helpers';\nimport {ProfilerPanelConfig} from '../dashboard/core-types';\n\nexport const ProfilerToolParameters = z.object({\n artifactId: z\n .string()\n .optional()\n .describe('Optional dashboard artifact ID. Defaults to current dashboard.'),\n tableName: z\n .string()\n .optional()\n .describe('Optional table name. Use when no table is selected yet.'),\n createArtifactIfMissing: z\n .boolean()\n .optional()\n .default(true)\n .describe('If true, create dashboard artifact if missing.'),\n panelId: z\n .string()\n .optional()\n .describe(\n 'Optional panel ID. If provided, updates the existing panel instead of creating new one.',\n ),\n title: z\n .string()\n .optional()\n .default('Profiler')\n .describe('Title for the profiler panel.'),\n config: ProfilerPanelConfig,\n reasoning: z.string().describe('Brief rationale for creating the profiler.'),\n});\n\nexport type ProfilerToolParams = z.infer<typeof ProfilerToolParameters>;\n\nexport function createProfilerTool(deps: DashboardToolDeps) {\n return tool({\n description: `Data profiler: displays table schema and statistics for all columns (count, distinct values, min/max, etc.).\n\nUse when: user asks to \"profile the data\", \"show table statistics\", \"what's in this table\", \"summarize columns\", \"give me an overview of the data\".\n\nUseful for: quick data exploration, understanding data quality, finding missing values, identifying column types.\n\nTo UPDATE an existing profiler: provide the panelId parameter. Otherwise creates new panel.`,\n inputSchema: ProfilerToolParameters,\n execute: async (params) => {\n try {\n const artifactId = deps.resolveArtifact(\n params.artifactId,\n params.createArtifactIfMissing,\n );\n const {tableName} = deps.resolveTable(artifactId, params.tableName);\n\n const result = createOrUpdateProfilerPanel(deps, {\n panelId: params.panelId,\n dashboardId: artifactId,\n tableName,\n title: params.title || 'Profiler',\n config: params.config,\n });\n\n return {\n llmResult: {\n success: true,\n details: params.panelId\n ? `Updated profiler \"${result.title}\".`\n : `Created profiler \"${result.title}\".`,\n data: result,\n },\n };\n } catch (error) {\n return {\n llmResult: {\n success: false,\n errorMessage:\n error instanceof Error ? error.message : String(error),\n },\n };\n }\n },\n });\n}\n"]}
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ import type { DashboardToolDeps } from './base-types';
3
+ export declare const RemovePanelToolParameters: z.ZodObject<{
4
+ artifactId: z.ZodOptional<z.ZodString>;
5
+ panelId: z.ZodString;
6
+ reasoning: z.ZodString;
7
+ }, z.core.$strip>;
8
+ export type RemovePanelToolParams = z.infer<typeof RemovePanelToolParameters>;
9
+ export declare function createRemovePanelTool(deps: DashboardToolDeps): import("ai").Tool<{
10
+ panelId: string;
11
+ reasoning: string;
12
+ artifactId?: string | undefined;
13
+ }, {
14
+ llmResult: {
15
+ success: boolean;
16
+ details: string;
17
+ data: {
18
+ artifactId: string;
19
+ panelId: string;
20
+ };
21
+ errorMessage?: undefined;
22
+ };
23
+ } | {
24
+ llmResult: {
25
+ success: boolean;
26
+ errorMessage: string;
27
+ details?: undefined;
28
+ data?: undefined;
29
+ };
30
+ }>;
31
+ //# sourceMappingURL=remove-panel-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-panel-tool.d.ts","sourceRoot":"","sources":["../../src/chart-types/remove-panel-tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAEpD,eAAO,MAAM,yBAAyB;;;;iBAWpC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE9E,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;GA+C5D"}
@@ -0,0 +1,55 @@
1
+ import { tool } from 'ai';
2
+ import { z } from 'zod';
3
+ export const RemovePanelToolParameters = z.object({
4
+ artifactId: z
5
+ .string()
6
+ .optional()
7
+ .describe('Optional dashboard artifact ID. Defaults to current dashboard.'),
8
+ panelId: z
9
+ .string()
10
+ .describe('ID of the panel to remove. Use list_dashboard_panels to discover panel IDs.'),
11
+ reasoning: z.string().describe('Brief rationale for removing this panel.'),
12
+ });
13
+ export function createRemovePanelTool(deps) {
14
+ return tool({
15
+ description: `Remove dashboard panel: deletes a panel from the dashboard by its ID.
16
+
17
+ Use when: user asks to "remove", "delete", "get rid of" a specific panel.
18
+
19
+ Use list_dashboard_panels first to discover panel IDs.`,
20
+ inputSchema: RemovePanelToolParameters,
21
+ execute: async (params) => {
22
+ try {
23
+ const artifactId = deps.resolveArtifact(params.artifactId);
24
+ const dashboard = deps.getDashboard(artifactId);
25
+ if (!dashboard) {
26
+ throw new Error(`Dashboard "${artifactId}" not found.`);
27
+ }
28
+ const panelExists = dashboard.panels.some((panel) => panel.id === params.panelId);
29
+ if (!panelExists) {
30
+ throw new Error(`Panel "${params.panelId}" not found in dashboard "${artifactId}". Cannot remove.`);
31
+ }
32
+ deps.removePanel(artifactId, params.panelId);
33
+ return {
34
+ llmResult: {
35
+ success: true,
36
+ details: `Removed panel "${params.panelId}" from dashboard.`,
37
+ data: {
38
+ artifactId,
39
+ panelId: params.panelId,
40
+ },
41
+ },
42
+ };
43
+ }
44
+ catch (error) {
45
+ return {
46
+ llmResult: {
47
+ success: false,
48
+ errorMessage: error instanceof Error ? error.message : String(error),
49
+ },
50
+ };
51
+ }
52
+ },
53
+ });
54
+ }
55
+ //# sourceMappingURL=remove-panel-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove-panel-tool.js","sourceRoot":"","sources":["../../src/chart-types/remove-panel-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AACxB,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,gEAAgE,CAAC;IAC7E,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,CACP,6EAA6E,CAC9E;IACH,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,0CAA0C,CAAC;CAC3E,CAAC,CAAC;AAIH,MAAM,UAAU,qBAAqB,CAAC,IAAuB;IAC3D,OAAO,IAAI,CAAC;QACV,WAAW,EAAE;;;;uDAIsC;QACnD,WAAW,EAAE,yBAAyB;QACtC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;YACxB,IAAI,CAAC;gBACH,MAAM,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;gBAC3D,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;gBAChD,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,MAAM,IAAI,KAAK,CAAC,cAAc,UAAU,cAAc,CAAC,CAAC;gBAC1D,CAAC;gBACD,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CACvC,CAAC,KAAmB,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,MAAM,CAAC,OAAO,CACrD,CAAC;gBACF,IAAI,CAAC,WAAW,EAAE,CAAC;oBACjB,MAAM,IAAI,KAAK,CACb,UAAU,MAAM,CAAC,OAAO,6BAA6B,UAAU,mBAAmB,CACnF,CAAC;gBACJ,CAAC;gBAED,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;gBAE7C,OAAO;oBACL,SAAS,EAAE;wBACT,OAAO,EAAE,IAAI;wBACb,OAAO,EAAE,kBAAkB,MAAM,CAAC,OAAO,mBAAmB;wBAC5D,IAAI,EAAE;4BACJ,UAAU;4BACV,OAAO,EAAE,MAAM,CAAC,OAAO;yBACxB;qBACF;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO;oBACL,SAAS,EAAE;wBACT,OAAO,EAAE,KAAK;wBACd,YAAY,EACV,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;qBACzD;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {tool} from 'ai';\nimport {z} from 'zod';\nimport type {DashboardToolDeps} from './base-types';\n\nexport const RemovePanelToolParameters = z.object({\n artifactId: z\n .string()\n .optional()\n .describe('Optional dashboard artifact ID. Defaults to current dashboard.'),\n panelId: z\n .string()\n .describe(\n 'ID of the panel to remove. Use list_dashboard_panels to discover panel IDs.',\n ),\n reasoning: z.string().describe('Brief rationale for removing this panel.'),\n});\n\nexport type RemovePanelToolParams = z.infer<typeof RemovePanelToolParameters>;\n\nexport function createRemovePanelTool(deps: DashboardToolDeps) {\n return tool({\n description: `Remove dashboard panel: deletes a panel from the dashboard by its ID.\n\nUse when: user asks to \"remove\", \"delete\", \"get rid of\" a specific panel.\n\nUse list_dashboard_panels first to discover panel IDs.`,\n inputSchema: RemovePanelToolParameters,\n execute: async (params) => {\n try {\n const artifactId = deps.resolveArtifact(params.artifactId);\n const dashboard = deps.getDashboard(artifactId);\n if (!dashboard) {\n throw new Error(`Dashboard \"${artifactId}\" not found.`);\n }\n const panelExists = dashboard.panels.some(\n (panel: {id: string}) => panel.id === params.panelId,\n );\n if (!panelExists) {\n throw new Error(\n `Panel \"${params.panelId}\" not found in dashboard \"${artifactId}\". Cannot remove.`,\n );\n }\n\n deps.removePanel(artifactId, params.panelId);\n\n return {\n llmResult: {\n success: true,\n details: `Removed panel \"${params.panelId}\" from dashboard.`,\n data: {\n artifactId,\n panelId: params.panelId,\n },\n },\n };\n } catch (error) {\n return {\n llmResult: {\n success: false,\n errorMessage:\n error instanceof Error ? error.message : String(error),\n },\n };\n }\n },\n });\n}\n"]}
@@ -0,0 +1,42 @@
1
+ import { z } from 'zod';
2
+ import type { DashboardToolDeps } from './base-types';
3
+ export declare const TextPanelToolParameters: z.ZodObject<{
4
+ artifactId: z.ZodOptional<z.ZodString>;
5
+ createArtifactIfMissing: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
6
+ panelId: z.ZodOptional<z.ZodString>;
7
+ title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
8
+ config: z.ZodObject<{
9
+ content: z.ZodDefault<z.ZodString>;
10
+ toolbarOpen: z.ZodDefault<z.ZodBoolean>;
11
+ sourcePanelOpen: z.ZodDefault<z.ZodBoolean>;
12
+ }, z.core.$strip>;
13
+ reasoning: z.ZodString;
14
+ }, z.core.$strip>;
15
+ export type TextPanelToolParams = z.infer<typeof TextPanelToolParameters>;
16
+ export declare function createTextPanelTool(deps: DashboardToolDeps): import("ai").Tool<{
17
+ createArtifactIfMissing: boolean;
18
+ title: string;
19
+ config: {
20
+ content: string;
21
+ toolbarOpen: boolean;
22
+ sourcePanelOpen: boolean;
23
+ };
24
+ reasoning: string;
25
+ artifactId?: string | undefined;
26
+ panelId?: string | undefined;
27
+ }, {
28
+ llmResult: {
29
+ success: boolean;
30
+ details: string;
31
+ data: import("./tool-helpers").PanelResult;
32
+ errorMessage?: undefined;
33
+ };
34
+ } | {
35
+ llmResult: {
36
+ success: boolean;
37
+ errorMessage: string;
38
+ details?: undefined;
39
+ data?: undefined;
40
+ };
41
+ }>;
42
+ //# sourceMappingURL=text-panel-tool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-panel-tool.d.ts","sourceRoot":"","sources":["../../src/chart-types/text-panel-tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAIpD,eAAO,MAAM,uBAAuB;;;;;;;;;;;iBAyBlC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE1E,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;GA8C1D"}
@@ -0,0 +1,71 @@
1
+ import { tool } from 'ai';
2
+ import { z } from 'zod';
3
+ import { createOrUpdateTextPanel } from './tool-helpers';
4
+ import { TextPanelConfig } from '../dashboard/core-types';
5
+ export const TextPanelToolParameters = z.object({
6
+ artifactId: z
7
+ .string()
8
+ .optional()
9
+ .describe('Optional dashboard artifact ID. Defaults to current dashboard.'),
10
+ createArtifactIfMissing: z
11
+ .boolean()
12
+ .optional()
13
+ .default(true)
14
+ .describe('If true, create dashboard artifact if missing.'),
15
+ panelId: z
16
+ .string()
17
+ .optional()
18
+ .describe('Optional panel ID. If provided, updates the existing panel instead of creating new one.'),
19
+ title: z
20
+ .string()
21
+ .optional()
22
+ .default('Text')
23
+ .describe('Title for the text panel.'),
24
+ config: TextPanelConfig,
25
+ reasoning: z
26
+ .string()
27
+ .describe('Brief rationale for creating the text panel.'),
28
+ });
29
+ export function createTextPanelTool(deps) {
30
+ return tool({
31
+ description: `Text panel: displays markdown-formatted text for annotations, insights, explanations, or dashboard headers.
32
+
33
+ Use when: user asks to "add text", "annotate findings", "add description", "summarize insights", or when you want to provide context for charts.
34
+
35
+ Supports Markdown: headings, lists, bold, italic, links, code blocks.
36
+
37
+ Best for: documenting insights discovered during data exploration, adding dashboard titles/sections, explaining chart findings.
38
+
39
+ To UPDATE an existing text panel: provide the panelId parameter. Otherwise creates new panel.`,
40
+ inputSchema: TextPanelToolParameters,
41
+ execute: async (params) => {
42
+ try {
43
+ const artifactId = deps.resolveArtifact(params.artifactId, params.createArtifactIfMissing);
44
+ const result = createOrUpdateTextPanel(deps, {
45
+ panelId: params.panelId,
46
+ dashboardId: artifactId,
47
+ title: params.title || 'Text',
48
+ config: params.config,
49
+ });
50
+ return {
51
+ llmResult: {
52
+ success: true,
53
+ details: params.panelId
54
+ ? `Updated text panel "${result.title}".`
55
+ : `Created text panel "${result.title}".`,
56
+ data: result,
57
+ },
58
+ };
59
+ }
60
+ catch (error) {
61
+ return {
62
+ llmResult: {
63
+ success: false,
64
+ errorMessage: error instanceof Error ? error.message : String(error),
65
+ },
66
+ };
67
+ }
68
+ },
69
+ });
70
+ }
71
+ //# sourceMappingURL=text-panel-tool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-panel-tool.js","sourceRoot":"","sources":["../../src/chart-types/text-panel-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAC,MAAM,IAAI,CAAC;AACxB,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,OAAO,EAAC,uBAAuB,EAAC,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,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AAC,KAAK,IAAI;4BACzC,CAAC,CAAC,uBAAuB,MAAM,CAAC,KAAK,IAAI;wBAC3C,IAAI,EAAE,MAAM;qBACb;iBACF,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO;oBACL,SAAS,EAAE;wBACT,OAAO,EAAE,KAAK;wBACd,YAAY,EACV,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;qBACzD;iBACF,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {tool} from 'ai';\nimport {z} from 'zod';\nimport type {DashboardToolDeps} from './base-types';\nimport {createOrUpdateTextPanel} from './tool-helpers';\nimport {TextPanelConfig} from '../dashboard/core-types';\n\nexport const TextPanelToolParameters = z.object({\n artifactId: z\n .string()\n .optional()\n .describe('Optional dashboard artifact ID. Defaults to current dashboard.'),\n createArtifactIfMissing: z\n .boolean()\n .optional()\n .default(true)\n .describe('If true, create dashboard artifact if missing.'),\n panelId: z\n .string()\n .optional()\n .describe(\n 'Optional panel ID. If provided, updates the existing panel instead of creating new one.',\n ),\n title: z\n .string()\n .optional()\n .default('Text')\n .describe('Title for the text panel.'),\n config: TextPanelConfig,\n reasoning: z\n .string()\n .describe('Brief rationale for creating the text panel.'),\n});\n\nexport type TextPanelToolParams = z.infer<typeof TextPanelToolParameters>;\n\nexport function createTextPanelTool(deps: DashboardToolDeps) {\n return tool({\n description: `Text panel: displays markdown-formatted text for annotations, insights, explanations, or dashboard headers.\n\nUse when: user asks to \"add text\", \"annotate findings\", \"add description\", \"summarize insights\", or when you want to provide context for charts.\n\nSupports Markdown: headings, lists, bold, italic, links, code blocks.\n\nBest for: documenting insights discovered during data exploration, adding dashboard titles/sections, explaining chart findings.\n\nTo UPDATE an existing text panel: provide the panelId parameter. Otherwise creates new panel.`,\n inputSchema: TextPanelToolParameters,\n execute: async (params) => {\n try {\n const artifactId = deps.resolveArtifact(\n params.artifactId,\n params.createArtifactIfMissing,\n );\n\n const result = createOrUpdateTextPanel(deps, {\n panelId: params.panelId,\n dashboardId: artifactId,\n title: params.title || 'Text',\n config: params.config,\n });\n\n return {\n llmResult: {\n success: true,\n details: params.panelId\n ? `Updated text panel \"${result.title}\".`\n : `Created text panel \"${result.title}\".`,\n data: result,\n },\n };\n } catch (error) {\n return {\n llmResult: {\n success: false,\n errorMessage:\n error instanceof Error ? error.message : String(error),\n },\n };\n }\n },\n });\n}\n"]}
@@ -0,0 +1,44 @@
1
+ import type { DashboardToolDeps } from './base-types';
2
+ import type { ProfilerPanelConfig, TextPanelConfig } from '../dashboard/core-types';
3
+ import type { ChartConfig } from './chart-config';
4
+ export interface PanelResult {
5
+ panelId: string;
6
+ artifactId: string;
7
+ title: string;
8
+ config: ChartConfig | ProfilerPanelConfig | TextPanelConfig;
9
+ }
10
+ export interface CreateOrUpdateChartPanelParams {
11
+ panelId?: string;
12
+ dashboardId: string;
13
+ tableName: string;
14
+ title: string;
15
+ config: ChartConfig;
16
+ }
17
+ export interface CreateOrUpdateProfilerPanelParams {
18
+ panelId?: string;
19
+ dashboardId: string;
20
+ tableName: string;
21
+ title: string;
22
+ config: ProfilerPanelConfig;
23
+ }
24
+ export interface CreateOrUpdateTextPanelParams {
25
+ panelId?: string;
26
+ dashboardId: string;
27
+ title: string;
28
+ config: TextPanelConfig;
29
+ }
30
+ /**
31
+ * Universal helper to create or update a chart panel.
32
+ * Handles everything: panel config creation, add/update logic, artifact switching.
33
+ * When updating, both source and config are updated to allow changing the data source.
34
+ */
35
+ export declare function createOrUpdateChartPanel(deps: DashboardToolDeps, params: CreateOrUpdateChartPanelParams): PanelResult;
36
+ /**
37
+ * Universal helper to create or update a profiler panel.
38
+ */
39
+ export declare function createOrUpdateProfilerPanel(deps: DashboardToolDeps, params: CreateOrUpdateProfilerPanelParams): PanelResult;
40
+ /**
41
+ * Universal helper to create or update a text panel.
42
+ */
43
+ export declare function createOrUpdateTextPanel(deps: DashboardToolDeps, params: CreateOrUpdateTextPanelParams): PanelResult;
44
+ //# sourceMappingURL=tool-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-helpers.d.ts","sourceRoot":"","sources":["../../src/chart-types/tool-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAOpD,OAAO,KAAK,EACV,mBAAmB,EACnB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAEhD,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,WAAW,GAAG,mBAAmB,GAAG,eAAe,CAAC;CAC7D;AAED,MAAM,WAAW,8BAA8B;IAC7C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,iCAAiC;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,mBAAmB,CAAC;CAC7B;AAED,MAAM,WAAW,6BAA6B;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,eAAe,CAAC;CACzB;AAkCD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,8BAA8B,GACrC,WAAW,CAoCb;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,iCAAiC,GACxC,WAAW,CAmCb;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,6BAA6B,GACpC,WAAW,CAmCb"}
@@ -0,0 +1,129 @@
1
+ import { createMosaicDashboardChartPanelConfig, createMosaicDashboardProfilerPanelConfig, createMosaicDashboardTextPanelConfig, } from '../dashboard/MosaicDashboardSlice';
2
+ /**
3
+ * Validates that a dashboard exists. Throws if not found.
4
+ */
5
+ function ensureDashboard(deps, dashboardId) {
6
+ const dashboard = deps.getDashboard(dashboardId);
7
+ if (!dashboard) {
8
+ throw new Error(`Dashboard "${dashboardId}" not found. Cannot update panel.`);
9
+ }
10
+ return dashboard;
11
+ }
12
+ /**
13
+ * Validates that a panel exists in a dashboard. Throws if not found.
14
+ */
15
+ function ensurePanel(dashboard, dashboardId, panelId) {
16
+ const panelExists = dashboard.panels.some((p) => p.id === panelId);
17
+ if (!panelExists) {
18
+ throw new Error(`Panel "${panelId}" not found in dashboard "${dashboardId}". Cannot update.`);
19
+ }
20
+ }
21
+ /**
22
+ * Universal helper to create or update a chart panel.
23
+ * Handles everything: panel config creation, add/update logic, artifact switching.
24
+ * When updating, both source and config are updated to allow changing the data source.
25
+ */
26
+ export function createOrUpdateChartPanel(deps, params) {
27
+ if (params.panelId) {
28
+ // Validate panel exists before attempting update
29
+ const dashboard = ensureDashboard(deps, params.dashboardId);
30
+ ensurePanel(dashboard, params.dashboardId, params.panelId);
31
+ // Update existing panel - update both source and config
32
+ deps.updatePanel(params.dashboardId, params.panelId, {
33
+ title: params.title,
34
+ source: { tableName: params.tableName },
35
+ config: params.config,
36
+ });
37
+ return {
38
+ panelId: params.panelId,
39
+ artifactId: params.dashboardId,
40
+ title: params.title,
41
+ config: params.config,
42
+ };
43
+ }
44
+ else {
45
+ // Create new panel - create config and add to dashboard
46
+ const panel = createMosaicDashboardChartPanelConfig(params.title, params.config);
47
+ const panelId = deps.addPanel(params.dashboardId, panel);
48
+ deps.setCurrentArtifact(params.dashboardId);
49
+ return {
50
+ panelId,
51
+ artifactId: params.dashboardId,
52
+ title: params.title,
53
+ config: params.config,
54
+ };
55
+ }
56
+ }
57
+ /**
58
+ * Universal helper to create or update a profiler panel.
59
+ */
60
+ export function createOrUpdateProfilerPanel(deps, params) {
61
+ if (params.panelId) {
62
+ // Validate panel exists before attempting update
63
+ const dashboard = ensureDashboard(deps, params.dashboardId);
64
+ ensurePanel(dashboard, params.dashboardId, params.panelId);
65
+ deps.updatePanel(params.dashboardId, params.panelId, {
66
+ config: params.config,
67
+ source: { tableName: params.tableName },
68
+ title: params.title,
69
+ });
70
+ return {
71
+ panelId: params.panelId,
72
+ artifactId: params.dashboardId,
73
+ title: params.title,
74
+ config: params.config,
75
+ };
76
+ }
77
+ else {
78
+ // Create new panel - create full panel config
79
+ const panel = createMosaicDashboardProfilerPanelConfig({
80
+ title: params.title,
81
+ config: params.config,
82
+ });
83
+ const panelId = deps.addPanel(params.dashboardId, panel);
84
+ deps.setCurrentArtifact(params.dashboardId);
85
+ return {
86
+ panelId,
87
+ artifactId: params.dashboardId,
88
+ title: panel.title,
89
+ config: panel.config,
90
+ };
91
+ }
92
+ }
93
+ /**
94
+ * Universal helper to create or update a text panel.
95
+ */
96
+ export function createOrUpdateTextPanel(deps, params) {
97
+ if (params.panelId) {
98
+ // Validate panel exists before attempting update
99
+ const dashboard = ensureDashboard(deps, params.dashboardId);
100
+ ensurePanel(dashboard, params.dashboardId, params.panelId);
101
+ // Update existing panel
102
+ deps.updatePanel(params.dashboardId, params.panelId, {
103
+ title: params.title,
104
+ config: params.config,
105
+ });
106
+ return {
107
+ panelId: params.panelId,
108
+ artifactId: params.dashboardId,
109
+ title: params.title,
110
+ config: params.config,
111
+ };
112
+ }
113
+ else {
114
+ // Create new panel - create full panel config
115
+ const panel = createMosaicDashboardTextPanelConfig({
116
+ title: params.title,
117
+ config: params.config,
118
+ });
119
+ const panelId = deps.addPanel(params.dashboardId, panel);
120
+ deps.setCurrentArtifact(params.dashboardId);
121
+ return {
122
+ panelId,
123
+ artifactId: params.dashboardId,
124
+ title: panel.title,
125
+ config: panel.config,
126
+ };
127
+ }
128
+ }
129
+ //# sourceMappingURL=tool-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tool-helpers.js","sourceRoot":"","sources":["../../src/chart-types/tool-helpers.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qCAAqC,EACrC,wCAAwC,EACxC,oCAAoC,GACrC,MAAM,mCAAmC,CAAC;AAsC3C;;GAEG;AACH,SAAS,eAAe,CACtB,IAAuB,EACvB,WAAmB;IAEnB,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IACjD,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,cAAc,WAAW,mCAAmC,CAC7D,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,SAAS,WAAW,CAClB,SAA+B,EAC/B,WAAmB,EACnB,OAAe;IAEf,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC;IACnE,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CACb,UAAU,OAAO,6BAA6B,WAAW,mBAAmB,CAC7E,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CACtC,IAAuB,EACvB,MAAsC;IAEtC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,iDAAiD;QACjD,MAAM,SAAS,GAAG,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;QAC5D,WAAW,CAAC,SAAS,EAAE,MAAM,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D,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,CAAC;QAEH,OAAO;YACL,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,UAAU,EAAE,MAAM,CAAC,WAAW;YAC9B,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,8CAA8C;QAC9C,MAAM,KAAK,GAAG,oCAAoC,CAAC;YACjD,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QACzD,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAE5C,OAAO;YACL,OAAO;YACP,UAAU,EAAE,MAAM,CAAC,WAAW;YAC9B,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,MAAM,EAAE,KAAK,CAAC,MAAM;SACrB,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["import type {DashboardToolDeps} from './base-types';\nimport {\n createMosaicDashboardChartPanelConfig,\n createMosaicDashboardProfilerPanelConfig,\n createMosaicDashboardTextPanelConfig,\n} from '../dashboard/MosaicDashboardSlice';\nimport {MosaicDashboardEntry} from '../dashboard/dashboard-types';\nimport type {\n ProfilerPanelConfig,\n TextPanelConfig,\n} from '../dashboard/core-types';\nimport type {ChartConfig} from './chart-config';\n\nexport interface PanelResult {\n panelId: string;\n artifactId: string;\n title: string;\n config: ChartConfig | ProfilerPanelConfig | TextPanelConfig;\n}\n\nexport interface CreateOrUpdateChartPanelParams {\n panelId?: string;\n dashboardId: string;\n tableName: string;\n title: string;\n config: ChartConfig;\n}\n\nexport interface CreateOrUpdateProfilerPanelParams {\n panelId?: string;\n dashboardId: string;\n tableName: string;\n title: string;\n config: ProfilerPanelConfig;\n}\n\nexport interface CreateOrUpdateTextPanelParams {\n panelId?: string;\n dashboardId: string;\n title: string;\n config: TextPanelConfig;\n}\n\n/**\n * Validates that a dashboard exists. Throws if not found.\n */\nfunction ensureDashboard(\n deps: DashboardToolDeps,\n dashboardId: string,\n): NonNullable<ReturnType<DashboardToolDeps['getDashboard']>> {\n const dashboard = deps.getDashboard(dashboardId);\n if (!dashboard) {\n throw new Error(\n `Dashboard \"${dashboardId}\" not found. Cannot update panel.`,\n );\n }\n return dashboard;\n}\n\n/**\n * Validates that a panel exists in a dashboard. Throws if not found.\n */\nfunction ensurePanel(\n dashboard: MosaicDashboardEntry,\n dashboardId: string,\n panelId: string,\n): void {\n const panelExists = dashboard.panels.some((p) => p.id === panelId);\n if (!panelExists) {\n throw new Error(\n `Panel \"${panelId}\" not found in dashboard \"${dashboardId}\". Cannot update.`,\n );\n }\n}\n\n/**\n * Universal helper to create or update a chart panel.\n * Handles everything: panel config creation, add/update logic, artifact switching.\n * When updating, both source and config are updated to allow changing the data source.\n */\nexport function createOrUpdateChartPanel(\n deps: DashboardToolDeps,\n params: CreateOrUpdateChartPanelParams,\n): PanelResult {\n if (params.panelId) {\n // Validate panel exists before attempting update\n const dashboard = ensureDashboard(deps, params.dashboardId);\n ensurePanel(dashboard, params.dashboardId, params.panelId);\n\n // Update existing panel - update both source and config\n deps.updatePanel(params.dashboardId, params.panelId, {\n title: params.title,\n source: {tableName: params.tableName},\n config: params.config,\n });\n\n return {\n panelId: params.panelId,\n artifactId: params.dashboardId,\n title: params.title,\n config: params.config,\n };\n } else {\n // Create new panel - create config and add to dashboard\n const panel = createMosaicDashboardChartPanelConfig(\n params.title,\n params.config,\n );\n\n const panelId = deps.addPanel(params.dashboardId, panel);\n deps.setCurrentArtifact(params.dashboardId);\n\n return {\n panelId,\n artifactId: params.dashboardId,\n title: params.title,\n config: params.config,\n };\n }\n}\n\n/**\n * Universal helper to create or update a profiler panel.\n */\nexport function createOrUpdateProfilerPanel(\n deps: DashboardToolDeps,\n params: CreateOrUpdateProfilerPanelParams,\n): PanelResult {\n if (params.panelId) {\n // Validate panel exists before attempting update\n const dashboard = ensureDashboard(deps, params.dashboardId);\n ensurePanel(dashboard, params.dashboardId, params.panelId);\n\n deps.updatePanel(params.dashboardId, params.panelId, {\n config: params.config,\n source: {tableName: params.tableName},\n title: params.title,\n });\n\n return {\n panelId: params.panelId,\n artifactId: params.dashboardId,\n title: params.title,\n config: params.config,\n };\n } else {\n // Create new panel - create full panel config\n const panel = createMosaicDashboardProfilerPanelConfig({\n title: params.title,\n config: params.config,\n });\n\n const panelId = deps.addPanel(params.dashboardId, panel);\n deps.setCurrentArtifact(params.dashboardId);\n\n return {\n panelId,\n artifactId: params.dashboardId,\n title: panel.title,\n config: panel.config,\n };\n }\n}\n\n/**\n * Universal helper to create or update a text panel.\n */\nexport function createOrUpdateTextPanel(\n deps: DashboardToolDeps,\n params: CreateOrUpdateTextPanelParams,\n): PanelResult {\n if (params.panelId) {\n // Validate panel exists before attempting update\n const dashboard = ensureDashboard(deps, params.dashboardId);\n ensurePanel(dashboard, params.dashboardId, params.panelId);\n\n // Update existing panel\n deps.updatePanel(params.dashboardId, params.panelId, {\n title: params.title,\n config: params.config,\n });\n\n return {\n panelId: params.panelId,\n artifactId: params.dashboardId,\n title: params.title,\n config: params.config,\n };\n } else {\n // Create new panel - create full panel config\n const panel = createMosaicDashboardTextPanelConfig({\n title: params.title,\n config: params.config,\n });\n\n const panelId = deps.addPanel(params.dashboardId, panel);\n deps.setCurrentArtifact(params.dashboardId);\n\n return {\n panelId,\n artifactId: params.dashboardId,\n title: panel.title,\n config: panel.config,\n };\n }\n}\n"]}
@@ -3,6 +3,7 @@ export declare const BaseChartToolParameters: z.ZodObject<{
3
3
  artifactId: z.ZodOptional<z.ZodString>;
4
4
  tableName: z.ZodOptional<z.ZodString>;
5
5
  createArtifactIfMissing: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
6
+ panelId: z.ZodOptional<z.ZodString>;
6
7
  reasoning: z.ZodString;
7
8
  }, z.core.$strip>;
8
9
  //# sourceMappingURL=tool-schemas.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-schemas.d.ts","sourceRoot":"","sources":["../../src/chart-types/tool-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,uBAAuB;;;;;iBAelC,CAAC"}
1
+ {"version":3,"file":"tool-schemas.d.ts","sourceRoot":"","sources":["../../src/chart-types/tool-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,uBAAuB;;;;;;iBAuBlC,CAAC"}
@@ -3,7 +3,7 @@ export const BaseChartToolParameters = z.object({
3
3
  artifactId: z
4
4
  .string()
5
5
  .optional()
6
- .describe('Optional dashboard artifact ID. Defaults to current dashboard.'),
6
+ .describe('Optional dashboard artifact ID. Prefer passing this explicitly; if omitted, the host may use an unambiguous primary dashboard context.'),
7
7
  tableName: z
8
8
  .string()
9
9
  .optional()
@@ -13,6 +13,10 @@ export const BaseChartToolParameters = z.object({
13
13
  .optional()
14
14
  .default(true)
15
15
  .describe('If true, create dashboard artifact if missing.'),
16
+ panelId: z
17
+ .string()
18
+ .optional()
19
+ .describe('Optional panel ID. If provided, updates the existing panel instead of creating new one.'),
16
20
  reasoning: z.string().describe('Brief rationale for the chart choice.'),
17
21
  });
18
22
  //# sourceMappingURL=tool-schemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tool-schemas.js","sourceRoot":"","sources":["../../src/chart-types/tool-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,gEAAgE,CAAC;IAC7E,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,yDAAyD,CAAC;IACtE,uBAAuB,EAAE,CAAC;SACvB,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CAAC,gDAAgD,CAAC;IAC7D,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;CACxE,CAAC,CAAC","sourcesContent":["import {z} from 'zod';\n\nexport const BaseChartToolParameters = z.object({\n artifactId: z\n .string()\n .optional()\n .describe('Optional dashboard artifact ID. Defaults to current dashboard.'),\n tableName: z\n .string()\n .optional()\n .describe('Optional table name. Use when no table is selected yet.'),\n createArtifactIfMissing: z\n .boolean()\n .optional()\n .default(true)\n .describe('If true, create dashboard artifact if missing.'),\n reasoning: z.string().describe('Brief rationale for the chart choice.'),\n});\n"]}
1
+ {"version":3,"file":"tool-schemas.js","sourceRoot":"","sources":["../../src/chart-types/tool-schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,wIAAwI,CACzI;IACH,SAAS,EAAE,CAAC;SACT,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CAAC,yDAAyD,CAAC;IACtE,uBAAuB,EAAE,CAAC;SACvB,OAAO,EAAE;SACT,QAAQ,EAAE;SACV,OAAO,CAAC,IAAI,CAAC;SACb,QAAQ,CAAC,gDAAgD,CAAC;IAC7D,OAAO,EAAE,CAAC;SACP,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,yFAAyF,CAC1F;IACH,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uCAAuC,CAAC;CACxE,CAAC,CAAC","sourcesContent":["import {z} from 'zod';\n\nexport const BaseChartToolParameters = z.object({\n artifactId: z\n .string()\n .optional()\n .describe(\n 'Optional dashboard artifact ID. Prefer passing this explicitly; if omitted, the host may use an unambiguous primary dashboard context.',\n ),\n tableName: z\n .string()\n .optional()\n .describe('Optional table name. Use when no table is selected yet.'),\n createArtifactIfMissing: z\n .boolean()\n .optional()\n .default(true)\n .describe('If true, create dashboard artifact if missing.'),\n panelId: z\n .string()\n .optional()\n .describe(\n 'Optional panel ID. If provided, updates the existing panel instead of creating new one.',\n ),\n reasoning: z.string().describe('Brief rationale for the chart choice.'),\n});\n"]}
@@ -1,12 +1,15 @@
1
1
  import { PropsWithChildren, ReactElement } from 'react';
2
2
  import { MosaicDashboardPanels } from './MosaicDashboardPanels';
3
- import { MosaicDashboardToolbar } from './MosaicDashboardToolbar';
3
+ import { MosaicDashboardToolbar } from './toolbar/MosaicDashboardToolbar';
4
+ import type { MosaicDashboardInitialStateProps } from './initial-state/MosaicDashboardInitialState';
4
5
  export type MosaicDashboardRootProps = PropsWithChildren<{
5
6
  dashboardId: string;
7
+ onStart?: MosaicDashboardInitialStateProps['onStart'];
6
8
  }>;
7
- export declare function MosaicDashboardRoot({ children, dashboardId, }: MosaicDashboardRootProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare function MosaicDashboardRoot({ children, dashboardId, onStart, }: MosaicDashboardRootProps): import("react/jsx-runtime").JSX.Element;
8
10
  export type MosaicDashboardProps = {
9
11
  dashboardId: string;
12
+ onStart?: MosaicDashboardInitialStateProps['onStart'];
10
13
  };
11
14
  type MosaicDashboardCompoundComponent = ((props: MosaicDashboardProps) => ReactElement) & {
12
15
  Root: typeof MosaicDashboardRoot;
@@ -1 +1 @@
1
- {"version":3,"file":"MosaicDashboard.d.ts","sourceRoot":"","sources":["../../src/dashboard/MosaicDashboard.tsx"],"names":[],"mappings":"A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