@lansenger-pm/openclaw-lansenger-channel 2.7.2 → 2.8.2
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.fr.md +88 -38
- package/README.md +67 -69
- package/README.zhHans.md +67 -69
- package/README.zhHant.md +67 -70
- package/README.zhHantHK.md +87 -35
- package/dist/index.js +3 -3
- package/dist/src/channel.js +18 -21
- package/dist/src/channel.js.map +1 -1
- package/dist/src/channel.test.js +37 -37
- package/dist/src/runtime.js +34 -9
- package/dist/src/runtime.js.map +1 -1
- package/dist/src/tools.js +1 -1
- package/index.ts +3 -3
- package/openclaw.plugin.json +41 -22
- package/package.json +1 -1
- package/skills/lansenger-messaging/SKILL.md +13 -14
- package/dist/src/bindings.js +0 -81
- package/dist/src/bindings.js.map +0 -1
package/README.fr.md
CHANGED
|
@@ -47,23 +47,53 @@ Connecte OpenClaw à Lansenger — une plateforme de messagerie d'entreprise —
|
|
|
47
47
|
| `lansenger_revoke_message` | Révoquer un message précédemment envoyé |
|
|
48
48
|
| `lansenger_query_groups` | Interroger les groupes disponibles |
|
|
49
49
|
|
|
50
|
-
## Installation
|
|
50
|
+
## Installation et Configuration
|
|
51
51
|
|
|
52
|
-
###
|
|
52
|
+
### Flux recommandé en 4 étapes
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
|
-
# 1.
|
|
55
|
+
# 1. Installer le plugin
|
|
56
56
|
openclaw plugins install @lansenger-pm/openclaw-lansenger-channel
|
|
57
57
|
|
|
58
|
-
# 2.
|
|
59
|
-
|
|
60
|
-
cp -r ~/.openclaw/npm/node_modules/@lansenger-pm/openclaw-lansenger-channel/* \
|
|
61
|
-
~/.openclaw/extensions/lansenger/
|
|
58
|
+
# 2. Activer le plugin (si non auto-activé)
|
|
59
|
+
openclaw config set plugins.entries.Lansenger.enabled true
|
|
62
60
|
|
|
63
|
-
# 3.
|
|
61
|
+
# 3. Configurer le canal (assistant interactif)
|
|
62
|
+
openclaw channels add --channel Lansenger
|
|
63
|
+
# OU non-interactif :
|
|
64
|
+
openclaw channels add --channel Lansenger --token "appId:appSecret"
|
|
65
|
+
|
|
66
|
+
# 4. Redémarrer la passerelle
|
|
64
67
|
openclaw gateway restart
|
|
65
68
|
```
|
|
66
69
|
|
|
70
|
+
Les métadonnées `openclaw.install` dans `package.json` (`npmSpec`, `localPath`, `defaultChoice`) permettent l'**installation à la demande** : si un utilisateur exécute `openclaw channels add --channel Lansenger` avant que le plugin soit installé, OpenClaw peut l'installer automatiquement.
|
|
71
|
+
|
|
72
|
+
> **Passerelle personnalisée** : pour les déploiements entreprise (ex. 奇安信), configurez `apiGatewayUrl` dans `openclaw.json` ou via les variables d'environnement après la configuration — voir [Configuration optionnelle](#configuration-optionnelle).
|
|
73
|
+
|
|
74
|
+
### Installation de développement (lien local)
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
cd /path/to/openclaw-lansenger-channel
|
|
78
|
+
npm install
|
|
79
|
+
openclaw plugins install --link
|
|
80
|
+
openclaw gateway restart
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Obtenir les identifiants
|
|
84
|
+
|
|
85
|
+
**Lansenger Desktop** → **Contacts** → **Bots** → **Personal Bots** → cliquer sur l'icône **ℹ️**
|
|
86
|
+
|
|
87
|
+
> ⚠️ **Le client mobile ne permet PAS de voir les identifiants.** Utilisez uniquement le client desktop.
|
|
88
|
+
|
|
89
|
+
### Premier message
|
|
90
|
+
|
|
91
|
+
Après le redémarrage, le bot se connecte automatiquement via WebSocket. Envoyez un DM au bot — vous recevrez un code de pairage. Approuvez-le :
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
openclaw pairing approve Lansenger <code>
|
|
95
|
+
```
|
|
96
|
+
|
|
67
97
|
> ⚠️ Step 2 is required because `openclaw channels add` only discovers plugins in the `extensions/` directory, not from npm-installed packages. This is an [OpenClaw upstream bug](https://docs.openclaw.ai), not a plugin issue.
|
|
68
98
|
|
|
69
99
|
### Via npm
|
|
@@ -112,7 +142,7 @@ Obtenir les identifiants : **Lansenger Desktop** → **Contacts** → **Bots**
|
|
|
112
142
|
Après le redémarrage, le bot se connecte automatiquement via WebSocket. Envoyez un DM au bot — vous recevrez un code de pairage. Approuvez-le :
|
|
113
143
|
|
|
114
144
|
```bash
|
|
115
|
-
openclaw pairing approve
|
|
145
|
+
openclaw pairing approve Lansenger <code>
|
|
116
146
|
```
|
|
117
147
|
|
|
118
148
|
## Configuration
|
|
@@ -138,11 +168,11 @@ Ajoutez ces variables à `~/.openclaw/.env` ou à votre environnement :
|
|
|
138
168
|
```json
|
|
139
169
|
{
|
|
140
170
|
"channels": {
|
|
141
|
-
"
|
|
171
|
+
"Lansenger": {
|
|
142
172
|
"appId": "your-appid",
|
|
143
173
|
"appSecret": "your-secret",
|
|
144
174
|
"apiGatewayUrl": "https://open.e.lanxin.cn/open/apigw",
|
|
145
|
-
"homeChannel": "
|
|
175
|
+
"homeChannel": "Lansenger",
|
|
146
176
|
"enabled": true,
|
|
147
177
|
"allowFrom": ["your-appid"],
|
|
148
178
|
"dmSecurity": "paired",
|
|
@@ -150,7 +180,6 @@ Ajoutez ces variables à `~/.openclaw/.env` ou à votre environnement :
|
|
|
150
180
|
"your-appid": {
|
|
151
181
|
"appId": "your-appid",
|
|
152
182
|
"appSecret": "...",
|
|
153
|
-
"agentId": "main",
|
|
154
183
|
"apiGatewayUrl": "https://open.e.lanxin.cn/open/apigw"
|
|
155
184
|
}
|
|
156
185
|
}
|
|
@@ -169,22 +198,19 @@ Ajoutez ces variables à `~/.openclaw/.env` ou à votre environnement :
|
|
|
169
198
|
| `allowFrom` | IDs d'utilisateurs autorisés en DM | `[]` |
|
|
170
199
|
| `dmSecurity` | Politique DM : `paired`, `allowlist`, `open` | `paired` |
|
|
171
200
|
| `accounts` | Configuration multi-bot | — |
|
|
201
|
+
| `groupPolicy` | Politique de groupe : `open` (tous les groupes), `allowlist` (groupes autorisés uniquement), `disabled` (messages de groupe désactivés) | `allowlist` |
|
|
202
|
+
| `groupAllowFrom` | IDs de groupes autorisés à déclencher le bot | `[]` |
|
|
203
|
+
| `groups` | Configuration par groupe (requireMention, enabled, allowFrom) | — |
|
|
172
204
|
|
|
173
205
|
### Configuration multi-bot
|
|
174
206
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
Après avoir ajouté le premier compte via `channels add`, ajoutez des bots supplémentaires avec `openclaw config set` :
|
|
207
|
+
Pour ajouter plusieurs bots, utilisez `openclaw config set` avec la structure `accounts` :
|
|
178
208
|
|
|
179
209
|
```bash
|
|
180
210
|
# Ajouter un deuxième bot (remplacez appid/appsecret/gateway par vos valeurs)
|
|
181
|
-
openclaw config set channels.
|
|
182
|
-
openclaw config set channels.
|
|
183
|
-
openclaw config set channels.
|
|
184
|
-
|
|
185
|
-
# Lier chaque bot à un agent différent
|
|
186
|
-
openclaw config set channels.lansenger.accounts.your-appid-2.agentId "main"
|
|
187
|
-
openclaw config set channels.lansenger.accounts.your-appid-1.agentId "test"
|
|
211
|
+
openclaw config set channels.Lansenger.accounts.your-appid-2.appId "your-appid-2"
|
|
212
|
+
openclaw config set channels.Lansenger.accounts.your-appid-2.appSecret "your-appsecret"
|
|
213
|
+
openclaw config set channels.Lansenger.accounts.your-appid-2.apiGatewayUrl "https://apigw.lx.qianxin.com"
|
|
188
214
|
|
|
189
215
|
# Redémarrer pour appliquer
|
|
190
216
|
openclaw gateway restart
|
|
@@ -195,7 +221,7 @@ Structure de configuration résultante :
|
|
|
195
221
|
```json
|
|
196
222
|
{
|
|
197
223
|
"channels": {
|
|
198
|
-
"
|
|
224
|
+
"Lansenger": {
|
|
199
225
|
"appId": "your-appid-2",
|
|
200
226
|
"appSecret": "...",
|
|
201
227
|
"dmSecurity": "paired",
|
|
@@ -203,19 +229,18 @@ Structure de configuration résultante :
|
|
|
203
229
|
"your-appid-2": {
|
|
204
230
|
"appId": "your-appid-2",
|
|
205
231
|
"appSecret": "...",
|
|
206
|
-
"agentId": "main",
|
|
207
232
|
"apiGatewayUrl": "https://apigw.lx.qianxin.com"
|
|
208
233
|
},
|
|
209
234
|
"your-appid-1": {
|
|
210
235
|
"appId": "your-appid-1",
|
|
211
236
|
"appSecret": "...",
|
|
212
|
-
"agentId": "test",
|
|
213
237
|
"apiGatewayUrl": "https://apigw.lx.qianxin.com"
|
|
214
238
|
}
|
|
215
239
|
}
|
|
216
240
|
}
|
|
217
241
|
}
|
|
218
242
|
}
|
|
243
|
+
```
|
|
219
244
|
|
|
220
245
|
## Utilisation
|
|
221
246
|
|
|
@@ -241,21 +266,45 @@ openclaw channels status
|
|
|
241
266
|
openclaw gateway call lansenger.status
|
|
242
267
|
```
|
|
243
268
|
|
|
244
|
-
###
|
|
269
|
+
### Routage multi-agent
|
|
245
270
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
```bash
|
|
249
|
-
# agentId par compte (recommandé)
|
|
250
|
-
openclaw config set channels.lansenger.accounts.your-appid.agentId "main"
|
|
271
|
+
Utilisez `bindings` pour router les DM Lansenger ou les conversations de groupe vers différents agents (même principe que Feishu/WhatsApp/etc.) :
|
|
251
272
|
|
|
252
|
-
|
|
253
|
-
|
|
273
|
+
```json5
|
|
274
|
+
{
|
|
275
|
+
agents: {
|
|
276
|
+
list: [
|
|
277
|
+
{ id: "main" },
|
|
278
|
+
{ id: "agent-a", workspace: "/home/user/agent-a" },
|
|
279
|
+
],
|
|
280
|
+
},
|
|
281
|
+
bindings: [
|
|
282
|
+
{
|
|
283
|
+
agentId: "agent-a",
|
|
284
|
+
match: {
|
|
285
|
+
channel: "Lansenger",
|
|
286
|
+
peer: { kind: "direct", id: "2285568-xxx" },
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
agentId: "agent-a",
|
|
291
|
+
match: {
|
|
292
|
+
channel: "Lansenger",
|
|
293
|
+
peer: { kind: "group", id: "group-chat-id" },
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
],
|
|
297
|
+
}
|
|
254
298
|
```
|
|
255
299
|
|
|
256
|
-
|
|
300
|
+
Champs de routage :
|
|
301
|
+
* `match.channel`: `"Lansenger"`
|
|
302
|
+
* `match.peer.kind`: `"direct"` (DM) ou `"group"` (chat de groupe)
|
|
303
|
+
* `match.peer.id`: ID utilisateur (`2285568-xxx`) ou ID de chat de groupe
|
|
304
|
+
|
|
305
|
+
En mode mono-agent, tous les messages routent vers l'agent par défaut (`main`) automatiquement — pas de bindings nécessaires.
|
|
257
306
|
|
|
258
|
-
|
|
307
|
+
### Politique de groupe
|
|
259
308
|
|
|
260
309
|
| Type | Description | Méthode API | Direction |
|
|
261
310
|
|------|-------------|-------------|-----------|
|
|
@@ -333,8 +382,7 @@ openclaw-lansenger-channel/
|
|
|
333
382
|
│ ├── client.ts # Client API Lansenger (WS, HTTP, médias)
|
|
334
383
|
│ ├── channel.ts # Plugin de canal OpenClaw
|
|
335
384
|
│ ├── channel.test.ts # Tests du plugin de canal
|
|
336
|
-
│
|
|
337
|
-
│ └── bindings.ts # Gestionnaire de liaisons multi-bot
|
|
385
|
+
│ └── runtime.ts # Runtime passerelle (méthodes, handler entrant)
|
|
338
386
|
├── skills/
|
|
339
387
|
│ └── lansenger-messaging/
|
|
340
388
|
│ └── SKILL.md # Stratégie de messagerie de l'agent
|
|
@@ -354,7 +402,7 @@ Utilisez uniquement le **client Lansenger (desktop)**. L'application mobile n'af
|
|
|
354
402
|
|
|
355
403
|
### "No binding for botId"
|
|
356
404
|
|
|
357
|
-
|
|
405
|
+
Le routage des agents est géré par la configuration `bindings[]` d'OpenClaw — voir [Routage multi-agent](#routage-multi-agent). En mode mono-agent, aucun binding est nécessaire ; les messages routent automatiquement vers l'agent par défaut.
|
|
358
406
|
|
|
359
407
|
### Déconnexions WebSocket
|
|
360
408
|
|
|
@@ -373,6 +421,8 @@ Les mises à jour de statut d'approbation utilisent le format DynamicMsg appCard
|
|
|
373
421
|
|
|
374
422
|
## Journal des modifications
|
|
375
423
|
|
|
424
|
+
- **v2.8.1** — Correction README : flux d'installation en 4 étapes (installer → activer → configurer → redémarrer), suppression du hack de copie manuelle ; correction SKILL.md frontmatter (conformité AgentSkills : suppression version/category/trigger, ajout metadata.openclaw gating) ; identifiant de canal renommé en Lansenger
|
|
425
|
+
- **v2.8.0** — Routage multi-agent via OpenClaw `bindings[]` (remplace `agentId` par compte) ; ajout groupPolicy/groupAllowFrom/groups pour contrôle d'accès groupe ; utilisation de `resolveAgentRoute` SDK pour routage inbound
|
|
376
426
|
- **v2.7.2** — Ajout fichier VERSION ; complétion changelog dans 5 READMEs ; régénération package-lock.json
|
|
377
427
|
- **v2.7.0** — Enregistrement des outils comme objets simples (pas fonctions factory) ; utilisation de l'état runtime pour client/target — correction de l'enregistrement des outils de plugin externe
|
|
378
428
|
- **v2.6.0** — Enregistrement inconditionnel des outils (résolution du compte à l'exécution) ; suppression du ghost delete_message
|
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ Lansenger (蓝信) channel plugin for OpenClaw — WebSocket inbound, HTTP API o
|
|
|
31
31
|
|
|
32
32
|
**Default strategy**: Use `formatText` first for Markdown replies. Fall back to `text` for attachments. Both `formatText` and `text` support @mention via `reminder` param — include "@姓名" in text content when mentioning.
|
|
33
33
|
|
|
34
|
-
## Agent Tools
|
|
34
|
+
## Agent Tools
|
|
35
35
|
|
|
36
36
|
| Tool | Description |
|
|
37
37
|
|------|-------------|
|
|
@@ -45,32 +45,29 @@ Lansenger (蓝信) channel plugin for OpenClaw — WebSocket inbound, HTTP API o
|
|
|
45
45
|
| `lansenger_revoke_message` | Revoke a previously sent message |
|
|
46
46
|
| `lansenger_query_groups` | Query available groups |
|
|
47
47
|
|
|
48
|
-
##
|
|
48
|
+
## Installation & Configuration
|
|
49
49
|
|
|
50
|
-
###
|
|
50
|
+
### Recommended 4-step flow
|
|
51
51
|
|
|
52
52
|
```bash
|
|
53
53
|
# 1. Install the plugin
|
|
54
54
|
openclaw plugins install @lansenger-pm/openclaw-lansenger-channel
|
|
55
55
|
|
|
56
|
-
# 2.
|
|
57
|
-
|
|
58
|
-
cp -r ~/.openclaw/npm/node_modules/@lansenger-pm/openclaw-lansenger-channel/* \
|
|
59
|
-
~/.openclaw/extensions/lansenger/
|
|
56
|
+
# 2. Enable the plugin (if not auto-enabled)
|
|
57
|
+
openclaw config set plugins.entries.Lansenger.enabled true
|
|
60
58
|
|
|
61
|
-
# 3.
|
|
59
|
+
# 3. Configure the channel (interactive wizard)
|
|
60
|
+
openclaw channels add --channel Lansenger
|
|
61
|
+
# OR non-interactive:
|
|
62
|
+
openclaw channels add --channel Lansenger --token "appId:appSecret"
|
|
63
|
+
|
|
64
|
+
# 4. Restart the gateway
|
|
62
65
|
openclaw gateway restart
|
|
63
66
|
```
|
|
64
67
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
### Via npm
|
|
68
|
+
The `openclaw.install` metadata in `package.json` (`npmSpec`, `localPath`, `defaultChoice`) enables **install-on-demand**: if a user runs `openclaw channels add --channel Lansenger` before the plugin is installed, OpenClaw can automatically install it using this metadata.
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
# First install the npm package manually, then configure via CLI
|
|
71
|
-
npm install -g @lansenger-pm/openclaw-lansenger-channel
|
|
72
|
-
openclaw channels add --channel lansenger
|
|
73
|
-
```
|
|
70
|
+
> **Custom gateway**: For enterprise deployments (e.g. 奇安信), set `apiGatewayUrl` in `openclaw.json` or environment after configuration — see [Optional Configuration](#optional-configuration).
|
|
74
71
|
|
|
75
72
|
### Development install (linked)
|
|
76
73
|
|
|
@@ -81,36 +78,18 @@ openclaw plugins install --link
|
|
|
81
78
|
openclaw gateway restart
|
|
82
79
|
```
|
|
83
80
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
After installing, configure credentials:
|
|
87
|
-
|
|
88
|
-
> **Single account**: `channels add` creates one account. For multiple bots, see [Multi-Bot Configuration](#multi-bot-configuration) below.
|
|
81
|
+
### Get Credentials
|
|
89
82
|
|
|
90
|
-
|
|
91
|
-
# Standard (uses default gateway https://open.e.lanxin.cn/open/apigw)
|
|
92
|
-
openclaw channels add --channel Lansenger \
|
|
93
|
-
--app-token "your-appid" \
|
|
94
|
-
--secret "your-appsecret"
|
|
95
|
-
|
|
96
|
-
# Enterprise deployment (custom gateway URL)
|
|
97
|
-
openclaw channels add --channel Lansenger \
|
|
98
|
-
--app-token "your-appid" \
|
|
99
|
-
--secret "your-appsecret" \
|
|
100
|
-
--base-url "https://apigw.lx.qianxin.com"
|
|
101
|
-
```
|
|
83
|
+
**Lansenger Desktop** → **Contacts** → **Bots** → **Personal Bots** → click **ℹ️** icon
|
|
102
84
|
|
|
103
|
-
|
|
104
|
-
```bash
|
|
105
|
-
openclaw gateway restart
|
|
106
|
-
```
|
|
85
|
+
> ⚠️ **Mobile client does NOT support viewing credentials.** Use the desktop client only.
|
|
107
86
|
|
|
108
|
-
|
|
87
|
+
### First message
|
|
109
88
|
|
|
110
|
-
The bot
|
|
89
|
+
The bot auto-connects via WebSocket on gateway restart. Send a DM to the bot — you'll receive a pairing code. Approve it:
|
|
111
90
|
|
|
112
91
|
```bash
|
|
113
|
-
openclaw pairing approve
|
|
92
|
+
openclaw pairing approve Lansenger <code>
|
|
114
93
|
```
|
|
115
94
|
|
|
116
95
|
## Configuration
|
|
@@ -136,11 +115,11 @@ Add these to `~/.openclaw/.env` or your environment:
|
|
|
136
115
|
```json
|
|
137
116
|
{
|
|
138
117
|
"channels": {
|
|
139
|
-
"
|
|
118
|
+
"Lansenger": {
|
|
140
119
|
"appId": "your-appid",
|
|
141
120
|
"appSecret": "your-secret",
|
|
142
121
|
"apiGatewayUrl": "https://open.e.lanxin.cn/open/apigw",
|
|
143
|
-
"homeChannel": "
|
|
122
|
+
"homeChannel": "Lansenger",
|
|
144
123
|
"enabled": true,
|
|
145
124
|
"allowFrom": ["your-appid"],
|
|
146
125
|
"dmSecurity": "paired",
|
|
@@ -148,7 +127,6 @@ Add these to `~/.openclaw/.env` or your environment:
|
|
|
148
127
|
"your-appid": {
|
|
149
128
|
"appId": "your-appid",
|
|
150
129
|
"appSecret": "...",
|
|
151
|
-
"agentId": "main",
|
|
152
130
|
"apiGatewayUrl": "https://open.e.lanxin.cn/open/apigw"
|
|
153
131
|
}
|
|
154
132
|
}
|
|
@@ -167,22 +145,19 @@ Add these to `~/.openclaw/.env` or your environment:
|
|
|
167
145
|
| `allowFrom` | User IDs allowed to DM the bot | `[]` |
|
|
168
146
|
| `dmSecurity` | DM policy: `paired`, `allowlist`, `open` | `paired` |
|
|
169
147
|
| `accounts` | Multi-bot configuration | — |
|
|
148
|
+
| `groupPolicy` | Group policy: `open`, `allowlist`, `disabled` | `allowlist` |
|
|
149
|
+
| `groupAllowFrom` | Group IDs allowed to trigger the bot | `[]` |
|
|
150
|
+
| `groups` | Per-group configuration (requireMention, enabled, allowFrom) | — |
|
|
170
151
|
|
|
171
152
|
### Multi-Bot Configuration
|
|
172
153
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
After adding the first account via `channels add`, add additional bots using `openclaw config set`:
|
|
154
|
+
For multiple bots, add additional accounts using `openclaw config set`:
|
|
176
155
|
|
|
177
156
|
```bash
|
|
178
157
|
# Add a second bot (replace appid/appsecret/gateway with your values)
|
|
179
|
-
openclaw config set channels.
|
|
180
|
-
openclaw config set channels.
|
|
181
|
-
openclaw config set channels.
|
|
182
|
-
|
|
183
|
-
# Bind each bot to a different agent
|
|
184
|
-
openclaw config set channels.lansenger.accounts.your-appid-2.agentId "main"
|
|
185
|
-
openclaw config set channels.lansenger.accounts.your-appid-1.agentId "test"
|
|
158
|
+
openclaw config set channels.Lansenger.accounts.your-appid-2.appId "your-appid-2"
|
|
159
|
+
openclaw config set channels.Lansenger.accounts.your-appid-2.appSecret "your-appsecret"
|
|
160
|
+
openclaw config set channels.Lansenger.accounts.your-appid-2.apiGatewayUrl "https://apigw.lx.qianxin.com"
|
|
186
161
|
|
|
187
162
|
# Restart to apply
|
|
188
163
|
openclaw gateway restart
|
|
@@ -193,7 +168,7 @@ The resulting config structure:
|
|
|
193
168
|
```json
|
|
194
169
|
{
|
|
195
170
|
"channels": {
|
|
196
|
-
"
|
|
171
|
+
"Lansenger": {
|
|
197
172
|
"appId": "your-appid-2",
|
|
198
173
|
"appSecret": "...",
|
|
199
174
|
"dmSecurity": "paired",
|
|
@@ -201,13 +176,11 @@ The resulting config structure:
|
|
|
201
176
|
"your-appid-2": {
|
|
202
177
|
"appId": "your-appid-2",
|
|
203
178
|
"appSecret": "...",
|
|
204
|
-
"agentId": "main",
|
|
205
179
|
"apiGatewayUrl": "https://apigw.lx.qianxin.com"
|
|
206
180
|
},
|
|
207
181
|
"your-appid-1": {
|
|
208
182
|
"appId": "your-appid-1",
|
|
209
183
|
"appSecret": "...",
|
|
210
|
-
"agentId": "test",
|
|
211
184
|
"apiGatewayUrl": "https://apigw.lx.qianxin.com"
|
|
212
185
|
}
|
|
213
186
|
}
|
|
@@ -240,21 +213,45 @@ openclaw channels status
|
|
|
240
213
|
openclaw gateway call lansenger.status
|
|
241
214
|
```
|
|
242
215
|
|
|
243
|
-
###
|
|
216
|
+
### Multi-agent routing
|
|
244
217
|
|
|
245
|
-
|
|
218
|
+
Use `bindings` to route Lansenger DMs or groups to different agents (same pattern as Feishu/WhatsApp/etc.):
|
|
246
219
|
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
220
|
+
```json5
|
|
221
|
+
{
|
|
222
|
+
agents: {
|
|
223
|
+
list: [
|
|
224
|
+
{ id: "main" },
|
|
225
|
+
{ id: "agent-a", workspace: "/home/user/agent-a" },
|
|
226
|
+
],
|
|
227
|
+
},
|
|
228
|
+
bindings: [
|
|
229
|
+
{
|
|
230
|
+
agentId: "agent-a",
|
|
231
|
+
match: {
|
|
232
|
+
channel: "Lansenger",
|
|
233
|
+
peer: { kind: "direct", id: "2285568-xxx" },
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
agentId: "agent-a",
|
|
238
|
+
match: {
|
|
239
|
+
channel: "Lansenger",
|
|
240
|
+
peer: { kind: "group", id: "group-chat-id" },
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
],
|
|
244
|
+
}
|
|
253
245
|
```
|
|
254
246
|
|
|
255
|
-
|
|
247
|
+
Routing fields:
|
|
248
|
+
* `match.channel`: `"Lansenger"`
|
|
249
|
+
* `match.peer.kind`: `"direct"` (DM) or `"group"` (group chat)
|
|
250
|
+
* `match.peer.id`: user ID (`2285568-xxx`) or group chat ID
|
|
251
|
+
|
|
252
|
+
In single-agent mode, all messages route to the default agent (`main`) automatically — no bindings needed.
|
|
256
253
|
|
|
257
|
-
|
|
254
|
+
### Group policy
|
|
258
255
|
|
|
259
256
|
| Type | Description | API Method | Direction |
|
|
260
257
|
|------|-------------|------------|-----------|
|
|
@@ -332,8 +329,7 @@ openclaw-lansenger-channel/
|
|
|
332
329
|
│ ├── client.ts # Lansenger API client (WS, HTTP, media)
|
|
333
330
|
│ ├── channel.ts # OpenClaw channel plugin
|
|
334
331
|
│ ├── channel.test.ts # Channel plugin tests
|
|
335
|
-
│
|
|
336
|
-
│ └── bindings.ts # Multi-bot binding manager
|
|
332
|
+
│ └── runtime.ts # Gateway runtime (methods, inbound handler)
|
|
337
333
|
├── skills/
|
|
338
334
|
│ └── lansenger-messaging/
|
|
339
335
|
│ └── SKILL.md # Agent messaging strategy
|
|
@@ -353,7 +349,7 @@ Use the **Lansenger Desktop** client only. The mobile app does not display bot c
|
|
|
353
349
|
|
|
354
350
|
### "No binding for botId"
|
|
355
351
|
|
|
356
|
-
|
|
352
|
+
Agent routing is handled by OpenClaw's `bindings[]` config — see [Multi-agent routing](#multi-agent-routing). In single-agent mode, no binding is needed; messages route to the default agent automatically.
|
|
357
353
|
|
|
358
354
|
### WebSocket disconnects
|
|
359
355
|
|
|
@@ -372,6 +368,8 @@ Approval status updates use the DynamicMsg appCard format. The `updateCardStatus
|
|
|
372
368
|
|
|
373
369
|
## Changelog
|
|
374
370
|
|
|
371
|
+
- **v2.8.1** — Fix README: proper 4-step install flow (install → enable → configure → restart), remove manual-copy hack; fix SKILL.md frontmatter (AgentSkills spec compliance: remove version/category/trigger, add metadata.openclaw gating); rename channel identifier to Lansenger
|
|
372
|
+
- **v2.8.0** — Use OpenClaw `bindings[]` for multi-agent routing (replaces per-account `agentId`); add groupPolicy/groupAllowFrom/groups for group chat access control; use `resolveAgentRoute` SDK for inbound routing
|
|
375
373
|
- **v2.7.2** — Add VERSION file; complete changelog in all 5 READMEs; regenerate package-lock.json
|
|
376
374
|
- **v2.7.0** — Register tools as plain objects (not factory functions); use runtime state for client/target — fixes external plugin tool registration
|
|
377
375
|
- **v2.6.0** — Register tools unconditionally (resolve account at execute time); removed phantom delete_message tool registration
|