@xmoxmo/bncr 0.6.5 → 0.6.7
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 +146 -338
- package/package.json +7 -7
- package/scripts/check-pack.mjs +5 -1
- package/scripts/selfcheck.mjs +2 -1
- package/src/core/types.ts +1 -1
- package/src/messaging/inbound/commands.ts +118 -67
- package/src/messaging/inbound/conversation-history.ts +53 -5
- package/src/messaging/inbound/native-command.ts +7 -11
- package/src/messaging/inbound/outbound-replay-cache.ts +18 -2
- package/src/messaging/inbound/reply-dispatch.ts +8 -0
- package/src/openclaw/session-reset-runtime.ts +80 -32
- package/src/plugin/channel-runtime-types.ts +1 -1
- package/src/plugin/config.ts +18 -0
- package/src/plugin/inbound-handlers.ts +11 -5
- package/src/plugin/sqlite-state.ts +42 -18
- package/src/plugin/state-store.ts +54 -20
package/README.md
CHANGED
|
@@ -1,25 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Bncr
|
|
2
2
|
|
|
3
|
-
OpenClaw 的 Bncr
|
|
3
|
+
OpenClaw 的 Bncr 频道插件,用于将 Bncr / 无界客户端接入 OpenClaw,实现消息收发、媒体传输和会话管理。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
> 当前定位说明:bncr **不是 agent**。它保留既有 **WS 接入链路** 作为 transport / 通信承载,
|
|
8
|
-
> 在 OpenClaw 内部则按 **正式频道插件(channel plugin)** 建模。
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## 1. 这是什么
|
|
13
|
-
|
|
14
|
-
- 一个 OpenClaw 的正式频道插件
|
|
15
|
-
- 负责把 Bncr / 无界客户端接入 OpenClaw
|
|
16
|
-
- 负责消息、媒体、文件与基础状态链路
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## 2. 安装方式
|
|
21
|
-
|
|
22
|
-
### OpenClaw 侧
|
|
5
|
+
## 安装
|
|
23
6
|
|
|
24
7
|
```bash
|
|
25
8
|
openclaw plugins install @xmoxmo/bncr
|
|
@@ -27,397 +10,222 @@ openclaw plugins enable bncr
|
|
|
27
10
|
openclaw gateway restart
|
|
28
11
|
```
|
|
29
12
|
|
|
30
|
-
|
|
13
|
+
升级插件:
|
|
31
14
|
|
|
32
15
|
```bash
|
|
33
16
|
openclaw plugins update bncr
|
|
34
17
|
openclaw gateway restart
|
|
35
18
|
```
|
|
36
19
|
|
|
37
|
-
|
|
38
|
-
>
|
|
39
|
-
> 如果你是从精确版本升级,或本地安装记录仍钉在旧版本,也可以显式执行:
|
|
40
|
-
>
|
|
41
|
-
> ```bash
|
|
42
|
-
> openclaw plugins install @xmoxmo/bncr@latest
|
|
43
|
-
> openclaw gateway restart
|
|
44
|
-
> ```
|
|
45
|
-
|
|
46
|
-
### Bncr / 无界侧
|
|
47
|
-
|
|
48
|
-
安装:
|
|
49
|
-
|
|
50
|
-
- `openclawclient.js`
|
|
51
|
-
|
|
52
|
-
然后完成客户端配置并连上 OpenClaw 网关即可。
|
|
20
|
+
当前兼容 `OpenClaw >= 2026.8.1`。
|
|
53
21
|
|
|
54
|
-
|
|
22
|
+
## 客户端接入
|
|
55
23
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
24
|
+
1. 安装并启用 `openclawclient.js`。
|
|
25
|
+
2. 在客户端填写 OpenClaw 网关地址、端口、SSL 和 gateway token。
|
|
26
|
+
3. 启动客户端,等待设备连接请求。
|
|
27
|
+
4. 在 OpenClaw 上批准设备:
|
|
60
28
|
|
|
61
29
|
```bash
|
|
62
30
|
openclaw devices approve --latest
|
|
63
31
|
```
|
|
64
32
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
## 4. 当前能力
|
|
70
|
-
|
|
71
|
-
- 文本
|
|
72
|
-
- 图片
|
|
73
|
-
- 视频
|
|
74
|
-
- 语音
|
|
75
|
-
- 音频
|
|
76
|
-
- 文件
|
|
77
|
-
- 下行推送
|
|
78
|
-
- ACK
|
|
79
|
-
- 离线消息排队
|
|
80
|
-
- 重连后继续发送
|
|
81
|
-
- 状态诊断
|
|
82
|
-
- 文件互传
|
|
83
|
-
|
|
84
|
-
### 0.6.1 新增说明
|
|
85
|
-
|
|
86
|
-
- `bncr.outbound.recent`:本地 bridge 方法,可直接查询最近的出站记录;该记录来自出站重放缓存,不额外维护一份独立最近出站存储。
|
|
87
|
-
- 出站重放缓存:最近出站消息会在下轮入站上下文回灌时带给 agent,用于让 agent 知道自己刚发过什么;查询和回灌共享同一份 `outboundReplayCache`。
|
|
88
|
-
- bridge 方法调用:`message` 工具支持传入 `bridgeMethod`,可调用插件本地方法(如 `bncr.status.*`、`bncr.outbound.recent`)或转发到 OpenClawClient RPC。
|
|
89
|
-
- unsend / delete:`message` 工具支持撤回/删除动作,按发送缓存映射回真实平台消息,不需要业务侧单独拼平台 message id。
|
|
33
|
+
设备批准后,客户端会保存授权信息并自动重连。
|
|
90
34
|
|
|
91
|
-
|
|
35
|
+
## 基础配置
|
|
92
36
|
|
|
93
|
-
|
|
37
|
+
配置位于 `channels.bncr`。最小配置:
|
|
94
38
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
- 非白名单裸发命令(如 `/allow`、`/mode`)以调用者自身身份交给 OpenClaw/agent 处理,允许 fallback 到 agent。
|
|
107
|
-
- `/bncr` 前缀命令由 bncr 插件按非管理员权限处理,可用的子命令为:`whoami`、`status`、`new`、`reset`、`verbose`、`history-help`、`history-limit`、`history-force`、`download-media`。
|
|
108
|
-
- `/bncr` 未知子命令(含 `/bncr stop`)→ 直接拒绝,不转发 agent。
|
|
109
|
-
- 非管理员私聊执行 self-admin 命令(`history-*`、`download-media`)时,如传入 `sceneId` 参数,仅允许控制当前私聊会话,传入其他会话 ID 会被拒绝。
|
|
110
|
-
|
|
111
|
-
#### 群聊
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"channels": {
|
|
42
|
+
"bncr": {
|
|
43
|
+
"enabled": true,
|
|
44
|
+
"allowTool": false,
|
|
45
|
+
"outboundRequireAck": true
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
112
50
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
51
|
+
常用配置:
|
|
52
|
+
|
|
53
|
+
| 配置 | 说明 |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| `enabled` | 是否启用 Bncr 频道 |
|
|
56
|
+
| `dmPolicy` | 私聊策略:`open`、`allowlist`、`disabled` |
|
|
57
|
+
| `groupPolicy` | 群聊策略:`open`、`allowlist`、`disabled` |
|
|
58
|
+
| `allowFrom` | 私聊允许的用户列表 |
|
|
59
|
+
| `groupAllowFrom` | 群聊允许的用户列表 |
|
|
60
|
+
| `allowTool` | 是否转发工具消息,默认关闭 |
|
|
61
|
+
| `outboundRequireAck` | 出站文本是否等待客户端 ACK,默认开启 |
|
|
62
|
+
| `accounts` | 多账号配置 |
|
|
63
|
+
| `debug.verbose` | 是否输出详细调试日志 |
|
|
64
|
+
|
|
65
|
+
多账号示例:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"channels": {
|
|
70
|
+
"bncr": {
|
|
71
|
+
"accounts": {
|
|
72
|
+
"Primary": { "enabled": true, "name": "主账号" },
|
|
73
|
+
"Secondary": { "enabled": true, "name": "备用账号" }
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
117
79
|
|
|
118
|
-
|
|
80
|
+
也可以使用命令生成最小配置:
|
|
119
81
|
|
|
120
|
-
|
|
82
|
+
```bash
|
|
83
|
+
openclaw bncr miniconfig
|
|
84
|
+
```
|
|
121
85
|
|
|
122
|
-
|
|
86
|
+
## 支持的能力
|
|
123
87
|
|
|
124
|
-
|
|
88
|
+
- 文本消息
|
|
89
|
+
- 图片、视频、音频和语音
|
|
90
|
+
- 文件传输和媒体附件
|
|
91
|
+
- 消息撤回和删除
|
|
92
|
+
- 离线排队、ACK、重试和重连
|
|
93
|
+
- 多账号、私聊和群聊会话
|
|
94
|
+
- 会话历史上下文
|
|
95
|
+
- 状态和投递诊断
|
|
125
96
|
|
|
126
|
-
|
|
127
|
-
- 私聊非管理员:展示当前可用命令,不展示管理类命令
|
|
128
|
-
- 群聊非管理员:仅展示 `/bncr whoami`、`/bncr status`,不展示 `new`、`reset`、`verbose`、`mode`、`history-*`、`download-media` 等命令
|
|
97
|
+
Agent 可以使用 OpenClaw 标准消息能力发送文本或媒体。需要指定目标会话时,使用 Bncr 目标地址并同时指定 `accountId`。
|
|
129
98
|
|
|
130
|
-
|
|
99
|
+
## 命令
|
|
131
100
|
|
|
132
|
-
|
|
101
|
+
### 基础命令
|
|
133
102
|
|
|
134
103
|
```text
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
• /bncr verbose on|off|full
|
|
143
|
-
|
|
144
|
-
🛡 Scene approval
|
|
145
|
-
• /bncr allow [<SceneId>]
|
|
146
|
-
• /bncr deny [<SceneId>]
|
|
147
|
-
• /bncr bind <agentId> [<SceneId>]
|
|
148
|
-
• /bncr mode help
|
|
149
|
-
• /bncr mode <admin|mention|hybrid|all|clear> [<SceneId>]
|
|
150
|
-
• /bncr revoke [<SceneId>]
|
|
151
|
-
• /bncr list pending [filters...]
|
|
152
|
-
• /bncr list scenes [filters...]
|
|
153
|
-
|
|
154
|
-
📋 Conversation history
|
|
155
|
-
• /bncr history-help
|
|
156
|
-
• /bncr history-limit [<number>|clear] [<SceneId>]
|
|
157
|
-
• /bncr history-force on|off|clear [<SceneId>]
|
|
158
|
-
|
|
159
|
-
🌐 Remote media
|
|
160
|
-
• /bncr download-media on|off|clear|default on|off [<SceneId>]
|
|
104
|
+
/bncr help
|
|
105
|
+
/bncr whoami
|
|
106
|
+
/bncr status
|
|
107
|
+
/bncr new
|
|
108
|
+
/bncr reset
|
|
109
|
+
/bncr verbose on|off|full
|
|
110
|
+
/stop
|
|
161
111
|
```
|
|
162
112
|
|
|
163
|
-
|
|
113
|
+
`/stop` 只支持精确写法,不支持 `/stop@bot`、`/stop extra` 等变体。
|
|
164
114
|
|
|
165
|
-
|
|
166
|
-
🦞 Bncr command usage
|
|
167
|
-
|
|
168
|
-
📌 Bncr builtins
|
|
169
|
-
• /bncr whoami
|
|
170
|
-
• /bncr status
|
|
171
|
-
• /bncr new
|
|
172
|
-
• /bncr reset
|
|
173
|
-
• /bncr verbose on|off|full
|
|
174
|
-
|
|
175
|
-
📋 Conversation history
|
|
176
|
-
• /bncr history-help
|
|
177
|
-
• /bncr history-limit [<number>|clear] [<SceneId>]
|
|
178
|
-
• /bncr history-force on|off|clear [<SceneId>]
|
|
179
|
-
|
|
180
|
-
🌐 Remote media
|
|
181
|
-
• /bncr download-media on|off|clear|default on|off [<SceneId>]
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
群聊非管理员:
|
|
115
|
+
### 场景管理
|
|
185
116
|
|
|
186
117
|
```text
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
118
|
+
/bncr allow [<SceneId>]
|
|
119
|
+
/bncr deny [<SceneId>]
|
|
120
|
+
/bncr bind <agentId> [<SceneId>]
|
|
121
|
+
/bncr revoke [<SceneId>]
|
|
122
|
+
/bncr list pending [filters...]
|
|
123
|
+
/bncr list scenes [filters...]
|
|
124
|
+
/bncr mode help
|
|
125
|
+
/bncr mode <admin|mention|hybrid|all|clear> [<SceneId>]
|
|
192
126
|
```
|
|
193
127
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
## 5. 架构定位
|
|
197
|
-
|
|
198
|
-
bncr 当前采用两层模型:
|
|
199
|
-
|
|
200
|
-
1. **WS 承载层**
|
|
201
|
-
- Bncr 客户端通过 WebSocket 接入 OpenClaw 网关
|
|
202
|
-
- 负责连接、推送、ACK、文件分块等 transport 能力
|
|
203
|
-
|
|
204
|
-
2. **OpenClaw 频道插件层**
|
|
205
|
-
- 在 OpenClaw 内部按正式 `channel plugin` 建模
|
|
206
|
-
- 负责入站解析、消息分发、出站适配、状态与治理
|
|
207
|
-
|
|
208
|
-
出站可靠投递的边界:bncr 后面仍有自己的服务框架和 outbox / ACK / retry / deadLetter 体系。对 OpenClaw 宿主来说,消息成功交给 bncr 插件并进入 bncr 自管 outbox,即表示频道 handoff 完成;这不等价于客户端 ACK 或目标平台最终送达。后续可靠投递由 bncr 自身负责。
|
|
209
|
-
|
|
210
|
-
当前已注册生产 `channel.message` 作为 bncr 的频道专用 handoff adapter:`text` / `media` / `payload` 会转换为 bncr outbox entry。原有通用 `message.send` / `channel.actions.send` 发送能力继续保留;`channel.message` 是频道专用入口,不替代通用发送入口。该 adapter 仍不启用 `durableFinal`;进入 outbox 后的客户端 ACK、目标平台送达、retry、deadLetter 继续由 bncr 服务框架负责。
|
|
211
|
-
|
|
212
|
-
当前代码结构:
|
|
128
|
+
### 会话历史
|
|
213
129
|
|
|
214
130
|
```text
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
messaging/
|
|
131
|
+
/bncr history-help
|
|
132
|
+
/bncr history-limit [<number>|clear] [<SceneId>]
|
|
133
|
+
/bncr history-force on|off|clear [<SceneId>]
|
|
219
134
|
```
|
|
220
135
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
## 6. 配置项总览
|
|
224
|
-
|
|
225
|
-
当前主要配置字段:
|
|
226
|
-
|
|
227
|
-
- `enabled`
|
|
228
|
-
- `dmPolicy`
|
|
229
|
-
- `groupPolicy`
|
|
230
|
-
- `allowFrom`
|
|
231
|
-
- `groupAllowFrom`
|
|
232
|
-
- `outboundRequireAck`
|
|
233
|
-
- `requireMention`
|
|
234
|
-
- `accounts`
|
|
235
|
-
|
|
236
|
-
补充:
|
|
136
|
+
会话历史统一累计用户消息和 Bot 回复,默认窗口为 50 条。达到上限后会在后续消息到达时整理并发送历史上下文。
|
|
237
137
|
|
|
238
|
-
|
|
239
|
-
- `outboundRequireAck` 是当前**单账号场景**使用的顶层字段:`channels.bncr.outboundRequireAck`
|
|
240
|
-
- `outboundRequireAck=true` 时,文本外发会等待 `bncr.ack` 再出队;关闭后不再强制等待文本 ACK,超时类错误会显示为 `push-delivery-unconfirmed`
|
|
241
|
-
- `requireMention` 当前仍是保留字段
|
|
242
|
-
|
|
243
|
-
---
|
|
244
|
-
|
|
245
|
-
## 7. 媒体发送(OpenClaw 2026.5.18 验证适用)
|
|
246
|
-
|
|
247
|
-
当前有两种常见媒体发送方式,它们都属于 OpenClaw 标准能力,但**不是同一条实现链路**。
|
|
248
|
-
|
|
249
|
-
### 方式 A:Agent 回复中的 `MEDIA:<path>`
|
|
250
|
-
|
|
251
|
-
适用场景:
|
|
252
|
-
|
|
253
|
-
- agent 在当前会话中直接回附件
|
|
254
|
-
- 由宿主 reply-media / outbound attachment 链统一处理
|
|
255
|
-
|
|
256
|
-
示例:
|
|
138
|
+
### 远程媒体
|
|
257
139
|
|
|
258
140
|
```text
|
|
259
|
-
|
|
141
|
+
/bncr download-media on|off|clear|default on|off [<SceneId>]
|
|
260
142
|
```
|
|
261
143
|
|
|
262
|
-
|
|
144
|
+
## 权限规则
|
|
263
145
|
|
|
264
|
-
|
|
265
|
-
- 本地文件是否允许发送,取决于宿主侧的路径准入与 MIME / 类型白名单
|
|
266
|
-
- 在 `2026.5.18` 口径下,`MEDIA:` 是否成功,**不能直接等价**为 bncr 插件自身的 file-transfer 是否成功
|
|
146
|
+
管理员可以使用全部 Bncr 命令。管理员发送的裸命令优先交给 OpenClaw 原生命令处理,未处理时才允许交给 Agent;`/bncr` 命令由 Bncr 处理。
|
|
267
147
|
|
|
268
|
-
|
|
148
|
+
非管理员的权限按会话类型区分:
|
|
269
149
|
|
|
270
|
-
|
|
150
|
+
- 私聊允许正常对话;`/whoami`、`/status`、`/new`、`/reset`、`/stop`、`/model`、`/verbose` 等受控命令按对应规则执行,不会以提升后的身份转交 Agent。
|
|
151
|
+
- 群聊受当前场景模式控制。未授权场景不会进入正常处理流程。
|
|
152
|
+
- `/bncr` 命令始终由 Bncr 识别;未知或不可用的 Bncr 命令会直接提示,不会转交 Agent。
|
|
153
|
+
- `/bncr help` 会根据当前会话类型和权限,仅展示当前可用的命令。
|
|
154
|
+
- 私聊非管理员使用 `history-*` 或 `download-media` 时,只能操作当前私聊会话,不能通过参数修改其他会话。
|
|
271
155
|
|
|
272
|
-
|
|
273
|
-
- 需要验证 OpenClaw 动作发送接口到 bncr channel 的下行链路
|
|
156
|
+
## 群聊模式
|
|
274
157
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
"accountId": "Primary",
|
|
282
|
-
"idempotencyKey": "bncr-media-demo-1",
|
|
283
|
-
"params": {
|
|
284
|
-
"to": "Bncr:tgBot:-1001:10001",
|
|
285
|
-
"caption": "图片发送测试",
|
|
286
|
-
"path": "/root/.openclaw/workspace/tmp/demo.png"
|
|
287
|
-
}
|
|
288
|
-
}'
|
|
158
|
+
```text
|
|
159
|
+
/bncr mode admin
|
|
160
|
+
/bncr mode mention
|
|
161
|
+
/bncr mode hybrid
|
|
162
|
+
/bncr mode all
|
|
163
|
+
/bncr mode clear
|
|
289
164
|
```
|
|
290
165
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
以下口径已在 OpenClaw `2026.5.18` 上完成验证,当前建议把媒体问题拆成两类看:
|
|
300
|
-
|
|
301
|
-
1. `MEDIA:<path>` 失败:优先检查宿主 reply-media / MIME 白名单 / 本地路径准入
|
|
302
|
-
2. `message.action` 失败:优先检查动作 envelope、目标 `to`、bncr 出站 push/ack 与 file-transfer 日志
|
|
303
|
-
|
|
304
|
-
后续如果在其他 OpenClaw 版本上完成验证,应继续在本节追加对应版本的验证过程与结论,不直接外推复用 `2026.5.18` 的验证口径。
|
|
305
|
-
|
|
306
|
-
### 2026.6.1 验证说明
|
|
307
|
-
|
|
308
|
-
以下口径已在 OpenClaw `2026.6.1` 与 bncr `0.3.2` 上完成基础验证:
|
|
309
|
-
|
|
310
|
-
1. 普通文本入站与 assistant 文本回复正常。
|
|
311
|
-
2. Agent 回复中的图片附件可通过 `MEDIA:<path>` 投递。
|
|
312
|
-
3. Agent 回复中的 `ogg(opus)` voice 附件可通过 `MEDIA:<path>` 搭配 voice 发送提示投递。
|
|
313
|
-
4. 入站 prompt 中只出现 OpenClaw 官方 `Conversation info` / `Sender` untrusted metadata,未重复注入 bncr 自定义 context block。
|
|
166
|
+
| 模式 | 说明 |
|
|
167
|
+
| --- | --- |
|
|
168
|
+
| `admin` | 仅管理员消息触发 |
|
|
169
|
+
| `mention` | 需要明确提及 Bot |
|
|
170
|
+
| `hybrid` | 按管理员或提及条件处理 |
|
|
171
|
+
| `all` | 处理群内符合接入条件的消息 |
|
|
172
|
+
| `clear` | 清除当前场景的自定义模式 |
|
|
314
173
|
|
|
315
|
-
|
|
174
|
+
新群聊默认需要管理员授权。管理员可以使用 `/bncr allow`、`/bncr deny`、`/bncr bind` 和 `/bncr revoke` 管理场景。
|
|
316
175
|
|
|
317
|
-
|
|
318
|
-
- `message.action` / `send` 仍应作为显式目标发送链单独验证,特别是跨会话、跨账号、文件传输 ACK 与 outbox 重试场景。
|
|
319
|
-
|
|
320
|
-
---
|
|
321
|
-
|
|
322
|
-
## 8. 状态与诊断
|
|
323
|
-
|
|
324
|
-
常用检查:
|
|
176
|
+
## 检查状态
|
|
325
177
|
|
|
326
178
|
```bash
|
|
327
179
|
openclaw gateway status
|
|
328
|
-
openclaw health
|
|
180
|
+
openclaw gateway health
|
|
181
|
+
openclaw bncr --help
|
|
329
182
|
```
|
|
330
183
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
- `linked`
|
|
334
|
-
- `pending`
|
|
335
|
-
- `deadLetter`
|
|
336
|
-
- diagnostics / probe / status 摘要
|
|
337
|
-
- diagnostics 里的 `runtimeFlags.outboundRequireAck`
|
|
338
|
-
- diagnostics 里的 `runtimeFlags.ackPolicySource`
|
|
339
|
-
- diagnostics 里的 `waiters.messageAck` / `waiters.fileAck`
|
|
340
|
-
|
|
341
|
-
---
|
|
342
|
-
|
|
343
|
-
## 9. 常见安装/加载问题
|
|
184
|
+
如需查看 Bncr 运行状态,可使用 `/bncr status`。如需排查连接、ACK、队列或媒体问题,再开启 `channels.bncr.debug.verbose` 后重启网关。
|
|
344
185
|
|
|
345
|
-
|
|
186
|
+
## 目标地址
|
|
346
187
|
|
|
347
|
-
|
|
188
|
+
发送到指定会话时使用以下形式:
|
|
348
189
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
190
|
+
```text
|
|
191
|
+
Bncr:<platform>:0:<userId>
|
|
192
|
+
Bncr:<platform>:<groupId>:0
|
|
193
|
+
```
|
|
352
194
|
|
|
353
|
-
|
|
195
|
+
示例:
|
|
354
196
|
|
|
355
|
-
```
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
openclaw gateway restart
|
|
359
|
-
openclaw plugins inspect bncr
|
|
197
|
+
```text
|
|
198
|
+
Bncr:tgBot:0:10001
|
|
199
|
+
Bncr:tgBot:-1001234567890:0
|
|
360
200
|
```
|
|
361
201
|
|
|
362
|
-
|
|
202
|
+
私聊目标使用用户 ID,群聊目标使用群 ID。多账号场景同时指定 `accountId`,避免不同账号之间串用会话或连接。
|
|
363
203
|
|
|
364
|
-
|
|
365
|
-
which openclaw
|
|
366
|
-
npm root -g
|
|
367
|
-
```
|
|
204
|
+
## 常见问题
|
|
368
205
|
|
|
369
|
-
|
|
206
|
+
### 客户端无法连接
|
|
370
207
|
|
|
371
|
-
|
|
208
|
+
确认 gateway token、网关地址、端口和 SSL 配置正确,并执行:
|
|
372
209
|
|
|
373
210
|
```bash
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
npm test
|
|
377
|
-
npm run typecheck
|
|
378
|
-
npm run selfcheck
|
|
379
|
-
npm run check-pack
|
|
380
|
-
npm pack
|
|
211
|
+
openclaw devices approve --latest
|
|
212
|
+
openclaw gateway restart
|
|
381
213
|
```
|
|
382
214
|
|
|
383
|
-
|
|
215
|
+
### 消息没有发出
|
|
384
216
|
|
|
385
|
-
|
|
386
|
-
- `npm test`:跑回归测试
|
|
387
|
-
- `npm run typecheck`:执行 `tsconfig.typecheck.json`,确保类型边界与 OpenClaw surface 对齐
|
|
388
|
-
- `npm run selfcheck`:检查插件骨架是否完整,并验证关键 OpenClaw SDK subpath 可解析
|
|
389
|
-
- `npm run check-pack`:执行 `npm pack --dry-run --json`,确认发布包包含关键入口与 OpenClaw adapter 文件
|
|
390
|
-
- `tests/integrity/source-manifest.test.mjs`:确保 `selfcheck` / `check-pack` 的源文件清单与当前 `src/**/*.ts` 一致,新增源文件不会漏进发布清单
|
|
391
|
-
- `npm run format:check`:执行 Biome `format` 只读检查(不带 `--write`),防止格式漂移混进发布门禁
|
|
392
|
-
- `npm pack`:确认当前版本可正常打包
|
|
393
|
-
- `npm run check-register-drift -- --duration-sec 300 --interval-sec 15`:静置采样 `bncr.diagnostics`,观察 `registerCount / apiGeneration / postWarmupRegisterCount` 是否在 warmup 后继续增长
|
|
217
|
+
检查网关、客户端和 Bncr 状态,确认客户端在线,并查看 ACK 与队列状态。
|
|
394
218
|
|
|
395
|
-
|
|
219
|
+
### 媒体发送失败
|
|
396
220
|
|
|
397
|
-
|
|
398
|
-
- `delta.apiGeneration`
|
|
399
|
-
- `delta.postWarmupRegisterCount`
|
|
400
|
-
- `historicalWarmupExternalDrift`
|
|
401
|
-
- `newDriftDuringWindow`
|
|
402
|
-
- `last.postWarmupRegisterCount`
|
|
403
|
-
- `last.unexpectedRegisterAfterWarmup`
|
|
404
|
-
- `driftDetected`
|
|
221
|
+
确认文件路径可被 OpenClaw 访问,文件类型受宿主和客户端支持,并检查客户端文件传输状态。
|
|
405
222
|
|
|
406
|
-
|
|
223
|
+
### 群聊没有响应
|
|
407
224
|
|
|
408
|
-
|
|
225
|
+
检查场景是否已授权、当前群聊模式以及消息是否满足触发条件:
|
|
409
226
|
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
- 测试通过
|
|
416
|
-
- 自检通过
|
|
417
|
-
- 可以正常打包
|
|
418
|
-
- 本地版本号与 npm / 发布目标一致(版本号修改应优先在工作仓完成,再同步到发布仓)
|
|
419
|
-
- 运行态 `linked / pending / deadLetter` 正常
|
|
420
|
-
|
|
421
|
-
---
|
|
422
|
-
|
|
423
|
-
如果你接触过旧版本,请以当前 README 和当前代码为准。
|
|
227
|
+
```text
|
|
228
|
+
/bncr status
|
|
229
|
+
/bncr list scenes
|
|
230
|
+
/bncr mode
|
|
231
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmoxmo/bncr",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"check": "biome check ."
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"openclaw": ">=2026.
|
|
41
|
+
"openclaw": ">=2026.8.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@biomejs/biome": "^2.4.16",
|
|
45
45
|
"@types/node": "^24.13.2",
|
|
46
46
|
"esbuild": "^0.28.0",
|
|
47
|
-
"openclaw": ">=2026.
|
|
47
|
+
"openclaw": ">=2026.8.1",
|
|
48
48
|
"typescript": "^6.0.3"
|
|
49
49
|
},
|
|
50
50
|
"openclaw": {
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
"./index.ts"
|
|
53
53
|
],
|
|
54
54
|
"compat": {
|
|
55
|
-
"pluginApi": ">=2026.
|
|
56
|
-
"minGatewayVersion": "2026.
|
|
55
|
+
"pluginApi": ">=2026.8.1",
|
|
56
|
+
"minGatewayVersion": "2026.8.1"
|
|
57
57
|
},
|
|
58
58
|
"build": {
|
|
59
|
-
"openclawVersion": "2026.
|
|
60
|
-
"pluginSdkVersion": "2026.
|
|
59
|
+
"openclawVersion": "2026.8.1",
|
|
60
|
+
"pluginSdkVersion": "2026.8.1"
|
|
61
61
|
},
|
|
62
62
|
"runtimeExtensions": [
|
|
63
63
|
"./dist/index.js"
|
package/scripts/check-pack.mjs
CHANGED
|
@@ -270,7 +270,11 @@ const channelMessageChecks = {
|
|
|
270
270
|
const channelMessageOk = Object.values(channelMessageChecks).every(Boolean);
|
|
271
271
|
|
|
272
272
|
const result = {
|
|
273
|
-
ok:
|
|
273
|
+
ok:
|
|
274
|
+
missing.length === 0 &&
|
|
275
|
+
pkg.peerDependencies?.openclaw === pkg.devDependencies?.openclaw &&
|
|
276
|
+
pkg.peerDependencies?.openclaw === `>=${pkg.openclaw?.compat?.minGatewayVersion}` &&
|
|
277
|
+
channelMessageOk,
|
|
274
278
|
package: pack?.id,
|
|
275
279
|
entryCount: pack?.entryCount,
|
|
276
280
|
missing,
|
package/scripts/selfcheck.mjs
CHANGED
|
@@ -234,7 +234,6 @@ const readNpmLatestVersion = (packageName) => {
|
|
|
234
234
|
};
|
|
235
235
|
|
|
236
236
|
const requiredOpenClawSdkSubpaths = [
|
|
237
|
-
'openclaw/plugin-sdk',
|
|
238
237
|
'openclaw/plugin-sdk/channel-outbound',
|
|
239
238
|
'openclaw/plugin-sdk/channel-ingress-runtime',
|
|
240
239
|
'openclaw/plugin-sdk/channel-message',
|
|
@@ -247,6 +246,8 @@ const requiredOpenClawSdkSubpaths = [
|
|
|
247
246
|
'openclaw/plugin-sdk/security-runtime',
|
|
248
247
|
'openclaw/plugin-sdk/status-helpers',
|
|
249
248
|
'openclaw/plugin-sdk/tool-send',
|
|
249
|
+
'openclaw/plugin-sdk/command-auth',
|
|
250
|
+
'openclaw/plugin-sdk/reply-history',
|
|
250
251
|
];
|
|
251
252
|
|
|
252
253
|
const resolveOpenClawSdkSubpaths = () => {
|
package/src/core/types.ts
CHANGED
|
@@ -137,7 +137,7 @@ export type BncrRecentOutboundEntry = {
|
|
|
137
137
|
export type BncrOutboundReplayMediaEntry = {
|
|
138
138
|
path?: string;
|
|
139
139
|
contentType?: string;
|
|
140
|
-
kind?: 'image' | 'video' | 'audio' | 'document' | 'unknown';
|
|
140
|
+
kind?: 'image' | 'video' | 'audio' | 'document' | 'sticker' | 'unknown';
|
|
141
141
|
messageId?: string;
|
|
142
142
|
};
|
|
143
143
|
|