@duckcodeailabs/dql-cli 1.5.0 → 1.5.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.
@@ -412,7 +412,7 @@ export async function startLocalServer(opts) {
412
412
  tileType: 'aiPin',
413
413
  title: item.title ?? pin.title,
414
414
  viz: item.viz,
415
- chartConfig: pin.chartConfig ?? { chart: item.viz.type },
415
+ chartConfig: mergeDashboardChartConfig(pin.chartConfig, item),
416
416
  result: pin.result,
417
417
  aiPin: pin,
418
418
  citation: {
@@ -468,7 +468,7 @@ export async function startLocalServer(opts) {
468
468
  certificationStatus: block.status ?? null,
469
469
  title: item.title ?? block.name,
470
470
  viz: item.viz,
471
- chartConfig: plan?.chartConfig ?? { chart: item.viz.type },
471
+ chartConfig: mergeDashboardChartConfig(plan?.chartConfig, item),
472
472
  result: normalizeQueryResult(result),
473
473
  citation: {
474
474
  kind: 'block',
@@ -1278,7 +1278,7 @@ export async function startLocalServer(opts) {
1278
1278
  }
1279
1279
  if (req.method === 'PATCH' && candidateId && !action) {
1280
1280
  const body = await readJSON(req);
1281
- const reviewStatus = typeof body.reviewStatus === 'string' && ['draft', 'saved', 'rejected'].includes(body.reviewStatus)
1281
+ const reviewStatus = typeof body.reviewStatus === 'string' && ['draft', 'review', 'saved', 'rejected'].includes(body.reviewStatus)
1282
1282
  ? body.reviewStatus
1283
1283
  : undefined;
1284
1284
  const candidate = updateBlockStudioImportCandidate(projectRoot, importId, candidateId, {
@@ -2951,6 +2951,21 @@ function resolveDashboardItemBlock(item, manifest) {
2951
2951
  const normalizedRef = normalize(item.block.ref).replaceAll('\\', '/');
2952
2952
  return Object.values(manifest.blocks).find((b) => normalize(b.filePath).replaceAll('\\', '/') === normalizedRef) ?? null;
2953
2953
  }
2954
+ function mergeDashboardChartConfig(base, item) {
2955
+ const options = item.viz.options ?? {};
2956
+ const baseChart = base?.chart;
2957
+ return {
2958
+ ...(base ?? {}),
2959
+ ...options,
2960
+ chart: dashboardVizToChart(String(options.chart ?? baseChart ?? item.viz.type)),
2961
+ };
2962
+ }
2963
+ function dashboardVizToChart(value) {
2964
+ const normalized = value.toLowerCase().replace(/_/g, '-');
2965
+ if (normalized === 'single-value')
2966
+ return 'kpi';
2967
+ return normalized;
2968
+ }
2954
2969
  export function serializeJSON(value) {
2955
2970
  return JSON.stringify(value, (_key, current) => {
2956
2971
  if (typeof current === 'bigint') {