@lansenger-pm/openclaw-lansenger-channel 2.8.1 → 2.8.3
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 +31 -53
- package/README.md +31 -53
- package/README.zhHans.md +30 -51
- package/README.zhHant.md +30 -52
- package/README.zhHantHK.md +30 -50
- package/dist/index.js +3 -3
- package/dist/src/channel.js +18 -18
- package/dist/src/channel.test.js +37 -37
- package/dist/src/runtime.js +8 -8
- package/dist/src/tools.js +1 -1
- package/index.ts +3 -3
- package/openclaw.plugin.json +15 -15
- package/package.json +2 -2
- package/skills/lansenger-messaging/SKILL.md +2 -4
package/README.fr.md
CHANGED
|
@@ -33,7 +33,7 @@ Connecte OpenClaw à Lansenger — une plateforme de messagerie d'entreprise —
|
|
|
33
33
|
|
|
34
34
|
**Stratégie par défaut** : utiliser `formatText` en priorité pour les réponses Markdown. Revenir à `text` pour les pièces jointes. Les deux types supportent @mention via le paramètre `reminder` — inclure « @姓名 » dans le texte pour les mentions.
|
|
35
35
|
|
|
36
|
-
## Outils de l'agent
|
|
36
|
+
## Outils de l'agent
|
|
37
37
|
|
|
38
38
|
| Outil | Description |
|
|
39
39
|
|-------|-------------|
|
|
@@ -47,32 +47,29 @@ 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
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
### Via npm
|
|
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.
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
# First install the npm package manually, then configure via CLI
|
|
73
|
-
npm install -g @lansenger-pm/openclaw-lansenger-channel
|
|
74
|
-
openclaw channels add --channel Lansenger --app-token "your-appid" --secret "your-appsecret"
|
|
75
|
-
```
|
|
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).
|
|
76
73
|
|
|
77
74
|
### Installation de développement (lien local)
|
|
78
75
|
|
|
@@ -83,36 +80,18 @@ openclaw plugins install --link
|
|
|
83
80
|
openclaw gateway restart
|
|
84
81
|
```
|
|
85
82
|
|
|
86
|
-
|
|
83
|
+
### Obtenir les identifiants
|
|
87
84
|
|
|
88
|
-
|
|
85
|
+
**Lansenger Desktop** → **Contacts** → **Bots** → **Personal Bots** → cliquer sur l'icône **ℹ️**
|
|
89
86
|
|
|
90
|
-
>
|
|
87
|
+
> ⚠️ **Le client mobile ne permet PAS de voir les identifiants.** Utilisez uniquement le client desktop.
|
|
91
88
|
|
|
92
|
-
|
|
93
|
-
# Standard (utilise la passerelle par défaut https://open.e.lanxin.cn/open/apigw)
|
|
94
|
-
openclaw channels add --channel Lansenger \
|
|
95
|
-
--app-token "your-appid" \
|
|
96
|
-
--secret "your-appsecret"
|
|
97
|
-
|
|
98
|
-
# Déploiement entreprise (URL de passerelle personnalisée)
|
|
99
|
-
openclaw channels add --channel Lansenger \
|
|
100
|
-
--app-token "your-appid" \
|
|
101
|
-
--secret "your-appsecret" \
|
|
102
|
-
--base-url "https://apigw.lx.qianxin.com"
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
Puis redémarrez :
|
|
106
|
-
```bash
|
|
107
|
-
openclaw gateway restart
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Obtenir les identifiants : **Lansenger Desktop** → **Contacts** → **Bots** → **Personal Bots** → cliquer sur l'icône **ℹ️** (le client mobile ne permet pas de voir les identifiants).
|
|
89
|
+
### Premier message
|
|
111
90
|
|
|
112
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 :
|
|
113
92
|
|
|
114
93
|
```bash
|
|
115
|
-
openclaw pairing approve
|
|
94
|
+
openclaw pairing approve Lansenger <code>
|
|
116
95
|
```
|
|
117
96
|
|
|
118
97
|
## Configuration
|
|
@@ -138,11 +117,11 @@ Ajoutez ces variables à `~/.openclaw/.env` ou à votre environnement :
|
|
|
138
117
|
```json
|
|
139
118
|
{
|
|
140
119
|
"channels": {
|
|
141
|
-
"
|
|
120
|
+
"Lansenger": {
|
|
142
121
|
"appId": "your-appid",
|
|
143
122
|
"appSecret": "your-secret",
|
|
144
123
|
"apiGatewayUrl": "https://open.e.lanxin.cn/open/apigw",
|
|
145
|
-
"homeChannel": "
|
|
124
|
+
"homeChannel": "Lansenger",
|
|
146
125
|
"enabled": true,
|
|
147
126
|
"allowFrom": ["your-appid"],
|
|
148
127
|
"dmSecurity": "paired",
|
|
@@ -163,7 +142,7 @@ Ajoutez ces variables à `~/.openclaw/.env` ou à votre environnement :
|
|
|
163
142
|
| `appId` | App ID du bot personnel | — |
|
|
164
143
|
| `appSecret` | App Secret du bot personnel | — |
|
|
165
144
|
| `apiGatewayUrl` | URL de la passerelle API | `https://open.e.lanxin.cn/open/apigw` |
|
|
166
|
-
| `homeChannel` | Canal par défaut pour le routage de l'agent | `
|
|
145
|
+
| `homeChannel` | Canal par défaut pour le routage de l'agent | `Lansenger` |
|
|
167
146
|
| `enabled` | Activer/désactiver le canal | `true` |
|
|
168
147
|
| `allowFrom` | IDs d'utilisateurs autorisés en DM | `[]` |
|
|
169
148
|
| `dmSecurity` | Politique DM : `paired`, `allowlist`, `open` | `paired` |
|
|
@@ -174,15 +153,13 @@ Ajoutez ces variables à `~/.openclaw/.env` ou à votre environnement :
|
|
|
174
153
|
|
|
175
154
|
### Configuration multi-bot
|
|
176
155
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
Après avoir ajouté le premier compte via `channels add`, ajoutez des bots supplémentaires avec `openclaw config set` :
|
|
156
|
+
Pour ajouter plusieurs bots, utilisez `openclaw config set` avec la structure `accounts` :
|
|
180
157
|
|
|
181
158
|
```bash
|
|
182
159
|
# Ajouter un deuxième bot (remplacez appid/appsecret/gateway par vos valeurs)
|
|
183
|
-
openclaw config set channels.
|
|
184
|
-
openclaw config set channels.
|
|
185
|
-
openclaw config set channels.
|
|
160
|
+
openclaw config set channels.Lansenger.accounts.your-appid-2.appId "your-appid-2"
|
|
161
|
+
openclaw config set channels.Lansenger.accounts.your-appid-2.appSecret "your-appsecret"
|
|
162
|
+
openclaw config set channels.Lansenger.accounts.your-appid-2.apiGatewayUrl "https://apigw.lx.qianxin.com"
|
|
186
163
|
|
|
187
164
|
# Redémarrer pour appliquer
|
|
188
165
|
openclaw gateway restart
|
|
@@ -193,7 +170,7 @@ Structure de configuration résultante :
|
|
|
193
170
|
```json
|
|
194
171
|
{
|
|
195
172
|
"channels": {
|
|
196
|
-
"
|
|
173
|
+
"Lansenger": {
|
|
197
174
|
"appId": "your-appid-2",
|
|
198
175
|
"appSecret": "...",
|
|
199
176
|
"dmSecurity": "paired",
|
|
@@ -254,14 +231,14 @@ Utilisez `bindings` pour router les DM Lansenger ou les conversations de groupe
|
|
|
254
231
|
{
|
|
255
232
|
agentId: "agent-a",
|
|
256
233
|
match: {
|
|
257
|
-
channel: "
|
|
234
|
+
channel: "Lansenger",
|
|
258
235
|
peer: { kind: "direct", id: "2285568-xxx" },
|
|
259
236
|
},
|
|
260
237
|
},
|
|
261
238
|
{
|
|
262
239
|
agentId: "agent-a",
|
|
263
240
|
match: {
|
|
264
|
-
channel: "
|
|
241
|
+
channel: "Lansenger",
|
|
265
242
|
peer: { kind: "group", id: "group-chat-id" },
|
|
266
243
|
},
|
|
267
244
|
},
|
|
@@ -270,7 +247,7 @@ Utilisez `bindings` pour router les DM Lansenger ou les conversations de groupe
|
|
|
270
247
|
```
|
|
271
248
|
|
|
272
249
|
Champs de routage :
|
|
273
|
-
* `match.channel`: `"
|
|
250
|
+
* `match.channel`: `"Lansenger"`
|
|
274
251
|
* `match.peer.kind`: `"direct"` (DM) ou `"group"` (chat de groupe)
|
|
275
252
|
* `match.peer.id`: ID utilisateur (`2285568-xxx`) ou ID de chat de groupe
|
|
276
253
|
|
|
@@ -393,6 +370,7 @@ Les mises à jour de statut d'approbation utilisent le format DynamicMsg appCard
|
|
|
393
370
|
|
|
394
371
|
## Journal des modifications
|
|
395
372
|
|
|
373
|
+
- **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
|
|
396
374
|
- **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
|
|
397
375
|
- **v2.7.2** — Ajout fichier VERSION ; complétion changelog dans 5 READMEs ; régénération package-lock.json
|
|
398
376
|
- **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
|
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",
|
|
@@ -161,7 +140,7 @@ Add these to `~/.openclaw/.env` or your environment:
|
|
|
161
140
|
| `appId` | Personal bot App ID | — |
|
|
162
141
|
| `appSecret` | Personal bot App Secret | — |
|
|
163
142
|
| `apiGatewayUrl` | API Gateway URL | `https://open.e.lanxin.cn/open/apigw` |
|
|
164
|
-
| `homeChannel` | Default channel for agent routing | `
|
|
143
|
+
| `homeChannel` | Default channel for agent routing | `Lansenger` |
|
|
165
144
|
| `enabled` | Enable/disable the channel | `true` |
|
|
166
145
|
| `allowFrom` | User IDs allowed to DM the bot | `[]` |
|
|
167
146
|
| `dmSecurity` | DM policy: `paired`, `allowlist`, `open` | `paired` |
|
|
@@ -172,15 +151,13 @@ Add these to `~/.openclaw/.env` or your environment:
|
|
|
172
151
|
|
|
173
152
|
### Multi-Bot Configuration
|
|
174
153
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
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`:
|
|
178
155
|
|
|
179
156
|
```bash
|
|
180
157
|
# Add a second bot (replace appid/appsecret/gateway with your values)
|
|
181
|
-
openclaw config set channels.
|
|
182
|
-
openclaw config set channels.
|
|
183
|
-
openclaw config set channels.
|
|
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"
|
|
184
161
|
|
|
185
162
|
# Restart to apply
|
|
186
163
|
openclaw gateway restart
|
|
@@ -191,7 +168,7 @@ The resulting config structure:
|
|
|
191
168
|
```json
|
|
192
169
|
{
|
|
193
170
|
"channels": {
|
|
194
|
-
"
|
|
171
|
+
"Lansenger": {
|
|
195
172
|
"appId": "your-appid-2",
|
|
196
173
|
"appSecret": "...",
|
|
197
174
|
"dmSecurity": "paired",
|
|
@@ -252,14 +229,14 @@ Use `bindings` to route Lansenger DMs or groups to different agents (same patter
|
|
|
252
229
|
{
|
|
253
230
|
agentId: "agent-a",
|
|
254
231
|
match: {
|
|
255
|
-
channel: "
|
|
232
|
+
channel: "Lansenger",
|
|
256
233
|
peer: { kind: "direct", id: "2285568-xxx" },
|
|
257
234
|
},
|
|
258
235
|
},
|
|
259
236
|
{
|
|
260
237
|
agentId: "agent-a",
|
|
261
238
|
match: {
|
|
262
|
-
channel: "
|
|
239
|
+
channel: "Lansenger",
|
|
263
240
|
peer: { kind: "group", id: "group-chat-id" },
|
|
264
241
|
},
|
|
265
242
|
},
|
|
@@ -268,7 +245,7 @@ Use `bindings` to route Lansenger DMs or groups to different agents (same patter
|
|
|
268
245
|
```
|
|
269
246
|
|
|
270
247
|
Routing fields:
|
|
271
|
-
* `match.channel`: `"
|
|
248
|
+
* `match.channel`: `"Lansenger"`
|
|
272
249
|
* `match.peer.kind`: `"direct"` (DM) or `"group"` (group chat)
|
|
273
250
|
* `match.peer.id`: user ID (`2285568-xxx`) or group chat ID
|
|
274
251
|
|
|
@@ -391,6 +368,7 @@ Approval status updates use the DynamicMsg appCard format. The `updateCardStatus
|
|
|
391
368
|
|
|
392
369
|
## Changelog
|
|
393
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
|
|
394
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
|
|
395
373
|
- **v2.7.2** — Add VERSION file; complete changelog in all 5 READMEs; regenerate package-lock.json
|
|
396
374
|
- **v2.7.0** — Register tools as plain objects (not factory functions); use runtime state for client/target — fixes external plugin tool registration
|
package/README.zhHans.md
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
**默认策略**:优先使用 `formatText` 发送 Markdown 回复。附件使用 `text` 回退。两种类型均支持 @mention(通过 `reminder` 参数)—提及用户时在文本中包含"@姓名"。
|
|
35
35
|
|
|
36
|
-
##
|
|
36
|
+
## 代理工具
|
|
37
37
|
|
|
38
38
|
| 工具 | 说明 |
|
|
39
39
|
|------|------|
|
|
@@ -47,31 +47,29 @@
|
|
|
47
47
|
| `lansenger_revoke_message` | 撤回已发送的消息 |
|
|
48
48
|
| `lansenger_query_groups` | 查询可用群组 |
|
|
49
49
|
|
|
50
|
-
##
|
|
50
|
+
## 安装与配置
|
|
51
51
|
|
|
52
|
-
###
|
|
52
|
+
### 推荐 4 步流程
|
|
53
53
|
|
|
54
54
|
```bash
|
|
55
55
|
# 1. 安装插件
|
|
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. 启用插件(如未自动启用)
|
|
59
|
+
openclaw config set plugins.entries.Lansenger.enabled true
|
|
62
60
|
|
|
63
|
-
# 3.
|
|
61
|
+
# 3. 配置频道(交互式向导)
|
|
62
|
+
openclaw channels add --channel Lansenger
|
|
63
|
+
# 或非交互式:
|
|
64
|
+
openclaw channels add --channel Lansenger --token "appId:appSecret"
|
|
65
|
+
|
|
66
|
+
# 4. 重启网关
|
|
64
67
|
openclaw gateway restart
|
|
65
68
|
```
|
|
66
69
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
### 通过 npm
|
|
70
|
+
`package.json` 中的 `openclaw.install` 元数据(`npmSpec`、`localPath`、`defaultChoice`)支持**按需安装**:如果用户在插件安装前运行 `openclaw channels add --channel Lansenger`,OpenClaw 可自动安装该插件。
|
|
70
71
|
|
|
71
|
-
|
|
72
|
-
npm install -g @lansenger-pm/openclaw-lansenger-channel
|
|
73
|
-
openclaw channels add --channel lansenger
|
|
74
|
-
```
|
|
72
|
+
> **自定义网关**:企业私有化部署(如奇安信)需在配置后通过 `openclaw.json` 或环境变量设置 `apiGatewayUrl` — 见[可选配置](#可选配置)。
|
|
75
73
|
|
|
76
74
|
### 开发安装(本地链接)
|
|
77
75
|
|
|
@@ -82,36 +80,18 @@ openclaw plugins install --link
|
|
|
82
80
|
openclaw gateway restart
|
|
83
81
|
```
|
|
84
82
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
安装后,配置凭证:
|
|
88
|
-
|
|
89
|
-
> **单账号**:`channels add` 仅创建一个账号。如需多个机器人,见下方[多机器人配置](#多机器人配置)。
|
|
83
|
+
### 获取凭证
|
|
90
84
|
|
|
91
|
-
|
|
92
|
-
# 标准安装(使用默认网关 https://open.e.lanxin.cn/open/apigw)
|
|
93
|
-
openclaw channels add --channel Lansenger \
|
|
94
|
-
--app-token "你的-appid" \
|
|
95
|
-
--secret "你的-appsecret"
|
|
96
|
-
|
|
97
|
-
# 企业私有化部署(自定义网关地址)
|
|
98
|
-
openclaw channels add --channel Lansenger \
|
|
99
|
-
--app-token "你的-appid" \
|
|
100
|
-
--secret "你的-appsecret" \
|
|
101
|
-
--base-url "https://apigw.lx.qianxin.com"
|
|
102
|
-
```
|
|
85
|
+
**蓝信桌面端** → **通讯录** → **智能机器人** → **个人机器人** → 点击 **ℹ️** 图标
|
|
103
86
|
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
openclaw gateway restart
|
|
107
|
-
```
|
|
87
|
+
> ⚠️ **移动端不支持查看凭证。** 请仅使用桌面端。
|
|
108
88
|
|
|
109
|
-
|
|
89
|
+
### 首次消息
|
|
110
90
|
|
|
111
91
|
重启后机器人自动通过 WebSocket 连接。给机器人发私聊消息,会收到配对码,审批配对:
|
|
112
92
|
|
|
113
93
|
```bash
|
|
114
|
-
openclaw pairing approve
|
|
94
|
+
openclaw pairing approve Lansenger <配对码>
|
|
115
95
|
```
|
|
116
96
|
|
|
117
97
|
## 配置
|
|
@@ -137,11 +117,11 @@ openclaw pairing approve lansenger <配对码>
|
|
|
137
117
|
```json
|
|
138
118
|
{
|
|
139
119
|
"channels": {
|
|
140
|
-
"
|
|
120
|
+
"Lansenger": {
|
|
141
121
|
"appId": "your-appid",
|
|
142
122
|
"appSecret": "your-secret",
|
|
143
123
|
"apiGatewayUrl": "https://open.e.lanxin.cn/open/apigw",
|
|
144
|
-
"homeChannel": "
|
|
124
|
+
"homeChannel": "Lansenger",
|
|
145
125
|
"enabled": true,
|
|
146
126
|
"allowFrom": ["your-appid"],
|
|
147
127
|
"dmSecurity": "paired",
|
|
@@ -162,7 +142,7 @@ openclaw pairing approve lansenger <配对码>
|
|
|
162
142
|
| `appId` | 个人机器人 App ID | — |
|
|
163
143
|
| `appSecret` | 个人机器人 App Secret | — |
|
|
164
144
|
| `apiGatewayUrl` | API 网关 URL | `https://open.e.lanxin.cn/open/apigw` |
|
|
165
|
-
| `homeChannel` | 代理路由的默认频道 | `
|
|
145
|
+
| `homeChannel` | 代理路由的默认频道 | `Lansenger` |
|
|
166
146
|
| `enabled` | 启用/禁用频道 | `true` |
|
|
167
147
|
| `allowFrom` | 允许私聊的用户 ID | `[]` |
|
|
168
148
|
| `dmSecurity` | 私聊策略:`paired`、`allowlist`、`open` | `paired` |
|
|
@@ -173,15 +153,13 @@ openclaw pairing approve lansenger <配对码>
|
|
|
173
153
|
|
|
174
154
|
### 多机器人配置
|
|
175
155
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
通过 `channels add` 添加第一个账号后,用 `openclaw config set` 添加更多机器人:
|
|
156
|
+
添加多个机器人时,使用 `openclaw config set` 配置 `accounts` 结构:
|
|
179
157
|
|
|
180
158
|
```bash
|
|
181
159
|
# 添加第二个机器人(替换 appid/appsecret/gateway 为你的值)
|
|
182
|
-
openclaw config set channels.
|
|
183
|
-
openclaw config set channels.
|
|
184
|
-
openclaw config set channels.
|
|
160
|
+
openclaw config set channels.Lansenger.accounts.your-appid-2.appId "your-appid-2"
|
|
161
|
+
openclaw config set channels.Lansenger.accounts.your-appid-2.appSecret "your-appsecret"
|
|
162
|
+
openclaw config set channels.Lansenger.accounts.your-appid-2.apiGatewayUrl "https://apigw.lx.qianxin.com"
|
|
185
163
|
|
|
186
164
|
# 重启生效
|
|
187
165
|
openclaw gateway restart
|
|
@@ -192,7 +170,7 @@ openclaw gateway restart
|
|
|
192
170
|
```json
|
|
193
171
|
{
|
|
194
172
|
"channels": {
|
|
195
|
-
"
|
|
173
|
+
"Lansenger": {
|
|
196
174
|
"appId": "your-appid-2",
|
|
197
175
|
"appSecret": "...",
|
|
198
176
|
"dmSecurity": "paired",
|
|
@@ -253,14 +231,14 @@ openclaw gateway call lansenger.status
|
|
|
253
231
|
{
|
|
254
232
|
agentId: "agent-a",
|
|
255
233
|
match: {
|
|
256
|
-
channel: "
|
|
234
|
+
channel: "Lansenger",
|
|
257
235
|
peer: { kind: "direct", id: "2285568-xxx" },
|
|
258
236
|
},
|
|
259
237
|
},
|
|
260
238
|
{
|
|
261
239
|
agentId: "agent-a",
|
|
262
240
|
match: {
|
|
263
|
-
channel: "
|
|
241
|
+
channel: "Lansenger",
|
|
264
242
|
peer: { kind: "group", id: "group-chat-id" },
|
|
265
243
|
},
|
|
266
244
|
},
|
|
@@ -269,7 +247,7 @@ openclaw gateway call lansenger.status
|
|
|
269
247
|
```
|
|
270
248
|
|
|
271
249
|
路由字段:
|
|
272
|
-
* `match.channel`: `"
|
|
250
|
+
* `match.channel`: `"Lansenger"`
|
|
273
251
|
* `match.peer.kind`: `"direct"`(私聊)或 `"group"`(群聊)
|
|
274
252
|
* `match.peer.id`: 用户 ID(`2285568-xxx`)或群聊 ID
|
|
275
253
|
|
|
@@ -392,6 +370,7 @@ Agent 路由由 OpenClaw 的 `bindings[]` 配置管理——见[多 Agent 路由
|
|
|
392
370
|
|
|
393
371
|
## 更新日志
|
|
394
372
|
|
|
373
|
+
- **v2.8.1** — 修复 README:正确的 4 步安装流程(安装 → 启用 → 配置 → 重启),移除手动复制 hack;修复 SKILL.md frontmatter(AgentSkills 规范合规:移除 version/category/trigger,添加 metadata.openclaw gating);channel identifier 改为 Lansenger
|
|
395
374
|
- **v2.8.0** — 多 Agent 路由改用 OpenClaw `bindings[]`(替代 per-account `agentId`);新增 groupPolicy/groupAllowFrom/groups 群聊准入控制;使用 `resolveAgentRoute` SDK 处理 inbound 路由
|
|
396
375
|
- **v2.7.2** — 新增 VERSION 文件;补全 5 个 README changelog;重新生成 package-lock.json
|
|
397
376
|
- **v2.7.0** — 工具注册改为纯对象(非工厂函数);使用运行时状态获取 client/target — 修复外部插件工具注册
|