@agent-wechat/wechat 0.1.0 → 0.2.0
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 +29 -74
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,47 +1,26 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @agent-wechat/wechat
|
|
2
2
|
|
|
3
3
|
OpenClaw channel plugin for WeChat. Polls the agent-wechat REST API for inbound messages and dispatches replies through OpenClaw's agent runtime.
|
|
4
4
|
|
|
5
5
|
## Prerequisites
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
- OpenClaw installed and configured
|
|
7
|
+
- **agent-wechat container** running and reachable (provides the REST API on port 6174). Install [`@agent-wechat/cli`](https://www.npmjs.com/package/@agent-wechat/cli) and run `wx up`, or use Docker Compose — see the [CLI docs](https://github.com/thisnick/agent-wechat/tree/main/packages/cli#running-the-container) for setup options.
|
|
8
|
+
- **OpenClaw** installed and configured
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
> **Note:** The agent-wechat container requires `SYS_PTRACE` and `seccomp=unconfined` (ptrace access to the WeChat desktop process). It cannot run in serverless or restricted container environments — use a VM or bare-metal Docker host.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
From the repo root:
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
pnpm install
|
|
18
|
-
pnpm build
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
This builds the shared package, CLI, and bundles the extension into `dist/index.js` via esbuild.
|
|
22
|
-
|
|
23
|
-
### 2. Deploy to OpenClaw
|
|
12
|
+
## Install
|
|
24
13
|
|
|
25
14
|
```bash
|
|
26
|
-
|
|
15
|
+
openclaw plugins install @agent-wechat/wechat
|
|
27
16
|
```
|
|
28
17
|
|
|
29
|
-
|
|
18
|
+
## Configure
|
|
30
19
|
|
|
31
|
-
|
|
32
|
-
pnpm deploy:openclaw /path/to/openclaw/extensions/wechat
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### 3. Enable the plugin
|
|
20
|
+
Run the setup wizard:
|
|
36
21
|
|
|
37
22
|
```bash
|
|
38
|
-
openclaw
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### 4. Configure the channel
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
openclaw channels add --channel wechat --url http://localhost:6174
|
|
23
|
+
openclaw channels setup wechat
|
|
45
24
|
```
|
|
46
25
|
|
|
47
26
|
Or edit `~/.openclaw/openclaw.json` directly:
|
|
@@ -53,59 +32,17 @@ Or edit `~/.openclaw/openclaw.json` directly:
|
|
|
53
32
|
"enabled": true,
|
|
54
33
|
"serverUrl": "http://localhost:6174"
|
|
55
34
|
}
|
|
56
|
-
},
|
|
57
|
-
"plugins": {
|
|
58
|
-
"entries": {
|
|
59
|
-
"wechat": { "enabled": true }
|
|
60
|
-
}
|
|
61
35
|
}
|
|
62
36
|
}
|
|
63
37
|
```
|
|
64
38
|
|
|
65
|
-
|
|
39
|
+
## Run
|
|
66
40
|
|
|
67
41
|
```bash
|
|
68
42
|
openclaw gateway run --verbose
|
|
69
43
|
```
|
|
70
44
|
|
|
71
|
-
The WeChat monitor starts polling the agent-wechat server for new messages. Make sure the agent-wechat container is running (`
|
|
72
|
-
|
|
73
|
-
### Iterating
|
|
74
|
-
|
|
75
|
-
After making changes to the extension source:
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
pnpm deploy:openclaw # rebuilds + copies
|
|
79
|
-
# restart the gateway
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## Docker Setup
|
|
83
|
-
|
|
84
|
-
The extension is bundled into a single `dist/index.js` with no runtime dependency on the shared package. Mount just the three required files:
|
|
85
|
-
|
|
86
|
-
```bash
|
|
87
|
-
mkdir -p /host/openclaw-ext/wechat/dist
|
|
88
|
-
cp packages/openclaw-extension/dist/index.js /host/openclaw-ext/wechat/dist/index.js
|
|
89
|
-
cp packages/openclaw-extension/package.json /host/openclaw-ext/wechat/package.json
|
|
90
|
-
cp packages/openclaw-extension/openclaw.plugin.json /host/openclaw-ext/wechat/openclaw.plugin.json
|
|
91
|
-
|
|
92
|
-
docker run \
|
|
93
|
-
-v /host/openclaw-ext/wechat:/app/extensions/wechat \
|
|
94
|
-
openclaw-image
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Inside the container, configure `channels.wechat.serverUrl` to point at the agent-wechat server. If both containers are on the same Docker network:
|
|
98
|
-
|
|
99
|
-
```json
|
|
100
|
-
{
|
|
101
|
-
"channels": {
|
|
102
|
-
"wechat": {
|
|
103
|
-
"enabled": true,
|
|
104
|
-
"serverUrl": "http://agent-wechat:6174"
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
```
|
|
45
|
+
The WeChat monitor starts polling the agent-wechat server for new messages. Make sure the agent-wechat container is running (`wx up` / `wx status`).
|
|
109
46
|
|
|
110
47
|
## Configuration Reference
|
|
111
48
|
|
|
@@ -123,6 +60,24 @@ All config lives under `channels.wechat` in OpenClaw's config file:
|
|
|
123
60
|
| `pollIntervalMs` | integer | `1000` | Message polling interval |
|
|
124
61
|
| `authPollIntervalMs` | integer | `30000` | Auth status check interval |
|
|
125
62
|
|
|
63
|
+
## Development
|
|
64
|
+
|
|
65
|
+
### Build from source
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
git clone https://github.com/thisnick/agent-wechat.git
|
|
69
|
+
cd agent-wechat
|
|
70
|
+
pnpm install && pnpm build
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Link for local development
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
openclaw plugins install -l ./packages/openclaw-extension
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
This symlinks the extension so changes are picked up without reinstalling. Rebuild with `pnpm build` after making changes, then restart the gateway.
|
|
80
|
+
|
|
126
81
|
## Architecture
|
|
127
82
|
|
|
128
83
|
```
|