cf-memory-mcp 3.49.0 → 3.50.0
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/bin/cf-memory-mcp.js +50 -3
- package/package.json +1 -1
package/bin/cf-memory-mcp.js
CHANGED
|
@@ -4399,21 +4399,34 @@ async function runResumeCli() {
|
|
|
4399
4399
|
// --diff <other-id>: compare two handoffs. Shows added/removed
|
|
4400
4400
|
// next_steps, branch shift, status change, files diff. Useful
|
|
4401
4401
|
// for "what changed between yesterday's session and today's?".
|
|
4402
|
+
// Special value "--parent" diffs against the chain parent.
|
|
4402
4403
|
if (flags.diff) {
|
|
4403
4404
|
if (!found) {
|
|
4404
4405
|
process.stderr.write('No source handoff available to diff against.\n');
|
|
4405
4406
|
process.exit(3);
|
|
4406
4407
|
}
|
|
4408
|
+
let diffTarget = flags.diff;
|
|
4409
|
+
// --diff --parent: resolve to the parent_session_id from the
|
|
4410
|
+
// current handoff so users can do "what's new since the
|
|
4411
|
+
// last checkpoint" without typing the parent's id.
|
|
4412
|
+
if (diffTarget === '--parent' || diffTarget === 'parent') {
|
|
4413
|
+
const parentId = payload.resume_handoff.handoff?.parent_session_id;
|
|
4414
|
+
if (!parentId) {
|
|
4415
|
+
process.stderr.write('This handoff has no parent_session_id to diff against.\n');
|
|
4416
|
+
process.exit(3);
|
|
4417
|
+
}
|
|
4418
|
+
diffTarget = parentId;
|
|
4419
|
+
}
|
|
4407
4420
|
const otherRes = await server.makeRequest({
|
|
4408
4421
|
jsonrpc: '2.0', id: `cli-diff-${Date.now()}`,
|
|
4409
4422
|
method: 'tools/call',
|
|
4410
|
-
params: { name: 'get_context_bootstrap', arguments: { resume: true, session_id_hint:
|
|
4423
|
+
params: { name: 'get_context_bootstrap', arguments: { resume: true, session_id_hint: diffTarget } },
|
|
4411
4424
|
});
|
|
4412
4425
|
const otherText = otherRes?.result?.content?.[0]?.text;
|
|
4413
4426
|
const otherPayload = JSON.parse(otherText || '{}');
|
|
4414
4427
|
const otherHandoff = otherPayload.resume_handoff?.handoff;
|
|
4415
4428
|
if (!otherHandoff) {
|
|
4416
|
-
process.stderr.write(`Could not fetch handoff "${
|
|
4429
|
+
process.stderr.write(`Could not fetch handoff "${diffTarget}" to diff against.\n`);
|
|
4417
4430
|
process.exit(3);
|
|
4418
4431
|
}
|
|
4419
4432
|
const h = payload.resume_handoff.handoff;
|
|
@@ -5359,8 +5372,25 @@ async function runDoctorCli() {
|
|
|
5359
5372
|
}
|
|
5360
5373
|
}
|
|
5361
5374
|
|
|
5375
|
+
// Optional: handoff stats summary at the bottom (visibility into
|
|
5376
|
+
// how much resume context is captured for the current user).
|
|
5377
|
+
let handoffStats = null;
|
|
5378
|
+
if (API_KEY) {
|
|
5379
|
+
try {
|
|
5380
|
+
const statsRes = await server.makeRequestOnce({
|
|
5381
|
+
jsonrpc: '2.0', id: `doctor-stats-${Date.now()}`,
|
|
5382
|
+
method: 'tools/call', params: { name: 'get_stats', arguments: {} },
|
|
5383
|
+
});
|
|
5384
|
+
const statsText = statsRes?.result?.content?.[0]?.text;
|
|
5385
|
+
if (statsText) {
|
|
5386
|
+
const statsPayload = JSON.parse(statsText);
|
|
5387
|
+
if (statsPayload?.handoffs) handoffStats = statsPayload.handoffs;
|
|
5388
|
+
}
|
|
5389
|
+
} catch (_) { /* skip on failure */ }
|
|
5390
|
+
}
|
|
5391
|
+
|
|
5362
5392
|
if (flags.json) {
|
|
5363
|
-
process.stdout.write(JSON.stringify({ checks }, null, 2) + '\n');
|
|
5393
|
+
process.stdout.write(JSON.stringify({ checks, ...(handoffStats ? { handoffs: handoffStats } : {}) }, null, 2) + '\n');
|
|
5364
5394
|
process.exit(checks.every(c => c.ok) ? 0 : 1);
|
|
5365
5395
|
}
|
|
5366
5396
|
process.stdout.write(`cf-memory-mcp v${PACKAGE_VERSION} — doctor\n\n`);
|
|
@@ -5373,6 +5403,23 @@ async function runDoctorCli() {
|
|
|
5373
5403
|
process.stdout.write(` → ${c.fix}\n`);
|
|
5374
5404
|
}
|
|
5375
5405
|
}
|
|
5406
|
+
if (handoffStats) {
|
|
5407
|
+
process.stdout.write('\nHandoff stats:\n');
|
|
5408
|
+
process.stdout.write(` total: ${handoffStats.total}\n`);
|
|
5409
|
+
if (handoffStats.by_status) {
|
|
5410
|
+
const byStatus = Object.entries(handoffStats.by_status)
|
|
5411
|
+
.map(([s, n]) => `${s}=${n}`).join(', ');
|
|
5412
|
+
process.stdout.write(` by_status: ${byStatus}\n`);
|
|
5413
|
+
}
|
|
5414
|
+
if (handoffStats.oldest_in_progress) {
|
|
5415
|
+
const o = handoffStats.oldest_in_progress;
|
|
5416
|
+
const shortId = (o.session_id || '').slice(0, 8);
|
|
5417
|
+
process.stdout.write(` oldest in_progress: ${shortId} (${o.age_minutes}m ago)\n`);
|
|
5418
|
+
}
|
|
5419
|
+
if (handoffStats.by_repo && handoffStats.by_repo.length > 0) {
|
|
5420
|
+
process.stdout.write(` top repos: ${handoffStats.by_repo.slice(0, 3).map(r => `${r.repo_path.split('/').pop()}=${r.count}`).join(', ')}\n`);
|
|
5421
|
+
}
|
|
5422
|
+
}
|
|
5376
5423
|
process.stdout.write('\n');
|
|
5377
5424
|
process.stdout.write(anyFailed ? 'Some checks failed. See suggestions above.\n' : 'All checks passed.\n');
|
|
5378
5425
|
process.exit(anyFailed ? 1 : 0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cf-memory-mcp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.50.0",
|
|
4
4
|
"description": "Cloudflare-hosted MCP server for code indexing, retrieval, and assistant memory with a direct remote MCP endpoint and local stdio bridge.",
|
|
5
5
|
"main": "bin/cf-memory-mcp.js",
|
|
6
6
|
"bin": {
|