@mgsoftwarebv/mg-dashboard-mcp 7.0.21 → 7.0.23

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 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,52 @@ 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 per commit: timestamp, repo (org/repo), sha, isMerge, additions, deletions, filesChanged, commit message, branch (webhook-only), PR number/title/link, ticketNumbers + ticketLinks (high/medium confidence), plus period summary counts. Optional includeChangedPaths returns filenames only (no diffs). Full diffs are never returned. 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
+ organization: {
10340
+ type: "string",
10341
+ description: "Optional org/owner filter (case-insensitive), e.g. 'MGSoftwareBV' or 'AVARC-Solutions'."
10342
+ },
10343
+ includeMerges: {
10344
+ type: "boolean",
10345
+ description: "Include merge commits in the commits list (default false). Summary counts always report merges separately."
10346
+ },
10347
+ includeChangedPaths: {
10348
+ type: "boolean",
10349
+ description: "Include changed file paths per commit (default false). Filenames only \u2014 no file contents or diffs."
10350
+ },
10351
+ pageSize: {
10352
+ type: "number",
10353
+ description: "Max commits listed (1-500, default 100). Summary counts are always the true period totals."
10354
+ }
10355
+ },
10356
+ required: ["actor", "dateFrom", "dateTo"]
10357
+ }
10358
+ },
10311
10359
  {
10312
10360
  name: "search-team-memory",
10313
10361
  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 +10536,55 @@ async function executeToolCall(name, a, _serverId) {
10488
10536
  const ctx = authContext;
10489
10537
  try {
10490
10538
  switch (name) {
10539
+ // ----- MG Dashboard git commits (for external daily reports) -----
10540
+ case "get_mg_dashboard_commits": {
10541
+ const actor = typeof a.actor === "string" ? a.actor.trim() : "";
10542
+ const dateFrom = typeof a.dateFrom === "string" ? a.dateFrom.trim() : "";
10543
+ const dateTo = typeof a.dateTo === "string" ? a.dateTo.trim() : "";
10544
+ if (!actor || !dateFrom || !dateTo) {
10545
+ return {
10546
+ content: [
10547
+ {
10548
+ type: "text",
10549
+ text: "Error: actor, dateFrom and dateTo are required"
10550
+ }
10551
+ ]
10552
+ };
10553
+ }
10554
+ const res = await fetch(`${dashboardBaseUrl}/api/activity/commits`, {
10555
+ method: "POST",
10556
+ headers: {
10557
+ "content-type": "application/json",
10558
+ authorization: `Bearer ${apiKey}`
10559
+ },
10560
+ body: JSON.stringify({
10561
+ actor,
10562
+ dateFrom,
10563
+ dateTo,
10564
+ timezone: typeof a.timezone === "string" ? a.timezone : void 0,
10565
+ repository: typeof a.repository === "string" ? a.repository : void 0,
10566
+ organization: typeof a.organization === "string" ? a.organization : void 0,
10567
+ includeMerges: typeof a.includeMerges === "boolean" ? a.includeMerges : void 0,
10568
+ includeChangedPaths: typeof a.includeChangedPaths === "boolean" ? a.includeChangedPaths : void 0,
10569
+ pageSize: typeof a.pageSize === "number" ? a.pageSize : void 0
10570
+ })
10571
+ });
10572
+ if (!res.ok) {
10573
+ const detail = await res.text().catch(() => "");
10574
+ return {
10575
+ content: [
10576
+ {
10577
+ type: "text",
10578
+ text: `Error: mg-dashboard commits fetch failed (${res.status}). ${detail.slice(0, 300)}`
10579
+ }
10580
+ ]
10581
+ };
10582
+ }
10583
+ const data = await res.json();
10584
+ return {
10585
+ content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
10586
+ };
10587
+ }
10491
10588
  // ----- Team memory -----
10492
10589
  case "search-team-memory": {
10493
10590
  const query = typeof a.query === "string" ? a.query.trim() : "";