cf-memory-mcp 3.55.0 → 3.56.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 +33 -0
- package/package.json +1 -1
package/bin/cf-memory-mcp.js
CHANGED
|
@@ -4038,6 +4038,12 @@ function parseCliArgs(rest) {
|
|
|
4038
4038
|
flags.blockers_only = true;
|
|
4039
4039
|
} else if (a === '--chain') {
|
|
4040
4040
|
flags.chain = true;
|
|
4041
|
+
} else if (a === '--include-chain') {
|
|
4042
|
+
const n = parseInt(rest[++i], 10);
|
|
4043
|
+
flags.include_chain = Number.isFinite(n) && n > 0 ? Math.min(n, 10) : 3;
|
|
4044
|
+
} else if (a.startsWith('--include-chain=')) {
|
|
4045
|
+
const n = parseInt(a.slice('--include-chain='.length), 10);
|
|
4046
|
+
flags.include_chain = Number.isFinite(n) && n > 0 ? Math.min(n, 10) : 3;
|
|
4041
4047
|
} else if (a === '--validate') {
|
|
4042
4048
|
flags.validate = true;
|
|
4043
4049
|
} else if (a === '--raw') {
|
|
@@ -4614,6 +4620,32 @@ async function runResumeCli() {
|
|
|
4614
4620
|
} else {
|
|
4615
4621
|
process.stdout.write(JSON.stringify(payload.resume_handoff, null, 2) + '\n');
|
|
4616
4622
|
}
|
|
4623
|
+
// --include-chain N: walk parent_session_id back N times and
|
|
4624
|
+
// append each parent's resume_prompt inline so the agent sees
|
|
4625
|
+
// the full thread arc in one output.
|
|
4626
|
+
if (flags.include_chain && flags.include_chain > 0) {
|
|
4627
|
+
let cur = payload.resume_handoff;
|
|
4628
|
+
for (let i = 0; i < flags.include_chain; i++) {
|
|
4629
|
+
const parentId = cur?.handoff?.parent_session_id;
|
|
4630
|
+
if (!parentId) break;
|
|
4631
|
+
const parentRes = await server.makeRequest({
|
|
4632
|
+
jsonrpc: '2.0', id: `cli-include-chain-${i}-${Date.now()}`,
|
|
4633
|
+
method: 'tools/call',
|
|
4634
|
+
params: { name: 'get_context_bootstrap', arguments: { resume: true, session_id_hint: parentId } },
|
|
4635
|
+
});
|
|
4636
|
+
const parentText = parentRes?.result?.content?.[0]?.text;
|
|
4637
|
+
const parentPayload = JSON.parse(parentText || '{}');
|
|
4638
|
+
if (!parentPayload.resume_handoff) break;
|
|
4639
|
+
process.stdout.write(`\n---\n## ↑ Parent ${i + 1}: ${(parentPayload.resume_handoff.session_id||'').slice(0,8)}\n\n`);
|
|
4640
|
+
if (parentPayload.resume_prompt) {
|
|
4641
|
+
// Strip the parent's own "## Resume context" header
|
|
4642
|
+
// to avoid duplicated h2s.
|
|
4643
|
+
const cleaned = parentPayload.resume_prompt.replace(/^## Resume context from previous session\n+/, '');
|
|
4644
|
+
process.stdout.write(cleaned + '\n');
|
|
4645
|
+
}
|
|
4646
|
+
cur = parentPayload.resume_handoff;
|
|
4647
|
+
}
|
|
4648
|
+
}
|
|
4617
4649
|
if (Array.isArray(payload.recent_handoffs) && payload.recent_handoffs.length > 1) {
|
|
4618
4650
|
process.stdout.write('\n---\nOther recent handoffs:\n');
|
|
4619
4651
|
for (const h of payload.recent_handoffs.slice(0, 4)) {
|
|
@@ -5391,6 +5423,7 @@ const PER_COMMAND_HELP = {
|
|
|
5391
5423
|
--decisions-only decisions, one per line.
|
|
5392
5424
|
--blockers-only open blockers, one per line.
|
|
5393
5425
|
--chain Walk parent_session_id back; show the thread history.
|
|
5426
|
+
--include-chain N Inline the last N parent handoffs in the rendered output (default 3, max 10).
|
|
5394
5427
|
--diff <other-id> Compare this handoff against another (added/removed/changed fields).
|
|
5395
5428
|
--validate Check that files_touched + code_anchors still exist locally.
|
|
5396
5429
|
--raw Print just the raw handoff JSON (no envelope metadata).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cf-memory-mcp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.56.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": {
|