@lansenger-pm/openclaw-lansenger-channel 3.16.2 → 3.16.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/CHANGELOG.md CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [3.16.3] - 2026-06-22
8
+
9
+ ### Fixed
10
+
11
+ - **`queryGroups` returns empty `groupIds`**: Default `pageOffset` was `1` but the API `page_offset` starts from `0`. With few groups, the first page was skipped entirely, returning `totalGroupIds > 0` but `groupIds: []`.
12
+
7
13
  ## [3.16.2] - 2026-06-22
8
14
 
9
15
  ### Added
package/README.fr.md CHANGED
@@ -359,6 +359,7 @@ Le plugin supporte les cartes d'approbation :
359
359
  - **reminder** — champ optionnel dans formatText ; recommandé dans les chats de groupe. Inclure « @姓名 » dans le texte pour les mentions.
360
360
  - **Média** — les balises `<media>` fonctionnent pour les fichiers du workspace ; pour les chemins externes, utilisez `lansenger_send_file`.
361
361
  - **openclaw skill/message lansenger** — ces commandes CLI n'existent PAS ; utilisez les outils de l'agent.
362
+ - **Copie automatique de la compétence lansenger-setup** — le plugin copie la compétence `lansenger-setup` dans `~/.openclaw/skills/` au démarrage pour que l'agent puisse aider à configurer Lansenger avant l'activation complète du canal. Ce comportement est intentionnel — ne le supprimez pas manuellement.
362
363
  - **Outils agent** — les outils agent (`lansenger_send_*`) nécessitent le plugin outils ET une injection réussie de la passerelle — si les outils ne sont pas disponibles, utilisez la CLI comme repli. Les commandes CLI (`lansenger message send-*`) nécessitent `pipx install lansenger-cli`.
363
364
  - **alsoAllow** — les outils agent sont enregistrés par ce plugin de canal mais peuvent être **invisibles** sous un profil d'outils restrictif. Ajoutez `"tools": { "alsoAllow": ["group:plugins"] }` dans `openclaw.json` pour que l'agent puisse voir et utiliser les outils `lansenger_send_*`. Sans cela, les outils peuvent ne pas apparaître silencieusement dans la liste d'outils de l'agent.
364
365
 
@@ -388,23 +389,26 @@ npx tsc --noEmit
388
389
  ```
389
390
  openclaw-lansenger-channel/
390
391
  ├── src/
391
- │ ├── client.ts # Client API Lansenger (WS, HTTP, médias)
392
- │ ├── channel.ts # Plugin de canal OpenClaw
393
- │ ├── runtime.ts # Runtime passerelle (méthodes, handler entrant)
394
- │ ├── tools.ts # Définitions des outils agent (10 outils intégrés)
395
- │ ├── setup-wizard.ts # Assistant de configuration (migration config multi-compte)
396
- │ ├── channel.test.ts # Tests du plugin de canal
397
- │ ├── client.test.ts # Tests du client API
398
- │ ├── runtime.test.ts # Tests du runtime
399
- │ ├── tools.test.ts # Tests des outils
400
- │ └── setup-wizard.test.ts # Tests de l'assistant de configuration
392
+ │ ├── client.ts # Client API Lansenger (WS, HTTP, médias)
393
+ │ ├── channel.ts # Plugin de canal OpenClaw
394
+ │ ├── runtime.ts # Runtime passerelle (handler entrant, livraison)
395
+ │ ├── tools.ts # Définitions des outils agent (lansenger_send_*)
396
+ │ ├── persistent-store.ts # Persistance d'état sur disque
397
+ │ ├── setup-wizard.ts # Assistant de configuration (migration config multi-compte)
398
+ │ ├── setup-i18n.ts # i18n de l'assistant de configuration
399
+ │ ├── *.test.ts # Tests unitaires
401
400
  ├── skills/
402
- └── lansenger-messaging/
403
- └── SKILL.md # Stratégie de messagerie (outils + CLI)
404
- ├── dist/ # JavaScript compilé
405
- ├── index.ts # Point d'entrée du plugin
406
- ├── setup-entry.ts # Point d'entrée de l'assistant de configuration
407
- ├── openclaw.plugin.json # Métadonnées du plugin & configuration GUI
401
+ ├── lansenger-messaging/
402
+ └── SKILL.md # Stratégie de messagerie (outils + CLI)
403
+ │ └── lansenger-setup/
404
+ │ └── SKILL.md # Assistant d'installation (copié auto vers ~/.openclaw/skills)
405
+ ├── dist/ # JavaScript compilé
406
+ ├── index.ts # Point d'entrée du plugin (registerFull, ensureSetupSkill)
407
+ ├── setup-entry.ts # Point d'entrée de l'assistant de configuration
408
+ ├── openclaw.plugin.json # Métadonnées du plugin & configuration GUI
409
+ ├── CHANGELOG.md
410
+ ├── VERSION
411
+ ├── vitest.config.ts
408
412
  ├── package.json
409
413
  └── tsconfig.json
410
414
  ```
