@zhin.js/adapter-discord 1.1.25 → 1.1.26

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,14 @@
1
1
  # @zhin.js/adapter-discord
2
2
 
3
+ ## 1.1.26
4
+
5
+ ### Patch Changes
6
+
7
+ - 0d76a7c: Overhaul Console interactive workbenches, platform-specific adapter account onboarding/login flows, DeclarativePageView visual/interactive capabilities, and official utility plugin Console pages.
8
+ - Updated dependencies [0d76a7c]
9
+ - @zhin.js/adapter@1.1.32
10
+ - @zhin.js/core@1.1.60
11
+
3
12
  ## 1.1.25
4
13
 
5
14
  ### Patch Changes
@@ -2,16 +2,121 @@ export const discordConsoleSpec = {
2
2
  adapterKey: 'discord',
3
3
  adapterDisplayName: 'Discord',
4
4
  fields: [
5
- { key: 'token', required: true, env: true, description: 'Discord bot token' },
6
- { key: 'connection', description: 'gateway or interactions' },
7
- { key: 'applicationId', description: 'Application ID for Interactions; identity changes replace the account' },
8
- { key: 'publicKey', description: 'Application Ed25519 public key' },
9
- { key: 'interactionsPath', description: 'Local Interactions route' },
10
- { key: 'restApiProxy.port', type: 'number', description: 'Configured REST loopback proxy port' },
11
- { key: 'gatewayFaultProxyUrl', description: 'Configured local Gateway fault proxy URL' },
12
- { key: 'defaultActivity.name', description: 'SDK activity name' },
13
- { key: 'defaultActivity.type', description: 'PLAYING, STREAMING, LISTENING, WATCHING or COMPETING' },
14
- { key: 'defaultActivity.url', description: 'SDK activity URL' },
5
+ {
6
+ key: 'token',
7
+ required: true,
8
+ env: true,
9
+ label: 'Bot Token (机器人令牌)',
10
+ labelI18n: { en: 'Bot Token' },
11
+ group: '基础认证',
12
+ groupI18n: { en: 'Basic Auth' },
13
+ placeholder: 'MTIzNDU2Nzg5MDEyMzQ1Njc4OQ.G...',
14
+ description: 'Discord Developer Portal 生成的 Bot Token',
15
+ descriptionI18n: { en: 'Discord bot token' },
16
+ },
17
+ {
18
+ key: 'connection',
19
+ label: '连接模式',
20
+ labelI18n: { en: 'Connection Mode' },
21
+ group: '连接与回调',
22
+ groupI18n: { en: 'Connection & Webhook' },
23
+ placeholder: 'gateway',
24
+ description: 'gateway(WebSocket 长连接)或 interactions(HTTP 交互回调)',
25
+ descriptionI18n: { en: 'gateway or interactions' },
26
+ options: [
27
+ { value: 'gateway', label: 'Gateway WebSocket(推荐)', labelI18n: { en: 'Gateway WebSocket (Recommended)' } },
28
+ { value: 'interactions', label: 'HTTP Interactions 回调', labelI18n: { en: 'HTTP Interactions' } },
29
+ ],
30
+ },
31
+ {
32
+ key: 'applicationId',
33
+ label: 'Application ID (应用 ID)',
34
+ labelI18n: { en: 'Application ID' },
35
+ group: '连接与回调',
36
+ groupI18n: { en: 'Connection & Webhook' },
37
+ placeholder: '123456789012345678',
38
+ description: 'Interactions 模式必填的应用 ID(修改此项将替换账号)',
39
+ descriptionI18n: { en: 'Application ID for Interactions; identity changes replace the account' },
40
+ },
41
+ {
42
+ key: 'publicKey',
43
+ label: 'Ed25519 公钥 (Public Key)',
44
+ labelI18n: { en: 'Ed25519 Public Key' },
45
+ group: '连接与回调',
46
+ groupI18n: { en: 'Connection & Webhook' },
47
+ placeholder: '64 位十六进制公钥字符串',
48
+ placeholderI18n: { en: '64-char hex Ed25519 public key' },
49
+ description: 'Interactions 模式下校验请求签名的应用公钥',
50
+ descriptionI18n: { en: 'Application Ed25519 public key' },
51
+ },
52
+ {
53
+ key: 'interactionsPath',
54
+ label: 'Interactions 本地路由',
55
+ labelI18n: { en: 'Interactions Local Path' },
56
+ group: '连接与回调',
57
+ groupI18n: { en: 'Connection & Webhook' },
58
+ placeholder: '/discord/interactions',
59
+ description: 'Interactions 模式监听的本地 HTTP 路径',
60
+ descriptionI18n: { en: 'Local Interactions route' },
61
+ },
62
+ {
63
+ key: 'defaultActivity.name',
64
+ label: '状态活动名称',
65
+ labelI18n: { en: 'Activity Name' },
66
+ group: '流式体验与代理',
67
+ groupI18n: { en: 'Streaming & Proxy' },
68
+ placeholder: '与 Zhin 对话中',
69
+ description: '机器人在线状态展示的活动名称(可选)',
70
+ descriptionI18n: { en: 'SDK activity name' },
71
+ },
72
+ {
73
+ key: 'defaultActivity.type',
74
+ label: '状态活动类型',
75
+ labelI18n: { en: 'Activity Type' },
76
+ group: '流式体验与代理',
77
+ groupI18n: { en: 'Streaming & Proxy' },
78
+ placeholder: 'PLAYING',
79
+ description: 'PLAYING、STREAMING、LISTENING、WATCHING 或 COMPETING',
80
+ descriptionI18n: { en: 'PLAYING, STREAMING, LISTENING, WATCHING or COMPETING' },
81
+ options: [
82
+ { value: 'PLAYING', label: '正在玩 (PLAYING)', labelI18n: { en: 'PLAYING' } },
83
+ { value: 'STREAMING', label: '正在直播 (STREAMING)', labelI18n: { en: 'STREAMING' } },
84
+ { value: 'LISTENING', label: '正在听 (LISTENING)', labelI18n: { en: 'LISTENING' } },
85
+ { value: 'WATCHING', label: '正在看 (WATCHING)', labelI18n: { en: 'WATCHING' } },
86
+ { value: 'COMPETING', label: '正在参与 (COMPETING)', labelI18n: { en: 'COMPETING' } },
87
+ ],
88
+ },
89
+ {
90
+ key: 'defaultActivity.url',
91
+ label: '状态直播链接',
92
+ labelI18n: { en: 'Activity Stream URL' },
93
+ group: '流式体验与代理',
94
+ groupI18n: { en: 'Streaming & Proxy' },
95
+ placeholder: 'https://twitch.tv/...',
96
+ description: 'STREAMING 状态下的直播链接(可选)',
97
+ descriptionI18n: { en: 'SDK activity URL' },
98
+ },
99
+ {
100
+ key: 'restApiProxy.port',
101
+ type: 'number',
102
+ label: 'REST API 代理端口',
103
+ labelI18n: { en: 'REST Proxy Port' },
104
+ group: '流式体验与代理',
105
+ groupI18n: { en: 'Streaming & Proxy' },
106
+ placeholder: '例如 7890',
107
+ description: '本地回环 REST API 代理端口(可选)',
108
+ descriptionI18n: { en: 'Configured REST loopback proxy port' },
109
+ },
110
+ {
111
+ key: 'gatewayFaultProxyUrl',
112
+ label: 'Gateway 代理地址',
113
+ labelI18n: { en: 'Gateway Proxy URL' },
114
+ group: '流式体验与代理',
115
+ groupI18n: { en: 'Streaming & Proxy' },
116
+ placeholder: 'ws://127.0.0.1:7890',
117
+ description: '本地 Gateway 代理或故障注入地址(可选)',
118
+ descriptionI18n: { en: 'Configured local Gateway fault proxy URL' },
119
+ },
15
120
  ],
16
121
  docsUrl: 'https://zhin.js.org/adapters/discord',
17
122
  readPermission: 'discord:read',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-discord",
3
- "version": "1.1.25",
3
+ "version": "1.1.26",
4
4
  "description": "Zhin.js Discord adapter for Plugin Runtime (Gateway WebSocket)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -35,10 +35,10 @@
35
35
  "@discordjs/ws": "1.2.3",
36
36
  "discord.js": "^14.27.0",
37
37
  "undici": "6.29.1",
38
- "@zhin.js/adapter": "1.1.31",
38
+ "@zhin.js/adapter": "1.1.32",
39
39
  "@zhin.js/agent-feature": "1.1.16",
40
40
  "@zhin.js/console-contract": "1.1.5",
41
- "@zhin.js/core": "1.1.59",
41
+ "@zhin.js/core": "1.1.60",
42
42
  "@zhin.js/feature-kit": "1.1.15",
43
43
  "@zhin.js/host-http": "1.1.17",
44
44
  "@zhin.js/im-contract": "1.1.13",
@@ -50,10 +50,10 @@
50
50
  },
