cf-memory-mcp 3.40.0 → 3.41.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 +23 -1
- package/package.json +1 -1
package/bin/cf-memory-mcp.js
CHANGED
|
@@ -2487,7 +2487,16 @@ class CFMemoryMCP {
|
|
|
2487
2487
|
* detection fails.
|
|
2488
2488
|
*/
|
|
2489
2489
|
getRepoMetadata() {
|
|
2490
|
-
|
|
2490
|
+
// 60s TTL: long enough to amortize git invocations across a flurry
|
|
2491
|
+
// of tool calls, short enough that a branch switch mid-session
|
|
2492
|
+
// gets picked up within a minute. Without the TTL, the bridge
|
|
2493
|
+
// would keep reporting the original branch for the whole process
|
|
2494
|
+
// lifetime even after `git checkout other-branch`.
|
|
2495
|
+
const TTL_MS = 60_000;
|
|
2496
|
+
if (this._repoMetaCache && this._repoMetaCacheTime &&
|
|
2497
|
+
(Date.now() - this._repoMetaCacheTime) < TTL_MS) {
|
|
2498
|
+
return this._repoMetaCache;
|
|
2499
|
+
}
|
|
2491
2500
|
const result = {};
|
|
2492
2501
|
try {
|
|
2493
2502
|
const root = process.env.CF_MEMORY_WATCH_PATH || process.cwd();
|
|
@@ -2509,6 +2518,7 @@ class CFMemoryMCP {
|
|
|
2509
2518
|
if (branch) result.branch = branch;
|
|
2510
2519
|
} catch (_) { /* not a git repo, detached HEAD, or no branch — leave undefined */ }
|
|
2511
2520
|
this._repoMetaCache = result;
|
|
2521
|
+
this._repoMetaCacheTime = Date.now();
|
|
2512
2522
|
_mcpTrace('REPO_META', `repo_path=${result.repo_path||'?'} branch=${result.branch||'?'}`);
|
|
2513
2523
|
return result;
|
|
2514
2524
|
}
|
|
@@ -3914,6 +3924,8 @@ function parseCliArgs(rest) {
|
|
|
3914
3924
|
flags.chain = true;
|
|
3915
3925
|
} else if (a === '--validate') {
|
|
3916
3926
|
flags.validate = true;
|
|
3927
|
+
} else if (a === '--raw') {
|
|
3928
|
+
flags.raw = true;
|
|
3917
3929
|
} else if (a === '--older-than') {
|
|
3918
3930
|
// Accept "7d" / "30d" / "12h" / raw number (days).
|
|
3919
3931
|
const raw = rest[++i] || '';
|
|
@@ -4067,6 +4079,15 @@ async function runResumeCli() {
|
|
|
4067
4079
|
process.exit(0);
|
|
4068
4080
|
}
|
|
4069
4081
|
|
|
4082
|
+
// --raw: print the bare handoff JSON (no envelope metadata).
|
|
4083
|
+
// Useful for migrations, direct inspection, or piping to jq.
|
|
4084
|
+
if (flags.raw) {
|
|
4085
|
+
const handoff = payload.resume_handoff?.handoff;
|
|
4086
|
+
if (!handoff) process.exit(3);
|
|
4087
|
+
process.stdout.write(JSON.stringify(handoff, null, 2) + '\n');
|
|
4088
|
+
process.exit(0);
|
|
4089
|
+
}
|
|
4090
|
+
|
|
4070
4091
|
// --chain: walk parent_session_id back through the thread history.
|
|
4071
4092
|
// Bounded at 20 iterations to avoid an infinite loop on malformed
|
|
4072
4093
|
// data. Prints each handoff as "<id> [age] status — goal".
|
|
@@ -4667,6 +4688,7 @@ const PER_COMMAND_HELP = {
|
|
|
4667
4688
|
--blockers-only open blockers, one per line.
|
|
4668
4689
|
--chain Walk parent_session_id back; show the thread history.
|
|
4669
4690
|
--validate Check that files_touched + code_anchors still exist locally.
|
|
4691
|
+
--raw Print just the raw handoff JSON (no envelope metadata).
|
|
4670
4692
|
--json, -j Full bootstrap payload as JSON.
|
|
4671
4693
|
Exit codes: 0 = found, 3 = no handoff / no data, 4 = --validate found missing files.`,
|
|
4672
4694
|
list: `cf-memory-mcp list [--status S] [--since ISO] [--repo PATH] [--limit N] [--json]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cf-memory-mcp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.41.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": {
|