@mgsoftwarebv/mg-dashboard-mcp 7.4.6 → 7.4.8
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.
- package/dist/index.js +121 -43
- 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
|
|
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:
|
|
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
|
|
1083
|
-
if (logs)
|
|
1084
|
-
return { content: [{ type: "text", text:
|
|
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
|
|
1106
|
+
let text13 = formatRunDetail(run);
|
|
1107
1107
|
const logs = await fetchRunLogs(runId, conn, proxy, sshExec2);
|
|
1108
|
-
if (logs)
|
|
1109
|
-
return { content: [{ type: "text", text:
|
|
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(
|
|
3796
|
+
catchall(index10) {
|
|
3797
3797
|
return new _ZodObject({
|
|
3798
3798
|
...this._def,
|
|
3799
|
-
catchall:
|
|
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
|
|
4118
|
-
const itemA = a[
|
|
4119
|
-
const itemB = b[
|
|
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],
|
|
4325
|
+
const pairs = [...ctx.data.entries()].map(([key, value], index10) => {
|
|
4326
4326
|
return {
|
|
4327
|
-
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [
|
|
4328
|
-
value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [
|
|
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) {
|
|
@@ -6153,6 +6153,12 @@ var directorySubmissionStatus = pgEnum(
|
|
|
6153
6153
|
"manual"
|
|
6154
6154
|
]
|
|
6155
6155
|
);
|
|
6156
|
+
var directoryAccountStatus = pgEnum("directory_account_status", [
|
|
6157
|
+
"pending_verification",
|
|
6158
|
+
"active",
|
|
6159
|
+
"failed",
|
|
6160
|
+
"captcha_blocked"
|
|
6161
|
+
]);
|
|
6156
6162
|
var linkDirectory = pgTable(
|
|
6157
6163
|
"link_directory",
|
|
6158
6164
|
{
|
|
@@ -6245,6 +6251,32 @@ pgTable(
|
|
|
6245
6251
|
)
|
|
6246
6252
|
]
|
|
6247
6253
|
);
|
|
6254
|
+
pgTable(
|
|
6255
|
+
"directory_account",
|
|
6256
|
+
{
|
|
6257
|
+
id: uuid("id").primaryKey().defaultRandom(),
|
|
6258
|
+
clientId: uuid("client_id").notNull().references(() => linkBuildingClient.id, { onDelete: "cascade" }),
|
|
6259
|
+
directoryId: uuid("directory_id").notNull().references(() => linkDirectory.id, { onDelete: "cascade" }),
|
|
6260
|
+
email: text("email").notNull(),
|
|
6261
|
+
passwordEncrypted: text("password_encrypted").notNull(),
|
|
6262
|
+
status: directoryAccountStatus("status").notNull().default("pending_verification"),
|
|
6263
|
+
registerUrl: text("register_url"),
|
|
6264
|
+
loginUrl: text("login_url"),
|
|
6265
|
+
lastError: text("last_error"),
|
|
6266
|
+
registeredAt: timestamp("registered_at", { withTimezone: true }),
|
|
6267
|
+
verifiedAt: timestamp("verified_at", { withTimezone: true }),
|
|
6268
|
+
lastLoginAt: timestamp("last_login_at", { withTimezone: true }),
|
|
6269
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
6270
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
6271
|
+
},
|
|
6272
|
+
(table) => [
|
|
6273
|
+
uniqueIndex("directory_account_client_directory_uidx").on(
|
|
6274
|
+
table.clientId,
|
|
6275
|
+
table.directoryId
|
|
6276
|
+
),
|
|
6277
|
+
index("directory_account_status_idx").on(table.status)
|
|
6278
|
+
]
|
|
6279
|
+
);
|
|
6248
6280
|
var githubToken = pgTable(
|
|
6249
6281
|
"github_token",
|
|
6250
6282
|
{
|
|
@@ -6375,6 +6407,47 @@ pgTable(
|
|
|
6375
6407
|
index("content_ingestion_runs_project_idx").on(table.projectKey)
|
|
6376
6408
|
]
|
|
6377
6409
|
);
|
|
6410
|
+
var refrontCustomer = pgTable(
|
|
6411
|
+
"refront_customer",
|
|
6412
|
+
{
|
|
6413
|
+
id: uuid("id").primaryKey(),
|
|
6414
|
+
name: text("name").notNull(),
|
|
6415
|
+
status: text("status"),
|
|
6416
|
+
teamId: text("team_id"),
|
|
6417
|
+
teamName: text("team_name"),
|
|
6418
|
+
syncedAt: timestamp("synced_at", { withTimezone: true }).notNull(),
|
|
6419
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
6420
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
6421
|
+
},
|
|
6422
|
+
(table) => [
|
|
6423
|
+
index("idx_refront_customer_status").on(table.status),
|
|
6424
|
+
index("idx_refront_customer_name").on(table.name)
|
|
6425
|
+
]
|
|
6426
|
+
);
|
|
6427
|
+
pgTable(
|
|
6428
|
+
"refront_project",
|
|
6429
|
+
{
|
|
6430
|
+
id: uuid("id").primaryKey(),
|
|
6431
|
+
name: text("name").notNull(),
|
|
6432
|
+
customerId: uuid("customer_id").references(() => refrontCustomer.id, {
|
|
6433
|
+
onDelete: "set null"
|
|
6434
|
+
}),
|
|
6435
|
+
status: text("status"),
|
|
6436
|
+
internal: boolean("internal").notNull().default(false),
|
|
6437
|
+
/** Ticket prefix code when known (e.g. MBC from 2026-MBC-*). */
|
|
6438
|
+
code: text("code"),
|
|
6439
|
+
teamId: text("team_id"),
|
|
6440
|
+
teamName: text("team_name"),
|
|
6441
|
+
syncedAt: timestamp("synced_at", { withTimezone: true }).notNull(),
|
|
6442
|
+
createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
|
|
6443
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
|
|
6444
|
+
},
|
|
6445
|
+
(table) => [
|
|
6446
|
+
index("idx_refront_project_customer").on(table.customerId),
|
|
6447
|
+
index("idx_refront_project_status").on(table.status),
|
|
6448
|
+
index("idx_refront_project_code").on(table.code)
|
|
6449
|
+
]
|
|
6450
|
+
);
|
|
6378
6451
|
pgTable(
|
|
6379
6452
|
"refront_source_sync_state",
|
|
6380
6453
|
{
|
|
@@ -7868,7 +7941,7 @@ function getEncryptionKey() {
|
|
|
7868
7941
|
throw new Error("ENCRYPTION_KEY must be a 64-character hex string");
|
|
7869
7942
|
return buf;
|
|
7870
7943
|
}
|
|
7871
|
-
function encrypt(
|
|
7944
|
+
function encrypt(text13) {
|
|
7872
7945
|
const key = getEncryptionKey();
|
|
7873
7946
|
const iv = randomBytes(ENC_IV_LENGTH);
|
|
7874
7947
|
const cipher = createCipheriv(
|
|
@@ -7876,7 +7949,7 @@ function encrypt(text12) {
|
|
|
7876
7949
|
new Uint8Array(key),
|
|
7877
7950
|
new Uint8Array(iv)
|
|
7878
7951
|
);
|
|
7879
|
-
let encrypted = cipher.update(
|
|
7952
|
+
let encrypted = cipher.update(text13, "utf8", "hex");
|
|
7880
7953
|
encrypted += cipher.final("hex");
|
|
7881
7954
|
const authTag = cipher.getAuthTag();
|
|
7882
7955
|
return Buffer.concat([
|
|
@@ -8596,10 +8669,10 @@ async function r2GetObjectRange(bucket, key, range) {
|
|
|
8596
8669
|
const body = result.Body;
|
|
8597
8670
|
if (!body?.transformToString)
|
|
8598
8671
|
throw new Error("R2 returned no readable body");
|
|
8599
|
-
const
|
|
8672
|
+
const text13 = await body.transformToString();
|
|
8600
8673
|
const header = `# range: bytes ${range.offset}-${end} of ${size} (${effectiveLen} bytes)`;
|
|
8601
8674
|
return `${header}
|
|
8602
|
-
${
|
|
8675
|
+
${text13}`;
|
|
8603
8676
|
} catch (e) {
|
|
8604
8677
|
throw r2WrapError(bucket, key, e);
|
|
8605
8678
|
}
|
|
@@ -8962,15 +9035,15 @@ async function sftpRead(opts, filePath, proxy, options) {
|
|
|
8962
9035
|
clearTimeout(timer);
|
|
8963
9036
|
cleanup?.();
|
|
8964
9037
|
cleanup = void 0;
|
|
8965
|
-
const
|
|
9038
|
+
const text13 = Buffer.concat(
|
|
8966
9039
|
chunks.map((ch) => new Uint8Array(ch))
|
|
8967
9040
|
).toString("utf-8");
|
|
8968
9041
|
if (!isWholeFileRequest) {
|
|
8969
9042
|
const header = `# range: bytes ${offset}-${offset + effectiveLen - 1} of ${total} (${effectiveLen} bytes)`;
|
|
8970
9043
|
resolve(`${header}
|
|
8971
|
-
${
|
|
9044
|
+
${text13}`);
|
|
8972
9045
|
} else {
|
|
8973
|
-
resolve(
|
|
9046
|
+
resolve(text13);
|
|
8974
9047
|
}
|
|
8975
9048
|
});
|
|
8976
9049
|
rs.on("error", (e) => {
|
|
@@ -9117,11 +9190,11 @@ function getKnownContainers(serverId, maxAgeMs = 5 * 6e4) {
|
|
|
9117
9190
|
if (Date.now() - e.capturedAt > maxAgeMs) return void 0;
|
|
9118
9191
|
return e.names;
|
|
9119
9192
|
}
|
|
9120
|
-
function truncateForLLM(
|
|
9121
|
-
const totalBytes = Buffer.byteLength(
|
|
9193
|
+
function truncateForLLM(text13, maxBytes) {
|
|
9194
|
+
const totalBytes = Buffer.byteLength(text13, "utf8");
|
|
9122
9195
|
if (totalBytes <= maxBytes)
|
|
9123
|
-
return { text:
|
|
9124
|
-
const buf = Buffer.from(
|
|
9196
|
+
return { text: text13, truncated: false, totalBytes, shownBytes: totalBytes };
|
|
9197
|
+
const buf = Buffer.from(text13, "utf8");
|
|
9125
9198
|
let cut = maxBytes;
|
|
9126
9199
|
while (cut > 0 && (buf[cut] & 192) === 128) cut--;
|
|
9127
9200
|
const head = buf.subarray(0, cut).toString("utf8");
|
|
@@ -9152,10 +9225,10 @@ function postprocessResult(result, meta) {
|
|
|
9152
9225
|
if (!result.content?.length) return result;
|
|
9153
9226
|
if (RAW_JSON_TOOLS.has(meta.toolName)) return result;
|
|
9154
9227
|
const block = result.content[0];
|
|
9155
|
-
let
|
|
9156
|
-
const trunc = truncateForLLM(
|
|
9228
|
+
let text13 = String(block.text ?? "");
|
|
9229
|
+
const trunc = truncateForLLM(text13, RESPONSE_MAX_BYTES);
|
|
9157
9230
|
if (trunc.truncated) {
|
|
9158
|
-
|
|
9231
|
+
text13 = trunc.text + "\n\n... " + buildTruncationHint(
|
|
9159
9232
|
meta.toolName,
|
|
9160
9233
|
meta.args,
|
|
9161
9234
|
trunc.totalBytes,
|
|
@@ -9169,11 +9242,11 @@ function postprocessResult(result, meta) {
|
|
|
9169
9242
|
const parts = [`took ${tookStr}`, sizeStr];
|
|
9170
9243
|
if (meta.serverIdLabel) parts.push(`server: ${meta.serverIdLabel}`);
|
|
9171
9244
|
if (meta.cached) parts.push("cached");
|
|
9172
|
-
|
|
9245
|
+
text13 = `${text13}
|
|
9173
9246
|
|
|
9174
9247
|
[${parts.join(", ")}]`;
|
|
9175
9248
|
}
|
|
9176
|
-
return { ...result, content: [{ ...block, text:
|
|
9249
|
+
return { ...result, content: [{ ...block, text: text13 }] };
|
|
9177
9250
|
}
|
|
9178
9251
|
function buildPipelineScript(commands, shell, marker, stopOnError) {
|
|
9179
9252
|
if (shell === "powershell") {
|
|
@@ -11693,6 +11766,10 @@ var TOOLS = [
|
|
|
11693
11766
|
limit: {
|
|
11694
11767
|
type: "number",
|
|
11695
11768
|
description: "Max pages to return (1-20, default 5)."
|
|
11769
|
+
},
|
|
11770
|
+
includeArchived: {
|
|
11771
|
+
type: "boolean",
|
|
11772
|
+
description: "Include lifecycle-archived pages (decommissioned systems). Default false \u2014 archived is hidden unless you opt in."
|
|
11696
11773
|
}
|
|
11697
11774
|
},
|
|
11698
11775
|
required: ["query"]
|
|
@@ -12050,7 +12127,7 @@ async function executeToolCall(name, a, _serverId) {
|
|
|
12050
12127
|
]
|
|
12051
12128
|
};
|
|
12052
12129
|
}
|
|
12053
|
-
const lines = data.hits.map((hit,
|
|
12130
|
+
const lines = data.hits.map((hit, index10) => {
|
|
12054
12131
|
const when = hit.lastMessageAt ? new Date(hit.lastMessageAt).toISOString().slice(0, 10) : "unknown date";
|
|
12055
12132
|
const repo = hit.repo ?? "unknown repo";
|
|
12056
12133
|
const sim = hit.similarity !== null ? ` \xB7 ${(hit.similarity * 100).toFixed(0)}% match` : "";
|
|
@@ -12060,7 +12137,7 @@ async function executeToolCall(name, a, _serverId) {
|
|
|
12060
12137
|
...Array.isArray(hit.tech) ? hit.tech.slice(0, 4) : []
|
|
12061
12138
|
].filter(Boolean);
|
|
12062
12139
|
const tags = facets.length > 0 ? ` \xB7 ${facets.join(", ")}` : "";
|
|
12063
|
-
return `${
|
|
12140
|
+
return `${index10 + 1}. [${repo} \xB7 ${when}${sim}${tags}] ${hit.title}
|
|
12064
12141
|
id: ${hit.id}
|
|
12065
12142
|
${(hit.summary ?? hit.snippet).replace(/\s+/g, " ").slice(0, 500)}`;
|
|
12066
12143
|
});
|
|
@@ -12176,7 +12253,8 @@ ${facets.join(", ")}` : ""),
|
|
|
12176
12253
|
},
|
|
12177
12254
|
body: JSON.stringify({
|
|
12178
12255
|
query,
|
|
12179
|
-
limit: typeof a.limit === "number" ? a.limit : void 0
|
|
12256
|
+
limit: typeof a.limit === "number" ? a.limit : void 0,
|
|
12257
|
+
includeArchived: typeof a.includeArchived === "boolean" ? a.includeArchived : void 0
|
|
12180
12258
|
})
|
|
12181
12259
|
});
|
|
12182
12260
|
if (!res.ok) {
|
|
@@ -12191,22 +12269,22 @@ ${facets.join(", ")}` : ""),
|
|
|
12191
12269
|
};
|
|
12192
12270
|
}
|
|
12193
12271
|
const data = await res.json();
|
|
12194
|
-
if (data.count === 0) {
|
|
12272
|
+
if (data.count === 0 || data.confident === false) {
|
|
12195
12273
|
return {
|
|
12196
12274
|
content: [
|
|
12197
12275
|
{
|
|
12198
12276
|
type: "text",
|
|
12199
|
-
text: "No wiki
|
|
12277
|
+
text: data.hint ?? "No confident wiki answer. Fall back to search-team-memory for raw history \u2014 repeated misses here become insight-scout / gap-filler signals automatically."
|
|
12200
12278
|
}
|
|
12201
12279
|
]
|
|
12202
12280
|
};
|
|
12203
12281
|
}
|
|
12204
|
-
const lines = data.hits.map((hit,
|
|
12282
|
+
const lines = data.hits.map((hit, index10) => {
|
|
12205
12283
|
const sim = hit.similarity !== null ? ` \xB7 ${Math.round(hit.similarity * 100)}% match` : "";
|
|
12206
12284
|
const tags = hit.tags.length ? ` \xB7 ${hit.tags.slice(0, 5).join(", ")}` : "";
|
|
12207
12285
|
const sources = hit.sources.length ? `
|
|
12208
12286
|
sources: ${hit.sources.slice(0, 6).map((s) => `${s.type}:${s.ref}`).join(", ")}` : "";
|
|
12209
|
-
return `${
|
|
12287
|
+
return `${index10 + 1}. [${hit.status} \xB7 updated ${hit.pageUpdatedOn ?? "unknown"}${sim}${tags}] ${hit.title}
|
|
12210
12288
|
slug: ${hit.slug}${sources}
|
|
12211
12289
|
${(hit.summary ?? hit.snippet).replace(/\s+/g, " ").slice(0, 400)}`;
|
|
12212
12290
|
});
|
|
@@ -13413,8 +13491,8 @@ ${sample.join("\n")}${files.length > 5 ? `
|
|
|
13413
13491
|
};
|
|
13414
13492
|
const filtered = sortRows(applyFilter(only.rows));
|
|
13415
13493
|
if (format === "json") {
|
|
13416
|
-
const
|
|
13417
|
-
return { content: [{ type: "text", text:
|
|
13494
|
+
const text14 = filtered.map((c) => JSON.stringify(c)).join("\n") || "(no containers)";
|
|
13495
|
+
return { content: [{ type: "text", text: text14 }] };
|
|
13418
13496
|
}
|
|
13419
13497
|
if (groupByProject) {
|
|
13420
13498
|
const groups = /* @__PURE__ */ new Map();
|
|
@@ -13441,8 +13519,8 @@ ${sample.join("\n")}${files.length > 5 ? `
|
|
|
13441
13519
|
}
|
|
13442
13520
|
const header = `${"NAMES".padEnd(36)} ${"IMAGE".padEnd(40)} ${"STATUS".padEnd(24)} ${"HEALTH".padEnd(10)} ${"PORTS".padEnd(40)} PROJECT`;
|
|
13443
13521
|
const body = filtered.map((r) => `${fmtRow(r)} ${r.Project || ""}`);
|
|
13444
|
-
const
|
|
13445
|
-
return { content: [{ type: "text", text:
|
|
13522
|
+
const text13 = filtered.length === 0 ? "(no containers match)" : [header, ...body].join("\n");
|
|
13523
|
+
return { content: [{ type: "text", text: text13 }] };
|
|
13446
13524
|
}
|
|
13447
13525
|
if (format === "json") {
|
|
13448
13526
|
const lines = [];
|
package/package.json
CHANGED