@zhin.js/adapter-lark 5.0.1 → 5.0.2
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 +18 -0
- package/adapters/lark.js +34 -0
- package/commands/endpoint/add/[name:string].js +3 -0
- package/commands/endpoint/list.js +3 -0
- package/commands/endpoint/remove/[name:string].js +3 -0
- package/package.json +12 -12
- package/plugin.js +16 -0
- package/plugin.ts +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @zhin.js/adapter-lark
|
|
2
2
|
|
|
3
|
+
## 5.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- d5cd4aa: Publish Plugin Runtime entry points and convention modules as JavaScript so
|
|
8
|
+
installed npm plugins load on Node without TypeScript stripping. Workspace
|
|
9
|
+
development continues to prefer TypeScript sources for local HMR.
|
|
10
|
+
|
|
11
|
+
Remove the unconsumed legacy game hub APIs from game-kit; game navigation and
|
|
12
|
+
records now use ordinary convention commands owned by the game hub plugin.
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [d5cd4aa]
|
|
15
|
+
- @zhin.js/command@1.0.4
|
|
16
|
+
- zhin.js@5.0.2
|
|
17
|
+
- @zhin.js/adapter@1.1.2
|
|
18
|
+
- @zhin.js/core@1.4.2
|
|
19
|
+
- @zhin.js/agent@1.0.7
|
|
20
|
+
|
|
3
21
|
## 5.0.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/adapters/lark.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
/**
|
|
3
|
+
* Convention entry: discover `adapters/lark.ts` → defineAdapter.
|
|
4
|
+
*/
|
|
5
|
+
import { defineAdapter } from '@zhin.js/adapter';
|
|
6
|
+
import { messageGatewayToken } from '@zhin.js/core/runtime';
|
|
7
|
+
import { httpHostToken } from '@zhin.js/host-http';
|
|
8
|
+
import { LarkEndpoint } from "../lib/endpoint.js";
|
|
9
|
+
import { resolveLarkConfig, } from "../lib/protocol.js";
|
|
10
|
+
import { larkRuntimeStateToken } from "../lib/lark-runtime-state.js";
|
|
11
|
+
export { LarkEndpoint } from "../lib/endpoint.js";
|
|
12
|
+
export default defineAdapter({
|
|
13
|
+
capabilities: ['inbound', 'outbound'],
|
|
14
|
+
// image 段经 /im/v1/images 物化为 image_key(url 下载后上传);
|
|
15
|
+
// 卡片交互未接入出站通道,交互段降级纯文本。
|
|
16
|
+
segments: {
|
|
17
|
+
outboundMedia: ['url', 'upload'],
|
|
18
|
+
interactive: 'text',
|
|
19
|
+
},
|
|
20
|
+
create(context) {
|
|
21
|
+
const config = resolveLarkConfig(context.config);
|
|
22
|
+
// 注册到插件运行时状态(lark endpoint list 的"运行中"数据源)
|
|
23
|
+
context.use(larkRuntimeStateToken).endpoints.set(config.name, {
|
|
24
|
+
name: config.name,
|
|
25
|
+
mode: 'webhook',
|
|
26
|
+
});
|
|
27
|
+
return new LarkEndpoint({
|
|
28
|
+
id: context.id,
|
|
29
|
+
gateway: context.use(messageGatewayToken),
|
|
30
|
+
http: context.use(httpHostToken),
|
|
31
|
+
config,
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-lark",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "Zhin.js Lark/Feishu (飞书) adapter for Plugin Runtime (HTTP webhook)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -34,21 +34,21 @@
|
|
|
34
34
|
"directory": "plugins/adapters/lark"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@zhin.js/adapter": "1.1.
|
|
38
|
-
"@zhin.js/command": "1.0.
|
|
39
|
-
"@zhin.js/core": "1.4.
|
|
37
|
+
"@zhin.js/adapter": "1.1.2",
|
|
38
|
+
"@zhin.js/command": "1.0.4",
|
|
39
|
+
"@zhin.js/core": "1.4.2",
|
|
40
40
|
"@zhin.js/host-http": "1.0.3",
|
|
41
41
|
"@zhin.js/logger": "1.0.75",
|
|
42
42
|
"@zhin.js/plugin-runtime": "1.1.1"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"zod": "^4.0.0",
|
|
46
|
-
"@zhin.js/adapter": "1.1.
|
|
47
|
-
"@zhin.js/agent": "1.0.
|
|
48
|
-
"@zhin.js/core": "1.4.
|
|
46
|
+
"@zhin.js/adapter": "1.1.2",
|
|
47
|
+
"@zhin.js/agent": "1.0.7",
|
|
48
|
+
"@zhin.js/core": "1.4.2",
|
|
49
49
|
"@zhin.js/host-http": "1.0.3",
|
|
50
50
|
"@zhin.js/plugin-runtime": "1.1.1",
|
|
51
|
-
"zhin.js": "5.0.
|
|
51
|
+
"zhin.js": "5.0.2"
|
|
52
52
|
},
|
|
53
53
|
"peerDependenciesMeta": {
|
|
54
54
|
"zhin.js": {
|
|
@@ -66,13 +66,13 @@
|
|
|
66
66
|
"typescript": "^6.0.3",
|
|
67
67
|
"vitest": "^4.1.10",
|
|
68
68
|
"zod": "^4.4.3",
|
|
69
|
-
"@zhin.js/agent": "1.0.
|
|
70
|
-
"zhin.js": "5.0.
|
|
69
|
+
"@zhin.js/agent": "1.0.7",
|
|
70
|
+
"zhin.js": "5.0.2"
|
|
71
71
|
},
|
|
72
72
|
"files": [
|
|
73
73
|
"adapters",
|
|
74
74
|
"commands",
|
|
75
|
-
"plugin.
|
|
75
|
+
"plugin.js",
|
|
76
76
|
"schema.json",
|
|
77
77
|
"src",
|
|
78
78
|
"lib",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"zhin": {
|
|
91
91
|
"protocol": 1,
|
|
92
92
|
"type": "plugin",
|
|
93
|
-
"entry": "./plugin.
|
|
93
|
+
"entry": "./plugin.js",
|
|
94
94
|
"engine": "^1.0.0",
|
|
95
95
|
"runtime": "trusted",
|
|
96
96
|
"features": [
|
package/plugin.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
import { createEndpointRuntimeState } from '@zhin.js/adapter';
|
|
3
|
+
import { definePlugin } from '@zhin.js/plugin-runtime';
|
|
4
|
+
import { registerLarkPlatformPermitChecker } from "./lib/platform-permit.js";
|
|
5
|
+
import { larkRuntimeStateToken } from "./lib/lark-runtime-state.js";
|
|
6
|
+
export default definePlugin({
|
|
7
|
+
name: 'lark',
|
|
8
|
+
metadata: {
|
|
9
|
+
displayName: 'Lark/Feishu (飞书) Adapter',
|
|
10
|
+
},
|
|
11
|
+
setup(context) {
|
|
12
|
+
// 运行中 endpoint 注册表(lark endpoint list 的"运行中"数据源)
|
|
13
|
+
context.resources.provide(larkRuntimeStateToken, createEndpointRuntimeState());
|
|
14
|
+
return registerLarkPlatformPermitChecker();
|
|
15
|
+
},
|
|
16
|
+
});
|
package/plugin.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { createEndpointRuntimeState } from '@zhin.js/adapter';
|
|
2
|
-
import { definePlugin } from '@zhin.js/plugin-runtime';
|
|
3
|
-
import { registerLarkPlatformPermitChecker } from './src/platform-permit.js';
|
|
4
|
-
import { larkRuntimeStateToken } from './src/lark-runtime-state.js';
|
|
5
|
-
|
|
6
|
-
export default definePlugin({
|
|
7
|
-
name: 'lark',
|
|
8
|
-
metadata: {
|
|
9
|
-
displayName: 'Lark/Feishu (飞书) Adapter',
|
|
10
|
-
},
|
|
11
|
-
setup(context) {
|
|
12
|
-
// 运行中 endpoint 注册表(lark endpoint list 的"运行中"数据源)
|
|
13
|
-
context.resources.provide(larkRuntimeStateToken, createEndpointRuntimeState());
|
|
14
|
-
return registerLarkPlatformPermitChecker();
|
|
15
|
-
},
|
|
16
|
-
});
|