@sqlrooms/deck 0.29.0-rc.10

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 (251) hide show
  1. package/LICENSE.md +10 -0
  2. package/README.md +654 -0
  3. package/dist/BlockMapSettings.d.ts +3 -0
  4. package/dist/BlockMapSettings.d.ts.map +1 -0
  5. package/dist/BlockMapSettings.js +57 -0
  6. package/dist/BlockMapSettings.js.map +1 -0
  7. package/dist/DashboardMapSettings.d.ts +7 -0
  8. package/dist/DashboardMapSettings.d.ts.map +1 -0
  9. package/dist/DashboardMapSettings.js +52 -0
  10. package/dist/DashboardMapSettings.js.map +1 -0
  11. package/dist/DeckJsonMap.d.ts +4 -0
  12. package/dist/DeckJsonMap.d.ts.map +1 -0
  13. package/dist/DeckJsonMap.js +370 -0
  14. package/dist/DeckJsonMap.js.map +1 -0
  15. package/dist/DeckJsonMapSpec.d.ts +7617 -0
  16. package/dist/DeckJsonMapSpec.d.ts.map +1 -0
  17. package/dist/DeckJsonMapSpec.js +82 -0
  18. package/dist/DeckJsonMapSpec.js.map +1 -0
  19. package/dist/DeckMapDefaultStylesProvider.d.ts +28 -0
  20. package/dist/DeckMapDefaultStylesProvider.d.ts.map +1 -0
  21. package/dist/DeckMapDefaultStylesProvider.js +23 -0
  22. package/dist/DeckMapDefaultStylesProvider.js.map +1 -0
  23. package/dist/DeckMapSurface.d.ts +39 -0
  24. package/dist/DeckMapSurface.d.ts.map +1 -0
  25. package/dist/DeckMapSurface.js +137 -0
  26. package/dist/DeckMapSurface.js.map +1 -0
  27. package/dist/DeckMapsSlice.d.ts +99 -0
  28. package/dist/DeckMapsSlice.d.ts.map +1 -0
  29. package/dist/DeckMapsSlice.js +89 -0
  30. package/dist/DeckMapsSlice.js.map +1 -0
  31. package/dist/MapSettings.d.ts +16 -0
  32. package/dist/MapSettings.d.ts.map +1 -0
  33. package/dist/MapSettings.js +292 -0
  34. package/dist/MapSettings.js.map +1 -0
  35. package/dist/MapSettingsControls.d.ts +40 -0
  36. package/dist/MapSettingsControls.d.ts.map +1 -0
  37. package/dist/MapSettingsControls.js +54 -0
  38. package/dist/MapSettingsControls.js.map +1 -0
  39. package/dist/ai.d.ts +261 -0
  40. package/dist/ai.d.ts.map +1 -0
  41. package/dist/ai.js +392 -0
  42. package/dist/ai.js.map +1 -0
  43. package/dist/block.d.ts +21 -0
  44. package/dist/block.d.ts.map +1 -0
  45. package/dist/block.js +105 -0
  46. package/dist/block.js.map +1 -0
  47. package/dist/blockDocumentRegistration.d.ts +45 -0
  48. package/dist/blockDocumentRegistration.d.ts.map +1 -0
  49. package/dist/blockDocumentRegistration.js +68 -0
  50. package/dist/blockDocumentRegistration.js.map +1 -0
  51. package/dist/createDeckJsonSpecFromDatasets.d.ts +11 -0
  52. package/dist/createDeckJsonSpecFromDatasets.d.ts.map +1 -0
  53. package/dist/createDeckJsonSpecFromDatasets.js +85 -0
  54. package/dist/createDeckJsonSpecFromDatasets.js.map +1 -0
  55. package/dist/createOrUpdateDeckMapResource.d.ts +81 -0
  56. package/dist/createOrUpdateDeckMapResource.d.ts.map +1 -0
  57. package/dist/createOrUpdateDeckMapResource.js +82 -0
  58. package/dist/createOrUpdateDeckMapResource.js.map +1 -0
  59. package/dist/dashboard.d.ts +6 -0
  60. package/dist/dashboard.d.ts.map +1 -0
  61. package/dist/dashboard.js +337 -0
  62. package/dist/dashboard.js.map +1 -0
  63. package/dist/dashboardConfig.d.ts +25 -0
  64. package/dist/dashboardConfig.d.ts.map +1 -0
  65. package/dist/dashboardConfig.js +82 -0
  66. package/dist/dashboardConfig.js.map +1 -0
  67. package/dist/dashboardIntegration.d.ts +3 -0
  68. package/dist/dashboardIntegration.d.ts.map +1 -0
  69. package/dist/dashboardIntegration.js +16 -0
  70. package/dist/dashboardIntegration.js.map +1 -0
  71. package/dist/datasetSourceUtils.d.ts +16 -0
  72. package/dist/datasetSourceUtils.d.ts.map +1 -0
  73. package/dist/datasetSourceUtils.js +25 -0
  74. package/dist/datasetSourceUtils.js.map +1 -0
  75. package/dist/datasets/PreparedDatasetStore.d.ts +120 -0
  76. package/dist/datasets/PreparedDatasetStore.d.ts.map +1 -0
  77. package/dist/datasets/PreparedDatasetStore.js +268 -0
  78. package/dist/datasets/PreparedDatasetStore.js.map +1 -0
  79. package/dist/datasets/helpers.d.ts +57 -0
  80. package/dist/datasets/helpers.d.ts.map +1 -0
  81. package/dist/datasets/helpers.js +155 -0
  82. package/dist/datasets/helpers.js.map +1 -0
  83. package/dist/datasets/normalizeDatasets.d.ts +11 -0
  84. package/dist/datasets/normalizeDatasets.d.ts.map +1 -0
  85. package/dist/datasets/normalizeDatasets.js +50 -0
  86. package/dist/datasets/normalizeDatasets.js.map +1 -0
  87. package/dist/datasets/tableAdapter.d.ts +11 -0
  88. package/dist/datasets/tableAdapter.d.ts.map +1 -0
  89. package/dist/datasets/tableAdapter.js +11 -0
  90. package/dist/datasets/tableAdapter.js.map +1 -0
  91. package/dist/datasets/tableDatasetSql.d.ts +16 -0
  92. package/dist/datasets/tableDatasetSql.d.ts.map +1 -0
  93. package/dist/datasets/tableDatasetSql.js +49 -0
  94. package/dist/datasets/tableDatasetSql.js.map +1 -0
  95. package/dist/datasets/types.d.ts +40 -0
  96. package/dist/datasets/types.d.ts.map +1 -0
  97. package/dist/datasets/types.js +2 -0
  98. package/dist/datasets/types.js.map +1 -0
  99. package/dist/datasets/usePreparedDatasetStates.d.ts +16 -0
  100. package/dist/datasets/usePreparedDatasetStates.d.ts.map +1 -0
  101. package/dist/datasets/usePreparedDatasetStates.js +59 -0
  102. package/dist/datasets/usePreparedDatasetStates.js.map +1 -0
  103. package/dist/index.d.ts +34 -0
  104. package/dist/index.d.ts.map +1 -0
  105. package/dist/index.js +27 -0
  106. package/dist/index.js.map +1 -0
  107. package/dist/json/aggregateWaypoints.d.ts +14 -0
  108. package/dist/json/aggregateWaypoints.d.ts.map +1 -0
  109. package/dist/json/aggregateWaypoints.js +190 -0
  110. package/dist/json/aggregateWaypoints.js.map +1 -0
  111. package/dist/json/colorScaleFunction.d.ts +27 -0
  112. package/dist/json/colorScaleFunction.d.ts.map +1 -0
  113. package/dist/json/colorScaleFunction.js +46 -0
  114. package/dist/json/colorScaleFunction.js.map +1 -0
  115. package/dist/json/compileColorScale.d.ts +12 -0
  116. package/dist/json/compileColorScale.d.ts.map +1 -0
  117. package/dist/json/compileColorScale.js +125 -0
  118. package/dist/json/compileColorScale.js.map +1 -0
  119. package/dist/json/compileGeoArrowAccessor.d.ts +18 -0
  120. package/dist/json/compileGeoArrowAccessor.d.ts.map +1 -0
  121. package/dist/json/compileGeoArrowAccessor.js +129 -0
  122. package/dist/json/compileGeoArrowAccessor.js.map +1 -0
  123. package/dist/json/createDeckJsonConfiguration.d.ts +9 -0
  124. package/dist/json/createDeckJsonConfiguration.d.ts.map +1 -0
  125. package/dist/json/createDeckJsonConfiguration.js +315 -0
  126. package/dist/json/createDeckJsonConfiguration.js.map +1 -0
  127. package/dist/json/defaultClasses.d.ts +12 -0
  128. package/dist/json/defaultClasses.d.ts.map +1 -0
  129. package/dist/json/defaultClasses.js +35 -0
  130. package/dist/json/defaultClasses.js.map +1 -0
  131. package/dist/json/extractColorScaleLegends.d.ts +8 -0
  132. package/dist/json/extractColorScaleLegends.d.ts.map +1 -0
  133. package/dist/json/extractColorScaleLegends.js +86 -0
  134. package/dist/json/extractColorScaleLegends.js.map +1 -0
  135. package/dist/json/heatmapDefaults.d.ts +8 -0
  136. package/dist/json/heatmapDefaults.d.ts.map +1 -0
  137. package/dist/json/heatmapDefaults.js +14 -0
  138. package/dist/json/heatmapDefaults.js.map +1 -0
  139. package/dist/json/layerCompatibility.d.ts +21 -0
  140. package/dist/json/layerCompatibility.d.ts.map +1 -0
  141. package/dist/json/layerCompatibility.js +168 -0
  142. package/dist/json/layerCompatibility.js.map +1 -0
  143. package/dist/json/layerConfig.d.ts +14 -0
  144. package/dist/json/layerConfig.d.ts.map +1 -0
  145. package/dist/json/layerConfig.js +54 -0
  146. package/dist/json/layerConfig.js.map +1 -0
  147. package/dist/json/layers/DeckColumnLayer.d.ts +10 -0
  148. package/dist/json/layers/DeckColumnLayer.d.ts.map +1 -0
  149. package/dist/json/layers/DeckColumnLayer.js +26 -0
  150. package/dist/json/layers/DeckColumnLayer.js.map +1 -0
  151. package/dist/json/layers/DeckH3HexagonLayer.d.ts +37 -0
  152. package/dist/json/layers/DeckH3HexagonLayer.d.ts.map +1 -0
  153. package/dist/json/layers/DeckH3HexagonLayer.js +118 -0
  154. package/dist/json/layers/DeckH3HexagonLayer.js.map +1 -0
  155. package/dist/json/layers/DeckTripsLayer.d.ts +46 -0
  156. package/dist/json/layers/DeckTripsLayer.d.ts.map +1 -0
  157. package/dist/json/layers/DeckTripsLayer.js +170 -0
  158. package/dist/json/layers/DeckTripsLayer.js.map +1 -0
  159. package/dist/json/layers/createTableToRecordBatchAdapter.d.ts +20 -0
  160. package/dist/json/layers/createTableToRecordBatchAdapter.d.ts.map +1 -0
  161. package/dist/json/layers/createTableToRecordBatchAdapter.js +81 -0
  162. package/dist/json/layers/createTableToRecordBatchAdapter.js.map +1 -0
  163. package/dist/json/layers/index.d.ts +5 -0
  164. package/dist/json/layers/index.d.ts.map +1 -0
  165. package/dist/json/layers/index.js +5 -0
  166. package/dist/json/layers/index.js.map +1 -0
  167. package/dist/json/rewriteGeoArrowAccessors.d.ts +7 -0
  168. package/dist/json/rewriteGeoArrowAccessors.d.ts.map +1 -0
  169. package/dist/json/rewriteGeoArrowAccessors.js +55 -0
  170. package/dist/json/rewriteGeoArrowAccessors.js.map +1 -0
  171. package/dist/mapAiConfig.d.ts +111 -0
  172. package/dist/mapAiConfig.d.ts.map +1 -0
  173. package/dist/mapAiConfig.js +69 -0
  174. package/dist/mapAiConfig.js.map +1 -0
  175. package/dist/mapConfig.d.ts +73 -0
  176. package/dist/mapConfig.d.ts.map +1 -0
  177. package/dist/mapConfig.js +47 -0
  178. package/dist/mapConfig.js.map +1 -0
  179. package/dist/mapConfigUtils.d.ts +111 -0
  180. package/dist/mapConfigUtils.d.ts.map +1 -0
  181. package/dist/mapConfigUtils.js +502 -0
  182. package/dist/mapConfigUtils.js.map +1 -0
  183. package/dist/mapDataPolicy.d.ts +9 -0
  184. package/dist/mapDataPolicy.d.ts.map +1 -0
  185. package/dist/mapDataPolicy.js +25 -0
  186. package/dist/mapDataPolicy.js.map +1 -0
  187. package/dist/mapFit.d.ts +62 -0
  188. package/dist/mapFit.d.ts.map +1 -0
  189. package/dist/mapFit.js +325 -0
  190. package/dist/mapFit.js.map +1 -0
  191. package/dist/mapLayerConfigUtils.d.ts +54 -0
  192. package/dist/mapLayerConfigUtils.d.ts.map +1 -0
  193. package/dist/mapLayerConfigUtils.js +296 -0
  194. package/dist/mapLayerConfigUtils.js.map +1 -0
  195. package/dist/mapResourceAuthoring.d.ts +40 -0
  196. package/dist/mapResourceAuthoring.d.ts.map +1 -0
  197. package/dist/mapResourceAuthoring.js +266 -0
  198. package/dist/mapResourceAuthoring.js.map +1 -0
  199. package/dist/mosaic.d.ts +9 -0
  200. package/dist/mosaic.d.ts.map +1 -0
  201. package/dist/mosaic.js +8 -0
  202. package/dist/mosaic.js.map +1 -0
  203. package/dist/prepare/detectGeometryColumn.d.ts +19 -0
  204. package/dist/prepare/detectGeometryColumn.d.ts.map +1 -0
  205. package/dist/prepare/detectGeometryColumn.js +126 -0
  206. package/dist/prepare/detectGeometryColumn.js.map +1 -0
  207. package/dist/prepare/geoarrow.d.ts +18 -0
  208. package/dist/prepare/geoarrow.d.ts.map +1 -0
  209. package/dist/prepare/geoarrow.js +114 -0
  210. package/dist/prepare/geoarrow.js.map +1 -0
  211. package/dist/prepare/geometryDecoder.d.ts +8 -0
  212. package/dist/prepare/geometryDecoder.d.ts.map +1 -0
  213. package/dist/prepare/geometryDecoder.js +2 -0
  214. package/dist/prepare/geometryDecoder.js.map +1 -0
  215. package/dist/prepare/prepareDeckDataset.d.ts +57 -0
  216. package/dist/prepare/prepareDeckDataset.d.ts.map +1 -0
  217. package/dist/prepare/prepareDeckDataset.js +112 -0
  218. package/dist/prepare/prepareDeckDataset.js.map +1 -0
  219. package/dist/prepare/toGeoJsonBinary.d.ts +9 -0
  220. package/dist/prepare/toGeoJsonBinary.d.ts.map +1 -0
  221. package/dist/prepare/toGeoJsonBinary.js +26 -0
  222. package/dist/prepare/toGeoJsonBinary.js.map +1 -0
  223. package/dist/prepare/types.d.ts +25 -0
  224. package/dist/prepare/types.d.ts.map +1 -0
  225. package/dist/prepare/types.js +2 -0
  226. package/dist/prepare/types.js.map +1 -0
  227. package/dist/prepare/wkbDecoder.d.ts +3 -0
  228. package/dist/prepare/wkbDecoder.d.ts.map +1 -0
  229. package/dist/prepare/wkbDecoder.js +419 -0
  230. package/dist/prepare/wkbDecoder.js.map +1 -0
  231. package/dist/prepare/wkbParser.d.ts +24 -0
  232. package/dist/prepare/wkbParser.d.ts.map +1 -0
  233. package/dist/prepare/wkbParser.js +139 -0
  234. package/dist/prepare/wkbParser.js.map +1 -0
  235. package/dist/types.d.ts +92 -0
  236. package/dist/types.d.ts.map +1 -0
  237. package/dist/types.js +11 -0
  238. package/dist/types.js.map +1 -0
  239. package/dist/useDeckMapDatasetSchema.d.ts +33 -0
  240. package/dist/useDeckMapDatasetSchema.d.ts.map +1 -0
  241. package/dist/useDeckMapDatasetSchema.js +138 -0
  242. package/dist/useDeckMapDatasetSchema.js.map +1 -0
  243. package/dist/useDeckMapDatasets.d.ts +17 -0
  244. package/dist/useDeckMapDatasets.d.ts.map +1 -0
  245. package/dist/useDeckMapDatasets.js +69 -0
  246. package/dist/useDeckMapDatasets.js.map +1 -0
  247. package/dist/useDeckMapFitToBounds.d.ts +31 -0
  248. package/dist/useDeckMapFitToBounds.d.ts.map +1 -0
  249. package/dist/useDeckMapFitToBounds.js +58 -0
  250. package/dist/useDeckMapFitToBounds.js.map +1 -0
  251. package/package.json +98 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MapSettingsControls.js","sourceRoot":"","sources":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nQuantitative,\n type DataTable,\n type TableColumn,\n} from '@sqlrooms/duckdb';\nimport {\n Button,\n cn,\n Combobox,\n CopyButton,\n ScrollArea,\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from '@sqlrooms/ui';\nimport {CodeIcon, TableIcon} from 'lucide-react';\nimport {\n createContext,\n useContext,\n type FC,\n type PropsWithChildren,\n} from 'react';\n\nexport const DeckMapSettingsField: FC<\n PropsWithChildren<{label: string; required?: boolean}>\n> = ({label, required, children}) => (\n <div className=\"flex flex-col gap-1\">\n <label className=\"text-xs font-medium\">\n {label}\n {required && <span className=\"text-destructive ml-1\">*</span>}\n </label>\n <div className=\"grid items-end gap-2\">{children}</div>\n </div>\n);\n\nexport type DeckMapColumnKind =\n | 'all'\n | 'numeric'\n | 'quantitative'\n | 'categorical';\n\nexport function filterDeckMapColumns(\n columns: TableColumn[],\n kind: DeckMapColumnKind,\n) {\n if (kind === 'all') return columns;\n return columns.filter((column) => {\n if (!column.type) return false;\n if (kind === 'numeric') return isColumnNumeric(column.type);\n if (kind === 'quantitative') return isColumnQuantitative(column.type);\n return isColumnCategorical(column.type);\n });\n}\n\nconst DeckMapColumnsContext = createContext<TableColumn[]>([]);\n\nexport const DeckMapColumnsProvider: FC<\n PropsWithChildren<{columns: TableColumn[]}>\n> = ({columns, children}) => (\n <DeckMapColumnsContext.Provider value={columns}>\n {children}\n </DeckMapColumnsContext.Provider>\n);\n\nexport type DeckMapColumnSelectorProps = {\n columns?: TableColumn[];\n kind?: DeckMapColumnKind;\n value?: string;\n onChange: (value: string) => void;\n placeholder?: string;\n disabled?: boolean;\n};\n\nconst DeckMapColumnSelectorRoot: FC<DeckMapColumnSelectorProps> = ({\n columns,\n kind = 'all',\n value,\n onChange,\n placeholder = 'Select column…',\n disabled,\n}) => {\n const contextColumns = useContext(DeckMapColumnsContext);\n const options = filterDeckMapColumns(columns ?? contextColumns, kind);\n const selectedColumn = options.find((column) => column.name === value);\n const isMissing = Boolean(value && !selectedColumn);\n return (\n <Combobox value={value ?? ''} onChange={onChange} disabled={disabled}>\n <Combobox.Trigger\n className={cn(\n 'w-full',\n isMissing && 'border-destructive/60 bg-destructive/5',\n )}\n >\n {selectedColumn ? (\n <span className=\"flex min-w-0 items-baseline gap-1\">\n <span className=\"truncate\">{selectedColumn.name}</span>\n <span className=\"text-muted-foreground truncate text-[8px]\">\n {selectedColumn.type}\n </span>\n </span>\n ) : value ? (\n <span className=\"text-destructive truncate\">{value} (missing)</span>\n ) : (\n <span className=\"text-muted-foreground truncate\">{placeholder}</span>\n )}\n </Combobox.Trigger>\n <Combobox.Content\n searchable\n searchPlaceholder=\"Search columns...\"\n emptyMessage=\"No matching column.\"\n >\n {options.map((column) => (\n <Combobox.Item key={column.name} value={column.name}>\n <span className=\"truncate\">{column.name}</span>\n <span className=\"text-muted-foreground ml-auto text-[8px]\">\n {column.type}\n </span>\n </Combobox.Item>\n ))}\n </Combobox.Content>\n </Combobox>\n );\n};\n\nexport const DeckMapColumnSelector = Object.assign(DeckMapColumnSelectorRoot, {\n Numeric: (props: Omit<DeckMapColumnSelectorProps, 'kind'>) => (\n <DeckMapColumnSelectorRoot {...props} kind=\"numeric\" />\n ),\n Quantitative: (props: Omit<DeckMapColumnSelectorProps, 'kind'>) => (\n <DeckMapColumnSelectorRoot {...props} kind=\"quantitative\" />\n ),\n Categorical: (props: Omit<DeckMapColumnSelectorProps, 'kind'>) => (\n <DeckMapColumnSelectorRoot {...props} kind=\"categorical\" />\n ),\n});\n\nexport const DeckMapTableSelector: FC<{\n tables: DataTable[];\n value?: DataTable;\n onChange: (table: DataTable) => void;\n disabled?: boolean;\n}> = ({tables, value, onChange, disabled}) => {\n const identity = value ? getTableIdentity(value.table) : '';\n return (\n <Combobox\n value={identity}\n onChange={(nextIdentity) => {\n const table = tables.find(\n (candidate) => getTableIdentity(candidate.table) === nextIdentity,\n );\n if (table) onChange(table);\n }}\n disabled={disabled}\n >\n <Combobox.Trigger className=\"w-full font-mono\">\n <span className=\"flex min-w-0 items-center gap-2\">\n <TableIcon className=\"text-muted-foreground h-3.5 w-3.5 shrink-0\" />\n <span className=\"truncate\">\n {value ? getTableDisplayName(value.table) : 'Select table...'}\n </span>\n </span>\n </Combobox.Trigger>\n <Combobox.Content\n searchable\n searchPlaceholder=\"Search tables...\"\n emptyMessage=\"No tables found.\"\n >\n {tables.map((table) => {\n const tableIdentity = getTableIdentity(table.table);\n return (\n <Combobox.Item\n key={tableIdentity}\n value={tableIdentity}\n keywords={[\n getTableDisplayName(table.table),\n table.table.schema ?? '',\n table.table.database ?? '',\n ]}\n >\n <span className=\"truncate font-mono\">\n {getTableDisplayName(table.table)}\n </span>\n {table.isView ? (\n <span className=\"text-muted-foreground ml-auto text-[10px]\">\n view\n </span>\n ) : null}\n </Combobox.Item>\n );\n })}\n </Combobox.Content>\n </Combobox>\n );\n};\n\nexport const DeckMapCodeViewToggleButton: FC<{\n selected: boolean;\n onClick: () => void;\n label?: string;\n}> = ({selected, onClick, label: labelProp}) => {\n const label = labelProp ?? (selected ? 'Show settings' : 'View code');\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <Button\n type=\"button\"\n variant={selected ? 'secondary' : 'ghost'}\n size=\"icon\"\n className=\"h-6 w-6\"\n onClick={onClick}\n aria-label={label}\n aria-pressed={selected}\n >\n <CodeIcon className=\"h-3.5 w-3.5\" />\n </Button>\n </TooltipTrigger>\n <TooltipContent>{label}</TooltipContent>\n </Tooltip>\n );\n};\n\nexport const DeckMapCodeViewerPanel: FC<{\n value: string;\n copyTooltipLabel?: string;\n}> = ({value, copyTooltipLabel = 'Copy map config'}) => (\n <ScrollArea className=\"min-h-0 flex-1\">\n <div className=\"h-full p-2\">\n <div className=\"border-input relative h-full overflow-hidden rounded-md border\">\n <pre className=\"h-full overflow-auto p-3 pr-12 font-mono text-xs whitespace-pre-wrap\">\n {value}\n </pre>\n <div className=\"bg-background absolute top-2 right-2 rounded-md border\">\n <CopyButton\n text={value}\n size=\"xs\"\n tooltipLabel={copyTooltipLabel}\n disabled={!value.trim()}\n />\n </div>\n </div>\n </div>\n </ScrollArea>\n);\n"]}
