@zhin.js/adapter-slack 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/slack.js +41 -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 +17 -0
- package/plugin.ts +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
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
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
+
/**
|
|
3
|
+
* Convention entry: discover `adapters/slack.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 { SlackEndpoint } from "../lib/endpoint.js";
|
|
9
|
+
import { resolveSlackConfig, } from "../lib/protocol.js";
|
|
10
|
+
import { slackRuntimeStateToken } from "../lib/slack-runtime-state.js";
|
|
11
|
+
export { SlackEndpoint } from "../lib/endpoint.js";
|
|
12
|
+
export default defineAdapter({
|
|
13
|
+
capabilities: ['inbound', 'outbound'],
|
|
14
|
+
// 媒体由端点物化(url 拉取 / 本地读取)经 files.uploadV2 上传;
|
|
15
|
+
// Block Kit 原生按钮承载交互段。
|
|
16
|
+
segments: {
|
|
17
|
+
outboundMedia: ['url', 'upload'],
|
|
18
|
+
interactive: 'native',
|
|
19
|
+
},
|
|
20
|
+
create(context) {
|
|
21
|
+
const config = resolveSlackConfig(context.config);
|
|
22
|
+
// 注册到插件运行时状态(slack endpoint list 的"运行中"数据源)
|
|
23
|
+
context.use(slackRuntimeStateToken).endpoints.set(config.name, {
|
|
24
|
+
name: config.name,
|
|
25
|
+
mode: config.mode,
|
|
26
|
+
});
|
|
27
|
+
if (config.mode === 'http') {
|
|
28
|
+
return new SlackEndpoint({
|
|
29
|
+
id: context.id,
|
|
30
|
+
gateway: context.use(messageGatewayToken),
|
|
31
|
+
http: context.use(httpHostToken),
|
|
32
|
+
config,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return new SlackEndpoint({
|
|
36
|
+
id: context.id,
|
|
37
|
+
gateway: context.use(messageGatewayToken),
|
|
38
|
+
config,
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-slack",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "Zhin.js Slack adapter for Plugin Runtime (Socket Mode / HTTP Events)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -34,21 +34,21 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@slack/socket-mode": "^2.0.3",
|
|
36
36
|
"@slack/web-api": "^7.17.0",
|
|
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,17 @@
|
|
|
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 { registerSlackPlatformPermitChecker } from "./lib/platform-permit.js";
|
|
5
|
+
import { slackRuntimeStateToken } from "./lib/slack-runtime-state.js";
|
|
6
|
+
export default definePlugin({
|
|
7
|
+
name: 'slack',
|
|
8
|
+
metadata: {
|
|
9
|
+
displayName: 'Slack Adapter',
|
|
10
|
+
},
|
|
11
|
+
setup(context) {
|
|
12
|
+
// 运行中 endpoint 注册表(slack endpoint list 的"运行中"数据源)
|
|
13
|
+
context.resources.provide(slackRuntimeStateToken, createEndpointRuntimeState());
|
|
14
|
+
// 平台权限门禁:workspace_owner / channel_manager 等(agent 工具 platformPermit)
|
|
15
|
+
return registerSlackPlatformPermitChecker();
|
|
16
|
+
},
|
|
17
|
+
});
|
package/plugin.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createEndpointRuntimeState } from '@zhin.js/adapter';
|
|
2
|
-
import { definePlugin } from '@zhin.js/plugin-runtime';
|
|
3
|
-
import { registerSlackPlatformPermitChecker } from './src/platform-permit.js';
|
|
4
|
-
import { slackRuntimeStateToken } from './src/slack-runtime-state.js';
|
|
5
|
-
|
|
6
|
-
export default definePlugin({
|
|
7
|
-
name: 'slack',
|
|
8
|
-
metadata: {
|
|
9
|
-
displayName: 'Slack Adapter',
|
|
10
|
-
},
|
|
11
|
-
setup(context) {
|
|
12
|
-
// 运行中 endpoint 注册表(slack endpoint list 的"运行中"数据源)
|
|
13
|
-
context.resources.provide(slackRuntimeStateToken, createEndpointRuntimeState());
|
|
14
|
-
// 平台权限门禁:workspace_owner / channel_manager 等(agent 工具 platformPermit)
|
|
15
|
-
return registerSlackPlatformPermitChecker();
|
|
16
|
-
},
|
|
17
|
-
});
|