@mgsoftwarebv/mg-dashboard-mcp 7.0.10 → 7.0.12
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 +88 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10178,6 +10178,24 @@ var TOOLS = [
|
|
|
10178
10178
|
required: ["query"]
|
|
10179
10179
|
}
|
|
10180
10180
|
},
|
|
10181
|
+
{
|
|
10182
|
+
name: "get-team-memory",
|
|
10183
|
+
description: "Fetch the FULL stored text of past conversation(s) found via search-team-memory (pass the `id` from its results). search-team-memory returns only snippets; this returns the distilled problem\u2192solution transcript so you can reuse the actual fix/approach/code. Call this on the 1-2 most relevant hits before re-solving from scratch.",
|
|
10184
|
+
inputSchema: {
|
|
10185
|
+
type: "object",
|
|
10186
|
+
properties: {
|
|
10187
|
+
id: {
|
|
10188
|
+
type: "string",
|
|
10189
|
+
description: "A memory id from a search-team-memory result."
|
|
10190
|
+
},
|
|
10191
|
+
ids: {
|
|
10192
|
+
type: "array",
|
|
10193
|
+
items: { type: "string" },
|
|
10194
|
+
description: "Optional: up to 5 memory ids to fetch in one call."
|
|
10195
|
+
}
|
|
10196
|
+
}
|
|
10197
|
+
}
|
|
10198
|
+
},
|
|
10181
10199
|
// ----- Trigger.dev -----
|
|
10182
10200
|
...TRIGGER_TOOLS
|
|
10183
10201
|
];
|
|
@@ -10294,20 +10312,88 @@ async function executeToolCall(name, a, _serverId) {
|
|
|
10294
10312
|
const when = hit.lastMessageAt ? new Date(hit.lastMessageAt).toISOString().slice(0, 10) : "unknown date";
|
|
10295
10313
|
const repo = hit.repo ?? "unknown repo";
|
|
10296
10314
|
const sim = hit.similarity !== null ? ` \xB7 ${(hit.similarity * 100).toFixed(0)}% match` : "";
|
|
10297
|
-
|
|
10315
|
+
const facets = [
|
|
10316
|
+
hit.category,
|
|
10317
|
+
hit.resolved === false ? "unresolved" : null,
|
|
10318
|
+
...Array.isArray(hit.tech) ? hit.tech.slice(0, 4) : []
|
|
10319
|
+
].filter(Boolean);
|
|
10320
|
+
const tags = facets.length > 0 ? ` \xB7 ${facets.join(", ")}` : "";
|
|
10321
|
+
return `${index5 + 1}. [${repo} \xB7 ${when}${sim}${tags}] ${hit.title}
|
|
10322
|
+
id: ${hit.id}
|
|
10298
10323
|
${(hit.summary ?? hit.snippet).replace(/\s+/g, " ").slice(0, 500)}`;
|
|
10299
10324
|
});
|
|
10300
10325
|
return {
|
|
10301
10326
|
content: [
|
|
10302
10327
|
{
|
|
10303
10328
|
type: "text",
|
|
10304
|
-
text: `Found ${data.count} prior conversation(s) (${data.mode} search) \u2014 reuse this before solving from scratch
|
|
10329
|
+
text: `Found ${data.count} prior conversation(s) (${data.mode} search) \u2014 reuse this before solving from scratch.
|
|
10330
|
+
These are SNIPPETS. For any hit worth reusing, call get-team-memory with its id to read the full problem\u2192solution transcript before re-solving.
|
|
10305
10331
|
|
|
10306
10332
|
` + lines.join("\n\n")
|
|
10307
10333
|
}
|
|
10308
10334
|
]
|
|
10309
10335
|
};
|
|
10310
10336
|
}
|
|
10337
|
+
// ----- Team memory: full detail -----
|
|
10338
|
+
case "get-team-memory": {
|
|
10339
|
+
const ids = [];
|
|
10340
|
+
if (typeof a.id === "string" && a.id.trim()) ids.push(a.id.trim());
|
|
10341
|
+
if (Array.isArray(a.ids)) {
|
|
10342
|
+
for (const value of a.ids) {
|
|
10343
|
+
if (typeof value === "string" && value.trim()) ids.push(value.trim());
|
|
10344
|
+
}
|
|
10345
|
+
}
|
|
10346
|
+
if (ids.length === 0) {
|
|
10347
|
+
return {
|
|
10348
|
+
content: [
|
|
10349
|
+
{ type: "text", text: "Error: id (or ids) is required" }
|
|
10350
|
+
]
|
|
10351
|
+
};
|
|
10352
|
+
}
|
|
10353
|
+
const res = await fetch(`${dashboardBaseUrl}/api/team-memory/detail`, {
|
|
10354
|
+
method: "POST",
|
|
10355
|
+
headers: {
|
|
10356
|
+
"content-type": "application/json",
|
|
10357
|
+
authorization: `Bearer ${apiKey}`
|
|
10358
|
+
},
|
|
10359
|
+
body: JSON.stringify({ ids: ids.slice(0, 5) })
|
|
10360
|
+
});
|
|
10361
|
+
if (!res.ok) {
|
|
10362
|
+
const detail = await res.text().catch(() => "");
|
|
10363
|
+
return {
|
|
10364
|
+
content: [
|
|
10365
|
+
{
|
|
10366
|
+
type: "text",
|
|
10367
|
+
text: `Error: team-memory detail failed (${res.status}). ${detail.slice(0, 300)}`
|
|
10368
|
+
}
|
|
10369
|
+
]
|
|
10370
|
+
};
|
|
10371
|
+
}
|
|
10372
|
+
const data = await res.json();
|
|
10373
|
+
if (data.count === 0) {
|
|
10374
|
+
return {
|
|
10375
|
+
content: [
|
|
10376
|
+
{
|
|
10377
|
+
type: "text",
|
|
10378
|
+
text: "No team-memory entries matched the given id(s)."
|
|
10379
|
+
}
|
|
10380
|
+
]
|
|
10381
|
+
};
|
|
10382
|
+
}
|
|
10383
|
+
const blocks = data.results.map((r) => {
|
|
10384
|
+
const when = r.lastMessageAt ? new Date(r.lastMessageAt).toISOString().slice(0, 10) : "unknown date";
|
|
10385
|
+
const repo = r.repo ?? "unknown repo";
|
|
10386
|
+
return `## ${r.title}
|
|
10387
|
+
[${repo} \xB7 ${when} \xB7 ${r.messageCount} msgs \xB7 ${r.source}]
|
|
10388
|
+
|
|
10389
|
+
` + r.content;
|
|
10390
|
+
});
|
|
10391
|
+
return {
|
|
10392
|
+
content: [
|
|
10393
|
+
{ type: "text", text: blocks.join("\n\n---\n\n") }
|
|
10394
|
+
]
|
|
10395
|
+
};
|
|
10396
|
+
}
|
|
10311
10397
|
// ----- Servers -----
|
|
10312
10398
|
case "list-servers": {
|
|
10313
10399
|
const data = ctx.allowedServerIds !== null ? await db.execute(sql`
|