@burdenoff/mcp-libs 2026.1107.1 → 2026.1107.3

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.
@@ -294,12 +294,46 @@ var EXPORT_DASHBOARD = `
294
294
  }
295
295
  `;
296
296
  var IMPORT_DASHBOARD = `
297
- mutation BigConsoleMcpImportDashboard($input: BigConsoleImportDashboardInput!) {
298
- importDashboard(input: $input) {
299
- id
300
- name
301
- pageCount
302
- widgetCount
297
+ mutation BigConsoleMcpImportDashboard($input: ImportBigConsoleDashboardInput!) {
298
+ importBigConsoleDashboard(input: $input) {
299
+ success
300
+ errorMessage
301
+ dashboard {
302
+ id
303
+ name
304
+ pageCount
305
+ widgetCount
306
+ }
307
+ stats {
308
+ pagesCreated
309
+ widgetsCreated
310
+ actionsCreated
311
+ filtersCreated
312
+ dataSourcesSkipped
313
+ }
314
+ }
315
+ }
316
+ `;
317
+ var VALIDATE_DASHBOARD_IMPORT = `
318
+ query BigConsoleMcpValidateDashboardImport($content: String!) {
319
+ validateDashboardImport(content: $content) {
320
+ isValid
321
+ dashboardInfo {
322
+ name
323
+ pageCount
324
+ widgetCount
325
+ schemaVersion
326
+ }
327
+ errors {
328
+ code
329
+ message
330
+ path
331
+ }
332
+ warnings {
333
+ code
334
+ message
335
+ suggestion
336
+ }
303
337
  }
304
338
  }
305
339
  `;
@@ -361,7 +395,6 @@ var DashboardVisibilityEnum = zod.z.enum(["PRIVATE", "WORKSPACE", "PUBLIC"]).des
361
395
  var ParserTypeEnum = zod.z.enum(["jq", "jsonata", "spark"]).describe("Parser transform engine \u2014 prefer jq");
362
396
  var ParserStatusEnum = zod.z.enum(["active", "inactive"]).describe("Parser status");
363
397
  var DataSinkStatusEnum = zod.z.enum(["ready", "refreshing", "stale", "error"]).describe("Data sink status filter");
364
- var ConflictResolutionEnum = zod.z.enum(["RENAME", "OVERWRITE", "FAIL"]).describe("Import conflict strategy (default RENAME)");
365
398
  var DATA_SINK_KEY_PATTERN = /^[a-z0-9_]+$/;
366
399
  var DataSinkKey = zod.z.string().regex(
367
400
  DATA_SINK_KEY_PATTERN,
@@ -566,25 +599,46 @@ function registerDashboardTools(server, ctx, track) {
566
599
  track(mcpToolName(ctx.productName, "dashboard_import")),
567
600
  {
568
601
  title: "Import Dashboard (Console Definition JSON)",
569
- description: "Reconstruct a dashboard from a Console Definition JSON string (from dashboard_export). This is the cross-workspace move: export in one workspace, import the string in another. Imported ids are REGENERATED \u2014 re-bind anything that referenced the old dashboard by id. " + WORKSPACE_NOTE,
602
+ description: "Reconstruct a dashboard from a Console Definition JSON string (from dashboard_export). This is the cross-workspace move: export in one workspace, import the string in another. Uses the v2.0 import path with per-entity stats \u2014 do NOT pair an export with the legacy importDashboard mutation, which expects the deprecated v1 layout and silently imports an empty dashboard. Imported ids are REGENERATED \u2014 re-bind anything that referenced the old dashboard by id. " + WORKSPACE_NOTE,
570
603
  inputSchema: {
571
- json: zod.z.string().describe("The Console Definition JSON string"),
604
+ content: zod.z.string().describe("The Console Definition JSON string"),
572
605
  name: zod.z.string().optional().describe("Override the dashboard name"),
573
606
  visibility: DashboardVisibilityEnum.optional(),
574
- conflictResolution: ConflictResolutionEnum.optional()
607
+ skipWarnings: zod.z.boolean().optional().describe("Import despite non-blocking validation warnings (default false)")
575
608
  }
576
609
  },
577
- async ({ json, name, visibility, conflictResolution }) => {
610
+ async ({ content, name, visibility, skipWarnings }) => {
578
611
  try {
579
612
  const result = await ctx.gql.workspace.request(IMPORT_DASHBOARD, {
580
613
  input: {
581
- json,
614
+ content,
582
615
  ...name !== void 0 ? { name } : {},
583
616
  ...visibility !== void 0 ? { visibility } : {},
584
- ...conflictResolution !== void 0 ? { conflictResolution } : {}
617
+ ...skipWarnings !== void 0 ? { skipWarnings } : {}
585
618
  }
586
619
  });
587
- return jsonResult(result.importDashboard);
620
+ if (!result.importBigConsoleDashboard.success) {
621
+ let detail = "";
622
+ try {
623
+ const validation = await ctx.gql.workspace.request(VALIDATE_DASHBOARD_IMPORT, { content });
624
+ const lines = [];
625
+ for (const e of validation.validateDashboardImport.errors ?? []) {
626
+ lines.push(`error ${e.code}: ${e.message}`);
627
+ }
628
+ for (const w of validation.validateDashboardImport.warnings ?? []) {
629
+ lines.push(
630
+ `warning ${w.code}: ${w.message}${w.suggestion ? ` (${w.suggestion})` : ""}`
631
+ );
632
+ }
633
+ if (lines.length > 0) detail = ` Validation says: ${lines.join(" | ")}`;
634
+ } catch {
635
+ }
636
+ return errorResult(
637
+ `Import failed: ${result.importBigConsoleDashboard.errorMessage ?? "unknown error"}.${detail}`,
638
+ "Read the errors/warnings above; fix the definition, or re-call with skipWarnings: true ONLY if every warning is understood and acceptable."
639
+ );
640
+ }
641
+ return jsonResult(result.importBigConsoleDashboard);
588
642
  } catch (error) {
589
643
  ctx.logger.error("bigconsole dashboard_import failed", { error: String(error) });
590
644
  return errorResult(