@wps365/openclaw-wpsxiezuo 1.11.3-beta.0 → 1.11.4

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 CHANGED
@@ -1,317 +1,317 @@
1
- # @wps365/openclaw-wpsxiezuo
2
-
3
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
- [![Node](https://img.shields.io/badge/node-%3E%3D22-brightgreen)](https://nodejs.org/)
5
-
6
- An [OpenClaw](https://openclaw.dev) native plugin that connects your AI agent to the **WPS Open Platform enterprise robot** — enabling AI-powered conversations in WPS group chats and direct messages.
7
-
8
- > This is an **OpenClaw plugin**. Install [OpenClaw](https://openclaw.dev) first, then use this package to add the WPS channel.
9
-
10
- ---
11
-
12
- ## Architecture
13
-
14
- ```
15
- WPS Open Platform ──► This plugin (Webhook / WebSocket)
16
- │ Decrypt + verify signature + idempotency
17
- │ Session mapping + media pre-fetch
18
-
19
- OpenClaw channelRuntime
20
- │ Route agent + orchestrate reply
21
-
22
- OpenClaw Agent (your AI)
23
- │ Reply text / call tools
24
-
25
- This plugin outbound ──► WPS Open Platform
26
- ```
27
-
28
- ---
29
-
30
- ## Requirements
31
-
32
- | Item | Version |
33
- |------|---------|
34
- | Node.js | >= 22 (24 LTS recommended) |
35
- | OpenClaw CLI | >= 2026.3.28 |
36
- | WPS Open Platform | App ID + App Secret |
37
-
38
- ---
39
-
40
- ## Quick Start
41
-
42
- ### Step 1: Install OpenClaw
43
-
44
- ```bash
45
- npm install -g openclaw
46
- ```
47
-
48
- ### Step 2: Install this plugin
49
-
50
- **Recommended: Global install + CLI**
51
-
52
- ```bash
53
- npm install -g @wps365/openclaw-wpsxiezuo --registry=https://registry.npmjs.org
54
- openclaw-wps-xiezuo install --app-id <YOUR_APP_ID> --app-secret <YOUR_APP_SECRET> --yes
55
- ```
56
-
57
- This approach is most reliable because:
58
- - Direct npm install ensures the package is fetched from the registry
59
- - `--registry` parameter bypasses CDN sync delays
60
- - Works consistently across macOS, Linux, and Windows
61
-
62
- **Alternative: npx (quick try)**
63
-
64
- ```bash
65
- npx -y @wps365/openclaw-wpsxiezuo install
66
- ```
67
-
68
- The CLI will prompt for `APP_ID` and `APP_SECRET` interactively.
69
-
70
- ### Step 3: Start the gateway
71
-
72
- ```bash
73
- openclaw gateway start
74
- ```
75
-
76
- Now @ mention the bot in WPS group chats or send direct messages to start chatting.
77
-
78
- ---
79
-
80
- ## Installation Details
81
-
82
- ### What the CLI does
83
-
84
- 1. Checks that OpenClaw CLI is available
85
- 2. Validates WPS credentials via OAuth
86
- 3. Removes stale config remnants (from previous versions)
87
- 4. Registers the plugin with OpenClaw
88
- 5. Writes channel config, plugins.allow, and bindings to `~/.openclaw/openclaw.json`
89
- 6. Verifies the installation result
90
-
91
- ### Unattended / CI mode
92
-
93
- ```bash
94
- # Via flags
95
- openclaw-wps-xiezuo install --app-id <ID> --app-secret <SECRET> --yes
96
-
97
- # Via environment variables
98
- WPS_APP_ID=xxx WPS_APP_SECRET=yyy openclaw-wps-xiezuo install --yes
99
- ```
100
-
101
- ### Upgrade
102
-
103
- ```bash
104
- npm install -g @wps365/openclaw-wpsxiezuo@latest --registry=https://registry.npmjs.org
105
- openclaw-wps-xiezuo install --yes
106
- ```
107
-
108
- ### Uninstall
109
-
110
- ```bash
111
- openclaw-wps-xiezuo uninstall --yes
112
- openclaw gateway restart
113
- ```
114
-
115
- ### Offline bundle (air-gapped environments)
116
-
117
- ```bash
118
- # 1. Download openclaw-wps-xiezuo-bundle-vX.Y.Z.zip from releases
119
- unzip openclaw-wps-xiezuo-bundle-vX.Y.Z.zip
120
- cd openclaw-wps-xiezuo-bundle
121
-
122
- # 2. Edit config/plugin.env with your APP_ID / APP_SECRET
123
- $EDITOR config/plugin.env
124
-
125
- # 3. Install
126
- bash scripts/install.sh # macOS / Linux
127
- ```
128
-
129
- ---
130
-
131
- ## Configuration
132
-
133
- ### Channel config
134
-
135
- The plugin reads `channels.wps-xiezuo` from `~/.openclaw/openclaw.json`:
136
-
137
- ```json
138
- {
139
- "channels": {
140
- "wps-xiezuo": {
141
- "enabled": true,
142
- "appId": "YOUR_APP_ID",
143
- "appSecret": "YOUR_APP_SECRET",
144
- "baseUrl": "https://openapi.wps.cn",
145
- "dmPolicy": "pairing",
146
- "groupPolicy": "open",
147
- "requireMention": true,
148
- "instantAck": {
149
- "enabled": true,
150
- "text": "Processing, please wait..."
151
- }
152
- }
153
- }
154
- }
155
- ```
156
-
157
- | Field | Description |
158
- |-------|-------------|
159
- | `appId` / `appSecret` | WPS Open Platform credentials (required) |
160
- | `baseUrl` | OAPI base URL, default `https://openapi.wps.cn` |
161
- | `dmPolicy` | Direct-message policy: `open` / `pairing` / `allowlist` |
162
- | `groupPolicy` | Group-chat policy: `open` / `allowlist` |
163
- | `requireMention` | Whether the bot must be @mentioned in group chats |
164
- | `instantAck` | Immediate acknowledgement message |
165
-
166
- Full schema: [`openclaw.plugin.json`](openclaw.plugin.json) → `channelConfigs.wps-xiezuo.schema`.
167
-
168
- ### Custom AI gateway
169
-
170
- This plugin is **model-agnostic** — configure your AI provider in OpenClaw:
171
-
172
- ```json
173
- {
174
- "models": {
175
- "mode": "merge",
176
- "providers": {
177
- "my-provider": {
178
- "baseUrl": "<your gateway URL>",
179
- "apiKey": "<your key>",
180
- "api": "openai-completions"
181
- }
182
- }
183
- },
184
- "agents": {
185
- "defaults": { "model": { "primary": "my-provider/<model-id>" } }
186
- }
187
- }
188
- ```
189
-
190
- Merge this into `~/.openclaw/openclaw.json`.
191
-
192
- ### Image understanding
193
-
194
- To enable image understanding for inbound attachments:
195
-
196
- ```json
197
- {
198
- "models": {
199
- "providers": {
200
- "<your-provider>": {
201
- "models": [{ "id": "<model-id>", "input": ["text", "image"] }]
202
- }
203
- }
204
- },
205
- "agents": {
206
- "defaults": { "model": "<your-provider>/<model-id>" }
207
- },
208
- "tools": {
209
- "media": {
210
- "image": {
211
- "enabled": true,
212
- "models": [{ "provider": "<your-provider>", "model": "<vision-model-id>" }]
213
- }
214
- }
215
- }
216
- }
217
- ```
218
-
219
- ---
220
-
221
- ## Usage
222
-
223
- ```bash
224
- openclaw gateway start # Start the gateway
225
- openclaw gateway logs # View logs
226
- openclaw plugins list # List installed plugins
227
- openclaw config get channels.wps-xiezuo # Inspect WPS channel config
228
- openclaw doctor # Health check
229
- ```
230
-
231
- ---
232
-
233
- ## Troubleshooting
234
-
235
- **1. Plugin not loaded after install**
236
-
237
- ```bash
238
- openclaw gateway restart
239
- ls ~/.openclaw/extensions/wps-xiezuo # Confirm plugin directory exists
240
- ```
241
-
242
- **2. Channel config not taking effect**
243
-
244
- ```bash
245
- openclaw config get channels.wps-xiezuo
246
- openclaw doctor --fix
247
- ```
248
-
249
- **3. Tool call rejected**
250
-
251
- ```bash
252
- openclaw config get tools.allow
253
- openclaw config set tools.allow '["wps_message_send"]'
254
- ```
255
-
256
- **4. View logs**
257
-
258
- ```bash
259
- openclaw gateway logs # Gateway log
260
- tail -f ~/.openclaw/logs/plugins/wps-xiezuo.log # Plugin log (macOS/Linux)
261
- ```
262
-
263
- **5. npm "No matching version found" / ETARGET error**
264
-
265
- Caused by npm registry CDN sync delay. Solutions in order:
266
-
267
- ```bash
268
- # Option A: Global install (recommended - most reliable)
269
- npm install -g @wps365/openclaw-wpsxiezuo --registry=https://registry.npmjs.org
270
- openclaw-wps-xiezuo install --yes
271
-
272
- # Option B: Clear cache and retry
273
- npm cache clean --force
274
- npx -y @wps365/openclaw-wpsxiezuo install --yes
275
-
276
- # Option C: Use @latest tag
277
- npx -y @wps365/openclaw-wpsxiezuo@latest install --yes
278
-
279
- # Option D: Wait 2-3 minutes for CDN sync, then retry
280
- ```
281
-
282
- ---
283
-
284
- ## Compatibility
285
-
286
- | Item | Support |
287
- |------|---------|
288
- | OpenClaw | Stable channel, `>= 2026.3.28` |
289
- | Node.js | 22 LTS, 24 (recommended) |
290
- | OS | macOS, Linux, Windows |
291
-
292
- ---
293
-
294
- ## Contributors
295
-
296
- - [@wangdong](https://github.com/wangdong)
297
- - [@hezhijian](https://github.com/hezhijian-wps)
298
- - [@liuxin21](https://github.com/kso-lx21)
299
- - [@huangluyang](https://www.npmjs.com/~lukeqqi)
300
- - [@duwei1](https://github.com/duwei1)
301
- - [@wangzhengrui](https://github.com/wangzhengrui)
302
- - [@liuzhifei](https://github.com/dacuotecuo)
303
- - [@chensi](https://github.com/chensi06lj)
304
- - [@zhangyong](https://github.com/ZhYong10)
305
- - [@xiangqiuling](https://github.com/xql799)
306
-
307
- ---
308
-
309
- ## License
310
-
311
- [MIT License](LICENSE)
312
-
313
- ## Acknowledgements
314
-
315
- - [OpenClaw](https://openclaw.dev) — AI agent framework
316
- - [WPS Open Platform](https://open.wps.cn) — Enterprise collaboration platform
1
+ # @wps365/openclaw-wpsxiezuo
2
+
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4
+ [![Node](https://img.shields.io/badge/node-%3E%3D22-brightgreen)](https://nodejs.org/)
5
+
6
+ An [OpenClaw](https://openclaw.dev) native plugin that connects your AI agent to the **WPS Open Platform enterprise robot** — enabling AI-powered conversations in WPS group chats and direct messages.
7
+
8
+ > This is an **OpenClaw plugin**. Install [OpenClaw](https://openclaw.dev) first, then use this package to add the WPS channel.
9
+
10
+ ---
11
+
12
+ ## Architecture
13
+
14
+ ```
15
+ WPS Open Platform ──► This plugin (Webhook / WebSocket)
16
+ │ Decrypt + verify signature + idempotency
17
+ │ Session mapping + media pre-fetch
18
+
19
+ OpenClaw channelRuntime
20
+ │ Route agent + orchestrate reply
21
+
22
+ OpenClaw Agent (your AI)
23
+ │ Reply text / call tools
24
+
25
+ This plugin outbound ──► WPS Open Platform
26
+ ```
27
+
28
+ ---
29
+
30
+ ## Requirements
31
+
32
+ | Item | Version |
33
+ |------|---------|
34
+ | Node.js | >= 22 (24 LTS recommended) |
35
+ | OpenClaw CLI | >= 2026.3.28 |
36
+ | WPS Open Platform | App ID + App Secret |
37
+
38
+ ---
39
+
40
+ ## Quick Start
41
+
42
+ ### Step 1: Install OpenClaw
43
+
44
+ ```bash
45
+ npm install -g openclaw
46
+ ```
47
+
48
+ ### Step 2: Install this plugin
49
+
50
+ **Recommended: Global install + CLI**
51
+
52
+ ```bash
53
+ npm install -g @wps365/openclaw-wpsxiezuo --registry=https://registry.npmjs.org
54
+ openclaw-wps-xiezuo install --app-id <YOUR_APP_ID> --app-secret <YOUR_APP_SECRET> --yes
55
+ ```
56
+
57
+ This approach is most reliable because:
58
+ - Direct npm install ensures the package is fetched from the registry
59
+ - `--registry` parameter bypasses CDN sync delays
60
+ - Works consistently across macOS, Linux, and Windows
61
+
62
+ **Alternative: npx (quick try)**
63
+
64
+ ```bash
65
+ npx -y @wps365/openclaw-wpsxiezuo install
66
+ ```
67
+
68
+ The CLI will prompt for `APP_ID` and `APP_SECRET` interactively.
69
+
70
+ ### Step 3: Start the gateway
71
+
72
+ ```bash
73
+ openclaw gateway start
74
+ ```
75
+
76
+ Now @ mention the bot in WPS group chats or send direct messages to start chatting.
77
+
78
+ ---
79
+
80
+ ## Installation Details
81
+
82
+ ### What the CLI does
83
+
84
+ 1. Checks that OpenClaw CLI is available
85
+ 2. Validates WPS credentials via OAuth
86
+ 3. Removes stale config remnants (from previous versions)
87
+ 4. Registers the plugin with OpenClaw
88
+ 5. Writes channel config, plugins.allow, and bindings to `~/.openclaw/openclaw.json`
89
+ 6. Verifies the installation result
90
+
91
+ ### Unattended / CI mode
92
+
93
+ ```bash
94
+ # Via flags
95
+ openclaw-wps-xiezuo install --app-id <ID> --app-secret <SECRET> --yes
96
+
97
+ # Via environment variables
98
+ WPS_APP_ID=xxx WPS_APP_SECRET=yyy openclaw-wps-xiezuo install --yes
99
+ ```
100
+
101
+ ### Upgrade
102
+
103
+ ```bash
104
+ npm install -g @wps365/openclaw-wpsxiezuo@latest --registry=https://registry.npmjs.org
105
+ openclaw-wps-xiezuo install --yes
106
+ ```
107
+
108
+ ### Uninstall
109
+
110
+ ```bash
111
+ openclaw-wps-xiezuo uninstall --yes
112
+ openclaw gateway restart
113
+ ```
114
+
115
+ ### Offline bundle (air-gapped environments)
116
+
117
+ ```bash
118
+ # 1. Download openclaw-wps-xiezuo-bundle-vX.Y.Z.zip from releases
119
+ unzip openclaw-wps-xiezuo-bundle-vX.Y.Z.zip
120
+ cd openclaw-wps-xiezuo-bundle
121
+
122
+ # 2. Edit config/plugin.env with your APP_ID / APP_SECRET
123
+ $EDITOR config/plugin.env
124
+
125
+ # 3. Install
126
+ bash scripts/install.sh # macOS / Linux
127
+ ```
128
+
129
+ ---
130
+
131
+ ## Configuration
132
+
133
+ ### Channel config
134
+
135
+ The plugin reads `channels.wps-xiezuo` from `~/.openclaw/openclaw.json`:
136
+
137
+ ```json
138
+ {
139
+ "channels": {
140
+ "wps-xiezuo": {
141
+ "enabled": true,
142
+ "appId": "YOUR_APP_ID",
143
+ "appSecret": "YOUR_APP_SECRET",
144
+ "baseUrl": "https://openapi.wps.cn",
145
+ "dmPolicy": "pairing",
146
+ "groupPolicy": "open",
147
+ "requireMention": true,
148
+ "instantAck": {
149
+ "enabled": true,
150
+ "text": "Processing, please wait..."
151
+ }
152
+ }
153
+ }
154
+ }
155
+ ```
156
+
157
+ | Field | Description |
158
+ |-------|-------------|
159
+ | `appId` / `appSecret` | WPS Open Platform credentials (required) |
160
+ | `baseUrl` | OAPI base URL, default `https://openapi.wps.cn` |
161
+ | `dmPolicy` | Direct-message policy: `open` / `pairing` / `allowlist` |
162
+ | `groupPolicy` | Group-chat policy: `open` / `allowlist` |
163
+ | `requireMention` | Whether the bot must be @mentioned in group chats |
164
+ | `instantAck` | Immediate acknowledgement message |
165
+
166
+ Full schema: [`openclaw.plugin.json`](openclaw.plugin.json) → `channelConfigs.wps-xiezuo.schema`.
167
+
168
+ ### Custom AI gateway
169
+
170
+ This plugin is **model-agnostic** — configure your AI provider in OpenClaw:
171
+
172
+ ```json
173
+ {
174
+ "models": {
175
+ "mode": "merge",
176
+ "providers": {
177
+ "my-provider": {
178
+ "baseUrl": "<your gateway URL>",
179
+ "apiKey": "<your key>",
180
+ "api": "openai-completions"
181
+ }
182
+ }
183
+ },
184
+ "agents": {
185
+ "defaults": { "model": { "primary": "my-provider/<model-id>" } }
186
+ }
187
+ }
188
+ ```
189
+
190
+ Merge this into `~/.openclaw/openclaw.json`.
191
+
192
+ ### Image understanding
193
+
194
+ To enable image understanding for inbound attachments:
195
+
196
+ ```json
197
+ {
198
+ "models": {
199
+ "providers": {
200
+ "<your-provider>": {
201
+ "models": [{ "id": "<model-id>", "input": ["text", "image"] }]
202
+ }
203
+ }
204
+ },
205
+ "agents": {
206
+ "defaults": { "model": "<your-provider>/<model-id>" }
207
+ },
208
+ "tools": {
209
+ "media": {
210
+ "image": {
211
+ "enabled": true,
212
+ "models": [{ "provider": "<your-provider>", "model": "<vision-model-id>" }]
213
+ }
214
+ }
215
+ }
216
+ }
217
+ ```
218
+
219
+ ---
220
+
221
+ ## Usage
222
+
223
+ ```bash
224
+ openclaw gateway start # Start the gateway
225
+ openclaw gateway logs # View logs
226
+ openclaw plugins list # List installed plugins
227
+ openclaw config get channels.wps-xiezuo # Inspect WPS channel config
228
+ openclaw doctor # Health check
229
+ ```
230
+
231
+ ---
232
+
233
+ ## Troubleshooting
234
+
235
+ **1. Plugin not loaded after install**
236
+
237
+ ```bash
238
+ openclaw gateway restart
239
+ ls ~/.openclaw/extensions/wps-xiezuo # Confirm plugin directory exists
240
+ ```
241
+
242
+ **2. Channel config not taking effect**
243
+
244
+ ```bash
245
+ openclaw config get channels.wps-xiezuo
246
+ openclaw doctor --fix
247
+ ```
248
+
249
+ **3. Tool call rejected**
250
+
251
+ ```bash
252
+ openclaw config get tools.allow
253
+ openclaw config set tools.allow '["wps_message_send"]'
254
+ ```
255
+
256
+ **4. View logs**
257
+
258
+ ```bash
259
+ openclaw gateway logs # Gateway log
260
+ tail -f ~/.openclaw/logs/plugins/wps-xiezuo.log # Plugin log (macOS/Linux)
261
+ ```
262
+
263
+ **5. npm "No matching version found" / ETARGET error**
264
+
265
+ Caused by npm registry CDN sync delay. Solutions in order:
266
+
267
+ ```bash
268
+ # Option A: Global install (recommended - most reliable)
269
+ npm install -g @wps365/openclaw-wpsxiezuo --registry=https://registry.npmjs.org
270
+ openclaw-wps-xiezuo install --yes
271
+
272
+ # Option B: Clear cache and retry
273
+ npm cache clean --force
274
+ npx -y @wps365/openclaw-wpsxiezuo install --yes
275
+
276
+ # Option C: Use @latest tag
277
+ npx -y @wps365/openclaw-wpsxiezuo@latest install --yes
278
+
279
+ # Option D: Wait 2-3 minutes for CDN sync, then retry
280
+ ```
281
+
282
+ ---
283
+
284
+ ## Compatibility
285
+
286
+ | Item | Support |
287
+ |------|---------|
288
+ | OpenClaw | Stable channel, `>= 2026.3.28` |
289
+ | Node.js | 22 LTS, 24 (recommended) |
290
+ | OS | macOS, Linux, Windows |
291
+
292
+ ---
293
+
294
+ ## Contributors
295
+
296
+ - [@wangdong](https://github.com/wangdong)
297
+ - [@hezhijian](https://github.com/hezhijian-wps)
298
+ - [@liuxin21](https://github.com/kso-lx21)
299
+ - [@huangluyang](https://www.npmjs.com/~lukeqqi)
300
+ - [@duwei1](https://github.com/duwei1)
301
+ - [@wangzhengrui](https://github.com/wangzhengrui)
302
+ - [@liuzhifei](https://github.com/dacuotecuo)
303
+ - [@chensi](https://github.com/chensi06lj)
304
+ - [@zhangyong](https://github.com/ZhYong10)
305
+ - [@xiangqiuling](https://github.com/xql799)
306
+
307
+ ---
308
+
309
+ ## License
310
+
311
+ [MIT License](LICENSE)
312
+
313
+ ## Acknowledgements
314
+
315
+ - [OpenClaw](https://openclaw.dev) — AI agent framework
316
+ - [WPS Open Platform](https://open.wps.cn) — Enterprise collaboration platform
317
317
  - [TypeScript](https://www.typescriptlang.org/) — Type-safe JavaScript