package/dist/ai.d.ts ADDED
@@ -0,0 +1,261 @@
1
+ import { type Tool } from 'ai';
2
+ import { z } from 'zod';
3
+ import { DashboardAiAdapter, type CreateDashboardAgentToolOptions, type CreateDashboardAiToolsOptions, DatabaseAiAdapter, MosaicDashboardStoreState } from '@sqlrooms/mosaic';
4
+ import { getFirstDatasetSourceTableName, hasSqlOnlyDatasetSource } from './datasetSourceUtils';
5
+ export { getFirstDatasetSourceTableName, hasSqlOnlyDatasetSource };
6
+ export declare const DECK_MAP_AI_INSTRUCTIONS = "\nDeck map tools:\n- create_deck_map_config validates and returns a reusable native Deck JSON map config without requiring a dashboard artifact.\n- create_dashboard_map creates or updates an interactive map panel inside a dashboard from a native Deck JSON map config.\n- Use map tools when the user asks for a map, geospatial/spatial visualization, locations, longitude/latitude data, or geometry columns.\n- CONFIG MODE: Every map config must include a configMode field (\"basic\" or \"custom\") that determines how the map was authored and whether the UI settings panel is available.\n - \"basic\" (default): Use for straightforward requests \u2014 single layer, standard color scale, simple geometry binding. Stick ONLY to properties that the UI configurator supports: layer @@type, visibility, color scale (@@function colorScale), point radius (numeric getRadius with radiusUnits), line width (numeric getWidth with widthUnits), geometry/H3/arc column bindings, extrusion with a single elevation column. Do NOT use string accessors (@@= expressions), custom extensions, multiple layers, or advanced deck.gl props in basic mode. The user can fine-tune these maps through the settings panel.\n - \"custom\": Use when the request demands creative, complex, or advanced visualization \u2014 multiple layers, data-driven accessors (@@= expressions), custom color arrays, advanced deck.gl props (opacity, transitions, material, highlightColor, etc.), layer extensions, or any props not representable in the UI configurator. The UI settings panel will be disabled for custom configs; users edit via the JSON editor instead.\n - Decision rule: If the map can be fully expressed with a single layer + basic color scale + simple numeric radius/width, use \"basic\". Otherwise use \"custom\".\n- Author maps with config.spec.layers using Deck JSON layer classes in @@type, such as GeoArrowScatterplotLayer, GeoArrowHeatmapLayer, GeoArrowPolygonLayer, GeoArrowPathLayer, GeoArrowTripsLayer, GeoArrowArcLayer, or GeoArrowH3HexagonLayer.\n- LAYER SELECTION: Choose the layer type based on the geometry type in the data.\n IMPORTANT: Only create a layer if the table contains data suitable for that layer type, or if you can transform the data into the required format with transformSql or a standalone sqlQuery. Do NOT create a layer if the data is clearly incompatible (e.g. do not create a path layer from point-only data without aggregation, do not create a polygon layer from point coordinates, do not create an arc layer without origin-destination pairs).\n - Point data (lon/lat coordinates, point geometry): GeoArrowScatterplotLayer (Point layer), GeoArrowHeatmapLayer, GeoArrowColumnLayer. Requires rows with individual point positions \u2014 either separate longitude/latitude numeric columns, or a point geometry column. Each row represents one point on the map.\n - Polygon data (building footprints, boundaries, areas, parcels, zones): GeoArrowPolygonLayer or GeoArrowSolidPolygonLayer. Requires a geometry column containing polygon or multipolygon WKB/GeoArrow data. Typically loaded from GeoJSON/Shapefile/GeoParquet or produced by spatial queries. Do NOT use for point data.\n - Line data (roads, routes, paths, rivers): GeoArrowPathLayer. CRITICAL: GeoArrowPathLayer requires LineString geometry, NOT individual point rows. If the table has one row per waypoint (indicated by columns like path_id/route_id + order/sequence + lat/lon), you MUST aggregate them with transformSql: \"SELECT path_id, label, ST_AsWKB(ST_MakeLine(LIST(ST_Point(lon, lat) ORDER BY waypoint_order))) AS geom FROM __sqlrooms_source GROUP BY path_id, label\". Set geometryColumn to \"geom\" and geometryEncodingHint to \"wkb\". If the table already has a geometry/geom column with linestring data, use it directly with tableName. NEVER pass raw waypoint rows to GeoArrowPathLayer \u2014 it will fail.\n - Animated trip data (routes with timestamps): GeoArrowTripsLayer. Same geometry requirements as GeoArrowPathLayer (LineString), plus a timestamps column. The transformSql MUST aggregate both the geometry and timestamps: \"SELECT path_id, label, ST_AsWKB(ST_MakeLine(LIST(ST_Point(lon, lat) ORDER BY waypoint_order))) AS geom, LIST(timestamp ORDER BY waypoint_order) AS timestamps FROM __sqlrooms_source GROUP BY path_id, label\". Set geometryColumn to \"geom\", geometryEncodingHint to \"wkb\", and _sqlroomsBinding.timestampColumn to \"timestamps\". The timestamps column must be a list of numbers (seconds) matching the order of waypoints in the linestring. Also set currentTime on the layer to control animation position. Do NOT use unless the data has or can produce both paths and ordered timestamps.\n- CRITICAL geometryColumn rule: The geometryColumn field (in datasets[id].geometryColumn, _sqlroomsBinding.geometryColumn, and fitToData.geometryColumn) MUST match the exact column alias that produces the WKB geometry in the final query output \u2014 typically the \"AS geom\" alias in ST_AsWKB(...) AS geom. It must NEVER be set to a GROUP BY key, an ID column, or any other non-geometry column. For example, if the transformSql is \"SELECT path_id, ST_AsWKB(ST_MakeLine(...)) AS geom ... GROUP BY path_id\", geometryColumn must be \"geom\" (the geometry output), NOT \"path_id\" (the grouping key). Setting geometryColumn to a non-geometry column will cause the layer to fail silently.\n - Arc data (origin-destination pairs): GeoArrowArcLayer. Requires two sets of coordinates per row (source and target). The table must have source_lon/source_lat AND target_lon/target_lat columns (or equivalent). The dataset source MUST use transformSql that creates WKB geometry columns from lat/lon, for example: \"SELECT *, ST_AsWKB(ST_Point(source_lon, source_lat)) AS source_geom, ST_AsWKB(ST_Point(target_lon, target_lat)) AS target_geom FROM __sqlrooms_source\". Set sourceGeometryColumn to \"source_geom\" and targetGeometryColumn to \"target_geom\". Set geometryEncodingHint to \"wkb\". To render straight lines instead of arcs, set \"getHeight\": 0 on the layer. Do NOT use for data with only one set of coordinates per row. When the source data has H3 indices instead of lat/lon, convert H3 to coordinates using h3_cell_to_lng(h3_index) and h3_cell_to_lat(h3_index) (the H3 extension is pre-loaded at startup), for example: \"SELECT *, ST_AsWKB(ST_Point(h3_cell_to_lng(source_h3), h3_cell_to_lat(source_h3))) AS source_geom, ST_AsWKB(ST_Point(h3_cell_to_lng(target_h3), h3_cell_to_lat(target_h3))) AS target_geom FROM __sqlrooms_source\". Do NOT use h3_latlng() \u2014 it does not exist.\n - H3 hexagon data (h3 index column): GeoArrowH3HexagonLayer. Requires a column containing H3 string indices. Bind to dataset with _sqlroomsBinding.dataset. Set \"getHexagon\": \"@@=h3_column_name\" where h3_column_name is the column containing H3 string indices. Always include \"fitToData\": {\"dataset\": \"datasetId\"} so the map can zoom to the data extent. Do NOT use unless the table has an H3 index column. DuckDB H3 extension functions: h3_cell_to_lat(index), h3_cell_to_lng(index), h3_cell_to_latlng(index). Do NOT use h3_latlng(), h3_to_lat(), or other non-existent function names.\n- CRITICAL: The transformSql and sqlQuery fields must contain ONLY a single SELECT statement. NEVER put INSTALL, LOAD, CREATE, or other DDL/meta-commands in dataset SQL \u2014 they will fail because dataset SQL is wrapped in a subquery at runtime. Extensions like h3 and spatial are pre-loaded at startup.\n - GeoJSON files typically contain polygon or multipolygon features (boundaries, buildings, parcels); use GeoArrowPolygonLayer for these. If a GeoJSON file contains point features, use GeoArrowScatterplotLayer (Point layer) instead.\n- RADIUS AND WIDTH: For GeoArrowScatterplotLayer (Point layer) use getRadius with radiusUnits: \"pixels\" (typically 2\u20136 pixels); large radii cause overdraw and rendering lag, especially with many points. For GeoArrowColumnLayer use the \"radius\" property (NOT getRadius) \u2014 it sets column radius in meters; typical values are 20\u2013200 for city-scale data or smaller for dense datasets. Do NOT use getRadius or radiusUnits on column layers. For GeoArrowArcLayer, GeoArrowPathLayer, and GeoArrowTripsLayer use getWidth with widthUnits: \"pixels\" (typically 1\u20133 pixels).\n- HEATMAP: For GeoArrowHeatmapLayer, do NOT set colorRange manually. The UI provides a scheme selector that generates the correct color array. If you set colorRange to hand-picked RGB arrays, it will be out of sync with the scheme selector shown in the UI. Just omit colorRange entirely and let the default apply \u2014 users can change the scheme through the map settings panel.\n- ARC vs LINE: GeoArrowArcLayer renders curved 3D arcs by default. If the user asks for \"lines\" or \"straight connections\" between origin-destination pairs (not arcs), set \"getHeight\": 0 on the layer to render flat straight lines. Use arcs for flight routes or connections where the curve adds clarity; use flat lines for direct relationships, edges, or when the user explicitly requests lines.\n- ELEVATION: For extruded layers, getElevation with @@function \"scale\" passes the raw field value as meters. Use elevationScale on the layer to multiply values to a useful visual height. For example, if the field is \"floors\" (1-10), set elevationScale to 3 (meters per floor). Do NOT use negative values for elevation. Avoid using diverging scales for elevation. IMPORTANT: Keep elevation moderate \u2014 if extruded polygons or H3 hexagons are too tall, users can't see the tops when zoomed in. Prefer elevationScale values that produce heights of a few hundred meters at most for city-scale data. A good rule of thumb: the maximum elevation (field max \u00D7 elevationScale) should not exceed ~500m for typical zoom levels.\n- Bind layers to datasets with _sqlroomsBinding.dataset and put tableName, tableName+transformSql, or sqlQuery sources in config.datasets.\n- Use source.tableName for direct table-backed datasets. Use source.tableName plus source.transformSql when the map needs generated geometry or aggregation but should still follow the dashboard selected table. transformSql must read from __sqlrooms_source, not from the authored table name.\n- Use source.sqlQuery only for a standalone literal query that should remain pinned to the authored SQL. Dashboard selected table replacement applies only to structured tableName sources, not literal sqlQuery sources.\n- IMPORTANT: Always pass tableName in the create_dashboard_map tool params (the top-level tableName field). Use the table currently selected in the dashboard (dashboard.selectedTable from list_dashboard_panels). At runtime, the dashboard's selected table overrides structured source.tableName values \u2014 this param seeds or changes that selection.\n- IMPORTANT: If you are creating a structured table-backed map layer for a table that is NOT the currently selected dashboard table, you MUST switch the dashboard's selected table to that dataset BEFORE or WHEN calling create_dashboard_map (pass the correct tableName). Structured table-backed map panels resolve data from the dashboard's active table \u2014 if you don't switch it, the layer will query the wrong table and fail.\n- IMPORTANT: When referencing tables in tableName or sqlQuery, use ONLY the bare table name (e.g. \"my_table\") or schema-qualified name (e.g. \"main.my_table\"). NEVER include the database/catalog prefix (e.g. do NOT use \"sqlrooms-cli.main.my_table\") \u2014 the catalog does not exist in the query execution context.\n- IMPORTANT: For point data with longitude/latitude columns that should follow dashboard table switching, use source.tableName plus source.transformSql to create a geometry column, for example: \"SELECT *, ST_AsWKB(ST_Point(\\\"Longitude\\\", \\\"Latitude\\\")) AS \\\"__sqlrooms_geom\\\" FROM __sqlrooms_source WHERE \\\"Longitude\\\" IS NOT NULL AND \\\"Latitude\\\" IS NOT NULL\". Set geometryColumn to the same name used in the AS clause (e.g. \"__sqlrooms_geom\") and geometryEncodingHint to \"wkb\".\n- IMPORTANT: When providing fitToData, it MUST be a flat object (NOT nested by dataset ID). Include either longitudeColumn+latitudeColumn (for point data with separate coordinate columns) OR geometryColumn (for data with a WKB geometry column like GeoJSON). For H3 hexagon layers, just specify the dataset: \"fitToData\": {\"dataset\": \"datasetId\"} \u2014 the H3 column is auto-detected from the layer binding. For GeoJSON/spatial files with a \"geom\" column, use: \"fitToData\": {\"dataset\": \"datasetId\", \"geometryColumn\": \"geom\"}. For point data use: \"fitToData\": {\"dataset\": \"datasetId\", \"longitudeColumn\": \"lon\", \"latitudeColumn\": \"lat\"}. NEVER nest fitToData as {\"datasetId\": {...}} \u2014 always use a flat object with \"dataset\" as a string field.\n- IMPORTANT: For GeoJSON or spatial files that already have a native geometry column (e.g. \"geometry\", \"geom\"), use the table directly with source.tableName (no sqlQuery needed), set the dataset's geometryColumn to \"geom\", set geometryEncodingHint to \"wkb\", and use fitToData with geometryColumn: {\"dataset\": \"datasetId\", \"geometryColumn\": \"geom\"}.\n- IMPORTANT: When a GeoJSON file (.geojson) is loaded as a table, DuckDB uses ST_Read to produce a table with a WKB \"geom\" column and all feature properties as columns. Use source.tableName, set geometryColumn to \"geom\" and geometryEncodingHint to \"wkb\". Use \"fitToData\": {\"dataset\": \"datasetId\", \"geometryColumn\": \"geom\"} to zoom to the data extent.\n- For data-driven color, use native Deck JSON accessors with {\"@@function\":\"colorScale\", \"field\":\"...\", \"type\":\"sequential\"|\"diverging\"|\"quantize\"|\"quantile\"|\"categorical\", \"scheme\":\"...\", \"domain\":\"auto\"} on color properties such as getFillColor, getLineColor, getColor, getSourceColor, or getTargetColor. Valid schemes: for \"categorical\" type use one of Accent, Dark2, Paired, Pastel1, Pastel2, Set1, Set2, Set3, Tableau10, Observable10, Category10. For \"sequential\" use Viridis, Inferno, Magma, Plasma, Turbo, Blues, Greens, Oranges, Reds, Purples, etc. For \"diverging\" use RdBu, Spectral, RdYlGn, BrBG, PiYG, etc. IMPORTANT: The colorScale \"field\" must reference a column that exists in the FINAL query output (after any GROUP BY aggregation). Do not reference columns that are lost during aggregation.\n- IMPORTANT: Enabling a color scale means adding a {\"@@function\":\"colorScale\", ...} accessor to a compatible layer color property. The top-level showLegends field only controls whether already-defined color scale legends are visible; showLegends by itself does NOT create or enable data-driven color.\n- Map panels default to a 100000-row runtime data limit; use config.dataPolicy.maxRows only when the map genuinely needs a panel-specific limit.\n- Create maps with a SINGLE layer unless the user explicitly asks for multiple layers. If you think multiple layers would better serve the user's request, ask the user for confirmation before adding them.\n- IMPORTANT: Browsers limit the number of active WebGL contexts (typically 8\u201316 per page). Each map panel uses one context. Do NOT create more than 4\u20135 map panels in a single dashboard \u2014 exceeding the limit causes older maps to lose their rendering context and show errors. If the user asks for many datasets, prefer combining compatible layers into fewer maps rather than creating one map per dataset.\n- After calling create_dashboard_map, call list_dashboard_panels before your final response and check the map panel issue. If it has a render-error, repair the map config in place instead of saying the map is complete.\n- BASEMAPS: Omit mapStyle unless the user explicitly requests a custom basemap. Maps inherit the host application's theme-aware basemap when available, with a token-free fallback. Do NOT use Mapbox styles (mapbox://styles/...) because a Mapbox access token may not be available. For an explicitly requested custom basemap, use a token-free MapLibre-compatible style URL.\n";
7
+ /**
8
+ * Returns AI instructions for dashboards with Deck.gl map support.
9
+ * Provides guidance on when and how to use map visualizations.
10
+ *
11
+ * @returns Instructions string for AI agents
12
+ */
13
+ export declare function getDashboardWithDeckMapAiInstructions(): string;
14
+ /**
15
+ * Creates dashboard AI tools with built-in Deck.gl map support.
16
+ * Extends standard dashboard tools with map visualization capabilities.
17
+ *
18
+ * @param options - Dashboard AI tools configuration options
19
+ * @returns Record mapping tool names to tool instances, including map tools
20
+ */
21
+ export declare function createDashboardWithDeckMapAiTools(options: CreateDashboardAiToolsOptions): Record<string, Tool>;
22
+ /**
23
+ * Creates a dashboard agent tool with built-in Deck.gl map support.
24
+ * Extends the standard dashboard agent with map creation capabilities.
25
+ *
26
+ * @template TState - Store state type extending MosaicDashboardStoreState
27
+ * @param options - Dashboard agent configuration options
28
+ * @returns Dashboard agent tool with map support
29
+ */
30
+ export declare function createDashboardAgentToolWithDeckMaps<TState extends MosaicDashboardStoreState>(options: CreateDashboardAgentToolOptions<TState>): Tool;
31
+ export declare const DeckMapDashboardConfigParameter: z.ZodObject<{
32
+ spec: z.ZodObject<{
33
+ initialViewState: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
34
+ viewState: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
35
+ controller: z.ZodOptional<z.ZodUnknown>;
36
+ layers: z.ZodOptional<z.ZodArray<z.ZodObject<{
37
+ '@@type': z.ZodOptional<z.ZodString>;
38
+ id: z.ZodOptional<z.ZodString>;
39
+ _sqlroomsBinding: z.ZodOptional<z.ZodObject<{
40
+ dataset: z.ZodOptional<z.ZodString>;
41
+ geometryColumn: z.ZodOptional<z.ZodString>;
42
+ geometryEncodingHint: z.ZodOptional<z.ZodEnum<{
43
+ geoarrow: "geoarrow";
44
+ wkb: "wkb";
45
+ wkt: "wkt";
46
+ }>>;
47
+ sourceGeometryColumn: z.ZodOptional<z.ZodString>;
48
+ targetGeometryColumn: z.ZodOptional<z.ZodString>;
49
+ timestampColumn: z.ZodOptional<z.ZodString>;
50
+ hexagonColumn: z.ZodOptional<z.ZodString>;
51
+ }, z.core.$loose>>;
52
+ }, z.core.$loose>>>;
53
+ }, z.core.$loose>;
54
+ datasets: z.ZodRecord<z.ZodString, z.ZodObject<{
55
+ source: z.ZodOptional<z.ZodObject<{
56
+ tableName: z.ZodOptional<z.ZodString>;
57
+ transformSql: z.ZodOptional<z.ZodString>;
58
+ sqlQuery: z.ZodOptional<z.ZodString>;
59
+ }, z.core.$loose>>;
60
+ geometryColumn: z.ZodOptional<z.ZodString>;
61
+ geometryEncodingHint: z.ZodOptional<z.ZodEnum<{
62
+ geoarrow: "geoarrow";
63
+ wkb: "wkb";
64
+ wkt: "wkt";
65
+ }>>;
66
+ }, z.core.$loose>>;
67
+ configMode: z.ZodOptional<z.ZodEnum<{
68
+ custom: "custom";
69
+ basic: "basic";
70
+ }>>;
71
+ mapStyle: z.ZodOptional<z.ZodString>;
72
+ mapProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
73
+ showLegends: z.ZodOptional<z.ZodBoolean>;
74
+ interaction: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
75
+ fitToData: z.ZodOptional<z.ZodObject<{
76
+ dataset: z.ZodString;
77
+ longitudeColumn: z.ZodOptional<z.ZodString>;
78
+ latitudeColumn: z.ZodOptional<z.ZodString>;
79
+ geometryColumn: z.ZodOptional<z.ZodString>;
80
+ h3Column: z.ZodOptional<z.ZodString>;
81
+ padding: z.ZodOptional<z.ZodNumber>;
82
+ maxZoom: z.ZodOptional<z.ZodNumber>;
83
+ }, z.core.$strip>>;
84
+ dataPolicy: z.ZodOptional<z.ZodObject<{
85
+ disabled: z.ZodOptional<z.ZodBoolean>;
86
+ maxRows: z.ZodOptional<z.ZodNumber>;
87
+ reason: z.ZodOptional<z.ZodString>;
88
+ }, z.core.$loose>>;
89
+ settingsOpen: z.ZodOptional<z.ZodBoolean>;
90
+ }, z.core.$loose>;
91
+ export type DeckMapDashboardConfigToolConfig = z.infer<typeof DeckMapDashboardConfigParameter>;
92
+ export declare const DeckMapConfigToolParameters: z.ZodObject<{
93
+ title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
94
+ config: z.ZodObject<{
95
+ spec: z.ZodObject<{
96
+ initialViewState: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
97
+ viewState: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
98
+ controller: z.ZodOptional<z.ZodUnknown>;
99
+ layers: z.ZodOptional<z.ZodArray<z.ZodObject<{
100
+ '@@type': z.ZodOptional<z.ZodString>;
101
+ id: z.ZodOptional<z.ZodString>;
102
+ _sqlroomsBinding: z.ZodOptional<z.ZodObject<{
103
+ dataset: z.ZodOptional<z.ZodString>;
104
+ geometryColumn: z.ZodOptional<z.ZodString>;
105
+ geometryEncodingHint: z.ZodOptional<z.ZodEnum<{
106
+ geoarrow: "geoarrow";
107
+ wkb: "wkb";
108
+ wkt: "wkt";
109
+ }>>;
110
+ sourceGeometryColumn: z.ZodOptional<z.ZodString>;
111
+ targetGeometryColumn: z.ZodOptional<z.ZodString>;
112
+ timestampColumn: z.ZodOptional<z.ZodString>;
113
+ hexagonColumn: z.ZodOptional<z.ZodString>;
114
+ }, z.core.$loose>>;
115
+ }, z.core.$loose>>>;
116
+ }, z.core.$loose>;
117
+ datasets: z.ZodRecord<z.ZodString, z.ZodObject<{
118
+ source: z.ZodOptional<z.ZodObject<{
119
+ tableName: z.ZodOptional<z.ZodString>;
120
+ transformSql: z.ZodOptional<z.ZodString>;
121
+ sqlQuery: z.ZodOptional<z.ZodString>;
122
+ }, z.core.$loose>>;
123
+ geometryColumn: z.ZodOptional<z.ZodString>;
124
+ geometryEncodingHint: z.ZodOptional<z.ZodEnum<{
125
+ geoarrow: "geoarrow";
126
+ wkb: "wkb";
127
+ wkt: "wkt";
128
+ }>>;
129
+ }, z.core.$loose>>;
130
+ configMode: z.ZodOptional<z.ZodEnum<{
131
+ custom: "custom";
132
+ basic: "basic";
133
+ }>>;
134
+ mapStyle: z.ZodOptional<z.ZodString>;
135
+ mapProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
136
+ showLegends: z.ZodOptional<z.ZodBoolean>;
137
+ interaction: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
138
+ fitToData: z.ZodOptional<z.ZodObject<{
139
+ dataset: z.ZodString;
140
+ longitudeColumn: z.ZodOptional<z.ZodString>;
141
+ latitudeColumn: z.ZodOptional<z.ZodString>;
142
+ geometryColumn: z.ZodOptional<z.ZodString>;
143
+ h3Column: z.ZodOptional<z.ZodString>;
144
+ padding: z.ZodOptional<z.ZodNumber>;
145
+ maxZoom: z.ZodOptional<z.ZodNumber>;
146
+ }, z.core.$strip>>;
147
+ dataPolicy: z.ZodOptional<z.ZodObject<{
148
+ disabled: z.ZodOptional<z.ZodBoolean>;
149
+ maxRows: z.ZodOptional<z.ZodNumber>;
150
+ reason: z.ZodOptional<z.ZodString>;
151
+ }, z.core.$loose>>;
152
+ settingsOpen: z.ZodOptional<z.ZodBoolean>;
153
+ }, z.core.$loose>;
154
+ reasoning: z.ZodString;
155
+ }, z.core.$strip>;
156
+ export type DeckMapConfigToolParams = z.infer<typeof DeckMapConfigToolParameters>;
157
+ export declare const DeckMapDashboardToolParameters: z.ZodObject<{
158
+ title: z.ZodDefault<z.ZodOptional<z.ZodString>>;
159
+ config: z.ZodObject<{
160
+ spec: z.ZodObject<{
161
+ initialViewState: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
162
+ viewState: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
163
+ controller: z.ZodOptional<z.ZodUnknown>;
164
+ layers: z.ZodOptional<z.ZodArray<z.ZodObject<{
165
+ '@@type': z.ZodOptional<z.ZodString>;
166
+ id: z.ZodOptional<z.ZodString>;
167
+ _sqlroomsBinding: z.ZodOptional<z.ZodObject<{
168
+ dataset: z.ZodOptional<z.ZodString>;
169
+ geometryColumn: z.ZodOptional<z.ZodString>;
170
+ geometryEncodingHint: z.ZodOptional<z.ZodEnum<{
171
+ geoarrow: "geoarrow";
172
+ wkb: "wkb";
173
+ wkt: "wkt";
174
+ }>>;
175
+ sourceGeometryColumn: z.ZodOptional<z.ZodString>;
176
+ targetGeometryColumn: z.ZodOptional<z.ZodString>;
177
+ timestampColumn: z.ZodOptional<z.ZodString>;
178
+ hexagonColumn: z.ZodOptional<z.ZodString>;
179
+ }, z.core.$loose>>;
180
+ }, z.core.$loose>>>;
181
+ }, z.core.$loose>;
182
+ datasets: z.ZodRecord<z.ZodString, z.ZodObject<{
183
+ source: z.ZodOptional<z.ZodObject<{
184
+ tableName: z.ZodOptional<z.ZodString>;
185
+ transformSql: z.ZodOptional<z.ZodString>;
186
+ sqlQuery: z.ZodOptional<z.ZodString>;
187
+ }, z.core.$loose>>;
188
+ geometryColumn: z.ZodOptional<z.ZodString>;
189
+ geometryEncodingHint: z.ZodOptional<z.ZodEnum<{
190
+ geoarrow: "geoarrow";
191
+ wkb: "wkb";
192
+ wkt: "wkt";
193
+ }>>;
194
+ }, z.core.$loose>>;
195
+ configMode: z.ZodOptional<z.ZodEnum<{
196
+ custom: "custom";
197
+ basic: "basic";
198
+ }>>;
199
+ mapStyle: z.ZodOptional<z.ZodString>;
200
+ mapProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
201
+ showLegends: z.ZodOptional<z.ZodBoolean>;
202
+ interaction: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
203
+ fitToData: z.ZodOptional<z.ZodObject<{
204
+ dataset: z.ZodString;
205
+ longitudeColumn: z.ZodOptional<z.ZodString>;
206
+ latitudeColumn: z.ZodOptional<z.ZodString>;
207
+ geometryColumn: z.ZodOptional<z.ZodString>;
208
+ h3Column: z.ZodOptional<z.ZodString>;
209
+ padding: z.ZodOptional<z.ZodNumber>;
210
+ maxZoom: z.ZodOptional<z.ZodNumber>;
211
+ }, z.core.$strip>>;
212
+ dataPolicy: z.ZodOptional<z.ZodObject<{
213
+ disabled: z.ZodOptional<z.ZodBoolean>;
214
+ maxRows: z.ZodOptional<z.ZodNumber>;
215
+ reason: z.ZodOptional<z.ZodString>;
216
+ }, z.core.$loose>>;
217
+ settingsOpen: z.ZodOptional<z.ZodBoolean>;
218
+ }, z.core.$loose>;
219
+ tableName: z.ZodOptional<z.ZodString>;
220
+ panelId: z.ZodOptional<z.ZodString>;
221
+ reasoning: z.ZodString;
222
+ }, z.core.$strip>;
223
+ export type DeckMapDashboardToolParams = z.infer<typeof DeckMapDashboardToolParameters>;
224
+ /**
225
+ * Creates a dashboard-compatible Deck map panel from the native map config
226
+ * used by AI tools and embeddable map surfaces.
227
+ */
228
+ export declare function createDeckMapPanelFromNativeConfig(params: Pick<DeckMapConfigToolParams, 'title' | 'config'>): {
229
+ id: string;
230
+ type: string;
231
+ title: string;
232
+ config: Record<string, unknown>;
233
+ };
234
+ export declare function createDeckMapConfigTool(): Tool;
235
+ /**
236
+ * Creates AI tools for Deck.gl map configuration.
237
+ * Returns tools for creating and configuring Deck.gl map panels.
238
+ *
239
+ * @returns Record mapping tool names to map configuration tools
240
+ */
241
+ export declare function createDeckMapAiTools(): Record<string, Tool>;
242
+ /**
243
+ * Parameters for creating a Deck.gl map dashboard tool.
244
+ * Provides adapters for dashboard and database operations.
245
+ */
246
+ export type CreateDeckMapDashboardToolParams = {
247
+ /** Dashboard adapter for adding and updating map panels */
248
+ dashboardAdapter: DashboardAiAdapter;
249
+ /** Database adapter for table validation */
250
+ databaseAdapter: DatabaseAiAdapter;
251
+ };
252
+ /**
253
+ * Creates a tool for adding Deck.gl map panels to dashboards.
254
+ * Supports creating new map panels or updating existing ones with native Deck JSON configs.
255
+ *
256
+ * @param params - Parameters containing dashboard and database adapters
257
+ * @returns Tool instance for creating/updating Deck.gl map panels
258
+ */
259
+ export declare function createDeckMapDashboardTool({ dashboardAdapter, databaseAdapter, }: CreateDeckMapDashboardToolParams): Tool;
260
+ export declare function createDeckMapDashboardAiTools(params: CreateDeckMapDashboardToolParams): Record<string, Tool>;
261
+ //# sourceMappingURL=ai.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,IAAI,EAAC,MAAM,IAAI,CAAC;AACnC,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AACtB,OAAO,EACL,kBAAkB,EAIlB,KAAK,+BAA+B,EACpC,KAAK,6BAA6B,EAGlC,iBAAiB,EAGjB,yBAAyB,EAC1B,MAAM,kBAAkB,CAAC;AAO1B,OAAO,EACL,8BAA8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