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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-helper-agent",
3
- "version": "1.14.6",
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",
@@ -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
- const { exec } = await import('child_process');
128
- return new Promise((resolve) => {
129
- exec(args.command, {
130
- cwd: args.cwd || process.cwd(),
131
- encoding: 'utf-8',
132
- timeout: 30000,
133
- maxBuffer: 10 * 1024 * 1024,
134
- windowsHide: true
135
- }, (error, stdout, stderr) => {
136
- if (error) {
137
- resolve({ success: false, error: error.message, stdout, stderr });
138
- } else {
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':