@mgsoftwarebv/mg-dashboard-mcp 7.4.6 → 7.4.7

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 (2) hide show
  1. package/dist/index.js +87 -41
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -990,9 +990,9 @@ ${raw2.substring(0, 500)}` }] };
990
990
  return { content: [{ type: "text", text: `No environment variables for ${project}/${env}.` }] };
991
991
  }
992
992
  const lines = vars.map((v) => `${v.isSecret ? "[secret]" : " "} ${v.name}`).sort();
993
- const text12 = `Env vars for ${project}/${env} (${vars.length}) \u2014 values hidden, use action="get" with a key:
993
+ const text13 = `Env vars for ${project}/${env} (${vars.length}) \u2014 values hidden, use action="get" with a key:
994
994
  ` + "-".repeat(50) + "\n" + lines.join("\n");
995
- return { content: [{ type: "text", text: text12 }] };
995
+ return { content: [{ type: "text", text: text13 }] };
996
996
  }
997
997
  if (action === "get") {
998
998
  const key2 = String(args2.key ?? "");
@@ -1079,9 +1079,9 @@ async function fetchAndFormatRun(conn, proxy, sshExec2, instance, runId) {
1079
1079
  return { content: [{ type: "text", text: `Invalid API response:
1080
1080
  ${rawJson.substring(0, 500)}` }] };
1081
1081
  }
1082
- let text12 = formatRunDetail(run);
1083
- if (logs) text12 += "\n\n--- Logs ---\n" + logs;
1084
- return { content: [{ type: "text", text: text12 }] };
1082
+ let text13 = formatRunDetail(run);
1083
+ if (logs) text13 += "\n\n--- Logs ---\n" + logs;
1084
+ return { content: [{ type: "text", text: text13 }] };
1085
1085
  }
1086
1086
  async function waitForCompletion(conn, proxy, sshExec2, instance, runId, waitSeconds) {
1087
1087
  const pollInterval = 3e3;
@@ -1103,10 +1103,10 @@ async function waitForCompletion(conn, proxy, sshExec2, instance, runId, waitSec
1103
1103
  continue;
1104
1104
  }
1105
1105
  if (TERMINAL_STATUSES.has(run.status)) {
1106
- let text12 = formatRunDetail(run);
1106
+ let text13 = formatRunDetail(run);
1107
1107
  const logs = await fetchRunLogs(runId, conn, proxy, sshExec2);
1108
- if (logs) text12 += "\n\n--- Logs ---\n" + logs;
1109
- return { content: [{ type: "text", text: text12 }] };
1108
+ if (logs) text13 += "\n\n--- Logs ---\n" + logs;
1109
+ return { content: [{ type: "text", text: text13 }] };
1110
1110
  }
1111
1111
  }
1112
1112
  return {
@@ -3793,10 +3793,10 @@ var ZodObject = class _ZodObject extends ZodType {
3793
3793
  // }) as any;
3794
3794
  // return merged;
3795
3795
  // }
3796
- catchall(index9) {
3796
+ catchall(index10) {
3797
3797
  return new _ZodObject({
3798
3798
  ...this._def,
3799
- catchall: index9
3799
+ catchall: index10
3800
3800
  });
3801
3801
  }
3802
3802
  pick(mask) {
@@ -4114,9 +4114,9 @@ function mergeValues(a, b) {
4114
4114
  return { valid: false };
4115
4115
  }
4116
4116
  const newArray = [];
4117
- for (let index9 = 0; index9 < a.length; index9++) {
4118
- const itemA = a[index9];
4119
- const itemB = b[index9];
4117
+ for (let index10 = 0; index10 < a.length; index10++) {
4118
+ const itemA = a[index10];
4119
+ const itemB = b[index10];
4120
4120
  const sharedValue = mergeValues(itemA, itemB);
4121
4121
  if (!sharedValue.valid) {
4122
4122
  return { valid: false };
@@ -4322,10 +4322,10 @@ var ZodMap = class extends ZodType {
4322
4322
  }
4323
4323
  const keyType = this._def.keyType;
4324
4324
  const valueType = this._def.valueType;
4325
- const pairs = [...ctx.data.entries()].map(([key, value], index9) => {
4325
+ const pairs = [...ctx.data.entries()].map(([key, value], index10) => {
4326
4326
  return {
4327
- key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index9, "key"])),
4328
- value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index9, "value"]))
4327
+ key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index10, "key"])),
4328
+ value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index10, "value"]))
4329
4329
  };
