@mrxkun/mcfast-mcp 1.4.2 → 1.4.3
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 +8 -2
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -691,12 +691,16 @@ async function handleEditFile({ path: filePath, content, instruction = "" }) {
|
|
|
691
691
|
try {
|
|
692
692
|
await fs.writeFile(filePath, content, 'utf8');
|
|
693
693
|
|
|
694
|
+
const estimatedTokens = Math.ceil(content.length / 4);
|
|
695
|
+
|
|
694
696
|
reportAudit({
|
|
695
697
|
tool: 'edit_file',
|
|
696
698
|
instruction: instruction || `Written ${filePath}`,
|
|
697
699
|
status: 'success',
|
|
698
700
|
latency_ms: Date.now() - start,
|
|
699
|
-
files_count: 1
|
|
701
|
+
files_count: 1,
|
|
702
|
+
input_tokens: estimatedTokens,
|
|
703
|
+
output_tokens: 10 // Minimal output (success message)
|
|
700
704
|
});
|
|
701
705
|
|
|
702
706
|
return {
|
|
@@ -708,7 +712,9 @@ async function handleEditFile({ path: filePath, content, instruction = "" }) {
|
|
|
708
712
|
instruction: instruction || `Failed write ${filePath}`,
|
|
709
713
|
status: 'error',
|
|
710
714
|
error_message: error.message,
|
|
711
|
-
latency_ms: Date.now() - start
|
|
715
|
+
latency_ms: Date.now() - start,
|
|
716
|
+
input_tokens: Math.ceil((content?.length || 0) / 4),
|
|
717
|
+
output_tokens: 0
|
|
712
718
|
});
|
|
713
719
|
return {
|
|
714
720
|
content: [{ type: "text", text: `❌ Failed to write file: ${error.message}` }],
|