@myassis/gateway 1.0.88 → 1.0.89
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.
|
@@ -152,7 +152,7 @@ const editTool = {
|
|
|
152
152
|
},
|
|
153
153
|
handler: async (args) => {
|
|
154
154
|
try {
|
|
155
|
-
if (typeof args === 'string') {
|
|
155
|
+
if (typeof args === 'string' && args.length > 1024) {
|
|
156
156
|
return { success: false, errorMessage: `参数过大 (${(args.length / 1024).toFixed(1)}KB),大文件请分批进行edit 操作` };
|
|
157
157
|
}
|
|
158
158
|
const { path: filePath, edits } = args;
|
|
@@ -138,7 +138,7 @@ exports.fileTool = {
|
|
|
138
138
|
try {
|
|
139
139
|
// 如果 args 是原始 JSON 字符串(上游 parseAruments 解析失败时原样返回),
|
|
140
140
|
// 先做轻量级检查:大文件写入时字符串极长,直接拦截避免 JSON.parse 爆内存
|
|
141
|
-
if (typeof args === 'string') {
|
|
141
|
+
if (typeof args === 'string' && args.length > 1024) {
|
|
142
142
|
return { success: false, errorMessage: `参数过大 (${(args.length / 1024).toFixed(1)}KB),大文件写入请分批进行或使用多次 edit 操作` };
|
|
143
143
|
}
|
|
144
144
|
const { action, path: filePath, content, searchQuery, maxResults = 50, excludeDirs, caseSensitive = false, wholeWord = false } = args;
|