ai-helper-agent 1.14.8 → 1.14.10

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.
Files changed (56) hide show
  1. package/README.md +198 -198
  2. package/README.zh-CN.md +372 -0
  3. package/dist/_locales/en/messages.json +11 -0
  4. package/dist/_locales/zh/messages.json +11 -0
  5. package/dist/assets/agent-defaults-DTZgZ5cC.js +97 -0
  6. package/dist/assets/agent-defaults-DTZgZ5cC.js.map +1 -0
  7. package/dist/assets/agent-store-DXo0NFsI.js +2 -0
  8. package/dist/assets/agent-store-DXo0NFsI.js.map +1 -0
  9. package/dist/assets/background.js +332 -0
  10. package/dist/assets/background.js.map +1 -0
  11. package/dist/assets/chunk-CMxvf4Kt.js +1 -0
  12. package/dist/assets/constants-DBNqocFG.js +2 -0
  13. package/dist/assets/constants-DBNqocFG.js.map +1 -0
  14. package/dist/assets/content.js +762 -0
  15. package/dist/assets/i18n-DgMBhvGU.js +44 -0
  16. package/dist/assets/i18n-DgMBhvGU.js.map +1 -0
  17. package/dist/assets/marked.min.js-D2rXgLAQ.js +57 -0
  18. package/dist/assets/marked.min.js-D2rXgLAQ.js.map +1 -0
  19. package/dist/assets/marked.min.js-loader-tKH5SQVQ.js +13 -0
  20. package/dist/assets/modulepreload-polyfill-Dezn_h7o.js +1 -0
  21. package/dist/assets/options-BikdJUQ7.css +1 -0
  22. package/dist/assets/options.js +487 -0
  23. package/dist/assets/options.js.map +1 -0
  24. package/dist/assets/session-manager-DdCwboIp.js +105 -0
  25. package/dist/assets/session-manager-DdCwboIp.js.map +1 -0
  26. package/dist/assets/session-manager-ui-BEsw7pJf.js +71 -0
  27. package/dist/assets/session-manager-ui-BEsw7pJf.js.map +1 -0
  28. package/dist/assets/side_panel.css +1 -0
  29. package/dist/assets/side_panel.js +2551 -0
  30. package/dist/assets/side_panel.js.map +1 -0
  31. package/dist/assets/state-B9PZN_fc.js +2 -0
  32. package/dist/assets/state-B9PZN_fc.js.map +1 -0
  33. package/dist/icons/README.md +11 -0
  34. package/dist/icons/design-philosophy.md +41 -0
  35. package/dist/icons/icon128.png +0 -0
  36. package/dist/icons/icon128.svg +68 -0
  37. package/dist/icons/icon16.png +0 -0
  38. package/dist/icons/icon16.svg +32 -0
  39. package/dist/icons/icon48.png +0 -0
  40. package/dist/icons/icon48.svg +56 -0
  41. package/dist/libs/github-markdown-light.min.css +8 -0
  42. package/dist/libs/html2canvas.min.js +20 -0
  43. package/dist/libs/jspdf.min.js +398 -0
  44. package/dist/libs/marked.min.js +69 -0
  45. package/dist/libs/mermaid.min.js +2024 -0
  46. package/dist/libs/pdf.worker.min.js +22 -0
  47. package/dist/libs/qrcode.min.js +7 -0
  48. package/dist/manifest.json +94 -0
  49. package/dist/offscreen/offscreen.html +11 -0
  50. package/dist/offscreen/offscreen.js +43 -0
  51. package/dist/options.html +669 -0
  52. package/dist/service-worker-loader.js +1 -0
  53. package/dist/side_panel.html +1036 -0
  54. package/dist/styles/styles.css +262 -0
  55. package/package.json +6 -3
  56. package/README.en.md +0 -372
package/README.md CHANGED
@@ -1,117 +1,117 @@
1
- > [English](./README.en.md) | [中文](./README.md)
1
+ > [English](./README.md) | [中文](./README.zh-CN.md)
2
2
 
3
3
  # AI Helper Agent
4
4
 
