@zhin.js/adapter-onebot11 1.1.14 → 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 CHANGED
@@ -1,5 +1,56 @@
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
+
31
+ ## 1.1.15
32
+
33
+ ### Patch Changes
34
+
35
+ - 7d68df6: 精简 Agent 内置固定提示词与消息说明,保留工具、审批和结构化回复能力。适配器 Skill 按会话场景拆分,群/频道管理仅向对应场景披露;提示段与模型消息段支持场景声明,沿用当前回合权限和 generation 投影。
36
+ - Updated dependencies [f98025b]
37
+ - Updated dependencies [66ec1a5]
38
+ - Updated dependencies [7d68df6]
39
+ - Updated dependencies [bf0fa9f]
40
+ - Updated dependencies [3326db3]
41
+ - Updated dependencies [e91235e]
42
+ - Updated dependencies [6da2bad]
43
+ - Updated dependencies [3781f1c]
44
+ - @zhin.js/core@1.1.50
45
+ - @zhin.js/adapter@1.1.22
46
+ - @zhin.js/im-contract@1.1.6
47
+ - @zhin.js/tool@1.1.9
48
+ - @zhin.js/host-http@1.1.9
49
+ - @zhin.js/agent-feature@1.1.9
50
+ - @zhin.js/feature-kit@1.1.8
51
+ - @zhin.js/permission@1.1.8
52
+ - @zhin.js/skill@1.1.9
53
+
3
54
  ## 1.1.14
4
55
 
5
56
  ### 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,13 +1,21 @@
1
1
  ---
2
2
  name: onebot11
3
- platforms: [onebot11]
3
+ platforms:
4
+ - onebot11
4
5
  description: OneBot 11 消息通道与群专属头衔设置能力。
5
- keywords: [onebot11, qq, title, 头衔]
6
- tags: [adapter, messaging]
6
+ keywords:
7
+ - onebot11
8
+ - qq
9
+ - title
10
+ - 头衔
11
+ tags:
12
+ - adapter
13
+ - messaging
7
14
  tools:
8
15
  - set_title
16
+ scopes:
17
+ - group
9
18
  ---
10
-
11
19
  # OneBot 11
12
20
 
13
21
  `set_title` 用于设置群成员专属头衔。执行前确认群、目标用户和头衔文本,并遵守 Tool 自身审批与平台权限。
@@ -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({
@@ -9,6 +10,7 @@ export default defineAgentTool({
9
10
  title: z.string().describe('头衔文字'),
10
11
  }),
11
12
  adapter: 'onebot11',
13
+ scopes: ["group"],
12
14
  tags: ['onebot11'],
13
15
  permissions: ['platform(onebot11,scene_owner)'],
14
16
  async execute({ group_id, user_id, title }, context) {
@@ -20,6 +22,6 @@ export default defineAgentTool({
20
22
  duration: -1,
21
23
  });
22
24
  const success = response.status === 'ok';
23
- return { success, message: success ? `已将 ${user_id} 的头衔设为 "${title}"` : '设置失败' };
25
+ return { success, message: success ? t(context.locale, 'titleChanged', { p0: user_id, p1: title }) : t(context.locale, 'setFailed') };
24
26
  },
25
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 }>({
@@ -8,6 +9,7 @@ export default defineAgentTool<{ group_id: number; user_id: number; title: strin
8
9
  title: z.string().describe('头衔文字'),
9
10
  }),
10
11
  adapter: 'onebot11',
12
+ scopes: ["group"],
11
13
  tags: ['onebot11'],
12
14
  permissions: ['platform(onebot11,scene_owner)'],
13
15
  async execute({ group_id, user_id, title }: { group_id: number; user_id: number; title: string }, context) {
@@ -19,6 +21,6 @@ export default defineAgentTool<{ group_id: number; user_id: number; title: strin
19
21
  duration: -1,
20
22
  });
21
23
  const success = response.status === 'ok';
22
- return { success, message: success ? `已将 ${user_id} 的头衔设为 "${title}"` : '设置失败' };
24
+ return { success, message: success ? t(context.locale, 'titleChanged', { p0: user_id, p1: title }) : t(context.locale, 'setFailed') };
23
25
  },
24
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.14",
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.21",
48
- "@zhin.js/agent-feature": "1.1.8",
49
- "@zhin.js/core": "1.1.49",
50
- "@zhin.js/feature-kit": "1.1.7",
51
- "@zhin.js/host-http": "1.1.8",
52
- "@zhin.js/im-contract": "1.1.5",
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.7",
55
- "@zhin.js/skill": "1.1.8",
56
- "@zhin.js/tool": "1.1.8"
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.8",
65
- "zhin.js": "1.1.14"
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.21",
70
- "@zhin.js/command": "^1.1.9",
71
- "@zhin.js/core": "^1.1.49",
72
- "zhin.js": "^1.1.14"
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": [