cf-memory-mcp 3.63.0 → 3.64.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 +40 -5
- package/package.json +1 -1
package/bin/cf-memory-mcp.js
CHANGED
|
@@ -4145,6 +4145,10 @@ function parseCliArgs(rest) {
|
|
|
4145
4145
|
flags.repo_path = rest[++i];
|
|
4146
4146
|
} else if (a.startsWith('--repo=')) {
|
|
4147
4147
|
flags.repo_path = a.slice('--repo='.length);
|
|
4148
|
+
} else if (a === '--repo-prefix') {
|
|
4149
|
+
flags.repo_path_prefix = rest[++i];
|
|
4150
|
+
} else if (a.startsWith('--repo-prefix=')) {
|
|
4151
|
+
flags.repo_path_prefix = a.slice('--repo-prefix='.length);
|
|
4148
4152
|
} else if (a === '--project-id') {
|
|
4149
4153
|
flags.project_id = rest[++i];
|
|
4150
4154
|
} else if (a.startsWith('--project-id=')) {
|
|
@@ -5280,14 +5284,15 @@ async function runDeleteCli() {
|
|
|
5280
5284
|
}
|
|
5281
5285
|
const { positional, flags } = parseCliArgs(process.argv.slice(3));
|
|
5282
5286
|
const idArg = positional[0];
|
|
5283
|
-
const bulkMode = !idArg && (flags.older_than_days !== undefined || flags.status || flags.repo_path);
|
|
5287
|
+
const bulkMode = !idArg && (flags.older_than_days !== undefined || flags.status || flags.repo_path || flags.repo_path_prefix);
|
|
5284
5288
|
if (!idArg && !bulkMode) {
|
|
5285
5289
|
console.error('Usage:');
|
|
5286
5290
|
console.error(' cf-memory-mcp delete <session-id-or-prefix> # single delete');
|
|
5287
5291
|
console.error(' cf-memory-mcp delete --older-than 30d # bulk delete by age');
|
|
5288
5292
|
console.error(' cf-memory-mcp delete --status abandoned # bulk by status');
|
|
5289
|
-
console.error(' cf-memory-mcp delete --repo /path/to/repo # bulk by repo');
|
|
5290
|
-
console.error('
|
|
5293
|
+
console.error(' cf-memory-mcp delete --repo /path/to/repo # bulk by exact repo');
|
|
5294
|
+
console.error(' cf-memory-mcp delete --repo-prefix /tmp/cfm- # bulk by repo prefix');
|
|
5295
|
+
console.error(' Combine filters; without --yes you get a dry-run preview.');
|
|
5291
5296
|
process.exit(1);
|
|
5292
5297
|
}
|
|
5293
5298
|
const server = new CFMemoryMCP();
|
|
@@ -5298,6 +5303,7 @@ async function runDeleteCli() {
|
|
|
5298
5303
|
if (flags.status) args.status = flags.status;
|
|
5299
5304
|
if (flags.older_than_days !== undefined) args.older_than_days = flags.older_than_days;
|
|
5300
5305
|
if (flags.repo_path) args.repo_path = flags.repo_path;
|
|
5306
|
+
if (flags.repo_path_prefix) args.repo_path_prefix = flags.repo_path_prefix;
|
|
5301
5307
|
|
|
5302
5308
|
// Dry-run preview when --yes is missing. The server returns
|
|
5303
5309
|
// {deleted:false, deleted_count, deleted_session_ids[]} so the
|
|
@@ -5308,6 +5314,16 @@ async function runDeleteCli() {
|
|
|
5308
5314
|
method: 'tools/call',
|
|
5309
5315
|
params: { name: 'delete_session', arguments: { ...args, dry_run: true } },
|
|
5310
5316
|
});
|
|
5317
|
+
// Surface JSON-RPC errors (e.g. "repo_path_prefix too short")
|
|
5318
|
+
// instead of swallowing them into a "no matches" message.
|
|
5319
|
+
if (previewRes?.error) {
|
|
5320
|
+
if (flags.json) {
|
|
5321
|
+
process.stdout.write(JSON.stringify({ error: previewRes.error }, null, 2) + '\n');
|
|
5322
|
+
} else {
|
|
5323
|
+
process.stderr.write(`Error: ${previewRes.error.message || JSON.stringify(previewRes.error)}\n`);
|
|
5324
|
+
}
|
|
5325
|
+
process.exit(1);
|
|
5326
|
+
}
|
|
5311
5327
|
const previewText = previewRes?.result?.content?.[0]?.text;
|
|
5312
5328
|
const preview = JSON.parse(previewText || '{}');
|
|
5313
5329
|
if (flags.json) {
|
|
@@ -5364,6 +5380,14 @@ async function runDeleteCli() {
|
|
|
5364
5380
|
method: 'tools/call',
|
|
5365
5381
|
params: { name: 'delete_session', arguments: args },
|
|
5366
5382
|
});
|
|
5383
|
+
if (deleteRes?.error) {
|
|
5384
|
+
if (flags.json) {
|
|
5385
|
+
process.stdout.write(JSON.stringify({ error: deleteRes.error }, null, 2) + '\n');
|
|
5386
|
+
} else {
|
|
5387
|
+
process.stderr.write(`Error: ${deleteRes.error.message || JSON.stringify(deleteRes.error)}\n`);
|
|
5388
|
+
}
|
|
5389
|
+
process.exit(1);
|
|
5390
|
+
}
|
|
5367
5391
|
const deleteText = deleteRes?.result?.content?.[0]?.text;
|
|
5368
5392
|
const payload = JSON.parse(deleteText || '{}');
|
|
5369
5393
|
// Implicit-cache invalidation: if any deleted id matches the
|
|
@@ -5409,6 +5433,14 @@ async function runDeleteCli() {
|
|
|
5409
5433
|
method: 'tools/call',
|
|
5410
5434
|
params: { name: 'delete_session', arguments: { session_id: fullId } },
|
|
5411
5435
|
});
|
|
5436
|
+
if (deleteRes?.error) {
|
|
5437
|
+
if (flags.json) {
|
|
5438
|
+
process.stdout.write(JSON.stringify({ error: deleteRes.error, session_id: fullId }, null, 2) + '\n');
|
|
5439
|
+
} else {
|
|
5440
|
+
process.stderr.write(`Error: ${deleteRes.error.message || JSON.stringify(deleteRes.error)}\n`);
|
|
5441
|
+
}
|
|
5442
|
+
process.exit(1);
|
|
5443
|
+
}
|
|
5412
5444
|
const deleteText = deleteRes?.result?.content?.[0]?.text;
|
|
5413
5445
|
const payload = JSON.parse(deleteText || '{}');
|
|
5414
5446
|
// Drop the implicit-session disk cache if the deleted id matches
|
|
@@ -5766,12 +5798,15 @@ const PER_COMMAND_HELP = {
|
|
|
5766
5798
|
--uninstall Remove a previously-installed script.
|
|
5767
5799
|
--all-shells With --install: install for every shell at once.`,
|
|
5768
5800
|
delete: `cf-memory-mcp delete <session-id-or-prefix> [--json]
|
|
5769
|
-
cf-memory-mcp delete [--status STATUS] [--older-than 30d] [--repo PATH] --yes [--json]
|
|
5801
|
+
cf-memory-mcp delete [--status STATUS] [--older-than 30d] [--repo PATH] [--repo-prefix PFX] --yes [--json]
|
|
5770
5802
|
Delete session row(s) and any session_summary memories tied to them.
|
|
5771
5803
|
<session-id> Single delete: full UUID or short prefix (>=8 chars).
|
|
5772
5804
|
--status STATUS Bulk filter by status (abandoned, completed, ...).
|
|
5773
5805
|
--older-than 30d Bulk filter by age (suffixes: d, h, m).
|
|
5774
|
-
--repo PATH Bulk filter by repo_path.
|
|
5806
|
+
--repo PATH Bulk filter by repo_path (exact match).
|
|
5807
|
+
--repo-prefix PFX Bulk filter by repo_path PREFIX (min 4 chars).
|
|
5808
|
+
E.g. --repo-prefix /tmp/cfm-lifecycle- nukes
|
|
5809
|
+
accumulated benchmark artifacts in one call.
|
|
5775
5810
|
--yes, -y Required for bulk delete to confirm intent.
|
|
5776
5811
|
--json, -j Emit JSON.
|
|
5777
5812
|
Exit codes: 0 = deleted, 2 = bulk missing --yes, 3 = nothing matched.`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cf-memory-mcp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.64.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": {
|