@zhin.js/adapter-onebot11 1.1.10 → 1.1.12
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 +50 -0
- package/README.md +12 -10
- package/lib/protocol.js +1 -1
- package/package.json +16 -16
- package/src/protocol.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,55 @@
|
|
|
1
1
|
# @zhin.js/adapter-onebot11
|
|
2
2
|
|
|
3
|
+
## 1.1.12
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fbfefb7: Share segments accept `data.platform` (the song's music service: qq, netease, kugou, kuwo, migu). icqq maps it to the matching music app id when `config.appid` is absent and offers it to the Agent; adapters that cannot render share app metadata reject it like `audio` and `config`.
|
|
8
|
+
- Updated dependencies [1a11207]
|
|
9
|
+
- Updated dependencies [9943df6]
|
|
10
|
+
- Updated dependencies [5be09ae]
|
|
11
|
+
- Updated dependencies [a3ab153]
|
|
12
|
+
- Updated dependencies [e8f7309]
|
|
13
|
+
- Updated dependencies [5afc18f]
|
|
14
|
+
- Updated dependencies [d3563d9]
|
|
15
|
+
- Updated dependencies [c618eb7]
|
|
16
|
+
- Updated dependencies [fbfefb7]
|
|
17
|
+
- @zhin.js/tool@1.1.8
|
|
18
|
+
- @zhin.js/core@1.1.47
|
|
19
|
+
- @zhin.js/adapter@1.1.21
|
|
20
|
+
- @zhin.js/feature-kit@1.1.7
|
|
21
|
+
- @zhin.js/im-contract@1.1.5
|
|
22
|
+
- @zhin.js/agent-feature@1.1.8
|
|
23
|
+
- @zhin.js/skill@1.1.8
|
|
24
|
+
- @zhin.js/host-http@1.1.8
|
|
25
|
+
|
|
26
|
+
## 1.1.11
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- 9816c18: 将应用插件装配改为 configVersion: 2:主配置 plugins 映射实例名到包,disable_plugins 控制启停,业务配置使用顶层同名块。package.json 继续保留 features、entry、engine 等包契约,并支持静态 displayName/icon。
|
|
31
|
+
|
|
32
|
+
这是配置格式的破坏性更新:旧配置不能继续运行,请先停止 Bot,运行 `zhin migrate instances` 预览,再使用 `--apply` 转换;提供备份与中断继续/回滚,无法无损转换的嵌套、optional 和别名碰撞需人工迁移。Runtime、Console、CLI 与创建向导统一使用新声明。
|
|
33
|
+
|
|
34
|
+
保留框架顶层 `menuKeyword` / `menuStyle`,通过当前 generation 的 Root 配置视图供 Command Feature 消费;严格校验和配置修改不会丢失菜单设置,子实例配置保持隔离。
|
|
35
|
+
|
|
36
|
+
- Updated dependencies [c407bd2]
|
|
37
|
+
- Updated dependencies [064b06d]
|
|
38
|
+
- Updated dependencies [2b4d6dc]
|
|
39
|
+
- Updated dependencies [a50fc8a]
|
|
40
|
+
- Updated dependencies [b58548a]
|
|
41
|
+
- Updated dependencies [e914a93]
|
|
42
|
+
- Updated dependencies [e914a93]
|
|
43
|
+
- Updated dependencies [064b06d]
|
|
44
|
+
- @zhin.js/core@1.1.46
|
|
45
|
+
- @zhin.js/feature-kit@1.1.6
|
|
46
|
+
- @zhin.js/host-http@1.1.7
|
|
47
|
+
- @zhin.js/permission@1.1.7
|
|
48
|
+
- @zhin.js/adapter@1.1.20
|
|
49
|
+
- @zhin.js/agent-feature@1.1.7
|
|
50
|
+
- @zhin.js/skill@1.1.7
|
|
51
|
+
- @zhin.js/tool@1.1.7
|
|
52
|
+
|
|
3
53
|
## 1.1.10
|
|
4
54
|
|
|
5
55
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ pnpm add @zhin.js/adapter-onebot11
|
|
|
21
21
|
- `@zhin.js/adapter` — 约定式 `adapters/onebot11/index.ts`(`defineAdapter`)
|
|
22
22
|
- `@zhin.js/core` — `Endpoint.emit(...)` 入站、`outboundMessageToken` 出站
|
|
23
23
|
- `zhin.js` — `plugin.ts`(`definePlugin`)
|
|
24
|
-
- 配置经插件 `schema.json`
|
|
24
|
+
- 配置经插件 `schema.json` 落到顶层 `<instanceKey>`
|
|
25
25
|
|
|
26
26
|
`AdapterIndex` 会把实例默认值与 `endpoints[]` 的逐项覆盖合并;协议层只接收一个已经展开的 endpoint 配置,不再读取嵌套 endpoint、旧 `type: ws_reverse` 别名或进程环境。
|
|
27
27
|
|
|
@@ -41,19 +41,21 @@ pnpm add @zhin.js/adapter-onebot11
|
|
|
41
41
|
## 最小配置
|
|
42
42
|
|
|
43
43
|
```yaml
|
|
44
|
+
configVersion: 2
|
|
44
45
|
# zhin.config.yml(Plugin Runtime)
|
|
45
46
|
plugins:
|
|
46
|
-
onebot11:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
onebot11: "@zhin.js/adapter-onebot11"
|
|
48
|
+
onebot11:
|
|
49
|
+
connection: ws
|
|
50
|
+
reconnect_interval: 5000
|
|
51
|
+
heartbeat_interval: 30000
|
|
52
|
+
endpoints:
|
|
53
|
+
- id: ob11-bot
|
|
54
|
+
url: "ws://127.0.0.1:6700"
|
|
55
|
+
access_token: "${ONEBOT11_ACCESS_TOKEN}"
|
|
54
56
|
```
|
|
55
57
|
|
|
56
|
-
|
|
58
|
+
主配置 `plugins` 映射需引用 `@zhin.js/adapter-onebot11`(`instanceKey: onebot11`)。
|
|
57
59
|
|
|
58
60
|
## 连接方式
|
|
59
61
|
|
package/lib/protocol.js
CHANGED
|
@@ -228,7 +228,7 @@ function canonicalToOneBotSegment(segment) {
|
|
|
228
228
|
case 'keyboard':
|
|
229
229
|
throw new EndpointDeliveryError('unsupported_operation', `OneBot11 standard has no ${segment.type} message segment`, 'not_sent');
|
|
230
230
|
case 'share': {
|
|
231
|
-
if (['audio', 'artist', 'duration', 'config'].some(key => data[key] !== undefined)) {
|
|
231
|
+
if (['audio', 'artist', 'duration', 'platform', 'config'].some(key => data[key] !== undefined)) {
|
|
232
232
|
throw new EndpointDeliveryError('unsupported_operation', 'onebot11 rich share metadata is not implemented', 'not_sent');
|
|
233
233
|
}
|
|
234
234
|
if (typeof data.url !== 'string' || !/^https?:\/\//.test(data.url) || typeof data.title !== 'string' || !data.title) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-onebot11",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.12",
|
|
4
4
|
"description": "Zhin.js OneBot 11 adapter for Plugin Runtime (WebSocket client)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -44,16 +44,16 @@
|
|
|
44
44
|
"@imhelper/onebot-v11": "1.0.7",
|
|
45
45
|
"imhelper": "1.0.7",
|
|
46
46
|
"ws": "^8.21.1",
|
|
47
|
-
"@zhin.js/adapter": "1.1.
|
|
48
|
-
"@zhin.js/agent-feature": "1.1.
|
|
49
|
-
"@zhin.js/core": "1.1.
|
|
50
|
-
"@zhin.js/feature-kit": "1.1.
|
|
51
|
-
"@zhin.js/host-http": "1.1.
|
|
52
|
-
"@zhin.js/im-contract": "1.1.
|
|
47
|
+
"@zhin.js/adapter": "1.1.21",
|
|
48
|
+
"@zhin.js/agent-feature": "1.1.8",
|
|
49
|
+
"@zhin.js/core": "1.1.47",
|
|
50
|
+
"@zhin.js/feature-kit": "1.1.7",
|
|
51
|
+
"@zhin.js/host-http": "1.1.8",
|
|
52
|
+
"@zhin.js/im-contract": "1.1.5",
|
|
53
53
|
"@zhin.js/logger": "1.1.2",
|
|
54
|
-
"@zhin.js/permission": "1.1.
|
|
55
|
-
"@zhin.js/skill": "1.1.
|
|
56
|
-
"@zhin.js/tool": "1.1.
|
|
54
|
+
"@zhin.js/permission": "1.1.7",
|
|
55
|
+
"@zhin.js/skill": "1.1.8",
|
|
56
|
+
"@zhin.js/tool": "1.1.8"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/node": "^26.1.2",
|
|
@@ -61,15 +61,15 @@
|
|
|
61
61
|
"typescript": "^6.0.3",
|
|
62
62
|
"vitest": "^4.1.10",
|
|
63
63
|
"zod": "^4.4.3",
|
|
64
|
-
"@zhin.js/host-http": "1.1.
|
|
65
|
-
"zhin.js": "1.1.
|
|
64
|
+
"@zhin.js/host-http": "1.1.8",
|
|
65
|
+
"zhin.js": "1.1.12"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"zod": "^4.0.0",
|
|
69
|
-
"@zhin.js/adapter": "^1.1.
|
|
70
|
-
"@zhin.js/command": "^1.1.
|
|
71
|
-
"@zhin.js/core": "^1.1.
|
|
72
|
-
"zhin.js": "^1.1.
|
|
69
|
+
"@zhin.js/adapter": "^1.1.21",
|
|
70
|
+
"@zhin.js/command": "^1.1.9",
|
|
71
|
+
"@zhin.js/core": "^1.1.47",
|
|
72
|
+
"zhin.js": "^1.1.12"
|
|
73
73
|
},
|
|
74
74
|
"peerDependenciesMeta": {
|
|
75
75
|
"@zhin.js/command": {
|
package/src/protocol.ts
CHANGED
|
@@ -344,7 +344,7 @@ function canonicalToOneBotSegment(segment: OneBot11WireSegment): OneBot11Segment
|
|
|
344
344
|
case 'keyboard':
|
|
345
345
|
throw new EndpointDeliveryError('unsupported_operation', `OneBot11 standard has no ${segment.type} message segment`, 'not_sent');
|
|
346
346
|
case 'share': {
|
|
347
|
-
if (['audio', 'artist', 'duration', 'config'].some(key => data[key] !== undefined)) {
|
|
347
|
+
if (['audio', 'artist', 'duration', 'platform', 'config'].some(key => data[key] !== undefined)) {
|
|
348
348
|
throw new EndpointDeliveryError('unsupported_operation', 'onebot11 rich share metadata is not implemented', 'not_sent');
|
|
349
349
|
}
|
|
350
350
|
if (typeof data.url !== 'string' || !/^https?:\/\//.test(data.url) || typeof data.title !== 'string' || !data.title) {
|