vacumify-mcp 1.2.0 → 1.2.1
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/vacumify-mcp.js +73 -21
- package/lib/scanner.js +1 -0
- package/package.json +1 -1
package/bin/vacumify-mcp.js
CHANGED
|
@@ -7,7 +7,7 @@ const readline = require('readline');
|
|
|
7
7
|
const scanner = require('../lib/scanner');
|
|
8
8
|
|
|
9
9
|
const SERVER_NAME = 'vacumify';
|
|
10
|
-
const SERVER_VERSION = '1.2.
|
|
10
|
+
const SERVER_VERSION = '1.2.1';
|
|
11
11
|
const PROTOCOL_VERSION = '2024-11-05';
|
|
12
12
|
const MS_PER_DAY = 24 * 60 * 60 * 1000;
|
|
13
13
|
|
|
@@ -322,6 +322,47 @@ async function handleVacumifyScan(args) {
|
|
|
322
322
|
...enrichActivity(c.path, c.lastModifiedMs)
|
|
323
323
|
}));
|
|
324
324
|
|
|
325
|
+
const safeJunkCandidates = scanner.identifySafeJunk(result.files);
|
|
326
|
+
const abandonedCaches = devCaches.filter((c) => c.activityStatus === 'ABANDONED');
|
|
327
|
+
|
|
328
|
+
const zeroRiskItems = [
|
|
329
|
+
...safeJunkCandidates.map((f) => ({
|
|
330
|
+
path: f.path,
|
|
331
|
+
name: f.name,
|
|
332
|
+
size: f.size,
|
|
333
|
+
sizeFormatted: scanner.formatBytes(f.size),
|
|
334
|
+
reason: f.duplicateGroupId
|
|
335
|
+
? 'Redundant duplicate copy (original preserved)'
|
|
336
|
+
: 'Obsolete installer / crash dump (>30d idle)',
|
|
337
|
+
category: f.duplicateGroupId ? 'duplicate' : 'obsolete_installer'
|
|
338
|
+
})),
|
|
339
|
+
...abandonedCaches.map((c) => ({
|
|
340
|
+
path: c.path,
|
|
341
|
+
name: `${c.projectName} (${c.cacheType})`,
|
|
342
|
+
size: c.size,
|
|
343
|
+
sizeFormatted: c.sizeFormatted,
|
|
344
|
+
reason: `Dead dev cache in abandoned project (${c.daysUntouched}d idle)`,
|
|
345
|
+
category: 'abandoned_cache'
|
|
346
|
+
}))
|
|
347
|
+
].sort((a, b) => b.size - a.size);
|
|
348
|
+
|
|
349
|
+
const zeroRiskBytes = zeroRiskItems.reduce((acc, item) => acc + item.size, 0);
|
|
350
|
+
|
|
351
|
+
const zeroRiskSummary = {
|
|
352
|
+
totalItems: zeroRiskItems.length,
|
|
353
|
+
reclaimableBytes: zeroRiskBytes,
|
|
354
|
+
reclaimableFormatted: scanner.formatBytes(zeroRiskBytes),
|
|
355
|
+
topRecommendations: zeroRiskItems.slice(0, 5)
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
const reviewNeededSummary = {
|
|
359
|
+
largeFilesCount: topLargeFiles.length,
|
|
360
|
+
forgottenFilesCount: forgottenAll.length,
|
|
361
|
+
activeOrDormantCachesCount: devCaches.filter((c) => c.activityStatus !== 'ABANDONED').length,
|
|
362
|
+
topLargeCandidates: topLargeFiles.slice(0, 3),
|
|
363
|
+
topForgottenCandidates: topForgottenFiles.slice(0, 3)
|
|
364
|
+
};
|
|
365
|
+
|
|
325
366
|
return {
|
|
326
367
|
scannedPath: targetPath,
|
|
327
368
|
totalFiles: result.files.length,
|
|
@@ -333,6 +374,8 @@ async function handleVacumifyScan(args) {
|
|
|
333
374
|
minDuplicateBytes,
|
|
334
375
|
includeHidden
|
|
335
376
|
},
|
|
377
|
+
zeroRiskSummary,
|
|
378
|
+
reviewNeededSummary,
|
|
336
379
|
reclaimableDuplicateBytes: result.reclaimableDuplicateBytes,
|
|
337
380
|
reclaimableDuplicateFormatted: scanner.formatBytes(result.reclaimableDuplicateBytes),
|
|
338
381
|
duplicateGroupCount: groupsMap.size,
|
|
@@ -340,6 +383,7 @@ async function handleVacumifyScan(args) {
|
|
|
340
383
|
devCacheCount: result.devCaches.length,
|
|
341
384
|
devCacheTotalBytes: result.devCaches.reduce((acc, c) => acc + c.size, 0),
|
|
342
385
|
devCacheTotalFormatted: scanner.formatBytes(result.devCaches.reduce((acc, c) => acc + c.size, 0)),
|
|
386
|
+
zeroRiskItems: zeroRiskItems.slice(0, 50),
|
|
343
387
|
topLargeFiles,
|
|
344
388
|
topForgottenFiles,
|
|
345
389
|
topDuplicateGroups,
|
|
@@ -437,20 +481,20 @@ function getPromptResponse(name, args = {}) {
|
|
|
437
481
|
switch (name) {
|
|
438
482
|
case 'audit-storage':
|
|
439
483
|
return {
|
|
440
|
-
description: '
|
|
484
|
+
description: 'Executive storage audit with zero-risk recommendations and minimal noise.',
|
|
441
485
|
messages: [
|
|
442
486
|
{
|
|
443
487
|
role: 'user',
|
|
444
488
|
content: {
|
|
445
489
|
type: 'text',
|
|
446
490
|
text:
|
|
447
|
-
`Run
|
|
448
|
-
'
|
|
449
|
-
'1.
|
|
450
|
-
'2.
|
|
451
|
-
'3.
|
|
452
|
-
'4.
|
|
453
|
-
'
|
|
491
|
+
`Run an executive storage audit on ${target} using \`vacumify_scan\`.\n\n` +
|
|
492
|
+
'OUTPUT GUIDELINES (DO NOT OUTPUT MASSIVE 50+ ROW TABLES):\n' +
|
|
493
|
+
'1. Topline Impact (1-2 sentences): State total files scanned, total directory size, and immediate zero-risk reclaimable space (from `zeroRiskSummary`).\n' +
|
|
494
|
+
'2. Zero-Risk Safe Sweep (Top 3-5 items): Highlight the highest-impact zero-risk items (redundant duplicate copies with original preserved, obsolete installers/dumps >30d, and abandoned project caches) with size and why they are 100% safe to recycle.\n' +
|
|
495
|
+
'3. Items Needing Review: Briefly mention the top 2-3 large files or forgotten files that the user might want to consider.\n' +
|
|
496
|
+
'4. Actionable Next Step: Offer to recycle the Zero-Risk items directly to Recycle Bin/Trash using `vacumify_recycle_items`, and mention that the user can ask for full lists ("show all duplicates", "show forgotten") if desired.\n' +
|
|
497
|
+
'5. Strict Safety: NEVER permanently delete. Always use `vacumify_recycle_items` after user confirms.'
|
|
454
498
|
}
|
|
455
499
|
}
|
|
456
500
|
]
|
|
@@ -464,9 +508,11 @@ function getPromptResponse(name, args = {}) {
|
|
|
464
508
|
content: {
|
|
465
509
|
type: 'text',
|
|
466
510
|
text:
|
|
467
|
-
`Scan ${target} for duplicate files using \`vacumify_scan\` (respecting \`minDuplicateBytes\`, default 100 KB)
|
|
468
|
-
'
|
|
469
|
-
'
|
|
511
|
+
`Scan ${target} for duplicate files using \`vacumify_scan\` (respecting \`minDuplicateBytes\`, default 100 KB).\n\n` +
|
|
512
|
+
'OUTPUT GUIDELINES:\n' +
|
|
513
|
+
'1. State total duplicate groups found and total reclaimable space.\n' +
|
|
514
|
+
'2. Show only the top 3-5 duplicate groups by size. For each group, clearly indicate the original file to KEEP and the redundant copies safe to RECYCLE.\n' +
|
|
515
|
+
'3. Do not list dozens of rows. Offer to move the redundant copies to Recycle Bin via `vacumify_recycle_items`, or let the user ask to see more groups.'
|
|
470
516
|
}
|
|
471
517
|
}
|
|
472
518
|
]
|
|
@@ -481,9 +527,11 @@ function getPromptResponse(name, args = {}) {
|
|
|
481
527
|
content: {
|
|
482
528
|
type: 'text',
|
|
483
529
|
text:
|
|
484
|
-
`Scan ${target} using \`vacumify_scan\` with \`forgottenDays: ${days}\`.\n` +
|
|
485
|
-
|
|
486
|
-
|
|
530
|
+
`Scan ${target} using \`vacumify_scan\` with \`forgottenDays: ${days}\`.\n\n` +
|
|
531
|
+
'OUTPUT GUIDELINES:\n' +
|
|
532
|
+
`1. State total files untouched for ${days}+ days and their total size.\n` +
|
|
533
|
+
'2. Highlight only the top 3-5 largest forgotten files with their idle days and project activity status (ACTIVE / DORMANT / ABANDONED).\n' +
|
|
534
|
+
'3. Ask the user if they want to recycle any of these via `vacumify_recycle_items` or inspect more.'
|
|
487
535
|
}
|
|
488
536
|
}
|
|
489
537
|
]
|
|
@@ -500,9 +548,11 @@ function getPromptResponse(name, args = {}) {
|
|
|
500
548
|
content: {
|
|
501
549
|
type: 'text',
|
|
502
550
|
text:
|
|
503
|
-
`Scan ${target} using \`vacumify_scan\` with \`minLargeFileBytes: ${minBytes}\` (${minMb} MB).\n` +
|
|
504
|
-
'
|
|
505
|
-
|
|
551
|
+
`Scan ${target} using \`vacumify_scan\` with \`minLargeFileBytes: ${minBytes}\` (${minMb} MB).\n\n` +
|
|
552
|
+
'OUTPUT GUIDELINES:\n' +
|
|
553
|
+
`1. State total large files >= ${minMb} MB and aggregate size.\n` +
|
|
554
|
+
'2. Rank only the top 3-5 largest space hogs with file type, size, and last modified date.\n' +
|
|
555
|
+
'3. Ask the user for confirmation before recycling any files via `vacumify_recycle_items`.'
|
|
506
556
|
}
|
|
507
557
|
}
|
|
508
558
|
]
|
|
@@ -520,9 +570,11 @@ function getPromptResponse(name, args = {}) {
|
|
|
520
570
|
content: {
|
|
521
571
|
type: 'text',
|
|
522
572
|
text:
|
|
523
|
-
`Scan ${target} using \`vacumify_get_dev_caches\`${olderClause}.\n` +
|
|
524
|
-
'
|
|
525
|
-
'
|
|
573
|
+
`Scan ${target} using \`vacumify_get_dev_caches\`${olderClause}.\n\n` +
|
|
574
|
+
'OUTPUT GUIDELINES:\n' +
|
|
575
|
+
'1. Summarize total dev cache size found.\n' +
|
|
576
|
+
'2. Group into ABANDONED (safe to sweep), DORMANT (review), and ACTIVE (warn user to keep intact).\n' +
|
|
577
|
+
'3. Recommend recycling the ABANDONED caches first and ask for user confirmation before calling `vacumify_recycle_items`.'
|
|
526
578
|
}
|
|
527
579
|
}
|
|
528
580
|
]
|
package/lib/scanner.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vacumify-mcp",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Standalone cross-platform Model Context Protocol (MCP) server for Vacumify — Pure Node.js zero-dependency storage cleaner, duplicate finder, and dev-cache auditor for AI agents (Windows, macOS, Linux)",
|
|
5
5
|
"main": "bin/vacumify-mcp.js",
|
|
6
6
|
"bin": {
|