yamchart 0.9.0 → 0.9.1

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 (48) hide show
  1. package/dist/{advisor-Z7TKPPBR.js → advisor-HVD4FJ56.js} +3 -3
  2. package/dist/{chunk-FZFBBB7K.js → chunk-LQANFANB.js} +2 -2
  3. package/dist/{chunk-E2QN2M7S.js → chunk-LQN2HNQZ.js} +11 -3
  4. package/dist/chunk-LQN2HNQZ.js.map +1 -0
  5. package/dist/{chunk-AMHCOB4D.js → chunk-R22XWFKX.js} +3 -3
  6. package/dist/{chunk-G57J2WQM.js → chunk-XDDBDJQL.js} +2 -2
  7. package/dist/{connection-utils-CTPN7PV3.js → connection-utils-WVQGWJ7H.js} +3 -3
  8. package/dist/{describe-4NME6RCB.js → describe-UETE5XYO.js} +4 -4
  9. package/dist/{dev-6QGAB4ZH.js → dev-2WLFE37D.js} +4 -4
  10. package/dist/{dist-4GUE24QV.js → dist-OAKQOG6H.js} +2 -2
  11. package/dist/index.js +20 -20
  12. package/dist/public/assets/{EventManagement-MMsAkJKj.js → EventManagement-CWrv68To.js} +1 -1
  13. package/dist/public/assets/{ExplorePage-BSkSNgLT.js → ExplorePage-2wblm-7t.js} +1 -1
  14. package/dist/public/assets/{LoginPage-vaI1dnyL.js → LoginPage-J48L4t6I.js} +1 -1
  15. package/dist/public/assets/{PublicViewer-B-OKj2cg.js → PublicViewer-BrjKKW5m.js} +1 -1
  16. package/dist/public/assets/{SetupWizard-DvlVX2O6.js → SetupWizard-fRVi5bF4.js} +1 -1
  17. package/dist/public/assets/{ShareManagement-ulvPrOAQ.js → ShareManagement-DUdL-Diq.js} +1 -1
  18. package/dist/public/assets/{UserManagement-CvmpNy3o.js → UserManagement-BlwTHdH4.js} +1 -1
  19. package/dist/public/assets/index-CJ01RqZ2.js +195 -0
  20. package/dist/public/assets/{index.es-BeTaRWIv.js → index.es-BtmplkrJ.js} +1 -1
  21. package/dist/public/assets/{jspdf.es.min-9haD1GSE.js → jspdf.es.min-D0I_3frr.js} +3 -3
  22. package/dist/public/index.html +1 -1
  23. package/dist/{query-Z75RKTHV.js → query-E6NFXKV6.js} +3 -3
  24. package/dist/{sample-OIJNXQNC.js → sample-YLJC5H5X.js} +3 -3
  25. package/dist/{search-YDCPIDZX.js → search-QDOSNM2R.js} +4 -4
  26. package/dist/{source-resolver-4SUWXUGW.js → source-resolver-VAXDVSDF.js} +4 -4
  27. package/dist/{sync-warehouse-NZFDS6WK.js → sync-warehouse-5HEGZJHG.js} +3 -3
  28. package/dist/{tables-WJS2VI4L.js → tables-6TODJHM5.js} +4 -4
  29. package/dist/templates/default/docs/yamchart-reference.md +10 -2
  30. package/dist/{test-I4XOF7TZ.js → test-MXNBCQ3G.js} +3 -3
  31. package/package.json +1 -1
  32. package/dist/chunk-E2QN2M7S.js.map +0 -1
  33. package/dist/public/assets/index-DD59fsOk.js +0 -195
  34. /package/dist/{advisor-Z7TKPPBR.js.map → advisor-HVD4FJ56.js.map} +0 -0
  35. /package/dist/{chunk-FZFBBB7K.js.map → chunk-LQANFANB.js.map} +0 -0
  36. /package/dist/{chunk-AMHCOB4D.js.map → chunk-R22XWFKX.js.map} +0 -0
  37. /package/dist/{chunk-G57J2WQM.js.map → chunk-XDDBDJQL.js.map} +0 -0
  38. /package/dist/{connection-utils-CTPN7PV3.js.map → connection-utils-WVQGWJ7H.js.map} +0 -0
  39. /package/dist/{describe-4NME6RCB.js.map → describe-UETE5XYO.js.map} +0 -0
  40. /package/dist/{dev-6QGAB4ZH.js.map → dev-2WLFE37D.js.map} +0 -0
  41. /package/dist/{dist-4GUE24QV.js.map → dist-OAKQOG6H.js.map} +0 -0
  42. /package/dist/{query-Z75RKTHV.js.map → query-E6NFXKV6.js.map} +0 -0
  43. /package/dist/{sample-OIJNXQNC.js.map → sample-YLJC5H5X.js.map} +0 -0
  44. /package/dist/{search-YDCPIDZX.js.map → search-QDOSNM2R.js.map} +0 -0
  45. /package/dist/{source-resolver-4SUWXUGW.js.map → source-resolver-VAXDVSDF.js.map} +0 -0
  46. /package/dist/{sync-warehouse-NZFDS6WK.js.map → sync-warehouse-5HEGZJHG.js.map} +0 -0
  47. /package/dist/{tables-WJS2VI4L.js.map → tables-6TODJHM5.js.map} +0 -0
  48. /package/dist/{test-I4XOF7TZ.js.map → test-MXNBCQ3G.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createConnector,
3
3
  resolveConnection
4
- } from "./chunk-AMHCOB4D.js";
4
+ } from "./chunk-R22XWFKX.js";
5
5
  import {
6
6
  detail,
7
7
  error,
@@ -10,7 +10,7 @@ import {
10
10
  success,
11
11
  warning
12
12
  } from "./chunk-HJVVHYVN.js";
13
- import "./chunk-E2QN2M7S.js";
13
+ import "./chunk-LQN2HNQZ.js";
14
14
  import "./chunk-CWAWATL4.js";
15
15
  import "./chunk-UND73EOB.js";
16
16
  import "./chunk-DGUM43GV.js";
@@ -379,4 +379,4 @@ async function offerApply(context, proposals) {
379
379
  export {
380
380
  runAdvisor
381
381
  };
382
- //# sourceMappingURL=advisor-Z7TKPPBR.js.map
382
+ //# sourceMappingURL=advisor-HVD4FJ56.js.map
@@ -9,7 +9,7 @@ import {
9
9
  import {
10
10
  createConnector,
11
11
  resolveConnection
12
- } from "./chunk-AMHCOB4D.js";
12
+ } from "./chunk-R22XWFKX.js";
13
13
 
14
14
  // src/commands/source-resolver.ts
15
15
  import { readFile as readFile2, access as access2 } from "fs/promises";
@@ -359,4 +359,4 @@ export {
359
359
  resolveTablesSource,
360
360
  resolveSearchSource
361
361
  };
362
- //# sourceMappingURL=chunk-FZFBBB7K.js.map
362
+ //# sourceMappingURL=chunk-LQANFANB.js.map
@@ -313,9 +313,14 @@ var StandardChartConfigSchema = z2.object({
313
313
  // For donut charts
314
314
  goals: z2.array(GoalSchema).optional()
315
315
  });
316
+ var DualAxisConfigSchema = z2.object({
317
+ label: z2.string().optional(),
318
+ format: z2.string().optional(),
319
+ scale: z2.enum(["linear", "log"]).optional()
320
+ });
316
321
  var DualAxesSchema = z2.object({
317
- left: AxisSchema.optional(),
318
- right: AxisSchema.optional()
322
+ left: DualAxisConfigSchema.optional(),
323
+ right: DualAxisConfigSchema.optional()
319
324
  });
320
325
  var ComboChartConfigSchema = z2.object({
321
326
  type: z2.literal("combo"),
@@ -378,6 +383,8 @@ var WaterfallChartConfigSchema = z2.object({
378
383
  category: z2.object({ field: z2.string().min(1) }),
379
384
  value: z2.object({ field: z2.string().min(1) }),
380
385
  total_field: z2.string().optional(),
386
+ series: LongFormatSeriesSchema.optional(),
387
+ // Stacked breakdown within each waterfall step
381
388
  colors: z2.object({
382
389
  increase: z2.string().optional(),
383
390
  decrease: z2.string().optional(),
@@ -404,6 +411,7 @@ var GaugeChartConfigSchema = z2.object({
404
411
  value: z2.object({ field: z2.string().min(1) }),
405
412
  min: z2.number().optional(),
406
413
  max: z2.number().optional(),
414
+ unit: z2.string().optional(),
407
415
  thresholds: z2.array(GaugeThresholdSchema).optional(),
408
416
  format: z2.string().optional(),
409
417
  goal: KpiGoalSchema.optional()
@@ -966,4 +974,4 @@ export {
966
974
  AgentDefinitionSchema,
967
975
  VERSION
968
976
  };
969
- //# sourceMappingURL=chunk-E2QN2M7S.js.map
977
+ //# sourceMappingURL=chunk-LQN2HNQZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../packages/schema/src/connection.ts","../../../packages/schema/src/chart.ts","../../../packages/schema/src/project.ts","../../../packages/schema/src/semantic.ts","../../../packages/schema/src/model.ts","../../../packages/schema/src/dashboard.ts","../../../packages/schema/src/schedule.ts","../../../packages/schema/src/events.ts","../../../packages/schema/src/agent.ts","../../../packages/schema/src/index.ts"],"sourcesContent":["import { z } from 'zod';\n\n// Auth configuration for connections\nconst EnvAuthSchema = z.object({\n type: z.literal('env'),\n user_var: z.string(),\n password_var: z.string(),\n});\n\nconst KeyPairAuthSchema = z.object({\n type: z.literal('key_pair'),\n user_var: z.string(),\n private_key_path: z.string(),\n});\n\nconst SecretManagerAuthSchema = z.object({\n type: z.literal('secret_manager'),\n provider: z.enum(['aws_secrets_manager', 'gcp_secret_manager', 'vault']),\n secret_id: z.string(),\n});\n\nconst ExternalBrowserAuthSchema = z.object({\n type: z.literal('externalbrowser'),\n user_var: z.string(),\n cache_token: z.boolean().optional(),\n});\n\nconst AuthSchema = z.discriminatedUnion('type', [\n EnvAuthSchema,\n KeyPairAuthSchema,\n SecretManagerAuthSchema,\n ExternalBrowserAuthSchema,\n]);\n\n// Connection pool configuration\nconst PoolConfigSchema = z.object({\n min_connections: z.number().int().positive().optional(),\n max_connections: z.number().int().positive().optional(),\n idle_timeout: z.number().int().positive().optional(),\n});\n\n// Query settings\nconst QueryConfigSchema = z.object({\n timeout: z.number().int().positive().optional(),\n max_rows: z.number().int().positive().optional(),\n});\n\n// DuckDB-specific config\nconst DuckDBConfigSchema = z.object({\n path: z.string(), // file path or :memory:\n});\n\n// Postgres-specific config\nconst PostgresConfigSchema = z.object({\n host: z.string(),\n port: z.number().int().positive().default(5432),\n database: z.string(),\n schema: z.string().optional(),\n ssl: z.boolean().optional(),\n});\n\n// Snowflake-specific config\nconst SnowflakeConfigSchema = z.object({\n account: z.string(),\n warehouse: z.string(),\n database: z.string(),\n schema: z.string().optional(),\n role: z.string().optional(),\n});\n\n// MySQL-specific config\nconst MySQLConfigSchema = z.object({\n host: z.string(),\n port: z.number().int().positive().default(3306),\n database: z.string(),\n ssl: z.boolean().optional(),\n});\n\n// SQLite-specific config\nconst SQLiteConfigSchema = z.object({\n path: z.string(), // file path or :memory:\n});\n\n// Base connection schema\nconst BaseConnectionSchema = z.object({\n name: z.string().min(1),\n description: z.string().optional(),\n pool: PoolConfigSchema.optional(),\n query: QueryConfigSchema.optional(),\n});\n\n// Type-specific connection schemas\nconst DuckDBConnectionSchema = BaseConnectionSchema.extend({\n type: z.literal('duckdb'),\n config: DuckDBConfigSchema,\n auth: z.undefined().optional(),\n});\n\nconst PostgresConnectionSchema = BaseConnectionSchema.extend({\n type: z.literal('postgres'),\n config: PostgresConfigSchema,\n auth: AuthSchema.optional(),\n});\n\nconst SnowflakeConnectionSchema = BaseConnectionSchema.extend({\n type: z.literal('snowflake'),\n config: SnowflakeConfigSchema,\n auth: AuthSchema,\n});\n\nconst MySQLConnectionSchema = BaseConnectionSchema.extend({\n type: z.literal('mysql'),\n config: MySQLConfigSchema,\n auth: AuthSchema.optional(),\n});\n\nconst SQLiteConnectionSchema = BaseConnectionSchema.extend({\n type: z.literal('sqlite'),\n config: SQLiteConfigSchema,\n auth: z.undefined().optional(),\n});\n\n// Union of all connection types\nexport const ConnectionSchema = z.discriminatedUnion('type', [\n DuckDBConnectionSchema,\n PostgresConnectionSchema,\n SnowflakeConnectionSchema,\n MySQLConnectionSchema,\n SQLiteConnectionSchema,\n]);\n\nexport type Connection = z.infer<typeof ConnectionSchema>;\nexport type DuckDBConnection = z.infer<typeof DuckDBConnectionSchema>;\nexport type PostgresConnection = z.infer<typeof PostgresConnectionSchema>;\nexport type SnowflakeConnection = z.infer<typeof SnowflakeConnectionSchema>;\nexport type MySQLConnection = z.infer<typeof MySQLConnectionSchema>;\nexport type SQLiteConnection = z.infer<typeof SQLiteConnectionSchema>;\n","import { z } from 'zod';\n\n// Axis types\nconst AxisTypeSchema = z.enum(['temporal', 'quantitative', 'ordinal', 'nominal']);\n\n// Axis configuration\nconst AxisSchema = z.object({\n field: z.string().min(1),\n type: AxisTypeSchema,\n format: z.string().optional(),\n label: z.string().optional(),\n scale: z.enum(['linear', 'log']).optional(),\n});\n\n// Chart types supported (scatter has its own dedicated schema)\nconst ChartTypeSchema = z.enum([\n 'line',\n 'bar',\n 'area',\n 'pie',\n 'donut',\n 'table',\n 'metric',\n 'map',\n 'heatmap',\n 'funnel',\n 'sankey',\n 'treemap',\n 'waterfall',\n 'gauge',\n]);\n\n// Gradient configuration - boolean shorthand or explicit from/to\nconst GradientSchema = z.union([\n z.boolean(),\n z.object({\n from: z.string(),\n to: z.string(),\n }),\n]);\n\n// Long format series: group by a field in the data (one row per series value)\nconst LongFormatSeriesSchema = z.object({\n field: z.string().min(1),\n colors: z.record(z.string(), z.string()).optional(),\n});\n\n// Series transform: compute derived values client-side\nconst SeriesTransformSchema = z.object({\n type: z.enum(['rolling_average']),\n window: z.number().int().positive(),\n});\n\n// Wide format column: each column becomes a separate series\nconst WideFormatColumnSchema = z.object({\n field: z.string().min(1),\n name: z.string().optional(),\n type: z.enum(['line', 'bar', 'area']).optional(),\n axis: z.enum(['left', 'right']).optional(),\n color: z.string().optional(),\n style: z.enum(['solid', 'dashed', 'dotted']).optional(),\n opacity: z.number().min(0).max(1).optional(),\n gradient: GradientSchema.optional(),\n transform: SeriesTransformSchema.optional(),\n band: z.string().optional(), // Pair with another column to render as shaded range band\n});\n\n// Wide format series: explicit list of columns\nconst WideFormatSeriesSchema = z.object({\n columns: z.array(WideFormatColumnSchema).min(1),\n});\n\n// Series config is either long format (group by field) or wide format (explicit columns)\nconst SeriesConfigSchema = z.union([\n LongFormatSeriesSchema,\n WideFormatSeriesSchema,\n]);\n\n// Color condition for conditional coloring\nconst ColorConditionSchema = z.object({\n when: z.string(),\n color: z.string(),\n});\n\n// Conditional color configuration\nconst ConditionalColorSchema = z.object({\n conditions: z.array(ColorConditionSchema).min(1),\n default: z.string().optional(),\n});\n\n// Color - either a simple string or conditional config\nconst ColorSchema = z.union([\n z.string(),\n ConditionalColorSchema,\n]);\n\n// Legend configuration\nconst LegendSchema = z.object({\n show: z.boolean().optional(),\n position: z.enum(['top', 'bottom', 'left', 'right']).optional(),\n});\n\n// Annotation configuration\nconst LineAnnotationSchema = z.object({\n type: z.literal('line'),\n value: z.number(),\n label: z.string().optional(),\n color: z.string().optional(),\n style: z.enum(['solid', 'dashed', 'dotted']).optional(),\n});\n\nconst BandAnnotationSchema = z.object({\n type: z.literal('band'),\n from: z.number(),\n to: z.number(),\n label: z.string().optional(),\n color: z.string().optional(),\n});\n\nconst XLineAnnotationSchema = z.object({\n type: z.literal('x_line'),\n x: z.string(), // x-axis value (date string or category)\n label: z.string().optional(),\n color: z.string().optional(),\n style: z.enum(['solid', 'dashed', 'dotted']).optional(),\n});\n\nconst AnnotationSchema = z.discriminatedUnion('type', [\n LineAnnotationSchema,\n BandAnnotationSchema,\n XLineAnnotationSchema,\n]);\n\n// Goal zone configuration (tolerance band around target)\nconst GoalZoneSchema = z.object({\n tolerance: z.number().min(0).max(1),\n});\n\n// Goal line style\nconst GoalStyleSchema = z.enum(['solid', 'dashed', 'dotted']);\n\n// Fixed goal — constant horizontal target line\nconst FixedGoalSchema = z.object({\n type: z.literal('fixed'),\n value: z.number(),\n label: z.string().optional(),\n color: z.string().optional(),\n style: GoalStyleSchema.optional(),\n zone: GoalZoneSchema.optional(),\n});\n\n// Cumulative goal — target value to reach by a deadline\nconst CumulativeGoalSchema = z.object({\n type: z.literal('cumulative'),\n value: z.number(),\n by: z.string().min(1),\n from: z.string().optional(),\n label: z.string().optional(),\n color: z.string().optional(),\n style: GoalStyleSchema.optional(),\n zone: GoalZoneSchema.optional(),\n});\n\n// Source for model-driven goals\nconst GoalSourceSchema = z.object({\n model: z.string().min(1),\n value_field: z.string().min(1),\n date_field: z.string().optional(),\n});\n\n// Model-driven goal — target values from a SQL model\nconst ModelGoalSchema = z.object({\n type: z.literal('model'),\n source: GoalSourceSchema,\n label: z.string().optional(),\n color: z.string().optional(),\n style: GoalStyleSchema.optional(),\n zone: GoalZoneSchema.optional(),\n});\n\n// Goal discriminated union (for line/bar/area/combo charts)\nconst GoalSchema = z.discriminatedUnion('type', [\n FixedGoalSchema,\n CumulativeGoalSchema,\n ModelGoalSchema,\n]);\n\n// KPI/Gauge goal — simple target value with optional progress display\nconst KpiGoalSchema = z.object({\n value: z.number(),\n label: z.string().optional(),\n show_progress: z.boolean().optional(),\n color: z.string().optional(),\n});\n\n// Interactivity options\nconst InteractionsSchema = z.object({\n tooltip: z.boolean().default(true),\n zoom: z.boolean().default(false),\n brush: z.boolean().default(false),\n});\n\n// KPI format types\nconst KpiFormatSchema = z.object({\n type: z.enum(['number', 'currency', 'percent']),\n currency: z.string().optional(), // e.g., 'USD', 'EUR'\n decimals: z.number().optional(),\n});\n\n// KPI comparison configuration\nconst KpiComparisonSchema = z.object({\n enabled: z.boolean(),\n field: z.string().min(1).optional(),\n period: z.enum(['previous']).optional(),\n label: z.string().optional(),\n type: z.enum(['percent_change', 'absolute']),\n}).refine(\n (data) => !(data.field && data.period),\n { message: 'Cannot set both field and period — use one or the other' }\n).refine(\n (data) => data.field || data.period,\n { message: 'Must set either field or period for comparison' }\n);\n\n// KPI value configuration\nconst KpiValueSchema = z.object({\n field: z.string().min(1),\n});\n\n// KPI-specific config\nconst KpiConfigSchema = z.object({\n type: z.literal('kpi'),\n value: KpiValueSchema,\n format: KpiFormatSchema,\n comparison: KpiComparisonSchema.optional(),\n unit: z.string().optional(), // e.g., 'min', 'sessions', 'users'\n goal: KpiGoalSchema.optional(),\n});\n\n// Center value for donut charts\nconst CenterValueSchema = z.object({\n field: z.string().optional(), // 'total' for sum, or specific field\n label: z.string().optional(),\n format: z.string().optional(),\n});\n\n// Period comparison overlay\nconst CompareSchema = z.object({\n period: z.string(), // previous_week, previous_month, previous_year, or a preset name\n label: z.string().optional(),\n style: z.enum(['solid', 'dashed', 'dotted']).optional(),\n opacity: z.number().min(0).max(1).optional(),\n color: z.string().optional(),\n});\n\n// Standard chart config (existing)\nconst StandardChartConfigSchema = z.object({\n type: ChartTypeSchema,\n x: AxisSchema,\n y: AxisSchema.optional(),\n series: SeriesConfigSchema.optional(),\n stacking: z.enum(['stacked', 'percent']).optional(),\n orientation: z.enum(['vertical', 'horizontal']).optional(),\n color: ColorSchema.optional(),\n gradient: GradientSchema.optional(),\n legend: LegendSchema.optional(),\n annotations: z.array(AnnotationSchema).optional(),\n compare: z.array(CompareSchema).optional(),\n interactions: InteractionsSchema.optional(),\n centerValue: CenterValueSchema.optional(), // For donut charts\n goals: z.array(GoalSchema).optional(),\n});\n\n// Dual axis config for combo charts (label + format, not data field references)\nconst DualAxisConfigSchema = z.object({\n label: z.string().optional(),\n format: z.string().optional(),\n scale: z.enum(['linear', 'log']).optional(),\n});\n\nconst DualAxesSchema = z.object({\n left: DualAxisConfigSchema.optional(),\n right: DualAxisConfigSchema.optional(),\n});\n\n// Combo chart config - requires dual axes\nconst ComboChartConfigSchema = z.object({\n type: z.literal('combo'),\n x: AxisSchema,\n series: WideFormatSeriesSchema,\n axes: DualAxesSchema,\n legend: LegendSchema.optional(),\n interactions: InteractionsSchema.optional(),\n gradient: GradientSchema.optional(),\n goals: z.array(GoalSchema).optional(),\n});\n\n// Scatter chart size encoding\nconst ScatterSizeSchema = z.object({\n field: z.string().min(1),\n min: z.number().optional(),\n max: z.number().optional(),\n label: z.string().optional(),\n});\n\n// Scatter chart grouping\nconst ScatterGroupSchema = z.object({\n field: z.string().min(1),\n});\n\n// Regression line configuration\nconst RegressionSchema = z.object({\n type: z.literal('linear'),\n show_equation: z.boolean().optional(),\n show_r_squared: z.boolean().optional(),\n});\n\n// Scatter/bubble chart config\nconst ScatterChartConfigSchema = z.object({\n type: z.literal('scatter'),\n x: AxisSchema,\n y: AxisSchema,\n size: ScatterSizeSchema.optional(),\n group: ScatterGroupSchema.optional(),\n regression: RegressionSchema.optional(),\n color: ColorSchema.optional(),\n legend: LegendSchema.optional(),\n interactions: InteractionsSchema.optional(),\n});\n\n// Heatmap chart config\nconst HeatmapChartConfigSchema = z.object({\n type: z.literal('heatmap'),\n x: AxisSchema,\n y: AxisSchema,\n value: z.object({\n field: z.string().min(1),\n label: z.string().optional(),\n }),\n color_range: z.object({\n min: z.string().optional(),\n max: z.string().optional(),\n }).optional(),\n show_values: z.boolean().optional(),\n});\n\n// Funnel chart config\nconst FunnelChartConfigSchema = z.object({\n type: z.literal('funnel'),\n stage: z.object({ field: z.string().min(1) }),\n value: z.object({ field: z.string().min(1) }),\n show_conversion: z.boolean().optional(),\n color: ColorSchema.optional(),\n});\n\n// Waterfall chart config\nconst WaterfallChartConfigSchema = z.object({\n type: z.literal('waterfall'),\n category: z.object({ field: z.string().min(1) }),\n value: z.object({ field: z.string().min(1) }),\n total_field: z.string().optional(),\n series: LongFormatSeriesSchema.optional(), // Stacked breakdown within each waterfall step\n colors: z.object({\n increase: z.string().optional(),\n decrease: z.string().optional(),\n total: z.string().optional(),\n }).optional(),\n});\n\n// Sankey chart config\nconst SankeyChartConfigSchema = z.object({\n type: z.literal('sankey'),\n source: z.object({ field: z.string().min(1) }),\n target: z.object({ field: z.string().min(1) }),\n value: z.object({ field: z.string().min(1) }),\n levels: z.array(z.array(z.string())).optional(),\n orient: z.enum(['horizontal', 'vertical']).optional(),\n node_width: z.number().positive().optional(),\n node_gap: z.number().nonnegative().optional(),\n label_position: z.enum(['left', 'right', 'top', 'bottom', 'inside']).optional(),\n});\nexport type SankeyChartConfig = z.infer<typeof SankeyChartConfigSchema>;\n\n// Gauge chart config\nconst GaugeThresholdSchema = z.object({\n value: z.number(),\n color: z.string(),\n});\n\nconst GaugeChartConfigSchema = z.object({\n type: z.literal('gauge'),\n value: z.object({ field: z.string().min(1) }),\n min: z.number().optional(),\n max: z.number().optional(),\n unit: z.string().optional(),\n thresholds: z.array(GaugeThresholdSchema).optional(),\n format: z.string().optional(),\n goal: KpiGoalSchema.optional(),\n});\n\nconst TableColumnSummarySchema = z.enum(['sum', 'avg', 'min', 'max', 'count']);\n\nconst PivotAggregateSchema = z.enum(['sum', 'avg', 'min', 'max', 'count']);\n\nconst PivotValueSchema = z.object({\n field: z.string().min(1),\n aggregate: PivotAggregateSchema.default('sum'),\n format: z.string().optional(),\n heatmap: z.boolean().optional(),\n});\n\nconst PivotHeatmapSchema = z.object({\n color: z.string().optional(),\n scope: z.enum(['column', 'global']).optional(),\n});\n\nconst PivotConfigSchema = z.object({\n rows: z.array(z.string().min(1)).min(1),\n columns: z.string().min(1),\n values: z.array(PivotValueSchema).min(1),\n subtotals: z.boolean().optional(),\n grandTotals: z.boolean().optional(),\n heatmap: PivotHeatmapSchema.optional(),\n});\n\nconst TableChartConfigSchema = z.object({\n type: z.literal('table'),\n columns: z.array(z.object({\n field: z.string().min(1),\n label: z.string().optional(),\n format: z.string().optional(),\n sticky: z.boolean().optional(),\n summary: TableColumnSummarySchema.optional(),\n overflow: z.enum(['ellipsis', 'wrap', 'hidden']).optional(),\n font: z.enum(['mono']).optional(),\n })).optional(),\n summary: z.object({\n label: z.string().optional(),\n }).optional(),\n sort: z.object({\n field: z.string().min(1),\n direction: z.enum(['asc', 'desc']).optional(),\n }).optional(),\n pagination: z.object({\n enabled: z.boolean().optional(),\n page_size: z.number().int().positive().optional(),\n mode: z.enum(['paginated', 'infinite_scroll']).optional(),\n server_side: z.boolean().optional(),\n }).optional(),\n max_rows: z.number().int().positive().optional(),\n export: z.object({\n enabled: z.boolean().optional(),\n max_rows: z.number().int().positive().optional(),\n }).optional(),\n pivot: PivotConfigSchema.optional(),\n});\n\n// Chart visualization config - standard, KPI, combo, scatter, heatmap, funnel, waterfall, gauge, or table\nconst ChartConfigSchema = z.union([\n ScatterChartConfigSchema,\n ComboChartConfigSchema,\n HeatmapChartConfigSchema,\n FunnelChartConfigSchema,\n WaterfallChartConfigSchema,\n GaugeChartConfigSchema,\n SankeyChartConfigSchema,\n TableChartConfigSchema,\n StandardChartConfigSchema,\n KpiConfigSchema,\n]);\n\n// Parameter types\nconst ParameterTypeSchema = z.enum([\n 'date_range',\n 'select',\n 'multi_select',\n 'dynamic_select',\n 'text',\n 'number',\n 'boolean',\n]);\n\n// Parameter option\nconst ParameterOptionSchema = z.union([\n z.string(),\n z.object({\n value: z.string(),\n label: z.string(),\n }),\n]);\n\n// Parameter source (for dynamic options)\nconst ParameterSourceSchema = z.object({\n model: z.string(),\n value_field: z.string(),\n label_field: z.string(),\n});\n\n// Parameter definition\nconst ParameterSchema = z.object({\n name: z.string().min(1),\n type: ParameterTypeSchema,\n label: z.string().optional(),\n description: z.string().optional(),\n default: z.union([z.string(), z.number(), z.array(z.string())]).optional(),\n options: z.array(ParameterOptionSchema).optional(),\n source: ParameterSourceSchema.optional(),\n});\n\n// Data source - either model reference or inline SQL\nconst SourceSchema = z.object({\n model: z.string().optional(),\n sql: z.string().optional(),\n}).refine(\n (data) => data.model !== undefined || data.sql !== undefined,\n { message: 'Source must specify either model or sql' }\n).refine(\n (data) => !(data.model !== undefined && data.sql !== undefined),\n { message: 'Source cannot specify both model and sql' }\n);\n\n// Refresh/cache configuration\nconst RefreshSchema = z.object({\n schedule: z.string().optional(), // cron expression\n timezone: z.string().optional(),\n cache_ttl: z.string().optional(), // e.g., \"1h\", \"30m\"\n});\n\n// Drill-down column config for data table display\nconst DrillDownColumnSchema = z.object({\n field: z.string().min(1),\n label: z.string().optional(),\n format: z.string().optional(),\n});\n\n// Drill-down configuration\nconst DrillDownConfigSchema = z.object({\n chart: z.string().optional(), // target chart name (source side)\n model: z.string().optional(), // model name for row-level detail data\n field: z.string().optional(), // field to pass as filter, defaults to x-axis field (backward compat)\n fields: z.union([z.string(), z.array(z.string())]).optional(), // dimension field(s) for filtering\n columns: z.array(DrillDownColumnSchema).optional(), // data table columns (target side)\n}).refine(data => data.chart || data.model || data.columns, {\n message: \"drillDown requires 'chart', 'model', or 'columns'\",\n});\n\n// Main chart schema\nexport const ChartSchema = z.object({\n // Identity\n name: z.string().min(1),\n title: z.string().min(1),\n description: z.string().optional(),\n\n // Metadata\n owner: z.string().optional(),\n tags: z.array(z.string()).optional(),\n created: z.string().optional(),\n updated: z.string().optional(),\n\n // Data\n source: SourceSchema,\n parameters: z.array(ParameterSchema).optional(),\n\n // Visualization\n chart: ChartConfigSchema,\n\n // Caching\n refresh: RefreshSchema.optional(),\n\n // Drill-down navigation\n drillDown: DrillDownConfigSchema.optional(),\n});\n\nexport type Chart = z.infer<typeof ChartSchema>;\nexport type ChartConfig = z.infer<typeof ChartConfigSchema>;\nexport type ChartType = z.infer<typeof ChartTypeSchema>;\nexport type Parameter = z.infer<typeof ParameterSchema>;\nexport type Axis = z.infer<typeof AxisSchema>;\nexport type SeriesConfig = z.infer<typeof SeriesConfigSchema>;\nexport type LongFormatSeries = z.infer<typeof LongFormatSeriesSchema>;\nexport type WideFormatSeries = z.infer<typeof WideFormatSeriesSchema>;\nexport type WideFormatColumn = z.infer<typeof WideFormatColumnSchema>;\nexport type ColorConfig = z.infer<typeof ColorSchema>;\nexport type ConditionalColor = z.infer<typeof ConditionalColorSchema>;\nexport type ColorCondition = z.infer<typeof ColorConditionSchema>;\nexport type GradientConfig = z.infer<typeof GradientSchema>;\nexport type LegendConfig = z.infer<typeof LegendSchema>;\nexport type ComboChartConfig = z.infer<typeof ComboChartConfigSchema>;\nexport type DualAxes = z.infer<typeof DualAxesSchema>;\nexport type ScatterChartConfig = z.infer<typeof ScatterChartConfigSchema>;\nexport type ScatterSize = z.infer<typeof ScatterSizeSchema>;\nexport type ScatterGroup = z.infer<typeof ScatterGroupSchema>;\nexport type RegressionConfig = z.infer<typeof RegressionSchema>;\nexport type DrillDownConfig = z.infer<typeof DrillDownConfigSchema>;\nexport type DrillDownColumn = z.infer<typeof DrillDownColumnSchema>;\nexport type HeatmapChartConfig = z.infer<typeof HeatmapChartConfigSchema>;\nexport type FunnelChartConfig = z.infer<typeof FunnelChartConfigSchema>;\nexport type WaterfallChartConfig = z.infer<typeof WaterfallChartConfigSchema>;\nexport type GaugeChartConfig = z.infer<typeof GaugeChartConfigSchema>;\nexport type TableChartConfig = z.infer<typeof TableChartConfigSchema>;\nexport type PivotConfig = z.infer<typeof PivotConfigSchema>;\nexport type PivotValueConfig = z.infer<typeof PivotValueSchema>;\nexport type PivotHeatmapConfig = z.infer<typeof PivotHeatmapSchema>;\nexport type GoalConfig = z.infer<typeof GoalSchema>;\nexport type FixedGoal = z.infer<typeof FixedGoalSchema>;\nexport type CumulativeGoal = z.infer<typeof CumulativeGoalSchema>;\nexport type ModelGoal = z.infer<typeof ModelGoalSchema>;\nexport type KpiGoal = z.infer<typeof KpiGoalSchema>;\nexport type GoalZone = z.infer<typeof GoalZoneSchema>;\n\nexport { ParameterSchema };\n","import { z } from 'zod';\nimport { SemanticConfigSchema } from './semantic.js';\n\n// Default settings\nconst DefaultsSchema = z.object({\n connection: z.string().optional(),\n theme: z.string().optional(),\n timezone: z.string().optional(),\n cache_ttl: z.string().optional(),\n base_url: z.string().url().optional(),\n week_start: z.enum(['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday']).optional(),\n table: z.object({\n max_display_rows: z.number().int().positive().optional(),\n max_export_rows: z.number().int().positive().optional(),\n }).optional(),\n});\n\n// Git integration settings\nconst GitSchema = z.object({\n provider: z.enum(['github', 'gitlab', 'bitbucket']).optional(),\n repo: z.string().optional(),\n branch: z.string().optional(),\n preview_branches: z.boolean().optional(),\n});\n\n// SSO provider configuration\nconst SSOProviderSchema = z.object({\n client_id: z.string(),\n client_secret: z.string(),\n tenant: z.string().optional(),\n issuer: z.string().optional(),\n display_name: z.string().optional(),\n});\n\n// Authentication settings (built-in local auth)\nconst AuthSchema = z.object({\n enabled: z.boolean(),\n db_path: z.string().optional(),\n session_ttl: z.string().optional(),\n providers: z.object({\n google: SSOProviderSchema.optional(),\n microsoft: SSOProviderSchema.optional(),\n oidc: SSOProviderSchema.optional(),\n }).optional(),\n});\n\n// Feature flags\nconst FeaturesSchema = z.object({\n enable_sql_editor: z.boolean().optional(),\n enable_csv_export: z.boolean().optional(),\n enable_scheduling: z.boolean().optional(),\n chat: z.boolean().optional(),\n});\n\n// Sidebar link for external navigation\nconst SidebarLinkSchema = z.object({\n label: z.string(),\n url: z.string(),\n icon: z.string().optional(),\n});\n\n// Sidebar configuration\nconst SidebarConfigSchema = z.object({\n show: z.boolean().optional(),\n collapsed: z.boolean().optional(),\n links: z.array(SidebarLinkSchema).optional(),\n sections: z.object({\n dashboards: z.boolean().optional(),\n charts: z.boolean().optional(),\n }).optional(),\n});\n\n// Color configuration\nconst ColorsSchema = z.object({\n primary: z.string().optional(),\n background: z.string().optional(),\n surface: z.string().optional(),\n sidebar: z.string().optional(),\n text: z.string().optional(),\n});\n\n// Font configuration\nconst FontsSchema = z.object({\n heading: z.string().optional(),\n body: z.string().optional(),\n mono: z.string().optional(),\n size: z.enum(['compact', 'default', 'comfortable']).optional(),\n});\n\n// Logo can be a string path or light/dark object\nconst LogoSchema = z.union([\n z.string(),\n z.object({\n light: z.string(),\n dark: z.string(),\n }),\n]);\n\n// Theme configuration\nconst ThemeSchema = z.object({\n mode: z.enum(['light', 'dark', 'auto']).optional(),\n base: z.enum(['modern', 'executive', 'minimal']).optional(),\n logo: LogoSchema.optional(),\n favicon: z.string().optional(),\n title: z.string().optional(),\n colors: ColorsSchema.optional(),\n palette: z.array(z.string()).optional(),\n gradient: z.boolean().default(false),\n opacity: z.number().min(0).max(1).default(1.0),\n fonts: FontsSchema.optional(),\n sidebar: SidebarConfigSchema.optional(),\n customCss: z.string().optional(),\n});\n\n// Environment-specific overrides — same shape as ProjectSchema minus identity fields\nconst EnvironmentOverrideSchema = z.object({\n defaults: DefaultsSchema.optional(),\n git: GitSchema.optional(),\n auth: AuthSchema.optional(),\n features: FeaturesSchema.optional(),\n theme: ThemeSchema.optional(),\n semantic: SemanticConfigSchema.optional(),\n}).passthrough();\n\n/**\n * Deep-merge two plain objects. Objects merge recursively;\n * arrays and scalars in override replace the base value entirely.\n */\nexport function deepMerge<T extends Record<string, unknown>>(\n base: T,\n override: Record<string, unknown> | undefined,\n): T {\n if (!override) return { ...base };\n\n const result = { ...base } as Record<string, unknown>;\n for (const [key, value] of Object.entries(override)) {\n if (\n value !== null &&\n typeof value === 'object' &&\n !Array.isArray(value) &&\n typeof result[key] === 'object' &&\n result[key] !== null &&\n !Array.isArray(result[key])\n ) {\n result[key] = deepMerge(\n result[key] as Record<string, unknown>,\n value as Record<string, unknown>,\n );\n } else {\n result[key] = value;\n }\n }\n return result as T;\n}\n\n/**\n * Resolve a raw yamchart.yaml object for a given environment.\n * Extracts and merges the matching environments block, then strips\n * the environments key. Does NOT validate — caller runs Zod after\n * optionally merging yamchart.local.yaml on top.\n */\nexport function resolveProjectConfig(\n raw: Record<string, unknown>,\n env?: string,\n): Record<string, unknown> {\n const { environments, ...base } = raw;\n const envBlocks = environments as Record<string, Record<string, unknown>> | undefined;\n const envOverride = env ? envBlocks?.[env] : undefined;\n return deepMerge(base as Record<string, unknown>, envOverride);\n}\n\n// Catalog filter configuration\nconst CatalogIncludeSchema = z.object({\n schemas: z.array(z.string()).optional(),\n tags: z.array(z.string()).optional(),\n});\n\nconst CatalogConfigSchema = z.object({\n include: CatalogIncludeSchema.optional(),\n});\n\nexport type CatalogConfig = z.infer<typeof CatalogConfigSchema>;\n\n// Main project schema\nexport const ProjectSchema = z.object({\n version: z.string().min(1),\n name: z.string().min(1),\n description: z.string().optional(),\n\n defaults: DefaultsSchema.optional(),\n\n environments: z.record(z.string(), EnvironmentOverrideSchema).optional(),\n\n git: GitSchema.optional(),\n auth: AuthSchema.optional(),\n features: FeaturesSchema.optional(),\n theme: ThemeSchema.optional(),\n semantic: SemanticConfigSchema,\n catalog: CatalogConfigSchema.optional(),\n});\n\nexport type Project = z.infer<typeof ProjectSchema>;\nexport type Auth = z.infer<typeof AuthSchema>;\nexport type Defaults = z.infer<typeof DefaultsSchema>;\nexport type EnvironmentOverride = z.infer<typeof EnvironmentOverrideSchema>;\nexport type Theme = z.infer<typeof ThemeSchema>;\nexport type SidebarConfig = z.infer<typeof SidebarConfigSchema>;\nexport type FontsConfig = z.infer<typeof FontsSchema>;\nexport type ColorsConfig = z.infer<typeof ColorsSchema>;\n","import { z } from 'zod';\n\n// --- Semantic Model ---\n\nexport const MeasureTypeSchema = z.enum(['sum', 'count', 'avg', 'min', 'max', 'count_distinct']);\n\nexport const DimensionTypeSchema = z.enum(['string', 'number', 'time', 'boolean']);\n\nexport const MeasureSchema = z.object({\n name: z.string(),\n type: MeasureTypeSchema,\n description: z.string().optional(),\n format: z.string().optional(),\n});\n\nexport const DimensionSchema = z.object({\n name: z.string(),\n type: DimensionTypeSchema,\n description: z.string().optional(),\n});\n\nexport const SemanticEntitySchema = z.object({\n name: z.string(),\n description: z.string().optional(),\n source: z.enum(['catalog', 'model']),\n source_table: z.string(),\n measures: z.array(MeasureSchema),\n dimensions: z.array(DimensionSchema),\n parameters: z.array(z.object({\n name: z.string(),\n type: z.string(),\n default: z.union([z.string(), z.number()]).optional(),\n options: z.array(z.string()).optional(),\n })).optional(),\n});\n\nexport const RelationshipSchema = z.object({\n from: z.object({ entity: z.string(), field: z.string() }),\n to: z.object({ entity: z.string(), field: z.string() }),\n type: z.enum(['many_to_one', 'one_to_many', 'one_to_one']),\n});\n\nexport const SemanticModelSchema = z.object({\n entities: z.array(SemanticEntitySchema),\n relationships: z.array(RelationshipSchema),\n generated_at: z.string(),\n});\n\n// --- Structured Query ---\n\nexport const SemanticFilterOperatorSchema = z.enum([\n 'equals', 'not_equals', 'contains', 'gt', 'gte', 'lt', 'lte', 'in', 'not_in',\n]);\n\nexport const SemanticFilterSchema = z.object({\n dimension: z.string(),\n operator: SemanticFilterOperatorSchema,\n value: z.union([z.string(), z.number(), z.boolean(), z.array(z.union([z.string(), z.number()]))]),\n});\n\nexport const SemanticQuerySchema = z.object({\n model: z.string(),\n measures: z.array(z.string()).min(1),\n dimensions: z.array(z.string()).optional().default([]),\n parameters: z.record(z.union([z.string(), z.number()])).optional(),\n filters: z.array(SemanticFilterSchema).optional().default([]),\n order_by: z.object({\n field: z.string(),\n direction: z.enum(['asc', 'desc']).default('asc'),\n }).optional(),\n limit: z.number().int().positive().max(10000).optional().default(1000),\n});\n\n// --- Semantic Config (for yamchart.yaml) ---\n\nexport const SemanticConfigSchema = z.object({\n include: z.object({\n paths: z.array(z.string()).default(['gold/', 'marts/', 'core/']),\n prefixes: z.array(z.string()).default(['dim_', 'fct_', 'fact_']),\n }).optional().default({\n paths: ['gold/', 'marts/', 'core/'],\n prefixes: ['dim_', 'fct_', 'fact_'],\n }),\n}).optional();\n\n// --- Inferred types ---\n\nexport type Measure = z.infer<typeof MeasureSchema>;\nexport type MeasureType = z.infer<typeof MeasureTypeSchema>;\nexport type Dimension = z.infer<typeof DimensionSchema>;\nexport type DimensionType = z.infer<typeof DimensionTypeSchema>;\nexport type SemanticEntity = z.infer<typeof SemanticEntitySchema>;\nexport type Relationship = z.infer<typeof RelationshipSchema>;\nexport type SemanticModel = z.infer<typeof SemanticModelSchema>;\nexport type SemanticFilter = z.infer<typeof SemanticFilterSchema>;\nexport type SemanticQuery = z.infer<typeof SemanticQuerySchema>;\nexport type SemanticConfig = z.infer<typeof SemanticConfigSchema>;\n","import { z } from 'zod';\n\n// Parameter type\nconst ParamTypeSchema = z.enum(['string', 'number', 'date', 'boolean', 'string[]', 'number[]']);\n\n// Model parameter\nconst ModelParamSchema = z.object({\n name: z.string().min(1),\n type: ParamTypeSchema,\n default: z.string().optional(),\n options: z.array(z.string()).optional(), // For enum-like params\n description: z.string().optional(),\n});\n\n// Return column definition\nconst ReturnColumnSchema = z.object({\n name: z.string().min(1),\n type: z.string(),\n description: z.string().optional(),\n});\n\n// Model metadata (extracted from SQL comments)\nexport const ModelMetadataSchema = z.object({\n name: z.string().min(1),\n description: z.string().optional(),\n owner: z.string().optional(),\n tags: z.array(z.string()).optional(),\n\n params: z.array(ModelParamSchema).optional(),\n returns: z.array(ReturnColumnSchema).optional(),\n tests: z.array(z.string()).optional(), // SQL assertions\n});\n\n// Full model (metadata + SQL)\nexport const ModelSchema = z.object({\n metadata: ModelMetadataSchema,\n sql: z.string().min(1),\n filePath: z.string().optional(),\n});\n\nexport type ModelMetadata = z.infer<typeof ModelMetadataSchema>;\nexport type ModelParam = z.infer<typeof ModelParamSchema>;\nexport type ReturnColumn = z.infer<typeof ReturnColumnSchema>;\nexport type Model = z.infer<typeof ModelSchema>;\n","import { z } from 'zod';\nimport { ParameterSchema } from './chart.js';\n\n// Widget types\nconst ChartWidgetSchema = z.object({\n type: z.literal('chart'),\n ref: z.string().min(1),\n cols: z.number().min(1).max(12),\n height: z.number().min(38).optional(),\n x: z.number().min(0).max(11).optional(),\n y: z.number().min(0).optional(),\n});\n\nconst TextWidgetSchema = z.object({\n type: z.literal('text'),\n content: z.string(),\n cols: z.number().min(1).max(12),\n height: z.number().min(38).optional(),\n x: z.number().min(0).max(11).optional(),\n y: z.number().min(0).optional(),\n});\n\nconst WidgetSchema = z.discriminatedUnion('type', [\n ChartWidgetSchema,\n TextWidgetSchema,\n]);\n\n// Row configuration\nconst RowSchema = z.object({\n height: z.number().min(38),\n widgets: z.array(WidgetSchema).min(1),\n});\n\n// Layout configuration\nconst LayoutSchema = z.object({\n gap: z.number().min(0).default(16),\n rows: z.array(RowSchema).min(1),\n});\n\n// Tab configuration\nconst TabSchema = z.object({\n name: z.string().min(1),\n label: z.string().min(1),\n filters: z.array(ParameterSchema).optional(),\n layout: LayoutSchema,\n});\n\n// Main dashboard schema\nexport const DashboardSchema = z.object({\n // Identity\n name: z.string().min(1),\n title: z.string().min(1),\n description: z.string().optional(),\n\n // Filters inherited by all widgets (shared across tabs)\n filters: z.array(ParameterSchema).optional(),\n\n // Layout definition (mutually exclusive with tabs)\n layout: LayoutSchema.optional(),\n\n // Tabbed layout\n tabs: z.array(TabSchema).min(1).optional(),\n}).superRefine((data, ctx) => {\n if (data.layout && data.tabs) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'Dashboard must have either \"layout\" or \"tabs\", not both',\n path: ['tabs'],\n });\n }\n if (!data.layout && !data.tabs) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: 'Dashboard must have either \"layout\" or \"tabs\"',\n path: [],\n });\n }\n});\n\nexport type Dashboard = z.infer<typeof DashboardSchema>;\nexport type DashboardTab = z.infer<typeof TabSchema>;\nexport type DashboardLayout = z.infer<typeof LayoutSchema>;\nexport type DashboardRow = z.infer<typeof RowSchema>;\nexport type DashboardWidget = z.infer<typeof WidgetSchema>;\nexport type ChartWidget = z.infer<typeof ChartWidgetSchema>;\nexport type TextWidget = z.infer<typeof TextWidgetSchema>;\n","import { z } from 'zod';\n\nconst SlackChannelSchema = z.object({\n webhook_url: z.string().min(1),\n channel: z.string().optional(),\n});\n\nconst ChannelSchema = z.object({\n slack: SlackChannelSchema,\n});\n\nconst ConditionOperatorSchema = z.enum(['lt', 'gt', 'lte', 'gte', 'eq']);\n\nconst ConditionSchema = z.object({\n field: z.string().min(1),\n operator: ConditionOperatorSchema,\n value: z.number(),\n});\n\nconst ReportScheduleSchema = z.object({\n name: z.string().min(1),\n type: z.literal('report'),\n schedule: z.string().min(1),\n timezone: z.string().optional(),\n channel: ChannelSchema,\n charts: z.array(z.string().min(1)).min(1),\n params: z.record(z.unknown()).optional(),\n message: z.string().optional(),\n notify_on_error: z.boolean().optional(),\n});\n\nconst AlertScheduleSchema = z.object({\n name: z.string().min(1),\n type: z.literal('alert'),\n schedule: z.string().min(1),\n timezone: z.string().optional(),\n channel: ChannelSchema,\n chart: z.string().min(1),\n params: z.record(z.unknown()).optional(),\n condition: ConditionSchema,\n cooldown: z.string().optional(),\n message: z.string().optional(),\n notify_on_error: z.boolean().optional(),\n});\n\nexport const ScheduleSchema = z.discriminatedUnion('type', [\n ReportScheduleSchema,\n AlertScheduleSchema,\n]);\n\nexport type Schedule = z.infer<typeof ScheduleSchema>;\nexport type ReportSchedule = z.infer<typeof ReportScheduleSchema>;\nexport type AlertSchedule = z.infer<typeof AlertScheduleSchema>;\nexport type Condition = z.infer<typeof ConditionSchema>;\nexport type ConditionOperator = z.infer<typeof ConditionOperatorSchema>;\n","import { z } from 'zod';\n\nexport const EventSchema = z.object({\n date: z.string(),\n endDate: z.string().optional(),\n label: z.string(),\n description: z.string().optional(),\n color: z.string().optional(),\n charts: z.array(z.string()).optional(),\n});\n\nexport const EventsFileSchema = z.object({\n events: z.array(EventSchema).default([]),\n});\n\nexport type ChartEvent = z.infer<typeof EventSchema>;\nexport type EventsFile = z.infer<typeof EventsFileSchema>;\n","import { z } from 'zod';\n\n/**\n * Zod schema for validating agent YAML files (agents/*.yaml).\n * system_prompt is treated as a plain string — Jinja rendering happens at load time in packages/chat.\n */\nexport const AgentDefinitionSchema = z.object({\n name: z.string(),\n title: z.string().optional(),\n description: z.string(),\n system_prompt: z.string(),\n tools: z.array(z.string()).default([]),\n model: z.string().optional(),\n models: z.array(z.string()).optional(),\n});\n\nexport type AgentDefinition = z.infer<typeof AgentDefinitionSchema>;\n","// Yamchart Schema - Zod schemas and TypeScript types\nexport const VERSION = '0.1.0';\n\nexport * from './connection.js';\nexport * from './chart.js';\nexport * from './project.js';\nexport * from './model.js';\nexport * from './dashboard.js';\nexport * from './schedule.js';\nexport * from './events.js';\nexport * from './semantic.js';\nexport { AgentDefinitionSchema, type AgentDefinition } from './agent.js';\n"],"mappings":";AAAA,SAAS,SAAS;AAGlB,IAAM,gBAAgB,EAAE,OAAO;EAC7B,MAAM,EAAE,QAAQ,KAAK;EACrB,UAAU,EAAE,OAAM;EAClB,cAAc,EAAE,OAAM;CACvB;AAED,IAAM,oBAAoB,EAAE,OAAO;EACjC,MAAM,EAAE,QAAQ,UAAU;EAC1B,UAAU,EAAE,OAAM;EAClB,kBAAkB,EAAE,OAAM;CAC3B;AAED,IAAM,0BAA0B,EAAE,OAAO;EACvC,MAAM,EAAE,QAAQ,gBAAgB;EAChC,UAAU,EAAE,KAAK,CAAC,uBAAuB,sBAAsB,OAAO,CAAC;EACvE,WAAW,EAAE,OAAM;CACpB;AAED,IAAM,4BAA4B,EAAE,OAAO;EACzC,MAAM,EAAE,QAAQ,iBAAiB;EACjC,UAAU,EAAE,OAAM;EAClB,aAAa,EAAE,QAAO,EAAG,SAAQ;CAClC;AAED,IAAM,aAAa,EAAE,mBAAmB,QAAQ;EAC9C;EACA;EACA;EACA;CACD;AAGD,IAAM,mBAAmB,EAAE,OAAO;EAChC,iBAAiB,EAAE,OAAM,EAAG,IAAG,EAAG,SAAQ,EAAG,SAAQ;EACrD,iBAAiB,EAAE,OAAM,EAAG,IAAG,EAAG,SAAQ,EAAG,SAAQ;EACrD,cAAc,EAAE,OAAM,EAAG,IAA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f,aAAaA,GAAE,OAAM,EAAG,SAAQ;EAChC,OAAOA,GAAE,OAAM,EAAG,SAAQ;EAC1B,QAAQA,GAAE,MAAMA,GAAE,OAAM,CAAE,EAAE,SAAQ;CACrC;AAEM,IAAM,mBAAmBA,GAAE,OAAO;EACvC,QAAQA,GAAE,MAAM,WAAW,EAAE,QAAQ,CAAA,CAAE;CACxC;;;ACbD,SAAS,KAAAC,UAAS;AAMX,IAAM,wBAAwBA,GAAE,OAAO;EAC5C,MAAMA,GAAE,OAAM;EACd,OAAOA,GAAE,OAAM,EAAG,SAAQ;EAC1B,aAAaA,GAAE,OAAM;EACrB,eAAeA,GAAE,OAAM;EACvB,OAAOA,GAAE,MAAMA,GAAE,OAAM,CAAE,EAAE,QAAQ,CAAA,CAAE;EACrC,OAAOA,GAAE,OAAM,EAAG,SAAQ;EAC1B,QAAQA,GAAE,MAAMA,GAAE,OAAM,CAAE,EAAE,SAAQ;CACrC;;;ACbM,IAAM,UAAU;","names":["z","z","z","z","AuthSchema","z","z","z","z","z","z"]}
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ConnectionSchema
3
- } from "./chunk-E2QN2M7S.js";
3
+ } from "./chunk-LQN2HNQZ.js";
4
4
  import {
5
5
  DuckDBConnector,
6
6
  MySQLConnector,
@@ -20,7 +20,7 @@ async function loadProjectConfig(projectDir, env) {
20
20
  const configPath = join(projectDir, "yamchart.yaml");
21
21
  const content = await readFile(configPath, "utf-8");
22
22
  const raw = parseYaml(content);
23
- const { resolveProjectConfig, deepMerge } = await import("./dist-4GUE24QV.js");
23
+ const { resolveProjectConfig, deepMerge } = await import("./dist-OAKQOG6H.js");
24
24
  const resolvedEnv = env || process.env.YAMCHART_ENV || void 0;
25
25
  let merged = resolveProjectConfig(raw, resolvedEnv);
26
26
  const localPath = join(projectDir, "yamchart.local.yaml");
@@ -180,4 +180,4 @@ export {
180
180
  formatTable,
181
181
  formatJSON
182
182
  };
183
- //# sourceMappingURL=chunk-AMHCOB4D.js.map
183
+ //# sourceMappingURL=chunk-R22XWFKX.js.map
@@ -4,7 +4,7 @@ import {
4
4
  DashboardSchema,
5
5
  ProjectSchema,
6
6
  ScheduleSchema
7
- } from "./chunk-E2QN2M7S.js";
7
+ } from "./chunk-LQN2HNQZ.js";
8
8
  import {
9
9
  parseModelMetadata
10
10
  } from "./chunk-CWAWATL4.js";
@@ -360,4 +360,4 @@ export {
360
360
  findProjectRoot,
361
361
  loadEnvFile
362
362
  };
363
- //# sourceMappingURL=chunk-G57J2WQM.js.map
363
+ //# sourceMappingURL=chunk-XDDBDJQL.js.map
@@ -4,8 +4,8 @@ import {
4
4
  formatTable,
5
5
  loadProjectConfig,
6
6
  resolveConnection
7
- } from "./chunk-AMHCOB4D.js";
8
- import "./chunk-E2QN2M7S.js";
7
+ } from "./chunk-R22XWFKX.js";
8
+ import "./chunk-LQN2HNQZ.js";
9
9
  import "./chunk-CWAWATL4.js";
10
10
  import "./chunk-UND73EOB.js";
11
11
  import "./chunk-DGUM43GV.js";
@@ -16,4 +16,4 @@ export {
16
16
  loadProjectConfig,
17
17
  resolveConnection
18
18
  };
19
- //# sourceMappingURL=connection-utils-CTPN7PV3.js.map
19
+ //# sourceMappingURL=connection-utils-WVQGWJ7H.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  resolveDescribeSource
3
- } from "./chunk-FZFBBB7K.js";
3
+ } from "./chunk-LQANFANB.js";
4
4
  import "./chunk-VJC24RKT.js";
5
5
  import "./chunk-EHM6AMMA.js";
6
- import "./chunk-AMHCOB4D.js";
7
- import "./chunk-E2QN2M7S.js";
6
+ import "./chunk-R22XWFKX.js";
7
+ import "./chunk-LQN2HNQZ.js";
8
8
  import "./chunk-CWAWATL4.js";
9
9
  import "./chunk-UND73EOB.js";
10
10
  import "./chunk-DGUM43GV.js";
@@ -26,4 +26,4 @@ async function describeTable(projectDir, table, options) {
26
26
  export {
27
27
  describeTable
28
28
  };
29
- //# sourceMappingURL=describe-4NME6RCB.js.map
29
+ //# sourceMappingURL=describe-UETE5XYO.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  loadEnvFile,
3
3
  validateProject
4
- } from "./chunk-G57J2WQM.js";
4
+ } from "./chunk-XDDBDJQL.js";
5
5
  import {
6
6
  box,
7
7
  detail,
@@ -23,7 +23,7 @@ import {
23
23
  SemanticQuerySchema,
24
24
  deepMerge,
25
25
  resolveProjectConfig
26
- } from "./chunk-E2QN2M7S.js";
26
+ } from "./chunk-LQN2HNQZ.js";
27
27
  import {
28
28
  StreamingChatAgent,
29
29
  filterCatalogEntries
@@ -15166,7 +15166,7 @@ async function runDevServer(projectDir, options) {
15166
15166
  try {
15167
15167
  const { readFileSync: readFileSync2 } = await import("fs");
15168
15168
  const { parse: parse2 } = await import("yaml");
15169
- const { resolveProjectConfig: resolveProjectConfig2, deepMerge: deepMerge3 } = await import("./dist-4GUE24QV.js");
15169
+ const { resolveProjectConfig: resolveProjectConfig2, deepMerge: deepMerge3 } = await import("./dist-OAKQOG6H.js");
15170
15170
  const raw = readFileSync2(resolve2(projectDir, "yamchart.yaml"), "utf-8");
15171
15171
  const rawConfig = parse2(raw);
15172
15172
  const resolvedEnv = options.env || process.env.YAMCHART_ENV || void 0;
@@ -15270,4 +15270,4 @@ async function runDevServer(projectDir, options) {
15270
15270
  export {
15271
15271
  runDevServer
15272
15272
  };
15273
- //# sourceMappingURL=dev-6QGAB4ZH.js.map
15273
+ //# sourceMappingURL=dev-2WLFE37D.js.map
@@ -24,7 +24,7 @@ import {
24
24
  VERSION,
25
25
  deepMerge,
26
26
  resolveProjectConfig
27
- } from "./chunk-E2QN2M7S.js";
27
+ } from "./chunk-LQN2HNQZ.js";
28
28
  import "./chunk-DGUM43GV.js";
29
29
  export {
30
30
  AgentDefinitionSchema,
@@ -53,4 +53,4 @@ export {
53
53
  deepMerge,
54
54
  resolveProjectConfig
55
55
  };
56
- //# sourceMappingURL=dist-4GUE24QV.js.map
56
+ //# sourceMappingURL=dist-OAKQOG6H.js.map
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  findProjectRoot,
7
7
  loadEnvFile,
8
8
  validateProject
9
- } from "./chunk-G57J2WQM.js";
9
+ } from "./chunk-XDDBDJQL.js";
10
10
  import {
11
11
  detail,
12
12
  error,
@@ -17,7 +17,7 @@ import {
17
17
  success,
18
18
  warning
19
19
  } from "./chunk-HJVVHYVN.js";
20
- import "./chunk-E2QN2M7S.js";
20
+ import "./chunk-LQN2HNQZ.js";
21
21
  import "./chunk-CWAWATL4.js";
22
22
  import "./chunk-UND73EOB.js";
23
23
  import "./chunk-DGUM43GV.js";
@@ -105,7 +105,7 @@ program.command("dev").description("Start development server with hot reload").a
105
105
  process.exit(2);
106
106
  }
107
107
  const globalOpts = program.opts();
108
- const { runDevServer } = await import("./dev-6QGAB4ZH.js");
108
+ const { runDevServer } = await import("./dev-2WLFE37D.js");
109
109
  await runDevServer(projectDir, {
110
110
  port: parseInt(options.port, 10),
111
111
  apiOnly: options.apiOnly ?? false,
@@ -179,7 +179,7 @@ program.command("sync-dbt").description("Sync dbt project metadata into AI-reada
179
179
  if (!options.targetDatabase) {
180
180
  try {
181
181
  const { readFile } = await import("fs/promises");
182
- const { resolveConnection } = await import("./connection-utils-CTPN7PV3.js");
182
+ const { resolveConnection } = await import("./connection-utils-WVQGWJ7H.js");
183
183
  const { detectDatabaseMismatch } = await import("./rewrite-database-FDJIXKZ2.js");
184
184
  const catalogJsonStr = await readFile(join(projectDir, ".yamchart", "catalog.json"), "utf-8");
185
185
  const catalogData = JSON.parse(catalogJsonStr);
@@ -233,7 +233,7 @@ program.command("test").description("Run model tests (@returns schema checks and
233
233
  }
234
234
  loadEnvFile(projectDir);
235
235
  try {
236
- const { testProject, formatTestOutput } = await import("./test-I4XOF7TZ.js");
236
+ const { testProject, formatTestOutput } = await import("./test-MXNBCQ3G.js");
237
237
  const result = await testProject(projectDir, model, {
238
238
  connection: options.connection,
239
239
  json: options.json
@@ -282,7 +282,7 @@ program.command("tables").description("List tables and views in the connected da
282
282
  loadEnvFile(projectDir);
283
283
  try {
284
284
  if (options.compare) {
285
- const { resolveTablesSource } = await import("./source-resolver-4SUWXUGW.js");
285
+ const { resolveTablesSource } = await import("./source-resolver-VAXDVSDF.js");
286
286
  const { compareTables, formatCompareTables } = await import("./compare-ZN6RUOOQ.js");
287
287
  let localResult;
288
288
  try {
@@ -313,7 +313,7 @@ program.command("tables").description("List tables and views in the connected da
313
313
  }
314
314
  return;
315
315
  }
316
- const { listTables } = await import("./tables-WJS2VI4L.js");
316
+ const { listTables } = await import("./tables-6TODJHM5.js");
317
317
  const result = await listTables(projectDir, {
318
318
  ...options,
319
319
  source: options.source || "auto"
@@ -351,7 +351,7 @@ program.command("describe").description("Show columns and types for a table").ar
351
351
  loadEnvFile(projectDir);
352
352
  try {
353
353
  if (options.compare) {
354
- const { resolveDescribeSource } = await import("./source-resolver-4SUWXUGW.js");
354
+ const { resolveDescribeSource } = await import("./source-resolver-VAXDVSDF.js");
355
355
  const { compareColumns, formatCompareColumns } = await import("./compare-ZN6RUOOQ.js");
356
356
  let localResult;
357
357
  try {
@@ -373,7 +373,7 @@ program.command("describe").description("Show columns and types for a table").ar
373
373
  }
374
374
  return;
375
375
  }
376
- const { describeTable } = await import("./describe-4NME6RCB.js");
376
+ const { describeTable } = await import("./describe-UETE5XYO.js");
377
377
  const result = await describeTable(projectDir, table, {
378
378
  ...options,
379
379
  source: options.source || "auto"
@@ -412,8 +412,8 @@ program.command("query").description("Execute SQL against a connection").argumen
412
412
  }
413
413
  loadEnvFile(projectDir);
414
414
  try {
415
- const { executeQuery } = await import("./query-Z75RKTHV.js");
416
- const { formatTable, formatJSON } = await import("./connection-utils-CTPN7PV3.js");
415
+ const { executeQuery } = await import("./query-E6NFXKV6.js");
416
+ const { formatTable, formatJSON } = await import("./connection-utils-WVQGWJ7H.js");
417
417
  const limit = options.limit ? parseInt(options.limit, 10) : void 0;
418
418
  const result = await executeQuery(projectDir, sql, {
419
419
  connection: options.connection,
@@ -440,8 +440,8 @@ program.command("sample").description("Show sample rows from a table or dbt mode
440
440
  }
441
441
  loadEnvFile(projectDir);
442
442
  try {
443
- const { sampleTable } = await import("./sample-OIJNXQNC.js");
444
- const { formatTable, formatJSON } = await import("./connection-utils-CTPN7PV3.js");
443
+ const { sampleTable } = await import("./sample-YLJC5H5X.js");
444
+ const { formatTable, formatJSON } = await import("./connection-utils-WVQGWJ7H.js");
445
445
  const limit = options.limit ? parseInt(options.limit, 10) : void 0;
446
446
  const result = await sampleTable(projectDir, table, {
447
447
  connection: options.connection,
@@ -471,7 +471,7 @@ program.command("search").description("Search for tables and columns by keyword"
471
471
  }
472
472
  loadEnvFile(projectDir);
473
473
  try {
474
- const { searchDatabase } = await import("./search-YDCPIDZX.js");
474
+ const { searchDatabase } = await import("./search-QDOSNM2R.js");
475
475
  const result = await searchDatabase(projectDir, keyword, {
476
476
  ...options,
477
477
  source: options.source || "auto"
@@ -525,7 +525,7 @@ catalogCmd.command("tables").description("List tables from cached catalog").opti
525
525
  process.exit(2);
526
526
  }
527
527
  try {
528
- const { listTables } = await import("./tables-WJS2VI4L.js");
528
+ const { listTables } = await import("./tables-6TODJHM5.js");
529
529
  const result = await listTables(projectDir, {
530
530
  source: "catalog",
531
531
  schema: options.schema
@@ -567,7 +567,7 @@ catalogCmd.command("describe").description("Show cached columns and types for a
567
567
  process.exit(2);
568
568
  }
569
569
  try {
570
- const { describeTable } = await import("./describe-4NME6RCB.js");
570
+ const { describeTable } = await import("./describe-UETE5XYO.js");
571
571
  const result = await describeTable(projectDir, table, { source: "catalog" });
572
572
  if (options.json) {
573
573
  console.log(JSON.stringify(result.columns, null, 2));
@@ -609,7 +609,7 @@ catalogCmd.command("search").description("Search cached metadata for tables and
609
609
  process.exit(2);
610
610
  }
611
611
  try {
612
- const { searchDatabase } = await import("./search-YDCPIDZX.js");
612
+ const { searchDatabase } = await import("./search-QDOSNM2R.js");
613
613
  const result = await searchDatabase(projectDir, keyword, { source: "catalog" });
614
614
  if (options.json) {
615
615
  console.log(JSON.stringify(result.results, null, 2));
@@ -734,7 +734,7 @@ program.command("sync-warehouse").description("Sync warehouse table metadata int
734
734
  }
735
735
  loadEnvFile(projectDir);
736
736
  try {
737
- const { runSyncWarehouse } = await import("./sync-warehouse-NZFDS6WK.js");
737
+ const { runSyncWarehouse } = await import("./sync-warehouse-5HEGZJHG.js");
738
738
  await runSyncWarehouse(projectDir, options);
739
739
  } catch (err) {
740
740
  error(err instanceof Error ? err.message : String(err));
@@ -785,7 +785,7 @@ program.command("advisor").description("AI-powered dbt model advisor \u2014 sugg
785
785
  process.exit(2);
786
786
  }
787
787
  loadEnvFile(projectDir);
788
- const { runAdvisor } = await import("./advisor-Z7TKPPBR.js");
788
+ const { runAdvisor } = await import("./advisor-HVD4FJ56.js");
789
789
  await runAdvisor(projectDir, question, {
790
790
  top: options.top ? parseInt(options.top, 10) : 5,
791
791
  json: options.json,
@@ -875,7 +875,7 @@ semanticCmd.command("query").description("Run a structured query against the sem
875
875
  console.log(result.sql);
876
876
  return;
877
877
  }
878
- const { resolveConnection, createConnector, formatTable, formatJSON } = await import("./connection-utils-CTPN7PV3.js");
878
+ const { resolveConnection, createConnector, formatTable, formatJSON } = await import("./connection-utils-WVQGWJ7H.js");
879
879
  const connection = await resolveConnection(projectDir, options.connection, program.opts().env);
880
880
  const connector = createConnector(connection, projectDir);
881
881
  const start = performance.now();
@@ -1,4 +1,4 @@
1
- import{t as xe,u as he,v as me,e as be,w as $,j as t,x as E,E as ce,M as fe,y as ve,z as je,I as Ce,a as S}from"./index-DD59fsOk.js";import{a as s}from"./echarts-DtOYsfLX.js";const ge=`
1
+ import{t as xe,u as he,v as me,e as be,w as $,j as t,x as E,E as ce,M as fe,y as ve,z as je,I as Ce,a as S}from"./index-CJ01RqZ2.js";import{a as s}from"./echarts-DtOYsfLX.js";const ge=`
2
2
  .rdp-root {
3
3
  --rdp-accent-color: var(--yc-color-primary, #2563eb);
4
4
  --rdp-accent-background-color: color-mix(in srgb, var(--yc-color-primary, #2563eb) 15%, transparent);
@@ -1 +1 @@
1
- import{j as e,i as k,J as E,K as B,v as M,N as W,O as $,a as D}from"./index-DD59fsOk.js";import{a}from"./echarts-DtOYsfLX.js";const T=["What data do I have?","Show me recent trends","What are the top items by revenue?","Compare this month to last month"];function P({summary:t,onPromptClick:i}){return e.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-6 py-12 gap-8",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-bold mb-2",style:{color:"var(--yc-color-text)"},children:"Data Explorer"}),e.jsx("p",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"Ask questions about your data in plain English"})]}),t&&(t.tableCount>0||t.modelCount>0)&&e.jsxs("div",{className:"rounded-xl px-5 py-4 w-full max-w-md flex flex-col gap-3",style:{background:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--yc-color-text-secondary)"},children:"Connected data"}),e.jsxs("div",{className:"flex gap-6",children:[t.tableCount>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xl font-bold",style:{color:"var(--yc-color-text)"},children:t.tableCount}),e.jsx("span",{className:"text-xs ml-1",style:{color:"var(--yc-color-text-secondary)"},children:t.tableCount===1?"table":"tables"})]}),t.modelCount>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xl font-bold",style:{color:"var(--yc-color-text)"},children:t.modelCount}),e.jsx("span",{className:"text-xs ml-1",style:{color:"var(--yc-color-text-secondary)"},children:t.modelCount===1?"model":"models"})]})]}),t.connections.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.connections.map(l=>e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{background:"var(--yc-color-bg)",color:"var(--yc-color-text-secondary)",border:"1px solid var(--yc-color-border)"},children:l.name},l.name))})]}),e.jsx("div",{className:"flex flex-wrap gap-2 justify-center max-w-lg",children:T.map(l=>e.jsx("button",{onClick:()=>i(l),className:"text-sm px-3 py-1.5 rounded-full transition-opacity hover:opacity-80",style:{background:"var(--yc-color-surface)",color:"var(--yc-color-text)",border:"1px solid var(--yc-color-border)"},children:l},l))})]})}function R({summary:t,onTableClick:i}){const[l,x]=a.useState(new Set),[n,h]=a.useState(new Set),v=s=>{x(o=>{const c=new Set(o);return c.has(s)?c.delete(s):c.add(s),c})},f=s=>{h(o=>{const c=new Set(o);return c.has(s)?c.delete(s):c.add(s),c})},y=((t==null?void 0:t.connections)??[]).map(s=>({connection:s.name,tables:((t==null?void 0:t.tables)??[]).filter(o=>o.connection===s.name)})),u=(t==null?void 0:t.models)??[];return e.jsxs("div",{className:"w-64 flex-shrink-0 flex flex-col h-full overflow-y-auto",style:{borderRight:"1px solid var(--yc-color-border)",background:"var(--yc-color-surface)"},children:[e.jsx("div",{className:"px-3 py-2 flex items-center",style:{borderBottom:"1px solid var(--yc-color-border)"},children:e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--yc-color-text-secondary)"},children:"Catalog"})}),e.jsxs("div",{className:"flex-1 overflow-y-auto py-2",children:[y.map(s=>e.jsxs("div",{children:[e.jsxs("button",{className:"w-full flex items-center gap-1.5 px-3 py-1.5 hover:opacity-80 text-left",onClick:()=>v(s.connection),children:[e.jsx(g,{expanded:l.has(s.connection)}),e.jsx(I,{}),e.jsx("span",{className:"text-xs font-medium truncate",style:{color:"var(--yc-color-text)"},children:s.connection}),e.jsx("span",{className:"ml-auto text-xs",style:{color:"var(--yc-color-text-secondary)"},children:s.tables.length})]}),l.has(s.connection)&&e.jsx("div",{children:s.tables.map(o=>{const c=`${s.connection}:${o.name}`,m=n.has(c);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1 pl-6 pr-2 py-1 group",children:[e.jsxs("button",{className:"flex items-center gap-1 flex-1 min-w-0 hover:opacity-80 text-left",onClick:()=>f(c),children:[e.jsx(g,{expanded:m}),e.jsx(A,{}),e.jsx("span",{className:"text-xs truncate",style:{color:"var(--yc-color-text)"},children:o.schema?`${o.schema}.${o.name}`:o.name})]}),e.jsx("button",{className:"opacity-0 group-hover:opacity-100 text-xs px-1.5 py-0.5 rounded transition-opacity flex-shrink-0",style:{background:"var(--yc-color-primary)",color:"#fff"},onClick:()=>i(o.schema?`${o.schema}.${o.name}`:o.name),title:`Ask about ${o.name}`,children:"Ask"})]}),m&&o.columns.length>0&&e.jsx("div",{className:"pl-12 pb-1",children:o.columns.map(d=>e.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 pr-2",children:[e.jsx("span",{className:"text-xs truncate",style:{color:"var(--yc-color-text)"},children:d.name}),d.type&&e.jsx("span",{className:"text-xs ml-auto flex-shrink-0",style:{color:"var(--yc-color-text-secondary)"},children:d.type})]},d.name))})]},c)})})]},s.connection)),u.length>0&&e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"px-3 py-1.5",style:{borderTop:"1px solid var(--yc-color-border)"},children:e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--yc-color-text-secondary)"},children:"Models"})}),u.map(s=>e.jsxs("div",{className:"flex items-center gap-1.5 pl-3 pr-2 py-1.5 group",children:[e.jsx(O,{}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs truncate",style:{color:"var(--yc-color-text)"},children:s.name}),s.description&&e.jsx("p",{className:"text-xs truncate",style:{color:"var(--yc-color-text-secondary)"},children:s.description})]}),e.jsx("button",{className:"opacity-0 group-hover:opacity-100 text-xs px-1.5 py-0.5 rounded transition-opacity flex-shrink-0",style:{background:"var(--yc-color-primary)",color:"#fff"},onClick:()=>i(s.name),title:`Ask about ${s.name}`,children:"Ask"})]},s.name))]}),!t||y.length===0&&u.length===0?e.jsx("div",{className:"px-3 py-4 text-center",children:e.jsxs("p",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:["No catalog data available. Run ",e.jsx("code",{className:"font-mono",children:"yamchart sync-warehouse"})," to populate."]})}):null]})]})}function g({expanded:t}){return e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--yc-color-text-secondary)",transform:t?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s",flexShrink:0},children:e.jsx("polyline",{points:"9 18 15 12 9 6"})})}function I(){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--yc-color-text-secondary)",flexShrink:0},children:[e.jsx("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),e.jsx("path",{d:"M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"}),e.jsx("path",{d:"M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"})]})}function A(){return e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--yc-color-text-secondary)",flexShrink:0},children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M3 9h18M3 15h18M9 3v18"})]})}function O(){return e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--yc-color-text-secondary)",flexShrink:0},children:[e.jsx("polyline",{points:"16 18 22 12 16 6"}),e.jsx("polyline",{points:"8 6 2 12 8 18"})]})}function q(){const t=k(n=>n.savedCharts),[i,l]=a.useState(!1),x=a.useRef(null);return a.useEffect(()=>{if(!i)return;function n(h){x.current&&!x.current.contains(h.target)&&l(!1)}return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[i]),t.length===0?null:e.jsxs("div",{className:"relative",ref:x,children:[e.jsxs("button",{onClick:()=>l(n=>!n),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-opacity hover:opacity-80",style:{background:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)",color:"var(--yc-color-text)"},children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"7",height:"7"}),e.jsx("rect",{x:"14",y:"3",width:"7",height:"7"}),e.jsx("rect",{x:"14",y:"14",width:"7",height:"7"}),e.jsx("rect",{x:"3",y:"14",width:"7",height:"7"})]}),e.jsxs("span",{children:[t.length," saved ",t.length===1?"chart":"charts"]}),e.jsx("span",{className:"inline-flex items-center justify-center w-5 h-5 rounded-full text-xs font-bold text-white",style:{background:"var(--yc-color-primary)"},children:t.length})]}),i&&e.jsxs("div",{className:"absolute right-0 top-full mt-1 w-56 rounded-lg shadow-lg z-50 py-1",style:{background:"var(--yc-color-bg)",border:"1px solid var(--yc-color-border)"},children:[e.jsx("p",{className:"px-3 py-1.5 text-xs font-semibold uppercase tracking-wide",style:{color:"var(--yc-color-text-secondary)"},children:"Saved charts"}),t.map(n=>e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--yc-color-primary)",flexShrink:0},children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),e.jsx("span",{className:"text-sm truncate",style:{color:"var(--yc-color-text)"},children:n})]},n))]})]})}function V(){const t=E(),{messages:i,isStreaming:l,savedCharts:x,openPanel:n,setPanelMode:h,snapshotExploreHistory:v,clearConversation:f}=k(),[y,u]=a.useState(!0),[s,o]=a.useState(void 0),c=a.useRef(null);a.useEffect(()=>(h("explore"),n({type:"explore"}),()=>{h("panel")}),[h,n]),a.useEffect(()=>{var r;(r=c.current)==null||r.scrollIntoView({behavior:"smooth"})},[i]);const m=a.useCallback((r,p,S)=>{v(p),h("panel");const L=r==="chart"?"charts":"dashboards";window.location.hash=`/${L}/${encodeURIComponent(p)}${S?"?edit=true":""}`,n({type:r==="chart"?"chart":"dashboard",name:p})},[v,h,n]),{sendMessage:d}=B(m),{data:j}=M({queryKey:["catalog-summary"],queryFn:()=>D.getCatalogSummary(),staleTime:6e4,retry:!1}),b=a.useCallback(r=>{o(`Tell me about the ${r} table`)},[]),w=a.useCallback(r=>{d(r)},[d]),N=a.useCallback(r=>{d(r),o(void 0)},[d]),C=a.useCallback(()=>{const r=x.join(", ");d(`Build a dashboard using these charts: ${r}. Arrange them in a logical layout.`)},[x,d]);return t==="sm"?e.jsx("div",{className:"flex items-center justify-center h-screen px-6",style:{background:"var(--yc-color-bg)"},children:e.jsxs("div",{className:"text-center max-w-xs",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",style:{color:"var(--yc-color-text)"},children:"Desktop required"}),e.jsx("p",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"Data Explorer is designed for larger screens. Please open it on a desktop or laptop."})]})}):e.jsxs("div",{className:"flex h-screen overflow-hidden",style:{background:"var(--yc-color-bg)"},children:[y&&e.jsx(R,{summary:j??null,onTableClick:b}),e.jsxs("div",{className:"flex-1 flex flex-col h-full min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 flex-shrink-0",style:{borderBottom:"1px solid var(--yc-color-border)"},children:[e.jsxs("a",{href:"#/",className:"flex items-center gap-1.5 text-sm hover:opacity-80",style:{color:"var(--yc-color-text-secondary)"},onClick:r=>{r.preventDefault(),window.location.hash="/"},children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"15 18 9 12 15 6"})}),"Dashboards"]}),e.jsx("div",{className:"w-px h-4 mx-1",style:{background:"var(--yc-color-border)"}}),e.jsx("button",{className:"p-1.5 rounded hover:opacity-80",style:{color:"var(--yc-color-text-secondary)"},onClick:()=>u(r=>!r),title:y?"Hide catalog":"Show catalog",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M9 3v18"})]})}),e.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--yc-color-text)"},children:"Data Explorer"}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.jsx(q,{}),e.jsxs("button",{disabled:x.length===0||l,onClick:C,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-opacity disabled:opacity-40",style:{background:"var(--yc-color-primary)",color:"#fff"},children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"7",height:"7"}),e.jsx("rect",{x:"14",y:"3",width:"7",height:"7"}),e.jsx("rect",{x:"14",y:"14",width:"7",height:"7"}),e.jsx("rect",{x:"3",y:"14",width:"7",height:"7"})]}),"Build Dashboard"]}),i.length>0&&e.jsx("button",{className:"p-1.5 rounded hover:opacity-80",style:{color:"var(--yc-color-text-secondary)"},onClick:f,title:"New conversation",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12 20h9"}),e.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]})})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4 flex flex-col gap-3 min-h-0",children:i.length===0?e.jsx(P,{summary:j??null,onPromptClick:w}):e.jsxs(e.Fragment,{children:[i.map((r,p)=>e.jsx(W,{message:r,isStreaming:l&&p===i.length-1&&r.role==="assistant",onSendMessage:d},p)),e.jsx("div",{ref:c})]})}),e.jsx("div",{className:"px-6 py-3 flex-shrink-0",style:{borderTop:"1px solid var(--yc-color-border)"},children:e.jsx($,{onSend:N,placeholder:"Ask about your data...",disabled:l,initialValue:s})})]})]})}export{V as default};
1
+ import{j as e,i as k,J as E,K as B,v as M,N as W,O as $,a as D}from"./index-CJ01RqZ2.js";import{a}from"./echarts-DtOYsfLX.js";const T=["What data do I have?","Show me recent trends","What are the top items by revenue?","Compare this month to last month"];function P({summary:t,onPromptClick:i}){return e.jsxs("div",{className:"flex flex-col items-center justify-center h-full px-6 py-12 gap-8",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("h1",{className:"text-2xl font-bold mb-2",style:{color:"var(--yc-color-text)"},children:"Data Explorer"}),e.jsx("p",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"Ask questions about your data in plain English"})]}),t&&(t.tableCount>0||t.modelCount>0)&&e.jsxs("div",{className:"rounded-xl px-5 py-4 w-full max-w-md flex flex-col gap-3",style:{background:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)"},children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--yc-color-text-secondary)"},children:"Connected data"}),e.jsxs("div",{className:"flex gap-6",children:[t.tableCount>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xl font-bold",style:{color:"var(--yc-color-text)"},children:t.tableCount}),e.jsx("span",{className:"text-xs ml-1",style:{color:"var(--yc-color-text-secondary)"},children:t.tableCount===1?"table":"tables"})]}),t.modelCount>0&&e.jsxs("div",{children:[e.jsx("span",{className:"text-xl font-bold",style:{color:"var(--yc-color-text)"},children:t.modelCount}),e.jsx("span",{className:"text-xs ml-1",style:{color:"var(--yc-color-text-secondary)"},children:t.modelCount===1?"model":"models"})]})]}),t.connections.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.connections.map(l=>e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full",style:{background:"var(--yc-color-bg)",color:"var(--yc-color-text-secondary)",border:"1px solid var(--yc-color-border)"},children:l.name},l.name))})]}),e.jsx("div",{className:"flex flex-wrap gap-2 justify-center max-w-lg",children:T.map(l=>e.jsx("button",{onClick:()=>i(l),className:"text-sm px-3 py-1.5 rounded-full transition-opacity hover:opacity-80",style:{background:"var(--yc-color-surface)",color:"var(--yc-color-text)",border:"1px solid var(--yc-color-border)"},children:l},l))})]})}function R({summary:t,onTableClick:i}){const[l,x]=a.useState(new Set),[n,h]=a.useState(new Set),v=s=>{x(o=>{const c=new Set(o);return c.has(s)?c.delete(s):c.add(s),c})},f=s=>{h(o=>{const c=new Set(o);return c.has(s)?c.delete(s):c.add(s),c})},y=((t==null?void 0:t.connections)??[]).map(s=>({connection:s.name,tables:((t==null?void 0:t.tables)??[]).filter(o=>o.connection===s.name)})),u=(t==null?void 0:t.models)??[];return e.jsxs("div",{className:"w-64 flex-shrink-0 flex flex-col h-full overflow-y-auto",style:{borderRight:"1px solid var(--yc-color-border)",background:"var(--yc-color-surface)"},children:[e.jsx("div",{className:"px-3 py-2 flex items-center",style:{borderBottom:"1px solid var(--yc-color-border)"},children:e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--yc-color-text-secondary)"},children:"Catalog"})}),e.jsxs("div",{className:"flex-1 overflow-y-auto py-2",children:[y.map(s=>e.jsxs("div",{children:[e.jsxs("button",{className:"w-full flex items-center gap-1.5 px-3 py-1.5 hover:opacity-80 text-left",onClick:()=>v(s.connection),children:[e.jsx(g,{expanded:l.has(s.connection)}),e.jsx(I,{}),e.jsx("span",{className:"text-xs font-medium truncate",style:{color:"var(--yc-color-text)"},children:s.connection}),e.jsx("span",{className:"ml-auto text-xs",style:{color:"var(--yc-color-text-secondary)"},children:s.tables.length})]}),l.has(s.connection)&&e.jsx("div",{children:s.tables.map(o=>{const c=`${s.connection}:${o.name}`,m=n.has(c);return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1 pl-6 pr-2 py-1 group",children:[e.jsxs("button",{className:"flex items-center gap-1 flex-1 min-w-0 hover:opacity-80 text-left",onClick:()=>f(c),children:[e.jsx(g,{expanded:m}),e.jsx(A,{}),e.jsx("span",{className:"text-xs truncate",style:{color:"var(--yc-color-text)"},children:o.schema?`${o.schema}.${o.name}`:o.name})]}),e.jsx("button",{className:"opacity-0 group-hover:opacity-100 text-xs px-1.5 py-0.5 rounded transition-opacity flex-shrink-0",style:{background:"var(--yc-color-primary)",color:"#fff"},onClick:()=>i(o.schema?`${o.schema}.${o.name}`:o.name),title:`Ask about ${o.name}`,children:"Ask"})]}),m&&o.columns.length>0&&e.jsx("div",{className:"pl-12 pb-1",children:o.columns.map(d=>e.jsxs("div",{className:"flex items-center gap-1.5 py-0.5 pr-2",children:[e.jsx("span",{className:"text-xs truncate",style:{color:"var(--yc-color-text)"},children:d.name}),d.type&&e.jsx("span",{className:"text-xs ml-auto flex-shrink-0",style:{color:"var(--yc-color-text-secondary)"},children:d.type})]},d.name))})]},c)})})]},s.connection)),u.length>0&&e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"px-3 py-1.5",style:{borderTop:"1px solid var(--yc-color-border)"},children:e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--yc-color-text-secondary)"},children:"Models"})}),u.map(s=>e.jsxs("div",{className:"flex items-center gap-1.5 pl-3 pr-2 py-1.5 group",children:[e.jsx(O,{}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs truncate",style:{color:"var(--yc-color-text)"},children:s.name}),s.description&&e.jsx("p",{className:"text-xs truncate",style:{color:"var(--yc-color-text-secondary)"},children:s.description})]}),e.jsx("button",{className:"opacity-0 group-hover:opacity-100 text-xs px-1.5 py-0.5 rounded transition-opacity flex-shrink-0",style:{background:"var(--yc-color-primary)",color:"#fff"},onClick:()=>i(s.name),title:`Ask about ${s.name}`,children:"Ask"})]},s.name))]}),!t||y.length===0&&u.length===0?e.jsx("div",{className:"px-3 py-4 text-center",children:e.jsxs("p",{className:"text-xs",style:{color:"var(--yc-color-text-secondary)"},children:["No catalog data available. Run ",e.jsx("code",{className:"font-mono",children:"yamchart sync-warehouse"})," to populate."]})}):null]})]})}function g({expanded:t}){return e.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--yc-color-text-secondary)",transform:t?"rotate(90deg)":"rotate(0deg)",transition:"transform 0.15s",flexShrink:0},children:e.jsx("polyline",{points:"9 18 15 12 9 6"})})}function I(){return e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--yc-color-text-secondary)",flexShrink:0},children:[e.jsx("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),e.jsx("path",{d:"M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"}),e.jsx("path",{d:"M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"})]})}function A(){return e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--yc-color-text-secondary)",flexShrink:0},children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M3 9h18M3 15h18M9 3v18"})]})}function O(){return e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--yc-color-text-secondary)",flexShrink:0},children:[e.jsx("polyline",{points:"16 18 22 12 16 6"}),e.jsx("polyline",{points:"8 6 2 12 8 18"})]})}function q(){const t=k(n=>n.savedCharts),[i,l]=a.useState(!1),x=a.useRef(null);return a.useEffect(()=>{if(!i)return;function n(h){x.current&&!x.current.contains(h.target)&&l(!1)}return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[i]),t.length===0?null:e.jsxs("div",{className:"relative",ref:x,children:[e.jsxs("button",{onClick:()=>l(n=>!n),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-opacity hover:opacity-80",style:{background:"var(--yc-color-surface)",border:"1px solid var(--yc-color-border)",color:"var(--yc-color-text)"},children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"7",height:"7"}),e.jsx("rect",{x:"14",y:"3",width:"7",height:"7"}),e.jsx("rect",{x:"14",y:"14",width:"7",height:"7"}),e.jsx("rect",{x:"3",y:"14",width:"7",height:"7"})]}),e.jsxs("span",{children:[t.length," saved ",t.length===1?"chart":"charts"]}),e.jsx("span",{className:"inline-flex items-center justify-center w-5 h-5 rounded-full text-xs font-bold text-white",style:{background:"var(--yc-color-primary)"},children:t.length})]}),i&&e.jsxs("div",{className:"absolute right-0 top-full mt-1 w-56 rounded-lg shadow-lg z-50 py-1",style:{background:"var(--yc-color-bg)",border:"1px solid var(--yc-color-border)"},children:[e.jsx("p",{className:"px-3 py-1.5 text-xs font-semibold uppercase tracking-wide",style:{color:"var(--yc-color-text-secondary)"},children:"Saved charts"}),t.map(n=>e.jsxs("div",{className:"flex items-center gap-2 px-3 py-2",children:[e.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:{color:"var(--yc-color-primary)",flexShrink:0},children:e.jsx("polyline",{points:"20 6 9 17 4 12"})}),e.jsx("span",{className:"text-sm truncate",style:{color:"var(--yc-color-text)"},children:n})]},n))]})]})}function V(){const t=E(),{messages:i,isStreaming:l,savedCharts:x,openPanel:n,setPanelMode:h,snapshotExploreHistory:v,clearConversation:f}=k(),[y,u]=a.useState(!0),[s,o]=a.useState(void 0),c=a.useRef(null);a.useEffect(()=>(h("explore"),n({type:"explore"}),()=>{h("panel")}),[h,n]),a.useEffect(()=>{var r;(r=c.current)==null||r.scrollIntoView({behavior:"smooth"})},[i]);const m=a.useCallback((r,p,S)=>{v(p),h("panel");const L=r==="chart"?"charts":"dashboards";window.location.hash=`/${L}/${encodeURIComponent(p)}${S?"?edit=true":""}`,n({type:r==="chart"?"chart":"dashboard",name:p})},[v,h,n]),{sendMessage:d}=B(m),{data:j}=M({queryKey:["catalog-summary"],queryFn:()=>D.getCatalogSummary(),staleTime:6e4,retry:!1}),b=a.useCallback(r=>{o(`Tell me about the ${r} table`)},[]),w=a.useCallback(r=>{d(r)},[d]),N=a.useCallback(r=>{d(r),o(void 0)},[d]),C=a.useCallback(()=>{const r=x.join(", ");d(`Build a dashboard using these charts: ${r}. Arrange them in a logical layout.`)},[x,d]);return t==="sm"?e.jsx("div",{className:"flex items-center justify-center h-screen px-6",style:{background:"var(--yc-color-bg)"},children:e.jsxs("div",{className:"text-center max-w-xs",children:[e.jsx("p",{className:"text-lg font-semibold mb-2",style:{color:"var(--yc-color-text)"},children:"Desktop required"}),e.jsx("p",{className:"text-sm",style:{color:"var(--yc-color-text-secondary)"},children:"Data Explorer is designed for larger screens. Please open it on a desktop or laptop."})]})}):e.jsxs("div",{className:"flex h-screen overflow-hidden",style:{background:"var(--yc-color-bg)"},children:[y&&e.jsx(R,{summary:j??null,onTableClick:b}),e.jsxs("div",{className:"flex-1 flex flex-col h-full min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 flex-shrink-0",style:{borderBottom:"1px solid var(--yc-color-border)"},children:[e.jsxs("a",{href:"#/",className:"flex items-center gap-1.5 text-sm hover:opacity-80",style:{color:"var(--yc-color-text-secondary)"},onClick:r=>{r.preventDefault(),window.location.hash="/"},children:[e.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("polyline",{points:"15 18 9 12 15 6"})}),"Dashboards"]}),e.jsx("div",{className:"w-px h-4 mx-1",style:{background:"var(--yc-color-border)"}}),e.jsx("button",{className:"p-1.5 rounded hover:opacity-80",style:{color:"var(--yc-color-text-secondary)"},onClick:()=>u(r=>!r),title:y?"Hide catalog":"Show catalog",children:e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),e.jsx("path",{d:"M9 3v18"})]})}),e.jsx("span",{className:"text-sm font-semibold",style:{color:"var(--yc-color-text)"},children:"Data Explorer"}),e.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[e.jsx(q,{}),e.jsxs("button",{disabled:x.length===0||l,onClick:C,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition-opacity disabled:opacity-40",style:{background:"var(--yc-color-primary)",color:"#fff"},children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"3",width:"7",height:"7"}),e.jsx("rect",{x:"14",y:"3",width:"7",height:"7"}),e.jsx("rect",{x:"14",y:"14",width:"7",height:"7"}),e.jsx("rect",{x:"3",y:"14",width:"7",height:"7"})]}),"Build Dashboard"]}),i.length>0&&e.jsx("button",{className:"p-1.5 rounded hover:opacity-80",style:{color:"var(--yc-color-text-secondary)"},onClick:f,title:"New conversation",children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M12 20h9"}),e.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"})]})})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4 flex flex-col gap-3 min-h-0",children:i.length===0?e.jsx(P,{summary:j??null,onPromptClick:w}):e.jsxs(e.Fragment,{children:[i.map((r,p)=>e.jsx(W,{message:r,isStreaming:l&&p===i.length-1&&r.role==="assistant",onSendMessage:d},p)),e.jsx("div",{ref:c})]})}),e.jsx("div",{className:"px-6 py-3 flex-shrink-0",style:{borderTop:"1px solid var(--yc-color-border)"},children:e.jsx($,{onSend:N,placeholder:"Ask about your data...",disabled:l,initialValue:s})})]})]})}export{V as default};