@zhin.js/adapter-onebot11 1.1.15 → 1.1.16
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 +28 -0
- package/agents/onebot11/messages.js +12 -0
- package/agents/onebot11/messages.ts +12 -0
- package/agents/onebot11/skills/onebot11/tools/set_title/index.js +2 -1
- package/agents/onebot11/skills/onebot11/tools/set_title/index.ts +2 -1
- package/commands/onebot11/endpoint/definition.js +2 -2
- package/commands/onebot11/endpoint/definition.ts +2 -2
- package/package.json +16 -16
- package/schema.json +35 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @zhin.js/adapter-onebot11
|
|
2
2
|
|
|
3
|
+
## 1.1.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 53bc6a0: 适配器配置标签、端点命令和工具反馈支持中英文;复用当前操作语言,保持协议值、用户内容、身份、权限与发送链路不变。Sandbox 展示使用项目语言,QQ 绑定与交互状态保留完整会话身份。
|
|
8
|
+
- Updated dependencies [334e92d]
|
|
9
|
+
- Updated dependencies [f3b7c9f]
|
|
10
|
+
- Updated dependencies [658a5fb]
|
|
11
|
+
- Updated dependencies [144a17b]
|
|
12
|
+
- Updated dependencies [18296cf]
|
|
13
|
+
- Updated dependencies [08e64de]
|
|
14
|
+
- Updated dependencies [9cade30]
|
|
15
|
+
- Updated dependencies [53bc6a0]
|
|
16
|
+
- Updated dependencies [7595136]
|
|
17
|
+
- Updated dependencies [66b6404]
|
|
18
|
+
- Updated dependencies [adb4af2]
|
|
19
|
+
- Updated dependencies [69f9ef6]
|
|
20
|
+
- Updated dependencies [17d1301]
|
|
21
|
+
- @zhin.js/adapter@1.1.23
|
|
22
|
+
- @zhin.js/host-http@1.1.10
|
|
23
|
+
- @zhin.js/core@1.1.51
|
|
24
|
+
- @zhin.js/permission@1.1.9
|
|
25
|
+
- @zhin.js/tool@1.1.10
|
|
26
|
+
- @zhin.js/skill@1.1.10
|
|
27
|
+
- @zhin.js/im-contract@1.1.7
|
|
28
|
+
- @zhin.js/agent-feature@1.1.10
|
|
29
|
+
- @zhin.js/feature-kit@1.1.9
|
|
30
|
+
|
|
3
31
|
## 1.1.15
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { createMessages } from 'zhin.js/i18n';
|
|
3
|
+
export const messages = createMessages({
|
|
4
|
+
"setFailed": {
|
|
5
|
+
"zh-CN": "设置失败",
|
|
6
|
+
"en": "Update failed"
|
|
7
|
+
},
|
|
8
|
+
"titleChanged": {
|
|
9
|
+
"zh-CN": "已将 {p0} 的头衔设为 \"{p1}\"",
|
|
10
|
+
"en": "Title for {p0} set to \"{p1}\""
|
|
11
|
+
}
|
|
12
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createMessages } from 'zhin.js/i18n';
|
|
2
|
+
|
|
3
|
+
export const messages = createMessages({
|
|
4
|
+
"setFailed": {
|
|
5
|
+
"zh-CN": "设置失败",
|
|
6
|
+
"en": "Update failed"
|
|
7
|
+
},
|
|
8
|
+
"titleChanged": {
|
|
9
|
+
"zh-CN": "已将 {p0} 的头衔设为 \"{p1}\"",
|
|
10
|
+
"en": "Title for {p0} set to \"{p1}\""
|
|
11
|
+
}
|
|
12
|
+
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { messages as t } from "../../../../messages.js";
|
|
2
3
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
export default defineAgentTool({
|
|
@@ -21,6 +22,6 @@ export default defineAgentTool({
|
|
|
21
22
|
duration: -1,
|
|
22
23
|
});
|
|
23
24
|
const success = response.status === 'ok';
|
|
24
|
-
return { success, message: success ?
|
|
25
|
+
return { success, message: success ? t(context.locale, 'titleChanged', { p0: user_id, p1: title }) : t(context.locale, 'setFailed') };
|
|
25
26
|
},
|
|
26
27
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { messages as t } from "../../../../messages.js";
|
|
1
2
|
import { defineAgentTool } from '@zhin.js/tool';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
export default defineAgentTool<{ group_id: number; user_id: number; title: string }>({
|
|
@@ -20,6 +21,6 @@ export default defineAgentTool<{ group_id: number; user_id: number; title: strin
|
|
|
20
21
|
duration: -1,
|
|
21
22
|
});
|
|
22
23
|
const success = response.status === 'ok';
|
|
23
|
-
return { success, message: success ?
|
|
24
|
+
return { success, message: success ? t(context.locale, 'titleChanged', { p0: user_id, p1: title }) : t(context.locale, 'setFailed') };
|
|
24
25
|
},
|
|
25
26
|
});
|
|
@@ -10,8 +10,8 @@ export const onebot11EndpointCommands = createEndpointCommands({
|
|
|
10
10
|
adapterKey: 'onebot11',
|
|
11
11
|
adapterDisplayName: 'OneBot 11',
|
|
12
12
|
fields: [
|
|
13
|
-
{ key: 'url', description: 'OneBot 实现 WebSocket URL(connection: ws 必填)' },
|
|
14
|
-
{ key: 'path', description: 'reverse-wss 路径(connection: wss)' },
|
|
13
|
+
{ key: 'url', description: 'OneBot 实现 WebSocket URL(connection: ws 必填)', descriptionI18n: { en: "OneBot WebSocket URL (required for connection: ws)" } },
|
|
14
|
+
{ key: 'path', description: 'reverse-wss 路径(connection: wss)', descriptionI18n: { en: "Reverse WebSocket path (connection: wss)" } },
|
|
15
15
|
{ key: 'access_token', env: true, description: 'OneBot access token' },
|
|
16
16
|
],
|
|
17
17
|
running: (use) => use(onebot11RuntimeStateToken).endpoints.values(),
|
|
@@ -10,8 +10,8 @@ export const onebot11EndpointCommands = createEndpointCommands({
|
|
|
10
10
|
adapterKey: 'onebot11',
|
|
11
11
|
adapterDisplayName: 'OneBot 11',
|
|
12
12
|
fields: [
|
|
13
|
-
{ key: 'url', description: 'OneBot 实现 WebSocket URL(connection: ws 必填)' },
|
|
14
|
-
{ key: 'path', description: 'reverse-wss 路径(connection: wss)' },
|
|
13
|
+
{ key: 'url', description: 'OneBot 实现 WebSocket URL(connection: ws 必填)', descriptionI18n: { en: "OneBot WebSocket URL (required for connection: ws)" } },
|
|
14
|
+
{ key: 'path', description: 'reverse-wss 路径(connection: wss)', descriptionI18n: { en: "Reverse WebSocket path (connection: wss)" } },
|
|
15
15
|
{ key: 'access_token', env: true, description: 'OneBot access token' },
|
|
16
16
|
],
|
|
17
17
|
running: (use) => use(onebot11RuntimeStateToken).endpoints.values(),
|
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.16",
|
|
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.23",
|
|
48
|
+
"@zhin.js/agent-feature": "1.1.10",
|
|
49
|
+
"@zhin.js/core": "1.1.51",
|
|
50
|
+
"@zhin.js/feature-kit": "1.1.9",
|
|
51
|
+
"@zhin.js/host-http": "1.1.10",
|
|
52
|
+
"@zhin.js/im-contract": "1.1.7",
|
|
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.9",
|
|
55
|
+
"@zhin.js/skill": "1.1.10",
|
|
56
|
+
"@zhin.js/tool": "1.1.10"
|
|
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.10",
|
|
65
|
+
"zhin.js": "1.1.16"
|
|
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.23",
|
|
70
|
+
"@zhin.js/command": "^1.1.11",
|
|
71
|
+
"@zhin.js/core": "^1.1.51",
|
|
72
|
+
"zhin.js": "^1.1.16"
|
|
73
73
|
},
|
|
74
74
|
"peerDependenciesMeta": {
|
|
75
75
|
"@zhin.js/command": {
|
package/schema.json
CHANGED
|
@@ -25,7 +25,12 @@
|
|
|
25
25
|
"string",
|
|
26
26
|
"number"
|
|
27
27
|
],
|
|
28
|
-
"description": "框架 master(platform user id;AI/工具权限、endpoint 管理)。endpoints[i].master 可逐项覆盖"
|
|
28
|
+
"description": "框架 master(platform user id;AI/工具权限、endpoint 管理)。endpoints[i].master 可逐项覆盖",
|
|
29
|
+
"x-i18n": {
|
|
30
|
+
"en": {
|
|
31
|
+
"description": "Framework masters (platform user id; AI/tool permissions and endpoint management). endpoints[i].master can override this value."
|
|
32
|
+
}
|
|
33
|
+
}
|
|
29
34
|
},
|
|
30
35
|
"trusted": {
|
|
31
36
|
"type": "array",
|
|
@@ -36,7 +41,12 @@
|
|
|
36
41
|
],
|
|
37
42
|
"description": "Trusted platform user id"
|
|
38
43
|
},
|
|
39
|
-
"description": "框架 trusted 用户列表(弱于 master)。endpoints[i].trusted 可逐项追加"
|
|
44
|
+
"description": "框架 trusted 用户列表(弱于 master)。endpoints[i].trusted 可逐项追加",
|
|
45
|
+
"x-i18n": {
|
|
46
|
+
"en": {
|
|
47
|
+
"description": "Framework trusted users, below master authority. endpoints[i].trusted can add users."
|
|
48
|
+
}
|
|
49
|
+
}
|
|
40
50
|
},
|
|
41
51
|
"endpoints": {
|
|
42
52
|
"type": "array",
|
|
@@ -51,7 +61,12 @@
|
|
|
51
61
|
"string",
|
|
52
62
|
"number"
|
|
53
63
|
],
|
|
54
|
-
"description": "本 endpoint 的框架 master(platform user id);覆盖顶层 master"
|
|
64
|
+
"description": "本 endpoint 的框架 master(platform user id);覆盖顶层 master",
|
|
65
|
+
"x-i18n": {
|
|
66
|
+
"en": {
|
|
67
|
+
"description": "Framework masters for this endpoint (platform user id), overriding the top-level master list."
|
|
68
|
+
}
|
|
69
|
+
}
|
|
55
70
|
},
|
|
56
71
|
"trusted": {
|
|
57
72
|
"type": "array",
|
|
@@ -62,7 +77,12 @@
|
|
|
62
77
|
],
|
|
63
78
|
"description": "Trusted platform user id"
|
|
64
79
|
},
|
|
65
|
-
"description": "本 endpoint 的 trusted 列表"
|
|
80
|
+
"description": "本 endpoint 的 trusted 列表",
|
|
81
|
+
"x-i18n": {
|
|
82
|
+
"en": {
|
|
83
|
+
"description": "Trusted users for this endpoint."
|
|
84
|
+
}
|
|
85
|
+
}
|
|
66
86
|
},
|
|
67
87
|
"connection": {
|
|
68
88
|
"type": "string",
|
|
@@ -100,12 +120,22 @@
|
|
|
100
120
|
"required": [
|
|
101
121
|
"id"
|
|
102
122
|
]
|
|
123
|
+
},
|
|
124
|
+
"x-i18n": {
|
|
125
|
+
"en": {
|
|
126
|
+
"description": "Multiple accounts: mount multiple endpoints in one plugin instance. Each entry uses the top-level fields; id is required and other fields override defaults."
|
|
127
|
+
}
|
|
103
128
|
}
|
|
104
129
|
},
|
|
105
130
|
"commandPrefix": {
|
|
106
131
|
"type": "string",
|
|
107
132
|
"default": "",
|
|
108
|
-
"description": "命令前缀(默认 '' 无前缀,任意文本按命令匹配;如 '/' 要求 / 开头)。endpoints[i] 可逐项覆盖"
|
|
133
|
+
"description": "命令前缀(默认 '' 无前缀,任意文本按命令匹配;如 '/' 要求 / 开头)。endpoints[i] 可逐项覆盖",
|
|
134
|
+
"x-i18n": {
|
|
135
|
+
"en": {
|
|
136
|
+
"description": "Command prefix. The default empty string allows unprefixed commands; '/' requires a leading slash. Each endpoints[i] can override it."
|
|
137
|
+
}
|
|
138
|
+
}
|
|
109
139
|
}
|
|
110
140
|
},
|
|
111
141
|
"required": [
|