cf-memory-mcp 3.56.0 → 3.57.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.
@@ -3919,7 +3919,7 @@ if (process.argv.includes('--version') || process.argv.includes('-v')) {
3919
3919
 
3920
3920
  // Global --help only when no subcommand is present. With a subcommand, fall
3921
3921
  // through to the per-command help dispatch below.
3922
- const SUBCOMMANDS = new Set(['resume', 'list', 'checkpoint', 'status', 'clean', 'export', 'import', 'doctor', 'completion', 'delete', 'env', 'history', 'link', 'explain']);
3922
+ const SUBCOMMANDS = new Set(['resume', 'list', 'checkpoint', 'status', 'clean', 'export', 'import', 'doctor', 'completion', 'delete', 'env', 'history', 'link', 'explain', 'gha']);
3923
3923
  const hasSubcommand = process.argv[2] && SUBCOMMANDS.has(process.argv[2]);
3924
3924
 
3925
3925
  if (!hasSubcommand && (process.argv.includes('--help') || process.argv.includes('-h'))) {
@@ -3936,6 +3936,7 @@ Usage:
3936
3936
  npx cf-memory-mcp checkpoint ["<goal>"] Snapshot current state (keep_open)
3937
3937
  npx cf-memory-mcp link <child> --parent <id> Retroactively link a child session to a parent
3938
3938
  npx cf-memory-mcp explain <id> Break down the handoff's quality_score
3939
+ npx cf-memory-mcp gha [<id>] Append rendered resume packet to $GITHUB_STEP_SUMMARY
3939
3940
  npx cf-memory-mcp status Show bridge state + server resume availability
3940
3941
  npx cf-memory-mcp clean Delete local disk cache for current cwd
3941
3942
  npx cf-memory-mcp clean --all Delete ALL local disk caches
@@ -4667,6 +4668,59 @@ async function runResumeCli() {
4667
4668
  }
4668
4669
  }
4669
4670
 
4671
+ async function runGhaCli() {
4672
+ if (!API_KEY) {
4673
+ console.error('Error: CF_MEMORY_API_KEY environment variable is required');
4674
+ process.exit(1);
4675
+ }
4676
+ const { positional } = parseCliArgs(process.argv.slice(3));
4677
+ const sessionArg = positional[0]; // optional
4678
+ const server = new CFMemoryMCP();
4679
+ server.logDebug = () => {};
4680
+ try {
4681
+ const meta = server.getRepoMetadata();
4682
+ const args = { resume: true };
4683
+ if (meta.repo_path) args.repo_path = meta.repo_path;
4684
+ if (meta.branch) args.branch = meta.branch;
4685
+ if (sessionArg) args.session_id_hint = sessionArg;
4686
+ const fake = { params: { name: 'retrieve_context', arguments: {} } };
4687
+ await server.maybeFillProjectId(fake);
4688
+ if (fake.params.arguments.project_id) args.project_id = fake.params.arguments.project_id;
4689
+
4690
+ const response = await server.makeRequest({
4691
+ jsonrpc: '2.0', id: `cli-gha-${Date.now()}`,
4692
+ method: 'tools/call',
4693
+ params: { name: 'get_context_bootstrap', arguments: args },
4694
+ });
4695
+ const text = response?.result?.content?.[0]?.text;
4696
+ const payload = JSON.parse(text || '{}');
4697
+ if (!payload.resume_handoff || !payload.resume_prompt) {
4698
+ process.stderr.write((payload.empty_hint || 'No resume handoff available.') + '\n');
4699
+ process.exit(3);
4700
+ }
4701
+ const summary = process.env.GITHUB_STEP_SUMMARY;
4702
+ const body = payload.resume_prompt + '\n';
4703
+ if (summary) {
4704
+ try {
4705
+ fs.appendFileSync(summary, body);
4706
+ process.stderr.write(`Appended resume packet to $GITHUB_STEP_SUMMARY (${body.length} chars)\n`);
4707
+ process.exit(0);
4708
+ } catch (err) {
4709
+ process.stderr.write(`Failed to write to $GITHUB_STEP_SUMMARY: ${err.message}\n`);
4710
+ process.exit(1);
4711
+ }
4712
+ }
4713
+ // Fallback: outside GHA, print to stdout. Lets users test the
4714
+ // formatting locally before deploying.
4715
+ process.stdout.write(body);
4716
+ process.stderr.write(`(GITHUB_STEP_SUMMARY not set — printed to stdout. In GHA, this would append to the step summary.)\n`);
4717
+ process.exit(0);
4718
+ } catch (err) {
4719
+ console.error('gha command failed:', err.message);
4720
+ process.exit(1);
4721
+ }
4722
+ }
4723
+
4670
4724
  async function runExplainCli() {
4671
4725
  if (!API_KEY) {
4672
4726
  console.error('Error: CF_MEMORY_API_KEY environment variable is required');
@@ -5243,7 +5297,7 @@ function runCompletionCli() {
5243
5297
  process.stderr.write(`\nDone. Installed completion for ${installed} shell${installed === 1 ? '' : 's'}.\n`);
5244
5298
  process.exit(installed > 0 ? 0 : 1);
5245
5299
  }
5246
- const commands = ['resume', 'list', 'history', 'checkpoint', 'link', 'explain', 'status', 'clean', 'export', 'import', 'delete', 'doctor', 'env', 'completion'];
5300
+ const commands = ['resume', 'list', 'history', 'checkpoint', 'link', 'explain', 'gha', 'status', 'clean', 'export', 'import', 'delete', 'doctor', 'env', 'completion'];
5247
5301
  const flags = ['--json', '-j', '--limit', '-n', '--md', '--all', '--force', '-f', '--version', '-v', '--help', '-h', '--diagnose'];
5248
5302
 
5249
5303
  // Determine the install target for each shell. Use user-local paths
@@ -5519,6 +5573,10 @@ const PER_COMMAND_HELP = {
5519
5573
  showing what's earned + what's missing. Lets users see why a handoff
5520
5574
  scored 0.5 vs 0.9 — and how to improve it.
5521
5575
  --json, -j Emit the breakdown as JSON.`,
5576
+ gha: `cf-memory-mcp gha [<session-id-or-prefix>]
5577
+ GitHub Actions integration: append the rendered resume packet to
5578
+ $GITHUB_STEP_SUMMARY. Falls back to stdout when run outside GHA.
5579
+ Useful in a workflow step to surface what the agent was doing.`,
5522
5580
  };
5523
5581
 
5524
5582
  function printPerCommandHelp(cmd) {
@@ -6326,6 +6384,11 @@ if (process.argv[2] === 'explain') {
6326
6384
  return;
6327
6385
  }
6328
6386
 
6387
+ if (process.argv[2] === 'gha') {
6388
+ runGhaCli();
6389
+ return;
6390
+ }
6391
+
6329
6392
  if (process.argv.includes('--diagnose')) {
6330
6393
  (async () => {
6331
6394
  console.log(`CF Memory MCP v${PACKAGE_VERSION} - Diagnostics`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cf-memory-mcp",
3
- "version": "3.56.0",
3
+ "version": "3.57.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": {