@zhin.js/adapter-lark 4.0.3 → 5.0.0

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,26 @@
1
1
  # @zhin.js/adapter-lark
2
2
 
3
+ ## 5.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 7db69c1: 命令前缀改为适配器配置项:`MessageDispatcher` 不再硬编码 `/`,默认按消息所属适配器实例 config 的 `commandPrefix` 解析(默认 `''` 无前缀,任意文本按命令匹配),`endpoints[i].commandPrefix` 逐项覆盖;`ImRuntime({ commandPrefix })` 仍可设全局静态前缀。全部 20 个平台适配器 schema 新增 `commandPrefix` 属性。
8
+
9
+ BREAKING(行为变化):未配置时命令不再需要 `/` 前缀——原 `/zt` 写法不再命中,直接发 `zt` 即可;需要斜杠风格的适配器请在配置里显式设 `commandPrefix: '/'`。
10
+
11
+ - 713445c: 适配器配置格式定稿(不兼容旧格式):`plugins.<adapter>` 顶层仅共享字段 + `commandPrefix`,`endpoints[i]` 携带 endpoint 级字段(`name` + 凭据,各 schema 已类型化),`endpoints` 为必填(icqq 另需顶层 `master`);icqq 新增 `trusted` 列表(顶层/逐项均可)。scaffold-wizard 全部字段式与自定义 configure() 产出改为新格式,examples(full-bot / qq-games-bot)与 20 个适配器 README 同步迁移。
12
+ - Updated dependencies [7db69c1]
13
+ - Updated dependencies [e5c84ed]
14
+ - Updated dependencies [3ea84a0]
15
+ - Updated dependencies [1ddcd70]
16
+ - Updated dependencies [ac9da66]
17
+ - @zhin.js/core@1.4.0
18
+ - @zhin.js/adapter@1.1.0
19
+ - @zhin.js/plugin-runtime@1.1.0
20
+ - @zhin.js/agent@1.0.5
21
+ - @zhin.js/host-http@1.0.2
22
+ - zhin.js@5.0.0
23
+
3
24
  ## 4.0.3
4
25
 
5
26
  ### Patch Changes
package/README.md CHANGED
@@ -36,7 +36,7 @@ pnpm add @zhin.js/adapter-lark
36
36
  3. 启用机器人能力并配置事件订阅 URL:`https://your-domain/lark/webhook`
37
37
  4. Runtime Host(`http`)须已 listen,Webhook 才可达
38
38
 
39
- 必填字段:`appId`、`appSecret`。
39
+ 必填字段(`endpoints[i]`):`name`、`appId`、`appSecret`。
40
40
 
41
41
  ## 最小配置
42
42
 
@@ -44,14 +44,15 @@ pnpm add @zhin.js/adapter-lark
44
44
  # zhin.config.yml(Plugin Runtime)
45
45
  plugins:
46
46
  lark:
47
- name: my-lark-bot
48
- appId: ${LARK_APP_ID}
49
- appSecret: ${LARK_APP_SECRET}
50
47
  webhookPath: /lark/webhook # 可选,默认 /lark/webhook
51
- encryptKey: ${LARK_ENCRYPT_KEY} # 可选
52
- verificationToken: ${LARK_VERIFY_TOKEN} # 可选
53
48
  isFeishu: true # 可选,默认 true
54
49
  # apiBaseUrl: https://open.feishu.cn/open-apis
