@mgsoftwarebv/mg-dashboard-mcp 7.0.10 → 7.0.11
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 +81 -1
- 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
|
];
|
|
@@ -10295,19 +10313,81 @@ async function executeToolCall(name, a, _serverId) {
|
|
|
10295
10313
|
const repo = hit.repo ?? "unknown repo";
|
|
10296
10314
|
const sim = hit.similarity !== null ? ` \xB7 ${(hit.similarity * 100).toFixed(0)}% match` : "";
|
|
10297
10315
|
return `${index5 + 1}. [${repo} \xB7 ${when}${sim}] ${hit.title}
|
|
10316
|
+
id: ${hit.id}
|
|
10298
10317
|
${(hit.summary ?? hit.snippet).replace(/\s+/g, " ").slice(0, 500)}`;
|
|
10299
10318
|
});
|
|
10300
10319
|
return {
|
|
10301
10320
|
content: [
|
|
10302
10321
|
{
|
|
10303
10322
|
type: "text",
|
|
10304
|
-
text: `Found ${data.count} prior conversation(s) (${data.mode} search) \u2014 reuse this before solving from scratch
|
|
10323
|
+
text: `Found ${data.count} prior conversation(s) (${data.mode} search) \u2014 reuse this before solving from scratch.
|
|
10324
|
+
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
10325
|
|
|
10306
10326
|
` + lines.join("\n\n")
|
|
10307
10327
|
}
|
|
10308
10328
|
]
|
|
10309
10329
|
};
|
|
10310
10330
|
}
|
|
10331
|
+
// ----- Team memory: full detail -----
|
|
10332
|
+
case "get-team-memory": {
|
|
10333
|
+
const ids = [];
|
|
10334
|
+
if (typeof a.id === "string" && a.id.trim()) ids.push(a.id.trim());
|
|
10335
|
+
if (Array.isArray(a.ids)) {
|
|
10336
|
+
for (const value of a.ids) {
|
|
10337
|
+
if (typeof value === "string" && value.trim()) ids.push(value.trim());
|
|
10338
|
+
}
|
|
10339
|
+
}
|
|
10340
|
+
if (ids.length === 0) {
|
|
10341
|
+
return {
|
|
10342
|
+
content: [
|
|
10343
|
+
{ type: "text", text: "Error: id (or ids) is required" }
|
|
10344
|
+
]
|
|
10345
|
+
};
|
|
10346
|
+
}
|
|
10347
|
+
const res = await fetch(`${dashboardBaseUrl}/api/team-memory/detail`, {
|
|
10348
|
+
method: "POST",
|
|
10349
|
+
headers: {
|
|
10350
|
+
"content-type": "application/json",
|
|
10351
|
+
authorization: `Bearer ${apiKey}`
|
|
10352
|
+
},
|
|
10353
|
+
body: JSON.stringify({ ids: ids.slice(0, 5) })
|
|
10354
|
+
});
|
|
10355
|
+
if (!res.ok) {
|
|
10356
|
+
const detail = await res.text().catch(() => "");
|
|
10357
|
+
return {
|
|
10358
|
+
content: [
|
|
10359
|
+
{
|
|
10360
|
+
type: "text",
|
|
10361
|
+
text: `Error: team-memory detail failed (${res.status}). ${detail.slice(0, 300)}`
|
|
10362
|
+
}
|
|
10363
|
+
]
|
|
10364
|
+
};
|
|
10365
|
+
}
|
|
10366
|
+
const data = await res.json();
|
|
10367
|
+
if (data.count === 0) {
|
|
10368
|
+
return {
|
|
10369
|
+
content: [
|
|
10370
|
+
{
|
|
10371
|
+
type: "text",
|
|
10372
|
+
text: "No team-memory entries matched the given id(s)."
|
|
10373
|
+
}
|
|
10374
|
+
]
|
|
10375
|
+
};
|
|
10376
|
+
}
|
|
10377
|
+
const blocks = data.results.map((r) => {
|
|
10378
|
+
const when = r.lastMessageAt ? new Date(r.lastMessageAt).toISOString().slice(0, 10) : "unknown date";
|
|
10379
|
+
const repo = r.repo ?? "unknown repo";
|
|
10380
|
+
return `## ${r.title}
|
|
10381
|
+
[${repo} \xB7 ${when} \xB7 ${r.messageCount} msgs \xB7 ${r.source}]
|
|
10382
|
+
|
|
10383
|
+
` + r.content;
|
|
10384
|
+
});
|
|
10385
|
+
return {
|
|
10386
|
+
content: [
|
|
10387
|
+
{ type: "text", text: blocks.join("\n\n---\n\n") }
|
|
10388
|
+
]
|
|
10389
|
+
};
|
|
10390
|
+
}
|
|
10311
10391
|
// ----- Servers -----
|
|
10312
10392
|
case "list-servers": {
|
|
10313
10393
|
const data = ctx.allowedServerIds !== null ? await db.execute(sql`
|