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.
- package/README.md +198 -198
- package/README.zh-CN.md +372 -0
- package/dist/_locales/en/messages.json +11 -0
- package/dist/_locales/zh/messages.json +11 -0
- package/dist/assets/agent-defaults-DTZgZ5cC.js +97 -0
- package/dist/assets/agent-defaults-DTZgZ5cC.js.map +1 -0
- package/dist/assets/agent-store-DXo0NFsI.js +2 -0
- package/dist/assets/agent-store-DXo0NFsI.js.map +1 -0
- package/dist/assets/background.js +332 -0
- package/dist/assets/background.js.map +1 -0
- package/dist/assets/chunk-CMxvf4Kt.js +1 -0
- package/dist/assets/constants-DBNqocFG.js +2 -0
- package/dist/assets/constants-DBNqocFG.js.map +1 -0
- package/dist/assets/content.js +762 -0
- package/dist/assets/i18n-DgMBhvGU.js +44 -0
- package/dist/assets/i18n-DgMBhvGU.js.map +1 -0
- package/dist/assets/marked.min.js-D2rXgLAQ.js +57 -0
- package/dist/assets/marked.min.js-D2rXgLAQ.js.map +1 -0
- package/dist/assets/marked.min.js-loader-tKH5SQVQ.js +13 -0
- package/dist/assets/modulepreload-polyfill-Dezn_h7o.js +1 -0
- package/dist/assets/options-BikdJUQ7.css +1 -0
- package/dist/assets/options.js +487 -0
- package/dist/assets/options.js.map +1 -0
- package/dist/assets/session-manager-DdCwboIp.js +105 -0
- package/dist/assets/session-manager-DdCwboIp.js.map +1 -0
- package/dist/assets/session-manager-ui-BEsw7pJf.js +71 -0
- package/dist/assets/session-manager-ui-BEsw7pJf.js.map +1 -0
- package/dist/assets/side_panel.css +1 -0
- package/dist/assets/side_panel.js +2551 -0
- package/dist/assets/side_panel.js.map +1 -0
- package/dist/assets/state-B9PZN_fc.js +2 -0
- package/dist/assets/state-B9PZN_fc.js.map +1 -0
- package/dist/icons/README.md +11 -0
- package/dist/icons/design-philosophy.md +41 -0
- package/dist/icons/icon128.png +0 -0
- package/dist/icons/icon128.svg +68 -0
- package/dist/icons/icon16.png +0 -0
- package/dist/icons/icon16.svg +32 -0
- package/dist/icons/icon48.png +0 -0
- package/dist/icons/icon48.svg +56 -0
- package/dist/libs/github-markdown-light.min.css +8 -0
- package/dist/libs/html2canvas.min.js +20 -0
- package/dist/libs/jspdf.min.js +398 -0
- package/dist/libs/marked.min.js +69 -0
- package/dist/libs/mermaid.min.js +2024 -0
- package/dist/libs/pdf.worker.min.js +22 -0
- package/dist/libs/qrcode.min.js +7 -0
- package/dist/manifest.json +94 -0
- package/dist/offscreen/offscreen.html +11 -0
- package/dist/offscreen/offscreen.js +43 -0
- package/dist/options.html +669 -0
- package/dist/service-worker-loader.js +1 -0
- package/dist/side_panel.html +1036 -0
- package/dist/styles/styles.css +262 -0
- package/package.json +6 -3
- package/README.en.md +0 -372
package/README.md
CHANGED
|
@@ -1,117 +1,117 @@
|
|
|
1
|
-
> [English](./README.
|
|
1
|
+
> [English](./README.md) | [中文](./README.zh-CN.md)
|
|
2
2
|
|
|
3
3
|
# AI Helper Agent
|
|
4
4
|
|
|
5
|
-
AI Helper
|
|
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
|
-
|
|
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
|
-
|
|
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` |
|
|
38
|
-
| `restart` |
|
|
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
|
|
50
|
-
--host
|
|
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
|
-
###
|
|
54
|
+
### Foreground vs Background
|
|
55
55
|
|
|
56
|
-
|
|
|
57
|
-
|
|
58
|
-
|
|
|
59
|
-
|
|
|
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] [
|
|
65
|
-
[12:30:05] [INFO] [
|
|
66
|
-
[12:30:12] [INFO] [
|
|
67
|
-
[12:31:00] [WARN] [
|
|
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
|
-
|
|
72
|
+
The agent manages process lifecycle via a PID file (`~/.ai-helper-agent/agent.pid`):
|
|
73
73
|
|
|
74
|
-
-
|
|
75
|
-
- `stop`
|
|
76
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
|
91
|
-
|
|
|
92
|
-
|
|
|
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
|
-
|
|
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
|
-
|
|
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` |
|
|
131
|
-
| `host` |
|
|
132
|
-
| `workdir` |
|
|
133
|
-
| `allowedPaths` |
|
|
134
|
-
| `pairCodeTTL` |
|
|
135
|
-
| `commandTimeout` |
|
|
136
|
-
| `fileMaxSize` |
|
|
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
|
-
|
|
140
|
+
The agent prefers native system search tools, with automatic fallback to Node.js implementation when unavailable:
|
|
141
141
|
|
|
142
|
-
|
|
|
143
|
-
|
|
144
|
-
| `fd` |
|
|
145
|
-
| `rg` (ripgrep) |
|
|
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
|
-
|
|
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
|
-
-
|
|
160
|
-
-
|
|
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
|
|
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
|
-
|
|
|
177
|
-
|
|
178
|
-
| `auth` |
|
|
179
|
-
| `fs` |
|
|
180
|
-
| `exec` |
|
|
181
|
-
| `security` |
|
|
182
|
-
| `system` |
|
|
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
|
-
###
|
|
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` -
|
|
192
|
-
- `category` -
|
|
193
|
-
- `limit` -
|
|
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
|
-
-
|
|
201
|
-
-
|
|
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
|
-
###
|
|
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` |
|
|
223
|
-
| POST | `/api/fs/search_content` |
|
|
224
|
-
| POST | `/api/exec` |
|
|
225
|
-
| POST | `/api/exec/stop` |
|
|
226
|
-
| GET | `/api/exec/running` |
|
|
227
|
-
| GET | `/api/status/detail` |
|
|
228
|
-
| GET | `/api/logs` |
|
|
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
|
-
|
|
239
|
+
The agent has built-in multi-layer exception protection to prevent a single error from crashing the entire service:
|
|
240
240
|
|
|
241
|
-
-
|
|
242
|
-
- **URL
|
|
243
|
-
-
|
|
244
|
-
-
|
|
245
|
-
-
|
|
246
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
266
|
-
├── another-skill.yaml # Workflow Skill
|
|
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: "
|
|
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
|
-
-
|
|
286
|
-
-
|
|
285
|
+
- Trigger condition 1
|
|
286
|
+
- Trigger condition 2
|
|
287
287
|
|
|
288
288
|
## Core Capabilities
|
|
289
289
|
|
|
290
|
-
-
|
|
291
|
-
-
|
|
290
|
+
- Capability 1
|
|
291
|
+
- Capability 2
|
|
292
292
|
|
|
293
293
|
## Usage
|
|
294
294
|
|
|
295
295
|
### Step-by-Step
|
|
296
296
|
|
|
297
|
-
1.
|
|
298
|
-
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
|
-
|
|
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` |
|
|
318
|
-
| GET | `/api/skill/:name` |
|
|
319
|
-
| POST | `/api/skill/import` |
|
|
320
|
-
| POST | `/api/skill/:name/toggle` |
|
|
321
|
-
| DELETE | `/api/skill/:name` |
|
|
322
|
-
| POST | `/api/skill/:name/run` |
|
|
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
|
-
|
|
326
|
+
Supports Model Context Protocol (MCP) to extend third-party tool capabilities.
|
|
327
327
|
|
|
328
|
-
### MCP Server
|
|
328
|
+
### MCP Server Configuration
|
|
329
329
|
|
|
330
|
-
|
|
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` |
|
|
350
|
-
| POST | `/api/mcp/:serverId/connect` |
|
|
351
|
-
| POST | `/api/mcp/:serverId/disconnect` |
|
|
352
|
-
| GET | `/api/mcp/tools` |
|
|
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
|
|
357
|
-
2.
|
|
358
|
-
3.
|
|
359
|
-
4.
|
|
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
|
-
-
|
|
366
|
-
- `ws`
|
|
367
|
-
-
|
|
368
|
-
-
|
|
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
|
|