50
+ endpoints:
51
+ - name: my-lark-bot
52
+ appId: ${LARK_APP_ID}
53
+ appSecret: ${LARK_APP_SECRET}
54
+ # encryptKey: ${LARK_ENCRYPT_KEY} # 可选
55
+ # verificationToken: ${LARK_VERIFY_TOKEN} # 可选
55
56
  ```
56
57
 
57
58
  根插件 `zhin.plugins`(或项目图)需引用 `@zhin.js/adapter-lark`(`instanceKey: lark`)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-lark",
3
- "version": "4.0.3",
3
+ "version": "5.0.0",
4
4
  "description": "Zhin.js Lark/Feishu (飞书) adapter for Plugin Runtime (HTTP webhook)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -34,20 +34,20 @@
34
34
  "directory": "plugins/adapters/lark"
35
35
  },
36
36
  "dependencies": {
37
- "@zhin.js/adapter": "1.0.1",
38
- "@zhin.js/core": "1.3.5",
39
- "@zhin.js/host-http": "1.0.1",
37
+ "@zhin.js/adapter": "1.1.0",
38
+ "@zhin.js/core": "1.4.0",
39
+ "@zhin.js/host-http": "1.0.2",
40
40
  "@zhin.js/logger": "1.0.75",
41
- "@zhin.js/plugin-runtime": "1.0.1"
41
+ "@zhin.js/plugin-runtime": "1.1.0"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "zod": "^4.0.0",
45
- "@zhin.js/adapter": "1.0.1",
46
- "@zhin.js/agent": "1.0.4",
47
- "@zhin.js/core": "1.3.5",
48
- "@zhin.js/host-http": "1.0.1",
49
- "@zhin.js/plugin-runtime": "1.0.1",
50
- "zhin.js": "4.1.3"
45
+ "@zhin.js/adapter": "1.1.0",
46
+ "@zhin.js/agent": "1.0.5",
47
+ "@zhin.js/core": "1.4.0",
48
+ "@zhin.js/host-http": "1.0.2",
49
+ "@zhin.js/plugin-runtime": "1.1.0",
50
+ "zhin.js": "5.0.0"
51
51
  },
52
52
  "peerDependenciesMeta": {
53
53
  "zhin.js": {
@@ -65,8 +65,8 @@
65
65
  "typescript": "^6.0.3",
66
66
  "vitest": "^4.1.10",
67
67
  "zod": "^4.4.3",
68
- "@zhin.js/agent": "1.0.4",
69
- "zhin.js": "4.1.3"
68
+ "@zhin.js/agent": "1.0.5",
69
+ "zhin.js": "5.0.0"
70
70
  },
71
71
  "files": [
72
72
  "adapters",
package/schema.json CHANGED
@@ -3,23 +3,59 @@
3
3
  "type": "object",
4
4
  "additionalProperties": false,
5
5
  "properties": {
6
- "name": {
7
- "type": "string",
8
- "default": "lark-bot"
9
- },
10
- "appId": { "type": "string" },
11
- "appSecret": { "type": "string" },
12
- "encryptKey": { "type": "string" },
13
- "verificationToken": { "type": "string" },
14
6
  "webhookPath": {
15
7
  "type": "string",
16
8
  "default": "/lark/webhook"
17
9
  },
18
- "apiBaseUrl": { "type": "string" },
10
+ "apiBaseUrl": {
11
+ "type": "string"
12
+ },
19
13
  "isFeishu": {
20
14
  "type": "boolean",
21
15
  "default": true
16
+ },
17
+ "endpoints": {
18
+ "type": "array",
19
+ "description": "多账号:一个插件实例挂多个 endpoint。每项与顶层字段同构(name 必填,其余覆盖顶层)",
20
+ "items": {
21
+ "type": "object",
22
+ "additionalProperties": true,
23
+ "properties": {
24
+ "name": {
25
+ "type": "string",
26
+ "description": "Lark bot name"
27
+ },
28
+ "appId": {
29
+ "type": "string",
30
+ "description": "Lark app ID"
31
+ },
32
+ "appSecret": {
33
+ "type": "string",
34
+ "description": "Lark app secret"
35
+ },
36
+ "encryptKey": {
37
+ "type": "string",
38
+ "description": "Lark encrypt key"
39
+ },
40
+ "verificationToken": {
41
+ "type": "string",
42
+ "description": "Lark verification token"
43
+ }
44
+ },
45
+ "required": [
46
+ "name",
47
+ "appId",
48
+ "appSecret"
49
+ ]
50
+ }
51
+ },
52
+ "commandPrefix": {
53
+ "type": "string",
54
+ "default": "",
55
+ "description": "命令前缀(默认 '' 无前缀,任意文本按命令匹配;如 '/' 要求 / 开头)。endpoints[i] 可逐项覆盖"
22
56
  }
23
57
  },
24
- "required": ["appId", "appSecret"]
58
+ "required": [
59
+ "endpoints"
60
+ ]
25
61
  }