5
- AI Helper 代理服务,为 [AI Helper Chrome 扩展](https://github.com/xiweicheng/ai-helper) 提供本地文件读写、系统命令执行、Skill 技能系统和 MCP 协议扩展能力。
5
+ AI Helper Agent — a local proxy service that provides the [AI Helper Chrome Extension](https://github.com/xiweicheng/ai-helper) with local file read/write, system command execution, Skill system, and MCP protocol extension capabilities.
6
6
 
7
- ## 安装
7
+ ## Installation
8
8
 
9
9
  ```bash
10
10
  npm install -g ai-helper-agent
11
11
  ```
12
12
 
13
- 要求 Node.js >= 18.0.0。
13
+ Requires Node.js >= 18.0.0.
14
14
 
15
- ## 快速开始
15
+ ## Quick Start
16
16
 
17
17
  ```bash
18
- # 前台启动(终端显示实时运行日志,适合调试)
18
+ # Start in foreground (real-time logs in terminal, ideal for debugging)
19
19
  ai-helper-agent start
20
20
 
21
- # 后台启动(守护进程模式,终端立即返回)
21
+ # Start in background (daemon mode, terminal returns immediately)
22
22
  ai-helper-agent start --background
23
23
  ai-helper-agent start -b
24
24
 
25
- # 指定工作目录和端口
25
+ # Specify work directory and port
26
26
  ai-helper-agent start --workdir /path/to/your/project --port 18911
27
27
  ```
28
28
 
29
- 启动后终端会显示 4 位配对码,在 Chrome 扩展设置页「代理」标签中填入即可完成配对。
29
+ After startup, the terminal will display a 4-digit pairing code. Enter it in the "Agent" tab of the Chrome extension settings page to complete pairing.
30
30
 
31
- ## CLI 命令
31
+ ## CLI Commands
32
32
 
33
- | 命令 | 说明 |
34
- |------|------|
35
- | `start` | 启动代理服务(前台运行,显示实时日志) |
36
- | `start --background` / `start -b` | 后台启动(守护进程模式) |
37
- | `stop` | 停止正在运行的 Agent |
38
- | `restart` | 重启代理服务(支持 -b 后台重启) |
39
- | `status` | 查看运行状态 |
40
- | `paircode` | 查看配对码提示 |
41
- | `config` | 查看当前配置 |
42
- | `help` | 显示帮助信息 |
43
- | `--version` / `-v` | 显示版本号 |
33
+ | Command | Description |
34
+ |---------|-------------|
35
+ | `start` | Start the agent service (foreground, with real-time logs) |
36
+ | `start --background` / `start -b` | Start in background (daemon mode) |
37
+ | `stop` | Stop the running agent |
38
+ | `restart` | Restart the agent service (supports -b for background restart) |
39
+ | `status` | Check running status |
40
+ | `paircode` | Show pairing code |
41
+ | `config` | View current configuration |
42
+ | `help` | Show help information |
43
+ | `--version` / `-v` | Show version number |
44
44
 
45
- ### 启动选项
45
+ ### Startup Options
46
46
 
47
47
  ```
48
- --background, -b 后台运行(守护进程模式)
49
- --port <端口> 监听端口,默认 18910
50
- --host <地址> 监听地址,默认 127.0.0.1
51
- --workdir <目录> 工作目录(文件读写限制在此范围内)
48
+ --background, -b Run in background (daemon mode)
49
+ --port <port> Listen port, default 18910
50
+ --host <address> Listen address, default 127.0.0.1
51
+ --workdir <dir> Work directory (file read/write restricted to this scope)
52
52
  ```
53
53
 
54
- ### 前台 vs 后台运行
54
+ ### Foreground vs Background
55
55
 
56
- | 模式 | 命令 | 终端行为 | 适用场景 |
57
- |------|------|----------|----------|
58
- | 前台 | `start` | 阻塞终端,实时显示运行日志 | 开发调试、问题排查 |
59
- | 后台 | `start --background` | 立即返回,终端无日志输出 | 生产环境、日常使用 |
56
+ | Mode | Command | Terminal Behavior | Use Case |
57
+ |------|---------|-------------------|----------|
58
+ | Foreground | `start` | Blocks terminal, shows real-time logs | Development, debugging |
59
+ | Background | `start --background` | Returns immediately, no log output | Production, daily use |
60
60
 
61
- 前台运行时,所有文件读写、命令执行、安全拦截等操作日志会以格式化形式实时输出到终端:
61
+ When running in foreground, all file read/write, command execution, and security interception logs are output in real-time in a formatted manner:
62
62
 
63
63
  ```
64
- [12:30:01] [INFO] [文件:read] path=/project/src/index.js size=2048
65
- [12:30:05] [INFO] [命令:started] command="npm test" cwd=/project execId=a1b2c3d4
66
- [12:30:12] [INFO] [命令:completed] execId=a1b2c3d4 exitCode=0 killed=false
67
- [12:31:00] [WARN] [安全:exec_denied] command="rm -rf /" reason=高危命令被拦截
64
+ [12:30:01] [INFO] [File:read] path=/project/src/index.js size=2048
65
+ [12:30:05] [INFO] [Command:started] command="npm test" cwd=/project execId=a1b2c3d4
66
+ [12:30:12] [INFO] [Command:completed] execId=a1b2c3d4 exitCode=0 killed=false
67
+ [12:31:00] [WARN] [Security:exec_denied] command="rm -rf /" reason=High-risk command blocked
68
68
  ```
69
69
 
70
- ### 进程管理
70
+ ### Process Management
71
71
 
72
- Agent 通过 PID 文件(`~/.ai-helper-agent/agent.pid`)管理进程生命周期:
72
+ The agent manages process lifecycle via a PID file (`~/.ai-helper-agent/agent.pid`):
73
73
 
74
- - 启动时自动写入 PID 文件
75
- - `stop` 命令优先通过 API 优雅关闭,失败则通过 PID 文件 kill 进程
76
- - 正常关闭时自动清理 PID 文件
74
+ - Automatically writes PID file on startup
75
+ - `stop` command prefers graceful shutdown via API, falls back to killing process via PID file
76
+ - Automatically cleans up PID file on normal shutdown
77
77
 
78
- ## 安全机制
78
+ ## Security
79
79
 
80
- ### 文件沙箱
80
+ ### File Sandbox
81
81
 
82
- 所有文件操作限制在配置的 `allowedPaths` 白名单目录内。通过 `realpath` 解析防止符号链接绕过,确保物理路径安全。
82
+ All file operations are restricted to directories listed in the `allowedPaths` whitelist. `realpath` resolution prevents symlink bypasses, ensuring physical paths are safe.
83
83
 
84
- ### 命令分级管控
84
+ ### Command Tiered Control
85
85
 
86
- **黑名单** — 直接拦截,不可绕过:
86
+ **Blacklist** — Blocked directly, cannot be bypassed:
87
87
 
88
- | 类型 | 示例 |
89
- |------|------|
90
- | 磁盘破坏 | `rm -rf /`、`mkfs.*`、`dd if=... of=/dev/...` |
91
- | 系统文件覆盖 | `> /etc/passwd`、`> /etc/shadow` |
92
- | 恶意管道执行 | `curl ... \| bash`、`git clone ... \| sh` |
93
- | Shell 注入 | 反引号、`$()`、`${}` 命令替换 |
88
+ | Type | Examples |
89
+ |------|----------|
90
+ | Disk destruction | `rm -rf /`, `mkfs.*`, `dd if=... of=/dev/...` |
91
+ | System file overwrite | `> /etc/passwd`, `> /etc/shadow` |
92
+ | Malicious pipe execution | `curl ... \| bash`, `git clone ... \| sh` |
93
+ | Shell injection | Backticks, `$()`, `${}` command substitution |
94
94
  | Fork bomb | `:(){ :\|:& };:` |
95
95
 
96
- **灰名单** — 需要用户确认后才执行:
96
+ **Greylist** — Requires user confirmation before execution:
97
97
 
98
- | 命令模式 | 原因 |
99
- |----------|------|
100
- | `sudo ...` | 需要管理员权限 |
101
- | `npm install -g ...` | 全局安装包 |
102
- | `pip install/uninstall` | Python 包管理 |
103
- | `chmod -R 777` | 递归修改权限 |
104
- | `rm -rf ...` | 递归强制删除 |
105
- | `git push --force` | 强制推送 |
106
- | `shutdown/reboot` | 关机/重启 |
98
+ | Command Pattern | Reason |
99
+ |-----------------|--------|
100
+ | `sudo ...` | Requires admin privileges |
101
+ | `npm install -g ...` | Global package installation |
102
+ | `pip install/uninstall` | Python package management |
103
+ | `chmod -R 777` | Recursive permission modification |
104
+ | `rm -rf ...` | Recursive forced deletion |
105
+ | `git push --force` | Force push |
106
+ | `shutdown/reboot` | System shutdown/restart |
107
107
 
108
- ### 认证机制
108
+ ### Authentication
109
109
 
110
- 首次配对时用户在扩展中输入终端显示的 4 位配对码完成配对。配对码每 30 秒轮换。配对成功后使用 HMAC token 做后续请求认证,存储在 `~/.ai-helper-agent/pairings.json`。
110
+ Pairing is completed by entering the 4-digit pairing code displayed in the terminal into the extension. The pairing code rotates every 30 seconds. After successful pairing, an HMAC token is used for subsequent request authentication, stored in `~/.ai-helper-agent/pairings.json`.
111
111
 
112
- ## 配置
112
+ ## Configuration
113
113
 
114
- 配置文件路径:`~/.ai-helper-agent/config.json`
114
+ Configuration file path: `~/.ai-helper-agent/config.json`
115
115
 
116
116
  ```json
117
117
  {
@@ -125,209 +125,209 @@ Agent 通过 PID 文件(`~/.ai-helper-agent/agent.pid`)管理进程生命周
125
125
  }
126
126
  ```
127
127
 
128
- | 字段 | 说明 | 默认值 |
129
- |------|------|--------|
130
- | `port` | 监听端口 | 18910 |
131
- | `host` | 监听地址 | 127.0.0.1 |
132
- | `workdir` | 默认工作目录 | 启动时当前目录 |
133
- | `allowedPaths` | 额外允许访问的目录列表 | `[]` |
134
- | `pairCodeTTL` | 配对码有效期(秒) | 30 |
135
- | `commandTimeout` | 命令执行超时(毫秒) | 300000(5分钟) |
136
- | `fileMaxSize` | 文件读写最大字节数 | 52428800(50MB) |
128
+ | Field | Description | Default |
129
+ |-------|-------------|---------|
130
+ | `port` | Listen port | 18910 |
131
+ | `host` | Listen address | 127.0.0.1 |
132
+ | `workdir` | Default work directory | Current directory at startup |
133
+ | `allowedPaths` | Additional allowed directory list | `[]` |
134
+ | `pairCodeTTL` | Pairing code validity (seconds) | 30 |
135
+ | `commandTimeout` | Command execution timeout (ms) | 300000 (5 min) |
136
+ | `fileMaxSize` | Max file read/write size (bytes) | 52428800 (50 MB) |
137
137
 
138
- ## 文件搜索
138
+ ## File Search
139
139
 
140
- Agent 优先使用系统原生搜索工具,不可用时自动回退到 Node.js 实现:
140
+ The agent prefers native system search tools, with automatic fallback to Node.js implementation when unavailable:
141
141
 
142
- | 引擎 | 用途 | 检测命令 |
143
- |------|------|----------|
144
- | `fd` | 文件名搜索(快速) | `fd --version` |
145
- | `rg` (ripgrep) | 文件内容搜索(快速) | `rg --version` |
142
+ | Engine | Purpose | Detection Command |
143
+ |--------|---------|-------------------|
144
+ | `fd` | Filename search (fast) | `fd --version` |
145
+ | `rg` (ripgrep) | File content search (fast) | `rg --version` |
146
146
 
147
- 状态接口返回当前可用的搜索工具:
147
+ The status endpoint reports currently available search tools:
148
148
 
149
149
  ```json
150
150
  { "searchTools": { "fd": true, "rg": true } }
151
151
  ```
152
152
 
153
- ## 审计日志
153
+ ## Audit Logs
154
154
 
155
- 所有操作自动记录到审计日志中,日志文件位于 `~/.ai-helper-agent/logs/`。
155
+ All operations are automatically recorded in audit logs, located in `~/.ai-helper-agent/logs/`.
156
156
 
157
- ### 双通道输出
157
+ ### Dual Channel Output
158
158
 
159
- - **终端输出**(前台模式):格式化可读格式,输出到 stderr
160
- - **文件输出**:JSON Lines 格式,写入日志文件
159
+ - **Terminal output** (foreground mode): Formatted human-readable output to stderr
160
+ - **File output**: JSON Lines format, written to log files
161
161
 
162
- 两种通道同时工作,互不影响。
162
+ Both channels work simultaneously without interfering with each other.
163
163
 
164
- ### 日志格式
164
+ ### Log Format
165
165
 
166
- JSON Lines 格式,每行一条记录,文件按日命名 `agent-YYYY-MM-DD.log`。
166
+ JSON Lines format, one record per line, files named by date `agent-YYYY-MM-DD.log`.
167
167
 
168
168
  ```json
169
169
  {"timestamp":"2026-01-15T10:30:00.123Z","level":"info","category":"fs","action":"read","path":"/home/user/project/src/index.js","size":2048}
170
170
  {"timestamp":"2026-01-15T10:30:05.456Z","level":"info","category":"exec","action":"completed","command":"npm test","cwd":"/home/user/project","execId":"a1b2c3d4","exitCode":0,"killed":false,"stdoutLen":1024,"stderrLen":0}
171
- {"timestamp":"2026-01-15T10:31:00.789Z","level":"warn","category":"security","action":"exec_denied","command":"rm -rf /","reason":"高危命令被拦截"}
171
+ {"timestamp":"2026-01-15T10:31:00.789Z","level":"warn","category":"security","action":"exec_denied","command":"rm -rf /","reason":"High-risk command blocked"}
172
172
  ```
173
173
 
174
- ### 日志分类
174
+ ### Log Categories
175
175
 
176
- | category | 说明 | 包含的操作 |
177
- |----------|------|-----------|
178
- | `auth` | 认证事件 | 配对成功/失败 |
179
- | `fs` | 文件操作 | read, write, list, delete, search_files, search_content |
180
- | `exec` | 命令执行 | started, completed, stopped, error |
181
- | `security` | 安全事件 | deny, confirm, auth 失败, 路径越权拦截 |
182
- | `system` | 系统事件 | server_start, server_stop, shutdown, server_error, uncaught_exception, unhandled_rejection |
176
+ | Category | Description | Included Actions |
177
+ |----------|-------------|-----------------|
178
+ | `auth` | Authentication events | Pairing success/failure |
179
+ | `fs` | File operations | read, write, list, delete, search_files, search_content |
180
+ | `exec` | Command execution | started, completed, stopped, error |
181
+ | `security` | Security events | deny, confirm, auth failure, path breach interception |
182
+ | `system` | System events | server_start, server_stop, shutdown, server_error, uncaught_exception, unhandled_rejection |
183
183
 
184
- ### 日志查询 API
184
+ ### Log Query API
185
185
 
186
186
  ```
187
187
  GET /api/logs?date=2026-01-15&category=security&limit=50&offset=0
188
188
  GET /api/logs/dates
189
189
  ```
190
190
 
191
- - `date` - 日期筛选 (YYYY-MM-DD),不传默认今天
192
- - `category` - 分类筛选,不传返回全部
193
- - `limit` - 返回条数上限,默认 200
194
- - `offset` - 分页偏移
191
+ - `date` - Date filter (YYYY-MM-DD), defaults to today
192
+ - `category` - Category filter, returns all if omitted
193
+ - `limit` - Max number of records returned, defaults to 200
194
+ - `offset` - Pagination offset
195
195
 
196
- 返回按时间倒序排列(最新的在前)。
196
+ Results are returned in reverse chronological order (newest first).
197
197
 
198
- ### 自动清理
198
+ ### Auto Cleanup
199
199
 
200
- - 最多保留 30 个日志文件
201
- - 单文件超过 10MB 自动删除
202
- - 每次写入日志时触发检查
200
+ - Maximum 30 log files retained
201
+ - Single files exceeding 10 MB are automatically deleted
202
+ - Cleanup check triggered on every log write
203
203
 
204
- ## API 端点
204
+ ## API Endpoints
205
205
 
206
- ### 无需认证
206
+ ### No Authentication Required
207
207
 
208
- | 方法 | 路径 | 说明 |
209
- |------|------|------|
210
- | POST | `/api/pair` | 配对认证 |
211
- | GET | `/api/status` | 健康检查(版本号、平台信息、搜索工具可用性) |
212
- | POST | `/api/shutdown` | 关闭代理服务(仅限本地访问) |
208
+ | Method | Path | Description |
209
+ |--------|------|-------------|
210
+ | POST | `/api/pair` | Pairing authentication |
211
+ | GET | `/api/status` | Health check (version, platform info, search tool availability) |
212
+ | POST | `/api/shutdown` | Shut down the agent service (local access only) |
213
213
 
214
- ### 需要认证(Bearer Token)
214
+ ### Authentication Required (Bearer Token)
215
215
 
216
- | 方法 | 路径 | 说明 |
217
- |------|------|------|
218
- | POST | `/api/fs/read` | 读取文件内容 |
219
- | POST | `/api/fs/write` | 写入文件 |
220
- | POST | `/api/fs/list` | 列出目录 |
221
- | POST | `/api/fs/delete` | 删除文件/目录 |
222
- | POST | `/api/fs/search_files` | 按文件名模式搜索(glob) |
223
- | POST | `/api/fs/search_content` | 搜索文件内容(rg 优先,Node.js 回退) |
224
- | POST | `/api/exec` | 执行系统命令 |
225
- | POST | `/api/exec/stop` | 停止命令执行 |
226
- | GET | `/api/exec/running` | 运行中的进程列表 |
227
- | GET | `/api/status/detail` | 详细信息(含工作目录、配对码、搜索工具) |
228
- | GET | `/api/logs` | 查询审计日志(支持 date/category/limit/offset 参数) |
229
- | GET | `/api/logs/dates` | 获取可用日志日期列表 |
216
+ | Method | Path | Description |
217
+ |--------|------|-------------|
218
+ | POST | `/api/fs/read` | Read file content |
219
+ | POST | `/api/fs/write` | Write file |
220
+ | POST | `/api/fs/list` | List directory |
221
+ | POST | `/api/fs/delete` | Delete file/directory |
222
+ | POST | `/api/fs/search_files` | Search files by name pattern (glob) |
223
+ | POST | `/api/fs/search_content` | Search file content (rg preferred, Node.js fallback) |
224
+ | POST | `/api/exec` | Execute system command |
225
+ | POST | `/api/exec/stop` | Stop command execution |
226
+ | GET | `/api/exec/running` | List running processes |
227
+ | GET | `/api/status/detail` | Detailed info (work directory, pairing code, search tools) |
228
+ | GET | `/api/logs` | Query audit logs (supports date/category/limit/offset params) |
229
+ | GET | `/api/logs/dates` | Get available log date list |
230
230
 
231
231
  ### WebSocket
232
232
 
233
- | 路径 | 说明 |
234
- |------|------|
235
- | `ws://127.0.0.1:18910/ws/exec/:execId` | 命令执行实时输出流 |
233
+ | Path | Description |
234
+ |------|-------------|
235
+ | `ws://127.0.0.1:18910/ws/exec/:execId` | Real-time command execution output stream |
236
236
 
237
- ## 健壮性
237
+ ## Robustness
238
238
 
239
- Agent 内置多层异常保护,防止单个错误导致整个服务崩溃:
239
+ The agent has built-in multi-layer exception protection to prevent a single error from crashing the entire service:
240
240
 
241
- - **请求级保护**:每个 HTTP 请求处理外层包裹异常捕获,异常时返回 500 而非崩溃
242
- - **URL 解析保护**:畸形 URL 不会导致进程崩溃,返回 400
243
- - **服务器级保护**:端口占用等服务器错误有专门处理,优雅报错退出
244
- - **全局兜底**:`uncaughtException` 和 `unhandledRejection` 全局捕获,记录错误日志但不退出进程
245
- - **文件 I/O 保护**:配置文件读写失败不影响服务运行
246
- - **进程管理保护**:`SIGTERM`/`SIGKILL` 发送对已退出进程有 try-catch 保护
241
+ - **Request-level protection**: Each HTTP request handler is wrapped with exception catching, returns 500 instead of crashing
242
+ - **URL parsing protection**: Malformed URLs don't crash the process, returns 400
243
+ - **Server-level protection**: Server errors like port conflicts are handled gracefully
244
+ - **Global fallback**: `uncaughtException` and `unhandledRejection` global handlers, logs errors but doesn't exit the process
245
+ - **File I/O protection**: Config file read/write failures don't affect service operation
246
+ - **Process management protection**: `SIGTERM`/`SIGKILL` sending has try-catch protection for already-exited processes
247
247
 
248
- ## Skill 系统
248
+ ## Skill System
249
249
 
250
- Agent 服务内置 Skill 系统,支持将操作流程沉淀为可复用的技能。
250
+ The agent has a built-in Skill system that allows codifying workflows into reusable skills.
251
251
 
252
- ### Skill 类型
252
+ ### Skill Types
253
253
 
254
- | 类型 | 定义格式 | 执行方式 | 用途 |
255
- |------|----------|----------|------|
256
- | **Workflow Skill** | JSON/YAML | 直接执行 | 自动化流程,按步骤执行 |
257
- | **Agent Skill** | SKILL.md | AI 自主调用 | 知识沉淀,在对话中触发 |
254
+ | Type | Definition Format | Execution | Purpose |
255
+ |------|-------------------|-----------|---------|
256
+ | **Workflow Skill** | JSON/YAML | Direct execution | Automated workflows, step-by-step |
257
+ | **Agent Skill** | SKILL.md | AI autonomous invocation | Knowledge codification, triggered in conversation |
258
258
 
259
- ### Skill 目录结构
259
+ ### Skill Directory Structure
260
260
 
261
- 所有 Skill 存储在 `~/.ai-helper-agent/skills/` 目录下:
261
+ All skills are stored in `~/.ai-helper-agent/skills/`:
262
262
 
263
263
  ```
264
264
  ~/.ai-helper-agent/skills/
265
- ├── workflow-skill.json # Workflow Skill(JSON 格式)
266
- ├── another-skill.yaml # Workflow Skill(YAML 格式)
267
- └── agent-skill/ # Agent Skill(目录形式)
268
- ├── SKILL.md # 技能定义文件
269
- └── _meta.json # 元数据(可选)
265
+ ├── workflow-skill.json # Workflow Skill (JSON format)
266
+ ├── another-skill.yaml # Workflow Skill (YAML format)
267
+ └── agent-skill/ # Agent Skill (directory form)
268
+ ├── SKILL.md # Skill definition file
269
+ └── _meta.json # Metadata (optional)
270
270
  ```
271
271
 
272
- ### SKILL.md 格式
272
+ ### SKILL.md Format
273
273
 
274
274
  ```markdown
275
275
  ---
276
276
  name: <skill-name>
277
- description: "<简明描述,包含:(1) 技能做什么,(2) 何时触发调用>"
277
+ description: "<Brief description including: (1) what the skill does, (2) when to trigger>"
278
278
  enabled: true
279
279
  ---
280
280
 
281
- # <技能标题>
281
+ # <Skill Title>
282
282
 
283
283
  ## When to Use This Skill
284
284
 
285
- - 触发条件1
286
- - 触发条件2
285
+ - Trigger condition 1
286
+ - Trigger condition 2
287
287
 
288
288
  ## Core Capabilities
289
289
 
290
- - 能力1
291
- - 能力2
290
+ - Capability 1
291
+ - Capability 2
292
292
 
293
293
  ## Usage
294
294
 
295
295
  ### Step-by-Step
296
296
 
297
- 1. 步骤1
298
- 2. 步骤2
297
+ 1. Step 1
298
+ 2. Step 2
299
299
 
300
300
  ## Examples
301
301
 
302
- [具体示例]
302
+ [Concrete examples]
303
303
 
304
304
  ## Source
305
305
 
306
- 从对话中沉淀,创建日期:YYYY-MM-DD
306
+ Codified from conversation, created: YYYY-MM-DD
307
307
  ```
308
308
 
309
- ### 内置技能
309
+ ### Built-in Skills
310
310
 
311
- - **skill-creator**:元技能,用于从对话中创建和更新其他技能
311
+ - **skill-creator**: Meta-skill for creating and updating other skills from conversations
312
312
 
313
313
  ### Skill API
314
314
 
315
- | 方法 | 路径 | 说明 |
316
- |------|------|------|
317
- | GET | `/api/skill/list` | 获取所有 Skill 列表 |
318
- | GET | `/api/skill/:name` | 获取单个 Skill 完整定义 |
319
- | POST | `/api/skill/import` | 导入新 Skill |
320
- | POST | `/api/skill/:name/toggle` | 切换启用/停用状态 |
321
- | DELETE | `/api/skill/:name` | 删除 Skill |
322
- | POST | `/api/skill/:name/run` | 执行 Workflow Skill |
315
+ | Method | Path | Description |
316
+ |--------|------|-------------|
317
+ | GET | `/api/skill/list` | Get all skills list |
318
+ | GET | `/api/skill/:name` | Get a single skill's full definition |
319
+ | POST | `/api/skill/import` | Import a new skill |
320
+ | POST | `/api/skill/:name/toggle` | Toggle enable/disable status |
321
+ | DELETE | `/api/skill/:name` | Delete a skill |
322
+ | POST | `/api/skill/:name/run` | Execute a workflow skill |
323
323
 
324
- ## MCP 协议扩展
324
+ ## MCP Protocol Extension
325
325
 
326
- 支持 Model Context Protocol(MCP),扩展第三方工具能力。
326
+ Supports Model Context Protocol (MCP) to extend third-party tool capabilities.
327
327
 
328
- ### MCP Server 配置
328
+ ### MCP Server Configuration
329
329
 
330
- 配置文件路径:`~/.ai-helper-agent/config.json`
330
+ Configuration file path: `~/.ai-helper-agent/config.json`
331
331
 
332
332
  ```json
333
333
  {
@@ -344,28 +344,28 @@ enabled: true
344
344
 
345
345
  ### MCP API
346
346
 
347
- | 方法 | 路径 | 说明 |
348
- |------|------|------|
349
- | GET | `/api/mcp/status` | 获取所有 MCP Server 状态 |
350
- | POST | `/api/mcp/:serverId/connect` | 连接指定 MCP Server |
351
- | POST | `/api/mcp/:serverId/disconnect` | 断开连接 |
352
- | GET | `/api/mcp/tools` | 获取所有 MCP 工具列表 |
347
+ | Method | Path | Description |
348
+ |--------|------|-------------|
349
+ | GET | `/api/mcp/status` | Get all MCP server statuses |
350
+ | POST | `/api/mcp/:serverId/connect` | Connect to specified MCP server |
351
+ | POST | `/api/mcp/:serverId/disconnect` | Disconnect |
352
+ | GET | `/api/mcp/tools` | Get all MCP tools list |
353
353
 
354
- ### 工作原理
354
+ ### How It Works
355
355
 
356
- 1. Agent 启动时自动连接所有启用的 MCP Server
357
- 2. 通过 stdio 建立 JSON-RPC 2.0 通信
358
- 3. 自动发现 MCP Server 提供的工具
359
- 4. 工具调用请求通过 Agent 转发到 MCP Server
360
- 5. 工具结果返回给扩展
356
+ 1. Agent auto-connects all enabled MCP servers on startup
357
+ 2. Establishes JSON-RPC 2.0 communication via stdio
358
+ 3. Auto-discover tools provided by MCP servers
359
+ 4. Tool call requests are forwarded to MCP servers via the agent
360
+ 5. Tool results are returned to the extension
361
361
 
362
- ## 技术栈
362
+ ## Tech Stack
363
363
 
364
364
  - Node.js >= 18
365
- - 原生 `http` 模块(HTTP 服务)
366
- - `ws` 库(WebSocket 服务)
367
- - 零外部框架依赖
368
- - 可选依赖:`fd`、`rg`(ripgrep)— 用于加速文件搜索
365
+ - Native `http` module (HTTP server)
366
+ - `ws` library (WebSocket server)
367
+ - Zero external framework dependencies
368
+ - Optional dependencies: `fd`, `rg` (ripgrep) — for accelerated file search
369
369
 
370
370
  ## License
371
371