package/README.md CHANGED
@@ -351,6 +351,7 @@ The plugin supports approval workflow cards:
351
351
  - **reminder** — optional in formatText; recommended in group chat. Include "@姓名" in text when mentioning.
352
352
  - **Media** — `<media>` tags work for workspace files; for external paths use `lansenger_send_file`.
353
353
  - **openclaw skill/message lansenger** — these CLI commands do NOT exist; use agent tools instead.
354
+ - **lansenger-setup skill auto-copy** — the plugin copies `lansenger-setup` skill to `~/.openclaw/skills/` on startup so the agent can help configure Lansenger even before the channel is fully activated. This is intentional — do not remove it manually.
354
355
  - **Agent tools** — agent tools (`lansenger_send_*`) are built into the channel plugin — always available when the channel is configured and running. CLI commands (`lansenger message send-*`) require `pipx install lansenger-cli` and are an optional alternative.
355
356
  - **alsoAllow** — agent tools are registered by this channel plugin but may be **invisible** under restrictive tool profiles. Add `"tools": { "alsoAllow": ["group:plugins"] }` to `openclaw.json` to ensure the agent can see and use `lansenger_send_*` tools. Without this, tools may silently not appear in the agent's tool list.
356
357
 
@@ -380,23 +381,26 @@ npx tsc --noEmit
380
381
  ```
381
382
  openclaw-lansenger-channel/
382
383
  ├── src/
383
- │ ├── client.ts # Lansenger API client (WS, HTTP, media)
384
- │ ├── channel.ts # OpenClaw channel plugin
385
- │ ├── runtime.ts # Gateway runtime (methods, inbound handler)
386
- │ ├── tools.ts # Agent tool definitions (10 built-in tools)
387
- │ ├── setup-wizard.ts # Setup wizard (multi-account config migration)
388
- │ ├── channel.test.ts # Channel plugin tests
389
- │ ├── client.test.ts # API client tests
390
- │ ├── runtime.test.ts # Runtime tests
391
- │ ├── tools.test.ts # Tool tests
392
- │ └── setup-wizard.test.ts # Setup wizard tests
384
+ │ ├── client.ts # Lansenger API client (WS, HTTP, media)
385
+ │ ├── channel.ts # OpenClaw channel plugin
386
+ │ ├── runtime.ts # Gateway runtime (inbound handler, delivery)
387
+ │ ├── tools.ts # Agent tool definitions (lansenger_send_*)
388
+ │ ├── persistent-store.ts # Disk-backed state persistence
389
+ │ ├── setup-wizard.ts # Setup wizard (multi-account config migration)
390
+ │ ├── setup-i18n.ts # Setup wizard i18n strings
391
+ │ ├── *.test.ts # Unit tests
393
392
  ├── skills/
394
- └── lansenger-messaging/
395
- └── SKILL.md # Agent messaging strategy (tools + CLI)
396
- ├── dist/ # Compiled JavaScript
397
- ├── index.ts # Plugin entry point
398
- ├── setup-entry.ts # Setup wizard entry
399
- ├── openclaw.plugin.json # Plugin metadata & GUI config
393
+ ├── lansenger-messaging/
394
+ └── SKILL.md # Agent messaging strategy (tools + CLI)
395
+ │ └── lansenger-setup/
396
+ │ └── SKILL.md # Setup assistant (auto-copied to ~/.openclaw/skills)
397
+ ├── dist/ # Compiled JavaScript
398
+ ├── index.ts # Plugin entry point (registerFull, ensureSetupSkill)
399
+ ├── setup-entry.ts # Setup wizard entry
400
+ ├── openclaw.plugin.json # Plugin metadata & GUI config
401
+ ├── CHANGELOG.md
402
+ ├── VERSION
403
+ ├── vitest.config.ts
400
404
  ├── package.json
401
405
  └── tsconfig.json
402
406
  ```