51
51
  "peerDependencies": {
52
52
  "zod": "^4.0.0",
53
- "@zhin.js/adapter": "^1.1.31",
53
+ "@zhin.js/adapter": "^1.1.32",
54
54
  "@zhin.js/command": "^1.1.17",
55
- "@zhin.js/core": "^1.1.59",
56
- "zhin.js": "^1.1.24"
55
+ "@zhin.js/core": "^1.1.60",
56
+ "zhin.js": "^1.1.25"
57
57
  },
58
58
  "peerDependenciesMeta": {
59
59
  "@zhin.js/command": {
@@ -72,7 +72,7 @@
72
72
  "vitest": "^4.1.10",
73
73
  "zod": "^4.4.3",
74
74
  "@zhin.js/host-http": "1.1.17",
75
- "zhin.js": "1.1.24"
75
+ "zhin.js": "1.1.25"
76
76
  },
77
77
  "files": [
78
78
  "adapters",
@@ -7,16 +7,121 @@ export const discordConsoleSpec = {
7
7
  adapterKey: 'discord',
8
8
  adapterDisplayName: 'Discord',
9
9
  fields: [
10
- { key: 'token', required: true, env: true, description: 'Discord bot token' },
11
- { key: 'connection', description: 'gateway or interactions' },
12
- { key: 'applicationId', description: 'Application ID for Interactions; identity changes replace the account' },
13
- { key: 'publicKey', description: 'Application Ed25519 public key' },
14
- { key: 'interactionsPath', description: 'Local Interactions route' },
15
- { key: 'restApiProxy.port', type: 'number', description: 'Configured REST loopback proxy port' },
16
- { key: 'gatewayFaultProxyUrl', description: 'Configured local Gateway fault proxy URL' },
17
- { key: 'defaultActivity.name', description: 'SDK activity name' },
18
- { key: 'defaultActivity.type', description: 'PLAYING, STREAMING, LISTENING, WATCHING or COMPETING' },
19
- { key: 'defaultActivity.url', description: 'SDK activity URL' },
10
+ {
11
+ key: 'token',
12
+ required: true,
13
+ env: true,
14
+ label: 'Bot Token (机器人令牌)',
15
+ labelI18n: { en: 'Bot Token' },
16
+ group: '基础认证',
17
+ groupI18n: { en: 'Basic Auth' },
18
+ placeholder: 'MTIzNDU2Nzg5MDEyMzQ1Njc4OQ.G...',
19
+ description: 'Discord Developer Portal 生成的 Bot Token',
20
+ descriptionI18n: { en: 'Discord bot token' },
21
+ },
22
+ {
23
+ key: 'connection',
24
+ label: '连接模式',
25
+ labelI18n: { en: 'Connection Mode' },
26
+ group: '连接与回调',
27
+ groupI18n: { en: 'Connection & Webhook' },
28
+ placeholder: 'gateway',
29
+ description: 'gateway(WebSocket 长连接)或 interactions(HTTP 交互回调)',
30
+ descriptionI18n: { en: 'gateway or interactions' },
31
+ options: [
32
+ { value: 'gateway', label: 'Gateway WebSocket(推荐)', labelI18n: { en: 'Gateway WebSocket (Recommended)' } },
33
+ { value: 'interactions', label: 'HTTP Interactions 回调', labelI18n: { en: 'HTTP Interactions' } },
34
+ ],
35
+ },
36
+ {
37
+ key: 'applicationId',
38
+ label: 'Application ID (应用 ID)',
39
+ labelI18n: { en: 'Application ID' },
40
+ group: '连接与回调',
41
+ groupI18n: { en: 'Connection & Webhook' },
42
+ placeholder: '123456789012345678',
43
+ description: 'Interactions 模式必填的应用 ID(修改此项将替换账号)',
44
+ descriptionI18n: { en: 'Application ID for Interactions; identity changes replace the account' },
45
+ },
46
+ {
47
+ key: 'publicKey',
48
+ label: 'Ed25519 公钥 (Public Key)',
49
+ labelI18n: { en: 'Ed25519 Public Key' },
50
+ group: '连接与回调',
51
+ groupI18n: { en: 'Connection & Webhook' },
52
+ placeholder: '64 位十六进制公钥字符串',
53
+ placeholderI18n: { en: '64-char hex Ed25519 public key' },
54
+ description: 'Interactions 模式下校验请求签名的应用公钥',
55
+ descriptionI18n: { en: 'Application Ed25519 public key' },
56
+ },
57
+ {
58
+ key: 'interactionsPath',
59
+ label: 'Interactions 本地路由',
60
+ labelI18n: { en: 'Interactions Local Path' },
61
+ group: '连接与回调',
62
+ groupI18n: { en: 'Connection & Webhook' },
63
+ placeholder: '/discord/interactions',
64
+ description: 'Interactions 模式监听的本地 HTTP 路径',
65
+ descriptionI18n: { en: 'Local Interactions route' },
66
+ },
67
+ {
68
+ key: 'defaultActivity.name',
69
+ label: '状态活动名称',
70
+ labelI18n: { en: 'Activity Name' },
71
+ group: '流式体验与代理',
72
+ groupI18n: { en: 'Streaming & Proxy' },
73
+ placeholder: '与 Zhin 对话中',
74
+ description: '机器人在线状态展示的活动名称(可选)',
75
+ descriptionI18n: { en: 'SDK activity name' },
76
+ },
77
+ {
78
+ key: 'defaultActivity.type',
79
+ label: '状态活动类型',
80
+ labelI18n: { en: 'Activity Type' },
81
+ group: '流式体验与代理',
82
+ groupI18n: { en: 'Streaming & Proxy' },
83
+ placeholder: 'PLAYING',
84
+ description: 'PLAYING、STREAMING、LISTENING、WATCHING 或 COMPETING',
85
+ descriptionI18n: { en: 'PLAYING, STREAMING, LISTENING, WATCHING or COMPETING' },
86
+ options: [
87
+ { value: 'PLAYING', label: '正在玩 (PLAYING)', labelI18n: { en: 'PLAYING' } },
88
+ { value: 'STREAMING', label: '正在直播 (STREAMING)', labelI18n: { en: 'STREAMING' } },
89
+ { value: 'LISTENING', label: '正在听 (LISTENING)', labelI18n: { en: 'LISTENING' } },
90
+ { value: 'WATCHING', label: '正在看 (WATCHING)', labelI18n: { en: 'WATCHING' } },
91
+ { value: 'COMPETING', label: '正在参与 (COMPETING)', labelI18n: { en: 'COMPETING' } },
92
+ ],
93
+ },
94
+ {
95
+ key: 'defaultActivity.url',
96
+ label: '状态直播链接',
97
+ labelI18n: { en: 'Activity Stream URL' },
98
+ group: '流式体验与代理',
99
+ groupI18n: { en: 'Streaming & Proxy' },
100
+ placeholder: 'https://twitch.tv/...',
101
+ description: 'STREAMING 状态下的直播链接(可选)',
102
+ descriptionI18n: { en: 'SDK activity URL' },
103
+ },
104
+ {
105
+ key: 'restApiProxy.port',
106
+ type: 'number',
107
+ label: 'REST API 代理端口',
108
+ labelI18n: { en: 'REST Proxy Port' },
109
+ group: '流式体验与代理',
110
+ groupI18n: { en: 'Streaming & Proxy' },
111
+ placeholder: '例如 7890',
112
+ description: '本地回环 REST API 代理端口(可选)',
113
+ descriptionI18n: { en: 'Configured REST loopback proxy port' },
114
+ },
115
+ {
116
+ key: 'gatewayFaultProxyUrl',
117
+ label: 'Gateway 代理地址',
118
+ labelI18n: { en: 'Gateway Proxy URL' },
119
+ group: '流式体验与代理',
120
+ groupI18n: { en: 'Streaming & Proxy' },
121
+ placeholder: 'ws://127.0.0.1:7890',
122
+ description: '本地 Gateway 代理或故障注入地址(可选)',
123
+ descriptionI18n: { en: 'Configured local Gateway fault proxy URL' },
124
+ },
20
125
  ] as readonly AdapterConsoleField[],
21
126
  docsUrl: 'https://zhin.js.org/adapters/discord',
22
127
  readPermission: 'discord:read',