4330
4330
  });
4331
4331
  if (ctx.common.async) {
@@ -6375,6 +6375,47 @@ pgTable(
6375
6375
  index("content_ingestion_runs_project_idx").on(table.projectKey)
6376
6376
  ]
6377
6377
  );
6378
+ var refrontCustomer = pgTable(
6379
+ "refront_customer",
6380
+ {
6381
+ id: uuid("id").primaryKey(),
6382
+ name: text("name").notNull(),
6383
+ status: text("status"),
6384
+ teamId: text("team_id"),
6385
+ teamName: text("team_name"),
6386
+ syncedAt: timestamp("synced_at", { withTimezone: true }).notNull(),
6387
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
6388
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
6389
+ },
6390
+ (table) => [
6391
+ index("idx_refront_customer_status").on(table.status),
6392
+ index("idx_refront_customer_name").on(table.name)
6393
+ ]
6394
+ );
6395
+ pgTable(
6396
+ "refront_project",
6397
+ {
6398
+ id: uuid("id").primaryKey(),
6399
+ name: text("name").notNull(),
6400
+ customerId: uuid("customer_id").references(() => refrontCustomer.id, {
6401
+ onDelete: "set null"
6402
+ }),
6403
+ status: text("status"),
6404
+ internal: boolean("internal").notNull().default(false),
6405
+ /** Ticket prefix code when known (e.g. MBC from 2026-MBC-*). */
6406
+ code: text("code"),
6407
+ teamId: text("team_id"),
6408
+ teamName: text("team_name"),
6409
+ syncedAt: timestamp("synced_at", { withTimezone: true }).notNull(),
6410
+ createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
6411
+ updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
6412
+ },
6413
+ (table) => [
6414
+ index("idx_refront_project_customer").on(table.customerId),
6415
+ index("idx_refront_project_status").on(table.status),
6416
+ index("idx_refront_project_code").on(table.code)
6417
+ ]
6418
+ );
6378
6419
  pgTable(
6379
6420
  "refront_source_sync_state",
6380
6421
  {
@@ -7868,7 +7909,7 @@ function getEncryptionKey() {
7868
7909
  throw new Error("ENCRYPTION_KEY must be a 64-character hex string");
7869
7910
  return buf;
7870
7911
  }
7871
- function encrypt(text12) {
7912
+ function encrypt(text13) {
7872
7913
  const key = getEncryptionKey();
7873
7914
  const iv = randomBytes(ENC_IV_LENGTH);
7874
7915
  const cipher = createCipheriv(
@@ -7876,7 +7917,7 @@ function encrypt(text12) {
7876
7917
  new Uint8Array(key),
7877
7918
  new Uint8Array(iv)
7878
7919
  );
7879
- let encrypted = cipher.update(text12, "utf8", "hex");
7920
+ let encrypted = cipher.update(text13, "utf8", "hex");
7880
7921
  encrypted += cipher.final("hex");
7881
7922
  const authTag = cipher.getAuthTag();
7882
7923
  return Buffer.concat([
@@ -8596,10 +8637,10 @@ async function r2GetObjectRange(bucket, key, range) {
8596
8637
  const body = result.Body;
8597
8638
  if (!body?.transformToString)
8598
8639
  throw new Error("R2 returned no readable body");
8599
- const text12 = await body.transformToString();
8640
+ const text13 = await body.transformToString();
8600
8641
  const header = `# range: bytes ${range.offset}-${end} of ${size} (${effectiveLen} bytes)`;
8601
8642
  return `${header}
8602
- ${text12}`;
8643
+ ${text13}`;
8603
8644
  } catch (e) {
8604
8645
  throw r2WrapError(bucket, key, e);
8605
8646
  }
@@ -8962,15 +9003,15 @@ async function sftpRead(opts, filePath, proxy, options) {
8962
9003
  clearTimeout(timer);
8963
9004
  cleanup?.();
8964
9005
  cleanup = void 0;
8965
- const text12 = Buffer.concat(
9006
+ const text13 = Buffer.concat(
8966
9007
  chunks.map((ch) => new Uint8Array(ch))
8967
9008
  ).toString("utf-8");
8968
9009
  if (!isWholeFileRequest) {
8969
9010
  const header = `# range: bytes ${offset}-${offset + effectiveLen - 1} of ${total} (${effectiveLen} bytes)`;
8970
9011
  resolve(`${header}
8971
- ${text12}`);
9012
+ ${text13}`);
8972
9013
  } else {
8973
- resolve(text12);
9014
+ resolve(text13);
8974
9015
  }
8975
9016
  });
8976
9017
  rs.on("error", (e) => {
@@ -9117,11 +9158,11 @@ function getKnownContainers(serverId, maxAgeMs = 5 * 6e4) {
9117
9158
  if (Date.now() - e.capturedAt > maxAgeMs) return void 0;
9118
9159
  return e.names;
9119
9160
  }
9120
- function truncateForLLM(text12, maxBytes) {
9121
- const totalBytes = Buffer.byteLength(text12, "utf8");
9161
+ function truncateForLLM(text13, maxBytes) {
9162
+ const totalBytes = Buffer.byteLength(text13, "utf8");
9122
9163
  if (totalBytes <= maxBytes)
9123
- return { text: text12, truncated: false, totalBytes, shownBytes: totalBytes };
9124
- const buf = Buffer.from(text12, "utf8");
9164
+ return { text: text13, truncated: false, totalBytes, shownBytes: totalBytes };
9165
+ const buf = Buffer.from(text13, "utf8");
9125
9166
  let cut = maxBytes;
9126
9167
  while (cut > 0 && (buf[cut] & 192) === 128) cut--;
9127
9168
  const head = buf.subarray(0, cut).toString("utf8");
@@ -9152,10 +9193,10 @@ function postprocessResult(result, meta) {
9152
9193
  if (!result.content?.length) return result;
9153
9194
  if (RAW_JSON_TOOLS.has(meta.toolName)) return result;
9154
9195
  const block = result.content[0];
9155
- let text12 = String(block.text ?? "");
9156
- const trunc = truncateForLLM(text12, RESPONSE_MAX_BYTES);
9196
+ let text13 = String(block.text ?? "");
9197
+ const trunc = truncateForLLM(text13, RESPONSE_MAX_BYTES);
9157
9198
  if (trunc.truncated) {
9158
- text12 = trunc.text + "\n\n... " + buildTruncationHint(
9199
+ text13 = trunc.text + "\n\n... " + buildTruncationHint(
9159
9200
  meta.toolName,
9160
9201
  meta.args,
9161
9202
  trunc.totalBytes,
@@ -9169,11 +9210,11 @@ function postprocessResult(result, meta) {
9169
9210
  const parts = [`took ${tookStr}`, sizeStr];
9170
9211
  if (meta.serverIdLabel) parts.push(`server: ${meta.serverIdLabel}`);
9171
9212
  if (meta.cached) parts.push("cached");
9172
- text12 = `${text12}
9213
+ text13 = `${text13}
9173
9214
 
9174
9215
  [${parts.join(", ")}]`;
9175
9216
  }
9176
- return { ...result, content: [{ ...block, text: text12 }] };
9217
+ return { ...result, content: [{ ...block, text: text13 }] };
9177
9218
  }
9178
9219
  function buildPipelineScript(commands, shell, marker, stopOnError) {
9179
9220
  if (shell === "powershell") {
@@ -11693,6 +11734,10 @@ var TOOLS = [
11693
11734
  limit: {
11694
11735
  type: "number",
11695
11736
  description: "Max pages to return (1-20, default 5)."
11737
+ },
11738
+ includeArchived: {
11739
+ type: "boolean",
11740
+ description: "Include lifecycle-archived pages (decommissioned systems). Default false \u2014 archived is hidden unless you opt in."
11696
11741
  }
11697
11742
  },
11698
11743
  required: ["query"]
@@ -12050,7 +12095,7 @@ async function executeToolCall(name, a, _serverId) {
12050
12095
  ]
12051
12096
  };
12052
12097
  }
12053
- const lines = data.hits.map((hit, index9) => {
12098
+ const lines = data.hits.map((hit, index10) => {
12054
12099
  const when = hit.lastMessageAt ? new Date(hit.lastMessageAt).toISOString().slice(0, 10) : "unknown date";
12055
12100
  const repo = hit.repo ?? "unknown repo";
12056
12101
  const sim = hit.similarity !== null ? ` \xB7 ${(hit.similarity * 100).toFixed(0)}% match` : "";
@@ -12060,7 +12105,7 @@ async function executeToolCall(name, a, _serverId) {
12060
12105
  ...Array.isArray(hit.tech) ? hit.tech.slice(0, 4) : []
12061
12106
  ].filter(Boolean);
12062
12107
  const tags = facets.length > 0 ? ` \xB7 ${facets.join(", ")}` : "";
12063
- return `${index9 + 1}. [${repo} \xB7 ${when}${sim}${tags}] ${hit.title}
12108
+ return `${index10 + 1}. [${repo} \xB7 ${when}${sim}${tags}] ${hit.title}
12064
12109
  id: ${hit.id}
12065
12110
  ${(hit.summary ?? hit.snippet).replace(/\s+/g, " ").slice(0, 500)}`;
12066
12111
  });
@@ -12176,7 +12221,8 @@ ${facets.join(", ")}` : ""),
12176
12221
  },
12177
12222
  body: JSON.stringify({
12178
12223
  query,
12179
- limit: typeof a.limit === "number" ? a.limit : void 0
12224
+ limit: typeof a.limit === "number" ? a.limit : void 0,
12225
+ includeArchived: typeof a.includeArchived === "boolean" ? a.includeArchived : void 0
12180
12226
  })
12181
12227
  });
12182
12228
  if (!res.ok) {
@@ -12201,12 +12247,12 @@ ${facets.join(", ")}` : ""),
12201
12247
  ]
12202
12248
  };
12203
12249
  }
12204
- const lines = data.hits.map((hit, index9) => {
12250
+ const lines = data.hits.map((hit, index10) => {
12205
12251
  const sim = hit.similarity !== null ? ` \xB7 ${Math.round(hit.similarity * 100)}% match` : "";
12206
12252
  const tags = hit.tags.length ? ` \xB7 ${hit.tags.slice(0, 5).join(", ")}` : "";
12207
12253
  const sources = hit.sources.length ? `
12208
12254
  sources: ${hit.sources.slice(0, 6).map((s) => `${s.type}:${s.ref}`).join(", ")}` : "";
12209
- return `${index9 + 1}. [${hit.status} \xB7 updated ${hit.pageUpdatedOn ?? "unknown"}${sim}${tags}] ${hit.title}
12255
+ return `${index10 + 1}. [${hit.status} \xB7 updated ${hit.pageUpdatedOn ?? "unknown"}${sim}${tags}] ${hit.title}
12210
12256
  slug: ${hit.slug}${sources}
12211
12257
  ${(hit.summary ?? hit.snippet).replace(/\s+/g, " ").slice(0, 400)}`;
12212
12258
  });
@@ -13413,8 +13459,8 @@ ${sample.join("\n")}${files.length > 5 ? `
13413
13459
  };
13414
13460
  const filtered = sortRows(applyFilter(only.rows));
13415
13461
  if (format === "json") {
13416
- const text13 = filtered.map((c) => JSON.stringify(c)).join("\n") || "(no containers)";
13417
- return { content: [{ type: "text", text: text13 }] };
13462
+ const text14 = filtered.map((c) => JSON.stringify(c)).join("\n") || "(no containers)";
13463
+ return { content: [{ type: "text", text: text14 }] };
13418
13464
  }
13419
13465
  if (groupByProject) {
13420
13466
  const groups = /* @__PURE__ */ new Map();
@@ -13441,8 +13487,8 @@ ${sample.join("\n")}${files.length > 5 ? `
13441
13487
  }
13442
13488
  const header = `${"NAMES".padEnd(36)} ${"IMAGE".padEnd(40)} ${"STATUS".padEnd(24)} ${"HEALTH".padEnd(10)} ${"PORTS".padEnd(40)} PROJECT`;
13443
13489
  const body = filtered.map((r) => `${fmtRow(r)} ${r.Project || ""}`);
13444
- const text12 = filtered.length === 0 ? "(no containers match)" : [header, ...body].join("\n");
13445
- return { content: [{ type: "text", text: text12 }] };
13490
+ const text13 = filtered.length === 0 ? "(no containers match)" : [header, ...body].join("\n");
13491
+ return { content: [{ type: "text", text: text13 }] };
13446
13492
  }
13447
13493
  if (format === "json") {
13448
13494
  const lines = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mgsoftwarebv/mg-dashboard-mcp",
3
- "version": "7.4.6",
3
+ "version": "7.4.7",
4
4
  "description": "MCP Server for MG Dashboard - SSH, SFTP, Docker, domains, DNS, and environment config tools for Cursor",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",