@mgsoftwarebv/mg-dashboard-mcp 7.4.14 → 7.4.15
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 +137 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1136,6 +1136,128 @@ async function waitForCompletion(conn, proxy, sshExec2, instance, runId, waitSec
|
|
|
1136
1136
|
}]
|
|
1137
1137
|
};
|
|
1138
1138
|
}
|
|
1139
|
+
|
|
1140
|
+
// src/github-code-access-tools.ts
|
|
1141
|
+
var GITHUB_CODE_ACCESS_TOOLS = [
|
|
1142
|
+
{
|
|
1143
|
+
name: "get_mg_dashboard_file",
|
|
1144
|
+
description: "Read ONE source file at a git ref for an allowlisted GitHub org/repo (CODE_BATTLE_GITHUB_ORGS, default MGSoftwareBV). Use after get_mg_dashboard_commits when commit subjects are not enough to judge exists / polish / new. Returns metadata + text content (secrets redacted). Credential paths (.env, keys) are denied. Binary files return { binary: true } with no payload. Full diffs are never attached to get_mg_dashboard_commits \u2014 use get_mg_dashboard_diff for a compact patch.",
|
|
1145
|
+
inputSchema: {
|
|
1146
|
+
type: "object",
|
|
1147
|
+
properties: {
|
|
1148
|
+
repository: {
|
|
1149
|
+
type: "string",
|
|
1150
|
+
description: "owner/repo, e.g. MGSoftwareBV/mg-dashboard. Org must be allowlisted."
|
|
1151
|
+
},
|
|
1152
|
+
ref: {
|
|
1153
|
+
type: "string",
|
|
1154
|
+
description: "Commit sha, branch, or tag."
|
|
1155
|
+
},
|
|
1156
|
+
path: {
|
|
1157
|
+
type: "string",
|
|
1158
|
+
description: "File path inside the repo (not a directory)."
|
|
1159
|
+
}
|
|
1160
|
+
},
|
|
1161
|
+
required: ["repository", "ref", "path"]
|
|
1162
|
+
}
|
|
1163
|
+
},
|
|
1164
|
+
{
|
|
1165
|
+
name: "get_mg_dashboard_diff",
|
|
1166
|
+
description: "Fetch a COMPACT unified diff for one commit sha XOR one pull request number, same org allowlist as get_mg_dashboard_file. Returns per-file path/status/+/- and a truncated patch (secrets redacted). Binary files are omitted. Does not change get_mg_dashboard_commits (metadata-only by design).",
|
|
1167
|
+
inputSchema: {
|
|
1168
|
+
type: "object",
|
|
1169
|
+
properties: {
|
|
1170
|
+
repository: {
|
|
1171
|
+
type: "string",
|
|
1172
|
+
description: "owner/repo, e.g. MGSoftwareBV/mg-dashboard. Org must be allowlisted."
|
|
1173
|
+
},
|
|
1174
|
+
sha: {
|
|
1175
|
+
type: "string",
|
|
1176
|
+
description: "Commit sha. Provide exactly one of sha or pullNumber."
|
|
1177
|
+
},
|
|
1178
|
+
pullNumber: {
|
|
1179
|
+
type: "number",
|
|
1180
|
+
description: "Pull request number. Provide exactly one of sha or pullNumber."
|
|
1181
|
+
}
|
|
1182
|
+
},
|
|
1183
|
+
required: ["repository"]
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
];
|
|
1187
|
+
async function handleGithubCodeAccessTool(name, args2, ctx) {
|
|
1188
|
+
if (name === "get_mg_dashboard_file") {
|
|
1189
|
+
const repository = typeof args2.repository === "string" ? args2.repository.trim() : "";
|
|
1190
|
+
const ref = typeof args2.ref === "string" ? args2.ref.trim() : "";
|
|
1191
|
+
const path = typeof args2.path === "string" ? args2.path.trim() : "";
|
|
1192
|
+
if (!repository || !ref || !path) {
|
|
1193
|
+
return {
|
|
1194
|
+
content: [
|
|
1195
|
+
{
|
|
1196
|
+
type: "text",
|
|
1197
|
+
text: "Error: repository, ref and path are required"
|
|
1198
|
+
}
|
|
1199
|
+
]
|
|
1200
|
+
};
|
|
1201
|
+
}
|
|
1202
|
+
return proxyJson(ctx, "/api/activity/file", { repository, ref, path });
|
|
1203
|
+
}
|
|
1204
|
+
if (name === "get_mg_dashboard_diff") {
|
|
1205
|
+
const repository = typeof args2.repository === "string" ? args2.repository.trim() : "";
|
|
1206
|
+
if (!repository) {
|
|
1207
|
+
return {
|
|
1208
|
+
content: [
|
|
1209
|
+
{ type: "text", text: "Error: repository is required" }
|
|
1210
|
+
]
|
|
1211
|
+
};
|
|
1212
|
+
}
|
|
1213
|
+
const sha = typeof args2.sha === "string" ? args2.sha.trim() : void 0;
|
|
1214
|
+
const pullNumber = typeof args2.pullNumber === "number" ? args2.pullNumber : void 0;
|
|
1215
|
+
const hasSha = Boolean(sha);
|
|
1216
|
+
const hasPr = pullNumber != null;
|
|
1217
|
+
if (hasSha === hasPr) {
|
|
1218
|
+
return {
|
|
1219
|
+
content: [
|
|
1220
|
+
{
|
|
1221
|
+
type: "text",
|
|
1222
|
+
text: "Error: provide exactly one of sha or pullNumber"
|
|
1223
|
+
}
|
|
1224
|
+
]
|
|
1225
|
+
};
|
|
1226
|
+
}
|
|
1227
|
+
return proxyJson(ctx, "/api/activity/diff", {
|
|
1228
|
+
repository,
|
|
1229
|
+
...hasSha ? { sha } : { pullNumber }
|
|
1230
|
+
});
|
|
1231
|
+
}
|
|
1232
|
+
return {
|
|
1233
|
+
content: [{ type: "text", text: `Error: unknown tool ${name}` }]
|
|
1234
|
+
};
|
|
1235
|
+
}
|
|
1236
|
+
async function proxyJson(ctx, route, body) {
|
|
1237
|
+
const res = await fetch(`${ctx.dashboardBaseUrl}${route}`, {
|
|
1238
|
+
method: "POST",
|
|
1239
|
+
headers: {
|
|
1240
|
+
"content-type": "application/json",
|
|
1241
|
+
authorization: `Bearer ${ctx.apiKey}`
|
|
1242
|
+
},
|
|
1243
|
+
body: JSON.stringify(body)
|
|
1244
|
+
});
|
|
1245
|
+
if (!res.ok) {
|
|
1246
|
+
const detail = await res.text().catch(() => "");
|
|
1247
|
+
return {
|
|
1248
|
+
content: [
|
|
1249
|
+
{
|
|
1250
|
+
type: "text",
|
|
1251
|
+
text: `Error: mg-dashboard ${route} failed (${res.status}). ${detail.slice(0, 300)}`
|
|
1252
|
+
}
|
|
1253
|
+
]
|
|
1254
|
+
};
|
|
1255
|
+
}
|
|
1256
|
+
const data = await res.json();
|
|
1257
|
+
return {
|
|
1258
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
|
|
1259
|
+
};
|
|
1260
|
+
}
|
|
1139
1261
|
var ALGORITHM = "aes-256-gcm";
|
|
1140
1262
|
var IV_LENGTH = 16;
|
|
1141
1263
|
var AUTH_TAG_LENGTH = 16;
|
|
@@ -5712,7 +5834,12 @@ pgTable(
|
|
|
5712
5834
|
(table) => [
|
|
5713
5835
|
index("idx_agent_world_event_created").on(table.createdAt),
|
|
5714
5836
|
index("idx_agent_world_event_type").on(table.type),
|
|
5715
|
-
index("idx_agent_world_event_agent").on(table.agentId)
|
|
5837
|
+
index("idx_agent_world_event_agent").on(table.agentId),
|
|
5838
|
+
// Diary / per-agent feed: WHERE agent_id ORDER BY created_at DESC LIMIT N
|
|
5839
|
+
index("idx_agent_world_event_agent_created").on(
|
|
5840
|
+
table.agentId,
|
|
5841
|
+
table.createdAt
|
|
5842
|
+
)
|
|
5716
5843
|
]
|
|
5717
5844
|
);
|
|
5718
5845
|
pgTable(
|
|
@@ -10547,6 +10674,8 @@ var RESPONSE_MAX_BYTES = 8192;
|
|
|
10547
10674
|
var NO_FOOTER_TOOLS = /* @__PURE__ */ new Set();
|
|
10548
10675
|
var RAW_JSON_TOOLS = /* @__PURE__ */ new Set([
|
|
10549
10676
|
"get_mg_dashboard_commits",
|
|
10677
|
+
"get_mg_dashboard_file",
|
|
10678
|
+
"get_mg_dashboard_diff",
|
|
10550
10679
|
"extract_article",
|
|
10551
10680
|
// Content family (2026-DASMG-040/041/042) — compact JSON consumed verbatim.
|
|
10552
10681
|
// Consolidated action-based tools (the Cursor surface); each proxies to the
|
|
@@ -12717,6 +12846,7 @@ var TOOLS = [
|
|
|
12717
12846
|
required: ["actor", "dateFrom", "dateTo"]
|
|
12718
12847
|
}
|
|
12719
12848
|
},
|
|
12849
|
+
...GITHUB_CODE_ACCESS_TOOLS,
|
|
12720
12850
|
{
|
|
12721
12851
|
name: "extract_article",
|
|
12722
12852
|
description: "Extract readable article/content data from ONE PUBLIC URL, with a browser-render fallback for pages that block a normal fetch (403) or only render with JavaScript (ticket 2026-DASMG-039). Returns title, author, publishedAt, source, summary, facts[], optional rawText (capped), canonicalUrl, the `extractionMethod` used (http | browser | jsonld | rss | amp | metadata_only) and an explicit `limitations` array (e.g. blocked_without_browser, paywall_detected, partial_content, rawtext_truncated). PUBLIC URLs only \u2014 SSRF-guarded (private/loopback/metadata addresses rejected), no paywall bypass, no credentials; the source/canonical URL is always preserved. Use it to turn a news/article link into safe factual source material for agents; it never auto-publishes or rewrites. For several sources + cross-checking, use `research` with action=topic.",
|
|
@@ -13629,6 +13759,12 @@ async function executeToolCall(name, a, _serverId) {
|
|
|
13629
13759
|
content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
|
|
13630
13760
|
};
|
|
13631
13761
|
}
|
|
13762
|
+
case "get_mg_dashboard_file":
|
|
13763
|
+
case "get_mg_dashboard_diff":
|
|
13764
|
+
return handleGithubCodeAccessTool(name, a, {
|
|
13765
|
+
dashboardBaseUrl,
|
|
13766
|
+
apiKey: apiKey ?? ""
|
|
13767
|
+
});
|
|
13632
13768
|
// ----- Public-web extraction (article tools) -----
|
|
13633
13769
|
case "extract_article": {
|
|
13634
13770
|
const url = typeof a.url === "string" ? a.url.trim() : "";
|
package/package.json
CHANGED