cf-memory-mcp 3.35.0 → 3.36.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.
@@ -3878,6 +3878,10 @@ function parseCliArgs(rest) {
3878
3878
  flags.files_only = true;
3879
3879
  } else if (a === '--anchors-only') {
3880
3880
  flags.anchors_only = true;
3881
+ } else if (a === '--decisions-only') {
3882
+ flags.decisions_only = true;
3883
+ } else if (a === '--blockers-only') {
3884
+ flags.blockers_only = true;
3881
3885
  } else if (a === '--older-than') {
3882
3886
  // Accept "7d" / "30d" / "12h" / raw number (days).
3883
3887
  const raw = rest[++i] || '';
@@ -4014,6 +4018,23 @@ async function runResumeCli() {
4014
4018
  process.exit(0);
4015
4019
  }
4016
4020
 
4021
+ // --decisions-only: list decisions from the handoff, one per line.
4022
+ if (flags.decisions_only) {
4023
+ const decisions = payload.resume_handoff?.handoff?.decisions || [];
4024
+ if (decisions.length === 0) process.exit(3);
4025
+ for (const d of decisions) process.stdout.write(`- ${d}\n`);
4026
+ process.exit(0);
4027
+ }
4028
+
4029
+ // --blockers-only: list open blockers, one per line. Empty list
4030
+ // exits 3 so scripts can branch on "no blockers".
4031
+ if (flags.blockers_only) {
4032
+ const blockers = payload.resume_handoff?.handoff?.blockers || [];
4033
+ if (blockers.length === 0) process.exit(3);
4034
+ for (const b of blockers) process.stdout.write(`- ${b}\n`);
4035
+ process.exit(0);
4036
+ }
4037
+
4017
4038
  // --md <path>: write the rendered markdown to a file instead of
4018
4039
  // (or in addition to) stdout. Useful for piping to a markdown
4019
4040
  // viewer or saving to the project.
@@ -4412,16 +4433,19 @@ complete -c cf-memory-mcp -l version -s v -d 'Show version'
4412
4433
 
4413
4434
  // Per-command help texts. Used when "cf-memory-mcp <cmd> --help" is invoked.
4414
4435
  const PER_COMMAND_HELP = {
4415
- resume: `cf-memory-mcp resume [<session-id-prefix>] [--md path] [--next-only|--next-steps|--files-only|--anchors-only] [--json]
4436
+ resume: `cf-memory-mcp resume [<session-id-prefix>] [--md path] [<extract-flag>] [--json]
4416
4437
  Print the prior resume handoff (markdown by default).
4417
4438
  <session-id-prefix> Optional: pick a specific session (>=8 char prefix or full UUID).
4418
4439
  --md <path> Write the markdown to a file instead of stdout.
4419
- --next-only Print just the first next_step (for shell prompts).
4420
- --next-steps Print ALL next_steps, numbered.
4421
- --files-only Print files_touched paths, one per line (xargs-friendly).
4422
- --anchors-only Print code_anchors as "file:lines symbol".
4423
- --json, -j Emit the full bootstrap payload as JSON for scripts.
4424
- Exit codes: 0 = handoff found, 3 = no handoff or no data for the flag.`,
4440
+ Extract flags (pick one; each exits 3 if the section is empty):
4441
+ --next-only First next_step only (for shell prompts).
4442
+ --next-steps All next_steps, numbered.
4443
+ --files-only files_touched paths, one per line (xargs-friendly).
4444
+ --anchors-only code_anchors as "file:lines symbol".
4445
+ --decisions-only decisions, one per line.
4446
+ --blockers-only open blockers, one per line.
4447
+ --json, -j Full bootstrap payload as JSON.
4448
+ Exit codes: 0 = found, 3 = no handoff / no data.`,
4425
4449
  list: `cf-memory-mcp list [--status S] [--since ISO] [--repo PATH] [--limit N] [--json]
4426
4450
  List recent handoffs for the current cwd, status-ranked. Header shows
4427
4451
  a status-count summary.
@@ -4890,11 +4914,14 @@ async function runCheckpointCli() {
4890
4914
  // Optional positional goal argument: `cf-memory-mcp checkpoint "<goal text>"`
4891
4915
  const goalArg = positional.filter(p => p !== '--force' && p !== '-f').join(' ').trim();
4892
4916
 
4893
- // Duplicate detection: before creating a new implicit session,
4894
- // check if there's a recent in_progress handoff for the same
4895
- // repo/branch. If so, suggest resuming it instead of churning a
4896
- // new one. Skipped with --force.
4897
- if (!force) {
4917
+ // Duplicate detection + parent linking: before creating a new
4918
+ // implicit session, check if there's a recent in_progress handoff
4919
+ // for the same repo/branch. If so, suggest resuming it instead
4920
+ // of churning a new one. With --force, proceed but record the
4921
+ // existing session id as the new handoff's parent_session_id so
4922
+ // the chain can be traced later.
4923
+ let parentSessionId = null;
4924
+ if (true) { // always probe to capture parent; --force only bypasses the abort
4898
4925
  const meta = server.getRepoMetadata();
4899
4926
  if (meta.repo_path) {
4900
4927
  const probeArgs = { resume: true, repo_path: meta.repo_path, status_filter: 'in_progress', max_age_minutes: 60 };
@@ -4912,7 +4939,7 @@ async function runCheckpointCli() {
4912
4939
  // Same-cwd implicit session won't be in the worker yet
4913
4940
  // unless someone called start_session — we look for
4914
4941
  // OTHER active threads on the same repo.
4915
- if (recent) {
4942
+ if (recent && !force) {
4916
4943
  const shortId = (recent.session_id || '').slice(0, 8);
4917
4944
  const ageMin = recent.handoff_age_minutes ?? '?';
4918
4945
  const status = recent.handoff?.status || '?';
@@ -4933,6 +4960,9 @@ async function runCheckpointCli() {
4933
4960
  process.stderr.write(`Resume it: cf-memory-mcp resume ${shortId}\n`);
4934
4961
  process.stderr.write(`Or re-run with --force to create a new session anyway.\n`);
4935
4962
  process.exit(4);
4963
+ } else if (recent && force) {
4964
+ // --force: proceed, but record the parent link.
4965
+ parentSessionId = recent.session_id;
4936
4966
  }
4937
4967
  } catch (_) { /* probe failure is non-fatal */ }
4938
4968
  }
@@ -4950,6 +4980,7 @@ async function runCheckpointCli() {
4950
4980
  // this is a fresh process).
4951
4981
  const handoff = server.synthesizeMinimalHandoff();
4952
4982
  if (goalArg) handoff.goal = goalArg;
4983
+ if (parentSessionId) handoff.parent_session_id = parentSessionId;
4953
4984
  if (meta.repo_path) handoff.repo_path = meta.repo_path;
4954
4985
  if (meta.branch) handoff.branch = meta.branch;
4955
4986
  const fake = { params: { name: 'retrieve_context', arguments: {} } };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cf-memory-mcp",
3
- "version": "3.35.0",
3
+ "version": "3.36.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": {