@mgsoftwarebv/mg-dashboard-mcp 7.0.21 → 7.0.22
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 +87 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8208,6 +8208,7 @@ function formatBytes(bytes) {
|
|
|
8208
8208
|
}
|
|
8209
8209
|
var RESPONSE_MAX_BYTES = 8192;
|
|
8210
8210
|
var NO_FOOTER_TOOLS = /* @__PURE__ */ new Set();
|
|
8211
|
+
var RAW_JSON_TOOLS = /* @__PURE__ */ new Set(["get_mg_dashboard_commits"]);
|
|
8211
8212
|
var TOOL_CACHE_TTL_MS = {
|
|
8212
8213
|
"list-servers": 6e4,
|
|
8213
8214
|
"docker-list": 3e4
|
|
@@ -8340,6 +8341,7 @@ function isTransientSshError(stderr, exitCode) {
|
|
|
8340
8341
|
}
|
|
8341
8342
|
function postprocessResult(result, meta) {
|
|
8342
8343
|
if (!result.content?.length) return result;
|
|
8344
|
+
if (RAW_JSON_TOOLS.has(meta.toolName)) return result;
|
|
8343
8345
|
const block = result.content[0];
|
|
8344
8346
|
let text7 = String(block.text ?? "");
|
|
8345
8347
|
const trunc = truncateForLLM(text7, RESPONSE_MAX_BYTES);
|
|
@@ -10308,6 +10310,44 @@ var TOOLS = [
|
|
|
10308
10310
|
}
|
|
10309
10311
|
},
|
|
10310
10312
|
// ----- Team memory -----
|
|
10313
|
+
{
|
|
10314
|
+
name: "get_mg_dashboard_commits",
|
|
10315
|
+
description: "Fetch a SAFE, COMPACT MG Dashboard git commit feed for ONE actor over an EXACT time range \u2014 the 'what was actually built' signal for daily operational reports (e.g. Hermes' rolling 19:00\u219219:00 Europe/Amsterdam Prince report), complementing Refront ticket activity. Backed by code_battle_commits (GitHub push webhook + nightly sync). Returns METADATA ONLY per commit: timestamp, repo (org/repo), sha, isMerge, additions, deletions, filesChanged \u2014 plus period summary counts. NEVER returns commit messages, branches, diffs or code (not stored here); message-derived ticket links are therefore out of scope (see `limitations`). The actor is mapped to ONE github login via, in order: MG_DASHBOARD_COMMIT_AUTHOR_ALIASES override, the MG Dashboard user's linked github_username, then code_battle_participants by login or display name. When it can't be mapped (or is ambiguous) the response carries an explicit `limitations` entry explaining how to fix it instead of guessing. dateFrom/dateTo accept a full ISO-8601 timestamp WITH offset (for the exact 19:00\u219219:00 window) or a bare YYYY-MM-DD date (local-midnight boundaries in `timezone`). The window is half-open [from, to).",
|
|
10316
|
+
inputSchema: {
|
|
10317
|
+
type: "object",
|
|
10318
|
+
properties: {
|
|
10319
|
+
actor: {
|
|
10320
|
+
type: "string",
|
|
10321
|
+
description: "Who to fetch commits for: a github login, an MG Dashboard user UUID/email/full name (e.g. 'Prince Rainier S. Mercado'), or a Code Battle display name. Resolved to one github login, returned as actor.githubUsername."
|
|
10322
|
+
},
|
|
10323
|
+
dateFrom: {
|
|
10324
|
+
type: "string",
|
|
10325
|
+
description: "Inclusive start: an ISO-8601 timestamp with offset (e.g. 2026-06-24T19:00:00+02:00) or YYYY-MM-DD (interpreted in `timezone`)."
|
|
10326
|
+
},
|
|
10327
|
+
dateTo: {
|
|
10328
|
+
type: "string",
|
|
10329
|
+
description: "Exclusive end: an ISO-8601 timestamp with offset (e.g. 2026-06-25T19:00:00+02:00) or YYYY-MM-DD (the whole calendar day is included)."
|
|
10330
|
+
},
|
|
10331
|
+
timezone: {
|
|
10332
|
+
type: "string",
|
|
10333
|
+
description: "IANA timezone for bare-date boundaries + output timestamps. Default Europe/Amsterdam."
|
|
10334
|
+
},
|
|
10335
|
+
repository: {
|
|
10336
|
+
type: "string",
|
|
10337
|
+
description: "Optional repo filter; accepts 'repo' or 'org/repo' (org prefix ignored), matched case-insensitively."
|
|
10338
|
+
},
|
|
10339
|
+
includeMerges: {
|
|
10340
|
+
type: "boolean",
|
|
10341
|
+
description: "Include merge commits in the commits list (default false). Summary counts always report merges separately."
|
|
10342
|
+
},
|
|
10343
|
+
pageSize: {
|
|
10344
|
+
type: "number",
|
|
10345
|
+
description: "Max commits listed (1-500, default 100). Summary counts are always the true period totals."
|
|
10346
|
+
}
|
|
10347
|
+
},
|
|
10348
|
+
required: ["actor", "dateFrom", "dateTo"]
|
|
10349
|
+
}
|
|
10350
|
+
},
|
|
10311
10351
|
{
|
|
10312
10352
|
name: "search-team-memory",
|
|
10313
10353
|
description: "Search the team's ENTIRE past Cursor history (every developer, every project) for how something was handled before. Use this FIRST, before investigating from scratch, whenever you: hit a non-trivial bug or error, are about to build something that may have been done before, need a project-specific convention/gotcha, or the user asks 'have we done X', 'how did we fix Y', or 'did we solve this already'. Hybrid semantic + keyword search over mirrored conversations. Returns ranked past chats with repo, date, a solution snippet and a similarity score. Phrase the query as the problem in natural language (e.g. 'release pipeline PM2 deploy fails with module not found').",
|
|
@@ -10488,6 +10528,53 @@ async function executeToolCall(name, a, _serverId) {
|
|
|
10488
10528
|
const ctx = authContext;
|
|
10489
10529
|
try {
|
|
10490
10530
|
switch (name) {
|
|
10531
|
+
// ----- MG Dashboard git commits (for external daily reports) -----
|
|
10532
|
+
case "get_mg_dashboard_commits": {
|
|
10533
|
+
const actor = typeof a.actor === "string" ? a.actor.trim() : "";
|
|
10534
|
+
const dateFrom = typeof a.dateFrom === "string" ? a.dateFrom.trim() : "";
|
|
10535
|
+
const dateTo = typeof a.dateTo === "string" ? a.dateTo.trim() : "";
|
|
10536
|
+
if (!actor || !dateFrom || !dateTo) {
|
|
10537
|
+
return {
|
|
10538
|
+
content: [
|
|
10539
|
+
{
|
|
10540
|
+
type: "text",
|
|
10541
|
+
text: "Error: actor, dateFrom and dateTo are required"
|
|
10542
|
+
}
|
|
10543
|
+
]
|
|
10544
|
+
};
|
|
10545
|
+
}
|
|
10546
|
+
const res = await fetch(`${dashboardBaseUrl}/api/activity/commits`, {
|
|
10547
|
+
method: "POST",
|
|
10548
|
+
headers: {
|
|
10549
|
+
"content-type": "application/json",
|
|
10550
|
+
authorization: `Bearer ${apiKey}`
|
|
10551
|
+
},
|
|
10552
|
+
body: JSON.stringify({
|
|
10553
|
+
actor,
|
|
10554
|
+
dateFrom,
|
|
10555
|
+
dateTo,
|
|
10556
|
+
timezone: typeof a.timezone === "string" ? a.timezone : void 0,
|
|
10557
|
+
repository: typeof a.repository === "string" ? a.repository : void 0,
|
|
10558
|
+
includeMerges: typeof a.includeMerges === "boolean" ? a.includeMerges : void 0,
|
|
10559
|
+
pageSize: typeof a.pageSize === "number" ? a.pageSize : void 0
|
|
10560
|
+
})
|
|
10561
|
+
});
|
|
10562
|
+
if (!res.ok) {
|
|
10563
|
+
const detail = await res.text().catch(() => "");
|
|
10564
|
+
return {
|
|
10565
|
+
content: [
|
|
10566
|
+
{
|
|
10567
|
+
type: "text",
|
|
10568
|
+
text: `Error: mg-dashboard commits fetch failed (${res.status}). ${detail.slice(0, 300)}`
|
|
10569
|
+
}
|
|
10570
|
+
]
|
|
10571
|
+
};
|
|
10572
|
+
}
|
|
10573
|
+
const data = await res.json();
|
|
10574
|
+
return {
|
|
10575
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
|
|
10576
|
+
};
|
|
10577
|
+
}
|
|
10491
10578
|
// ----- Team memory -----
|
|
10492
10579
|
case "search-team-memory": {
|
|
10493
10580
|
const query = typeof a.query === "string" ? a.query.trim() : "";
|