ai-helper-agent 1.14.6 → 1.14.7
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/skill/executor.js +12 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ai-helper-agent",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.7",
|
|
4
4
|
"description": "AI Helper Agent - Local file access and system command execution proxy for Chrome extension / AI Helper 代理服务,为 Chrome 扩展提供本地文件读写和系统命令执行",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/server.js",
|
package/src/skill/executor.js
CHANGED
|
@@ -124,22 +124,18 @@ async function executeToolCall(toolName, args) {
|
|
|
124
124
|
if (cmdCheck.level === 'confirm') {
|
|
125
125
|
return { success: false, error: tr('skill.commandNeedsConfirm', { reason: cmdCheck.reason }) };
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
resolve({ success: true, stdout, exitCode: 0, stderr });
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
});
|
|
127
|
+
// 走统一命令执行器(支持 Git Bash 等环境下 Bash 花括号扩展等特性)
|
|
128
|
+
const { executeCommandSync } = await import('../executor.js');
|
|
129
|
+
const result = await executeCommandSync(args.command, args.cwd || process.cwd());
|
|
130
|
+
const stdout = result.stdout || '';
|
|
131
|
+
const stderr = result.stderr || '';
|
|
132
|
+
if (result.error) {
|
|
133
|
+
return { success: false, error: result.error, stdout, stderr };
|
|
134
|
+
}
|
|
135
|
+
if (result.exitCode !== 0) {
|
|
136
|
+
return { success: false, error: stderr || tr('skill.execFailed'), stdout, stderr };
|
|
137
|
+
}
|
|
138
|
+
return { success: true, stdout, exitCode: result.exitCode, stderr };
|
|
143
139
|
}
|
|
144
140
|
|
|
145
141
|
case 'agent_search':
|