cf-memory-mcp 3.17.0 → 3.18.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 +57 -3
- package/package.json +1 -1
package/bin/cf-memory-mcp.js
CHANGED
|
@@ -213,8 +213,9 @@ const TOOLS_LIST = [
|
|
|
213
213
|
repo_path: { type: 'string', description: 'Absolute project root path. Bridge auto-fills from cwd if omitted.' },
|
|
214
214
|
project_id: { type: 'string', description: 'Canonical project id (proj_...). Used before repo_path when set.' },
|
|
215
215
|
branch: { type: 'string', description: 'Current git branch. Mismatch downgrades match_confidence but does not hide. Bridge auto-fills from git.' },
|
|
216
|
-
session_id_hint: { type: 'string', description: 'Resume a specific session by id (overrides repo/branch matching). Useful after seeing recent_handoffs.' },
|
|
217
|
-
max_age_minutes: { type: 'number', description: 'Hard cutoff: hide handoffs older than this many minutes. Without it, older handoffs surface with reduced confidence.' }
|
|
216
|
+
session_id_hint: { type: 'string', description: 'Resume a specific session by id (overrides repo/branch matching). Full UUID or short prefix (>=8 chars). Useful after seeing recent_handoffs.' },
|
|
217
|
+
max_age_minutes: { type: 'number', description: 'Hard cutoff: hide handoffs older than this many minutes. Without it, older handoffs surface with reduced confidence.' },
|
|
218
|
+
goal_contains: { type: 'string', description: 'Substring filter on handoff content (goal/notes/decisions). Case-insensitive. Lets agents find a specific thread by what it was about.' }
|
|
218
219
|
}
|
|
219
220
|
}
|
|
220
221
|
},
|
|
@@ -2637,10 +2638,63 @@ class CFMemoryMCP {
|
|
|
2637
2638
|
// sees the recent trajectory ("what was I doing").
|
|
2638
2639
|
const timelineNote = this.formatActivityTimeline();
|
|
2639
2640
|
const baseNote = `Auto-synthesized by cf-memory-mcp bridge. Agent did not provide a handoff. Tool calls observed: ${this._toolCallCount || 0}. Set CF_MEMORY_AUTO_HANDOFF=off to disable.`;
|
|
2640
|
-
|
|
2641
|
+
|
|
2642
|
+
// Workspace state: uncommitted changes + recent commits give the
|
|
2643
|
+
// next chat real signal about what's been happening in the repo,
|
|
2644
|
+
// not just what tools the agent called.
|
|
2645
|
+
const workspaceState = this.getGitWorkspaceState();
|
|
2646
|
+
const sections = [baseNote];
|
|
2647
|
+
if (timelineNote) sections.push(`Recent activity:\n${timelineNote}`);
|
|
2648
|
+
if (workspaceState) sections.push(`Workspace state:\n${workspaceState}`);
|
|
2649
|
+
handoff.notes = sections.join('\n\n');
|
|
2641
2650
|
return handoff;
|
|
2642
2651
|
}
|
|
2643
2652
|
|
|
2653
|
+
/**
|
|
2654
|
+
* Snapshot the local git workspace: uncommitted file count, top
|
|
2655
|
+
* changed files, last 3 commit messages. Used by auto-synthesized
|
|
2656
|
+
* handoffs so the next chat sees real workspace state, not just
|
|
2657
|
+
* tool-call activity. Best-effort: returns "" when git unavailable.
|
|
2658
|
+
*/
|
|
2659
|
+
getGitWorkspaceState() {
|
|
2660
|
+
try {
|
|
2661
|
+
const meta = this.getRepoMetadata();
|
|
2662
|
+
if (!meta.repo_path) return '';
|
|
2663
|
+
const { execSync } = require('child_process');
|
|
2664
|
+
const run = (cmd) => execSync(cmd, {
|
|
2665
|
+
cwd: meta.repo_path,
|
|
2666
|
+
encoding: 'utf8',
|
|
2667
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
2668
|
+
timeout: 500,
|
|
2669
|
+
});
|
|
2670
|
+
const lines = [];
|
|
2671
|
+
// Uncommitted: `git status --porcelain` is one line per changed file.
|
|
2672
|
+
try {
|
|
2673
|
+
const status = run('git status --porcelain').trim();
|
|
2674
|
+
if (status) {
|
|
2675
|
+
const files = status.split('\n').slice(0, 8);
|
|
2676
|
+
const more = status.split('\n').length > 8 ? ` (+ ${status.split('\n').length - 8} more)` : '';
|
|
2677
|
+
lines.push(` Uncommitted changes:${more}`);
|
|
2678
|
+
files.forEach(f => lines.push(` ${f}`));
|
|
2679
|
+
} else {
|
|
2680
|
+
lines.push(' Working tree clean.');
|
|
2681
|
+
}
|
|
2682
|
+
} catch (_) { /* git status failed */ }
|
|
2683
|
+
// Last 3 commits — short hash + subject only.
|
|
2684
|
+
try {
|
|
2685
|
+
const log = run('git log -3 --pretty=format:%h\\ %s').trim();
|
|
2686
|
+
if (log) {
|
|
2687
|
+
lines.push(' Recent commits:');
|
|
2688
|
+
log.split('\n').forEach(c => lines.push(` ${c}`));
|
|
2689
|
+
}
|
|
2690
|
+
} catch (_) { /* git log failed */ }
|
|
2691
|
+
return lines.join('\n');
|
|
2692
|
+
} catch (err) {
|
|
2693
|
+
this.logDebug(`getGitWorkspaceState failed: ${err && err.message}`);
|
|
2694
|
+
return '';
|
|
2695
|
+
}
|
|
2696
|
+
}
|
|
2697
|
+
|
|
2644
2698
|
/**
|
|
2645
2699
|
* Condense an MCP tool call into a single-line summary. Used for the
|
|
2646
2700
|
* activity timeline so the synthesized handoff includes "what was I
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cf-memory-mcp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.18.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": {
|