@zhin.js/adapter-icqq 1.1.29 → 1.1.30

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,43 @@
1
1
  # @zhin.js/adapter-icqq
2
2
 
3
+ ## 1.1.30
4
+
5
+ ### Patch Changes
6
+
7
+ - e6d7cc1: 配置表单与插件显示名的多语言约定(#1250):Schema 节点沿用已有的 `x-i18n`(`Schema#i18n()`),按 `zh-CN` / `en` 分别声明字段的 `title`、`description` 与 `enumLabels`;插件 `metadata`(`definePlugin` 或 `package.json#zhin.metadata`)新增可选的 `displayNameI18n: { 'zh-CN'?, en? }`,与 `displayName` 一样只能在一处声明,清单只接受这两个键且值必须是非空字符串。Console 插件列表(`/api/plugins`、插件详情)和 `feature.list` / `feature.matrix` 原样带出 `displayNameI18n`,由 Console 按界面语言选择(当前语言 → `en` → `displayName` → 实例 key)。没有这些字段时行为不变。
8
+
9
+ 官方插件补齐中英文配置字段标题与说明(group-suite、repeater、roulette、answers、calendar、ledger、reminder、rss、earthquake、bilibili、content-moderation、lottery、nettools、60s、process-monitor、activity-feedback)以及全部官方插件的中英文显示名。
10
+
11
+ - 7cd299e: ICQQ `system.*` 事件按语义分级记录(#1250):上线(`system.online`)与等待人工处理的登录验证(二维码、设备锁、滑块、身份验证)记为 INFO,只有登录失败(`system.login.error`)与掉线(`system.offline*`)记为 WARN,正常登录不再进入「历史警告」。
12
+ - 70ddaf4: 插件市场元数据(#1250 marketplace-metadata):`package.json#zhin.metadata` 新增可选的 `descriptionI18n: { 'zh-CN'?, en? }`(本地化描述)与 `category`(`adapter`、`ai`、`admin`、`community`、`entertainment`、`game`、`information`、`moderation`、`service`、`utility` 之一),校验方式与 `displayNameI18n` 相同:只接受这两个语言键、值为非空字符串、分类必须在枚举内。这两个字段只能写在清单里,插件市场才能从发布的 `package.json` 读到。`@zhin.js/plugin-runtime` 导出 `PLUGIN_CATEGORIES`、`PLUGIN_CATEGORY_LABELS`、`informativeKeywords`、`packageAuthorName`、`readPluginMarketplaceMetadata` 等读取工具。
13
+
14
+ 市场读取侧:`/pub/marketplace/search` 带出 `displayNameI18n` / `descriptionI18n`,分类读声明的 `category`(旧索引的 `util` 等按别名映射),可选 `locale=zh-CN|en` 按语言解析显示名与描述,并按两种语言的名称与描述搜索;`/pub/marketplace/detail/*` 带出发布清单的显示名、描述翻译与分类。作者一律取 `author`(没有时取 `maintainers`),不再显示发布账号——此前 `plugins.json` 生成脚本优先读 `_npmUser`,CI 可信发布的包因此都显示为「GitHub Actions」。keywords 去掉 `zhin`、`zhin.js`、`bot` 等通用词后展示与参与搜索。`zhin search` / `zhin info` 同样显示中文描述、分类和维护者,`zhin info` 不再读不存在的 `zhin.displayName` / `zhin.category`。
15
+
16
+ 官方插件与适配器:显示名移到 `package.json#zhin.metadata`,补齐中英文描述、分类、3–6 个有信息量的 keywords,author 统一为 `{ name: "lc-cn", url: "https://github.com/zhinjs/zhin" }`(不再发布邮箱);npm `description` 与英文描述一致。
17
+
18
+ - Updated dependencies [7cd299e]
19
+ - Updated dependencies [7cd299e]
20
+ - Updated dependencies [9026329]
21
+ - Updated dependencies [ccab2c1]
22
+ - Updated dependencies [c6b5563]
23
+ - Updated dependencies [f1a9745]
24
+ - Updated dependencies [e0b4e51]
25
+ - Updated dependencies [cca4427]
26
+ - Updated dependencies [b08cff2]
27
+ - Updated dependencies [704c7a4]
28
+ - Updated dependencies [07bd3dc]
29
+ - @zhin.js/core@1.8.0
30
+ - @zhin.js/adapter@1.3.0
31
+ - @zhin.js/im-contract@1.2.0
32
+ - @zhin.js/console-contract@1.2.0
33
+ - @zhin.js/adapter-onebot-events@0.0.9
34
+ - @zhin.js/page@1.1.20
35
+ - @zhin.js/agent-feature@1.1.19
36
+ - @zhin.js/feature-kit@1.1.18
37
+ - @zhin.js/permission@1.2.2
38
+ - @zhin.js/skill@1.1.19
39
+ - @zhin.js/tool@1.1.21
40
+
3
41
  ## 1.1.29
4
42
 
5
43
  ### Patch Changes
package/lib/endpoint.d.ts CHANGED
@@ -14,6 +14,12 @@ export interface IcqqEndpointOptions {
14
14
  /** Out-of-band outage notifier; absent in tests/hosts without outbound. */
15
15
  readonly notifier?: AdapterOutageNotifier;
16
16
  }
17
+ /**
18
+ * Log level of an ICQQ `system.*` event by meaning: coming online and login challenges waiting for
19
+ * the person (QR code, device lock, slider, identity check) are normal progress (`info`); only
20
+ * failures (login errors, going offline) are `warn`, so a routine login stays out of the warnings.
21
+ */
22
+ export declare function icqqSystemEventLogLevel(type: string): 'info' | 'warn';
17
23
  export declare class IcqqEndpoint extends ManagedIcqqClient implements Endpoint {
18
24
  #private;
19
25
  readonly [endpointSpec]: EndpointSpecification;
package/lib/endpoint.js CHANGED
@@ -39,6 +39,14 @@ const BOUND_EVENTS = [
39
39
  'system.login.error',
40
40
  'system.login.auth',
41
41
  ];
42
+ /**
43
+ * Log level of an ICQQ `system.*` event by meaning: coming online and login challenges waiting for
44
+ * the person (QR code, device lock, slider, identity check) are normal progress (`info`); only
45
+ * failures (login errors, going offline) are `warn`, so a routine login stays out of the warnings.
46
+ */
47
+ export function icqqSystemEventLogLevel(type) {
48
+ return type === 'online' || type.startsWith('login.') && type !== 'login.error' ? 'info' : 'warn';
49
+ }
42
50
  export class IcqqEndpoint extends ManagedIcqqClient {
43
51
  [endpointSpec];
44
52
  #logger;
@@ -969,7 +977,7 @@ export class IcqqEndpoint extends ManagedIcqqClient {
969
977
  #logSystemEvent(type, event, safe) {
970
978
  const payload = safe === undefined ? serializeIcqqEvent(event) : safe;
971
979
  const line = payload;
972
- this.#logger.warn(formatCompact({
980
+ this.#logger[icqqSystemEventLogLevel(type)](formatCompact({
973
981
  op: `system.${type}`,
974
982
  endpoint: this.endpointName,
975
983
  ...(line ? { event: JSON.stringify(line) } : {}),
package/package.json CHANGED
@@ -1,7 +1,17 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-icqq",
3
- "version": "1.1.29",
4
- "description": "Zhin.js ICQQ adapter — direct connection to @icqqjs/icqq",
3
+ "version": "1.1.30",
4
+ "description": "ICQQ adapter: in-process @icqqjs/icqq client for QQ groups, private chats, temporary sessions and guild channels.",
5
+ "keywords": [
6
+ "zhin.js",
7
+ "icqq",
8
+ "qq",
9
+ "tencent"
10
+ ],
11
+ "author": {
12
+ "name": "lc-cn",
13
+ "url": "https://github.com/zhinjs/zhin"
14
+ },
5
15
  "type": "module",
6
16
  "main": "./lib/index.js",
7
17
  "types": "./lib/index.d.ts",
@@ -11,21 +21,6 @@
11
21
  "import": "./lib/index.js"
12
22
  }
13
23
  },
14
- "keywords": [
15
- "zhin",
16
- "zhin.js",
17
- "bot",
18
- "adapter",
19
- "icqq",
20
- "qq",
21
- "tencent",
22
- "chatbot"
23
- ],
24
- "author": {
25
- "name": "lc-cn",
26
- "email": "admin@liucl.cn",
27
- "url": "https://github.com/lc-cn"
28
- },
29
24
  "license": "MIT",
30
25
  "repository": {
31
26
  "url": "git+https://github.com/zhinjs/zhin.git",
@@ -34,27 +29,27 @@
34
29
  },
35
30
  "dependencies": {
36
31
  "zod": "^4.6.7",
37
- "@zhin.js/adapter": "1.1.34",
38
- "@zhin.js/agent-feature": "1.1.18",
39
- "@zhin.js/adapter-onebot-events": "0.0.8",
40
- "@zhin.js/core": "1.7.0",
41
- "@zhin.js/console-contract": "1.1.6",
42
- "@zhin.js/im-contract": "1.1.14",
43
- "@zhin.js/feature-kit": "1.1.17",
32
+ "@zhin.js/adapter": "1.3.0",
33
+ "@zhin.js/adapter-onebot-events": "0.0.9",
34
+ "@zhin.js/agent-feature": "1.1.19",
35
+ "@zhin.js/console-contract": "1.2.0",
36
+ "@zhin.js/core": "1.8.0",
37
+ "@zhin.js/feature-kit": "1.1.18",
38
+ "@zhin.js/im-contract": "1.2.0",
44
39
  "@zhin.js/logger": "1.1.3",
45
- "@zhin.js/page": "1.1.19",
46
- "@zhin.js/tool": "1.1.20",
47
- "@zhin.js/skill": "1.1.18",
48
- "@zhin.js/permission": "1.2.1"
40
+ "@zhin.js/page": "1.1.20",
41
+ "@zhin.js/permission": "1.2.2",
42
+ "@zhin.js/skill": "1.1.19",
43
+ "@zhin.js/tool": "1.1.21"
49
44
  },
50
45
  "peerDependencies": {
51
46
  "@icqqjs/icqq": "^1.12.2",
52
- "@zhin.js/adapter": "^1.1.34",
53
- "@zhin.js/agent": "^1.3.1",
54
- "@zhin.js/command": "^1.2.2",
55
- "@zhin.js/core": "^1.7.0",
56
- "zhin.js": "^1.2.0",
57
- "@zhin.js/prompt-section": "^1.1.17"
47
+ "@zhin.js/adapter": "^1.3.0",
48
+ "@zhin.js/agent": "^1.4.0",
49
+ "@zhin.js/command": "^1.3.0",
50
+ "@zhin.js/core": "^1.8.0",
51
+ "@zhin.js/prompt-section": "^1.1.18",
52
+ "zhin.js": "^1.3.0"
58
53
  },
59
54
  "peerDependenciesMeta": {
60
55
  "@icqqjs/icqq": {
@@ -78,9 +73,9 @@
78
73
  "@types/node": "^26.1.2",
79
74
  "typescript": "^6.0.3",
80
75
  "vitest": "^4.1.10",
81
- "@zhin.js/prompt-section": "1.1.17",
82
- "zhin.js": "1.2.0",
83
- "@zhin.js/agent": "1.3.1"
76
+ "@zhin.js/agent": "1.4.0",
77
+ "@zhin.js/prompt-section": "1.1.18",
78
+ "zhin.js": "1.3.0"
84
79
  },
85
80
  "files": [
86
81
  "adapters",
@@ -140,7 +135,19 @@
140
135
  "optional": true
141
136
  }
142
137
  ],
143
- "plugins": []
138
+ "plugins": [],
139
+ "metadata": {
140
+ "displayName": "ICQQ Adapter",
141
+ "displayNameI18n": {
142
+ "zh-CN": "ICQQ 适配器",
143
+ "en": "ICQQ Adapter"
144
+ },
145
+ "descriptionI18n": {
146
+ "zh-CN": "ICQQ 适配器:进程内直连 @icqqjs/icqq,支持 QQ 群聊、私聊、临时会话与频道消息。",
147
+ "en": "ICQQ adapter: in-process @icqqjs/icqq client for QQ groups, private chats, temporary sessions and guild channels."
148
+ },
149
+ "category": "adapter"
150
+ }
144
151
  },
145
152
  "scripts": {
146
153
  "build": "tsc",
package/plugin.js CHANGED
@@ -6,9 +6,6 @@ import { icqqSensitiveExecRule } from "./lib/sensitive-commands.js";
6
6
  export default definePlugin({
7
7
  name: 'icqq',
8
8
  configUpdate: { featurePaths: [['nickname'], ['profile'], ['endpoints']] },
9
- metadata: {
10
- displayName: 'ICQQ Adapter',
11
- },
12
9
  setup(context) {
13
10
  const disposeExecRule = registerSensitiveExecCommand(icqqSensitiveExecRule);
14
11
  return {
package/src/endpoint.ts CHANGED
@@ -116,6 +116,15 @@ const BOUND_EVENTS = [
116
116
  'system.login.auth',
117
117
  ] as const;
118
118
 
119
+ /**
120
+ * Log level of an ICQQ `system.*` event by meaning: coming online and login challenges waiting for
121
+ * the person (QR code, device lock, slider, identity check) are normal progress (`info`); only
122
+ * failures (login errors, going offline) are `warn`, so a routine login stays out of the warnings.
123
+ */
124
+ export function icqqSystemEventLogLevel(type: string): 'info' | 'warn' {
125
+ return type === 'online' || type.startsWith('login.') && type !== 'login.error' ? 'info' : 'warn';
126
+ }
127
+
119
128
  export class IcqqEndpoint extends ManagedIcqqClient implements Endpoint {
120
129
  readonly [endpointSpec]: EndpointSpecification;
121
130
  readonly #logger: ReturnType<typeof getAdapterLogger>;
@@ -1032,7 +1041,7 @@ export class IcqqEndpoint extends ManagedIcqqClient implements Endpoint {
1032
1041
  #logSystemEvent(type: string, event: unknown, safe?: Record<string, unknown> | null): void {
1033
1042
  const payload = safe === undefined ? serializeIcqqEvent(event) : safe;
1034
1043
  const line = payload;
1035
- this.#logger.warn(formatCompact({
1044
+ this.#logger[icqqSystemEventLogLevel(type)](formatCompact({
1036
1045
  op: `system.${type}`,
1037
1046
  endpoint: this.endpointName,
1038
1047
  ...(line ? { event: JSON.stringify(line) } : {}),