package/README.zhHans.md CHANGED
@@ -359,6 +359,7 @@ openclaw channels status --probe
359
359
  - **reminder** — formatText 中可选字段;群聊中建议使用。提及用户时在文本中包含"@姓名"。
360
360
  - **媒体标签** — `<media>` 标签适用于工作区文件;外部路径请使用 `lansenger_send_file`。
361
361
  - **openclaw skill/message lansenger** — 这些 CLI 命令不存在;请使用代理工具。
362
+ - **lansenger-setup 技能自动复制** — 插件在启动时将 `lansenger-setup` 技能复制到 `~/.openclaw/skills/`,以便在频道完全激活之前就能帮助配置蓝信。这是有意设计,请勿手动删除。
362
363
  - **代理工具** — 代理工具(`lansenger_send_*`)需要工具插件且网关注入成功 — 若工具不可用,请使用 CLI 作为备选。CLI 命令(`lansenger message send-*`)需要 `pipx install lansenger-cli`。
363
364
  - **alsoAllow** — 本插件注册了 agent 工具(`lansenger_send_*`),但在严格工具策略下可能**不可见**。需在 `openclaw.json` 中添加 `"tools": { "alsoAllow": ["group:plugins"] }` 以确保 agent 能看到并使用这些工具。否则工具可能静默不出现在 agent 工具列表中。
364
365
 
@@ -388,23 +389,26 @@ npx tsc --noEmit
388
389
  ```
389
390
  openclaw-lansenger-channel/
390
391
  ├── src/
391
- │ ├── client.ts # 蓝信 API 客户端(WS、HTTP、媒体)
392
- │ ├── channel.ts # OpenClaw 频道插件
393
- │ ├── runtime.ts # 网关运行时(方法、入站处理器)
394
- │ ├── tools.ts # 代理工具定义(10 个内置工具)
395
- │ ├── setup-wizard.ts # 设置向导(多账号配置迁移)
396
- │ ├── channel.test.ts # 频道插件测试
397
- │ ├── client.test.ts # API 客户端测试
398
- │ ├── runtime.test.ts # 运行时测试
399
- │ ├── tools.test.ts # 工具测试
400
- │ └── setup-wizard.test.ts # 设置向导测试
392
+ │ ├── client.ts # 蓝信 API 客户端(WS、HTTP、媒体)
393
+ │ ├── channel.ts # OpenClaw 频道插件
394
+ │ ├── runtime.ts # 网关运行时(入站处理、投递)
395
+ │ ├── tools.ts # 代理工具定义(lansenger_send_*)
396
+ │ ├── persistent-store.ts # 磁盘状态持久化
397
+ │ ├── setup-wizard.ts # 设置向导(多账号配置迁移)
398
+ │ ├── setup-i18n.ts # 设置向导多语言
399
+ │ ├── *.test.ts # 单元测试
401
400
  ├── skills/
402
- └── lansenger-messaging/
403
- └── SKILL.md # 代理消息策略(工具 + CLI)
404
- ├── dist/ # 编译后的 JavaScript
405
- ├── index.ts # 插件入口
406
- ├── setup-entry.ts # 设置向导入口
407
- ├── openclaw.plugin.json # 插件元数据与 GUI 配置
401
+ ├── lansenger-messaging/
402
+ └── SKILL.md # 代理消息策略(工具 + CLI)
403
+ │ └── lansenger-setup/
404
+ │ └── SKILL.md # 安装助手(自动复制至 ~/.openclaw/skills)
405
+ ├── dist/ # 编译后的 JavaScript
406
+ ├── index.ts # 插件入口(registerFull、ensureSetupSkill)
407
+ ├── setup-entry.ts # 设置向导入口
408
+ ├── openclaw.plugin.json # 插件元数据与 GUI 配置
409
+ ├── CHANGELOG.md
410
+ ├── VERSION
411
+ ├── vitest.config.ts
408
412
  ├── package.json
409
413
  └── tsconfig.json
410
414
  ```
package/README.zhHant.md CHANGED
@@ -359,6 +359,7 @@ openclaw channels status --probe
359
359
  - **reminder**——formatText 中可選欄位;群組聊天中建議使用。提及使用者時在文字中包含「@姓名」。
360
360
  - **媒體標籤**——`<media>` 標籤適用於工作區檔案;外部路徑請使用 `lansenger_send_file`。
361
361
  - **openclaw skill/message lansenger**——這些 CLI 命令不存在;請使用代理工具。
