@mrxkun/mcfast-mcp 2.1.0 → 2.1.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +14 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mrxkun/mcfast-mcp",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Ultra-fast code editing with fuzzy patching, auto-rollback, and 5 unified tools.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/index.js CHANGED
@@ -518,11 +518,23 @@ async function handleEdit({ instruction, files, code_edit, dryRun = false }) {
518
518
  });
519
519
 
520
520
  if (!editResult.success) {
521
- // Rollback occurred
521
+ // Determine error type based on result
522
+ let errorType = 'generic';
523
+
524
+ if (editResult.error.includes('ENOENT')) {
525
+ errorType = 'file_not_found';
526
+ } else if (editResult.error.includes('EACCES')) {
527
+ errorType = 'permission_denied';
528
+ } else if (editResult.error.includes('Validation failed')) {
529
+ errorType = 'syntax_error';
530
+ } else if (editResult.error.includes('Failed to apply hunk') || editResult.error.includes('Could not find matching location')) {
531
+ errorType = 'fuzzy_match_failed';
532
+ }
533
+
522
534
  return {
523
535
  content: [{
524
536
  type: "text",
525
- text: formatError('syntax_error', {
537
+ text: formatError(errorType, {
526
538
  filePath,
527
539
  error: editResult.error,
528
540
  backupPath: editResult.backupPath