@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.
- package/package.json +1 -1
- package/src/index.js +14 -2
package/package.json
CHANGED
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
|
-
//
|
|
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(
|
|
537
|
+
text: formatError(errorType, {
|
|
526
538
|
filePath,
|
|
527
539
|
error: editResult.error,
|
|
528
540
|
backupPath: editResult.backupPath
|