362
+ - **lansenger-setup 技能自動複製**——插件在啟動時將 `lansenger-setup` 技能複製到 `~/.openclaw/skills/`,以便在頻道完全啟用前就能幫助設定藍信。此為設計行為,請勿手動刪除。
362
363
  - **代理工具**——代理工具(`lansenger_send_*`)需要工具插件且閘道注入成功——若工具不可用,請使用 CLI 作為備選。CLI 命令(`lansenger message send-*`)需要 `pipx install lansenger-cli`。
363
364
  - **alsoAllow**——本插件註冊了 agent 工具(`lansenger_send_*`),但在嚴格工具策略下可能**不可見**。需在 `openclaw.json` 中新增 `"tools": { "alsoAllow": ["group:plugins"] }` 以確保 agent 能看到並使用這些工具。否則工具可能靜默不出現在 agent 工具列表中。
364
365
 
@@ -388,23 +389,26 @@ npx tsc --noEmit
388
389
  ```
389
390
  openclaw-lansenger-channel/
390
391
  ├── src/
391
- │ ├── client.ts # 藍信 API 客戶端(WS、HTTP、媒體)
392
- │ ├── channel.ts # OpenClaw 频道插件
393
- │ ├── runtime.ts # 閘道運行時(方法、入站處理器)
394
- │ ├── tools.ts # 代理工具定義(10 個內建工具)
395
- │ ├── setup-wizard.ts # 設定精靈(多帳號配置遷移)
396
- │ ├── channel.test.ts # 频道插件測試
397
- │ ├── client.test.ts # API 客戶端測試
398
- │ ├── runtime.test.ts # 運行時測試
399
- │ ├── tools.test.ts # 工具測試
400
- │ └── setup-wizard.test.ts # 設定精靈測試
392
+ │ ├── client.ts # 藍信 API 客戶端(WS、HTTP、媒體)
393
+ │ ├── channel.ts # OpenClaw 頻道插件
394
+ │ ├── runtime.ts # 閘道運行時(入站處理、投遞)
395
+ │ ├── tools.ts # 代理工具定義(lansenger_send_*)
396
+ │ ├── persistent-store.ts # 磁碟狀態持久化
397
+ │ ├── setup-wizard.ts # 設定精靈(多帳號配置遷移)
398
+ │ ├── setup-i18n.ts # 設定精靈多語言
399
+ │ ├── *.test.ts # 單元測試
401
400
  ├── skills/
402
- └── lansenger-messaging/
403
- └── SKILL.md # 代理訊息策略(工具 + CLI)
404
- ├── dist/ # 編譯後的 JavaScript
405
- ├── index.ts # 插件入口
406
- ├── setup-entry.ts # 設定精靈入口
407
- ├── openclaw.plugin.json # 插件元資料與 GUI 設定
401
+ ├── lansenger-messaging/
402
+ └── SKILL.md # 代理訊息策略(工具 + CLI)
403
+ │ └── lansenger-setup/
404
+ │ └── SKILL.md # 安裝助手(自動複製至 ~/.openclaw/skills)
405
+ ├── dist/ # 編譯後的 JavaScript
406
+ ├── index.ts # 插件入口(registerFull、ensureSetupSkill)
407
+ ├── setup-entry.ts # 設定精靈入口
408
+ ├── openclaw.plugin.json # 插件元資料與 GUI 設定
409
+ ├── CHANGELOG.md
410
+ ├── VERSION
411
+ ├── vitest.config.ts
408
412
  ├── package.json
409
413
  └── tsconfig.json
410
414
  ```
@@ -361,6 +361,7 @@ openclaw channels status --probe
361
361
  - **reminder** — formatText 中可選欄位;群組聊天中建議使用。提及使用者時在文字中包含「@姓名」。
362
362
  - **媒體標籤** — `<media>` 標籤適用於工作區檔案;外部路徑請使用 `lansenger_send_file`。
363
363
  - **openclaw skill/message lansenger** — 這些 CLI 命令不存在;請使用代理工具。
364
+ - **lansenger-setup 技能自動複製** — 插件在啟動時將 `lansenger-setup` 技能複製到 `~/.openclaw/skills/`,以便在頻道完全啟用前就能幫助設定藍信。此為設計行為,請勿手動刪除。
364
365
  - **代理工具** — 代理工具(`lansenger_send_*`)需要工具插件且網關注入成功 — 若工具不可用,請使用 CLI 作為備選。CLI 命令(`lansenger message send-*`)需要 `pipx install lansenger-cli`。
