@echomem/mcp 1.4.59 → 1.4.60
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 +30 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2324,15 +2324,41 @@ Details: ${m.details || "N/A"}`)
|
|
|
2324
2324
|
return `- ${title} · ${ticketId} · version ${version} · active since ${linkedAt}`;
|
|
2325
2325
|
})
|
|
2326
2326
|
: ["- No active ticket."];
|
|
2327
|
+
const candidateById = new Map(candidates.flatMap((candidate) => {
|
|
2328
|
+
const id = readString(candidate, "id");
|
|
2329
|
+
return id ? [[id, candidate]] : [];
|
|
2330
|
+
}));
|
|
2331
|
+
const candidateDepth = (candidate) => {
|
|
2332
|
+
let depth = 0;
|
|
2333
|
+
let parentId = readString(candidate, "parentId");
|
|
2334
|
+
const visited = new Set();
|
|
2335
|
+
while (parentId && candidateById.has(parentId) && !visited.has(parentId)) {
|
|
2336
|
+
visited.add(parentId);
|
|
2337
|
+
depth += 1;
|
|
2338
|
+
parentId = readString(candidateById.get(parentId) ?? {}, "parentId");
|
|
2339
|
+
}
|
|
2340
|
+
return depth;
|
|
2341
|
+
};
|
|
2327
2342
|
const candidateLines = candidates.length
|
|
2328
|
-
? candidates
|
|
2343
|
+
? [...candidates]
|
|
2344
|
+
.sort((left, right) => {
|
|
2345
|
+
const leftAddress = readString(left, "address") ?? "";
|
|
2346
|
+
const rightAddress = readString(right, "address") ?? "";
|
|
2347
|
+
return leftAddress.localeCompare(rightAddress, undefined, { numeric: true });
|
|
2348
|
+
})
|
|
2349
|
+
.map((candidate) => {
|
|
2329
2350
|
const id = readString(candidate, "id") ?? "unknown";
|
|
2351
|
+
const parentId = readString(candidate, "parentId");
|
|
2330
2352
|
const address = readString(candidate, "address") ?? "?";
|
|
2331
2353
|
const title = (readString(candidate, "title") ?? "Untitled").replace(/\s+/g, " ").trim();
|
|
2332
|
-
const
|
|
2354
|
+
const rawDescription = (readString(candidate, "description") ?? "").replace(/\s+/g, " ").trim();
|
|
2355
|
+
const description = rawDescription.length > 600
|
|
2356
|
+
? `${rawDescription.slice(0, 597)}...`
|
|
2357
|
+
: rawDescription;
|
|
2333
2358
|
const version = numberArg(candidate, "version") ?? 0;
|
|
2334
2359
|
const updatedAt = readString(candidate, "updatedAt") ?? "unknown";
|
|
2335
|
-
|
|
2360
|
+
const indentation = " ".repeat(candidateDepth(candidate));
|
|
2361
|
+
return `${indentation}- ${address} · ${title} · ${id} · parent ${parentId ?? "root"} · version ${version} · updated ${updatedAt}${description ? `\n${indentation} ${description}` : ""}`;
|
|
2336
2362
|
})
|
|
2337
2363
|
: ["- No existing tickets."];
|
|
2338
2364
|
const memoriesSinceReview = numberArg(review, "memoriesSinceReview") ?? 0;
|
|
@@ -2391,7 +2417,7 @@ Details: ${m.details || "N/A"}`)
|
|
|
2391
2417
|
"Active assignment:",
|
|
2392
2418
|
...activeLines,
|
|
2393
2419
|
"",
|
|
2394
|
-
"Candidate
|
|
2420
|
+
"Candidate ticket structure (address order; indentation follows parentId):",
|
|
2395
2421
|
...candidateLines,
|
|
2396
2422
|
"",
|
|
2397
2423
|
...pendingLines,
|