365
366
  - **alsoAllow** — 本插件註冊了 agent 工具(`lansenger_send_*`),但在嚴格工具策略下可能**不可見**。需在 `openclaw.json` 中新增 `"tools": { "alsoAllow": ["group:plugins"] }` 以確保 agent 能看到並使用這些工具。否則工具可能靜默不出現在 agent 工具列表中。
366
367
 
@@ -390,23 +391,26 @@ npx tsc --noEmit
390
391
  ```
391
392
  openclaw-lansenger-channel/
392
393
  ├── src/
393
- │ ├── client.ts # 藍信 API 客戶端(WS、HTTP、媒體)
394
- │ ├── channel.ts # OpenClaw 频道插件
395
- │ ├── runtime.ts # 網關運行時(方法、入站處理器)
396
- │ ├── tools.ts # 代理工具定義(10 個內建工具)
397
- │ ├── setup-wizard.ts # 設定精靈(多帳號配置遷移)
398
- │ ├── channel.test.ts # 频道插件測試
399
- │ ├── client.test.ts # API 客戶端測試
400
- │ ├── runtime.test.ts # 運行時測試
401
- │ ├── tools.test.ts # 工具測試
402
- │ └── setup-wizard.test.ts # 設定精靈測試
394
+ │ ├── client.ts # 藍信 API 客戶端(WS、HTTP、媒體)
395
+ │ ├── channel.ts # OpenClaw 頻道插件
396
+ │ ├── runtime.ts # 網關運行時(入站處理、投遞)
397
+ │ ├── tools.ts # 代理工具定義(lansenger_send_*)
398
+ │ ├── persistent-store.ts # 磁碟狀態持久化
399
+ │ ├── setup-wizard.ts # 設定精靈(多帳號配置遷移)
400
+ │ ├── setup-i18n.ts # 設定精靈多語言
401
+ │ ├── *.test.ts # 單元測試
403
402
  ├── skills/
404
- └── lansenger-messaging/
405
- └── SKILL.md # 代理訊息策略(工具 + CLI)
406
- ├── dist/ # 編譯後的 JavaScript
407
- ├── index.ts # 插件入口
408
- ├── setup-entry.ts # 設定精靈入口
409
- ├── openclaw.plugin.json # 插件元資料與 GUI 設定
403
+ ├── lansenger-messaging/
404
+ └── SKILL.md # 代理訊息策略(工具 + CLI)
405
+ │ └── lansenger-setup/
406
+ │ └── SKILL.md # 安裝助手(自動複製至 ~/.openclaw/skills)
407
+ ├── dist/ # 編譯後的 JavaScript
408
+ ├── index.ts # 插件入口(registerFull、ensureSetupSkill)
409
+ ├── setup-entry.ts # 設定精靈入口
410
+ ├── openclaw.plugin.json # 插件元資料與 GUI 設定
411
+ ├── CHANGELOG.md
412
+ ├── VERSION
413
+ ├── vitest.config.ts
410
414
  ├── package.json
411
415
  └── tsconfig.json
412
416
  ```
@@ -511,7 +511,7 @@ export class LansengerClient {
511
511
  return { success: false, error: e.message };
512
512
  }
513
513
  }
514
- async queryGroups(pageOffset = 1, pageSize = 100) {
514
+ async queryGroups(pageOffset = 0, pageSize = 100) {
515
515
  const token = await this.getAppToken();
516
516
  if (!token)
517
517
  return { error: "No access token" };
package/dist/src/tools.js CHANGED
@@ -428,7 +428,7 @@ export function registerLansengerTools(api) {
428
428
  description: "Query the bot's group list on Lansenger (蓝信). Returns total count and group IDs. ⚠️ May return errCode=10005 'API服务无权限' on enterprise deployments where /v2/groups/fetch is not authorized. If permission denied, ask the user for group chatIds manually.",
429
429
  parameters: QueryGroupsSchema,
430
430
  async execute(_toolCallId, params) {
431
- const result = await tc.client.queryGroups(params.pageOffset ?? 1, params.pageSize ?? 100);
431
+ const result = await tc.client.queryGroups(params.pageOffset ?? 0, params.pageSize ?? 100);
432
432
  if ("error" in result)
433
433
  return jsonResult({ error: result.error });
434
434
  return jsonResult({ success: true, totalGroupIds: result.totalGroupIds, groupIds: result.groupIds });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lansenger-pm/openclaw-lansenger-channel",
3
- "version": "3.16.2",
3
+ "version": "3.16.3",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "exports": {