@zhin.js/adapter-telegram 6.0.1 → 6.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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.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
  ## 6.0.1
4
22
 
5
23
  ### Patch Changes
@@ -0,0 +1,34 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ /**
3
+ * Convention entry: discover `adapters/telegram.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 { TelegramEndpoint } from "../lib/endpoint.js";
9
+ import { resolveTelegramConfig, } from "../lib/protocol.js";
10
+ import { telegramRuntimeStateToken } from "../lib/telegram-runtime-state.js";
11
+ export { TelegramEndpoint } from "../lib/endpoint.js";
12
+ export default defineAdapter({
13
+ capabilities: ['inbound', 'outbound'],
14
+ // 媒体 url / file_id 直发,base64 / 本地路径经 multipart attach:// 上传物化;
15
+ // inline keyboard 原生按钮承载交互段。
16
+ segments: {
17
+ outboundMedia: ['url', 'upload'],
18
+ interactive: 'native',
19
+ },
20
+ create(context) {
21
+ const config = resolveTelegramConfig(context.config);
22
+ // 注册到插件运行时状态(telegram endpoint list 的"运行中"数据源)
23
+ context.use(telegramRuntimeStateToken).endpoints.set(config.name, {
24
+ name: config.name,
25
+ mode: config.mode,
26
+ });
27
+ return new TelegramEndpoint({
28
+ id: context.id,
29
+ gateway: context.use(messageGatewayToken),
30
+ config,
31
+ http: config.mode === 'webhook' ? context.use(httpHostToken) : undefined,
32
+ });
33
+ },
34
+ });
@@ -0,0 +1,3 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ import { telegramEndpointCommands } from "../../../lib/telegram-endpoint-commands.js";
3
+ export default telegramEndpointCommands.add;
@@ -0,0 +1,3 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ import { telegramEndpointCommands } from "../../lib/telegram-endpoint-commands.js";
3
+ export default telegramEndpointCommands.list;
@@ -0,0 +1,3 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ import { telegramEndpointCommands } from "../../../lib/telegram-endpoint-commands.js";
3
+ export default telegramEndpointCommands.remove;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-telegram",
3
- "version": "6.0.1",
3
+ "version": "6.0.2",
4
4
  "description": "Zhin.js Telegram Bot API adapter for Plugin Runtime (long-poll getUpdates)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -32,20 +32,20 @@
32
32
  "directory": "plugins/adapters/telegram"
33
33
  },
34
34
  "dependencies": {
35
- "@zhin.js/adapter": "1.1.1",
36
- "@zhin.js/command": "1.0.3",
37
- "@zhin.js/core": "1.4.1",
35
+ "@zhin.js/adapter": "1.1.2",
36
+ "@zhin.js/command": "1.0.4",
37
+ "@zhin.js/core": "1.4.2",
38
38
  "@zhin.js/host-http": "1.0.3",
39
39
  "@zhin.js/logger": "1.0.75",
40
40
  "@zhin.js/plugin-runtime": "1.1.1"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "zod": "^4.0.0",
44
- "@zhin.js/adapter": "1.1.1",
45
- "@zhin.js/agent": "1.0.6",
46
- "@zhin.js/core": "1.4.1",
44
+ "@zhin.js/adapter": "1.1.2",
45
+ "@zhin.js/agent": "1.0.7",
46
+ "@zhin.js/core": "1.4.2",
47
47
  "@zhin.js/plugin-runtime": "1.1.1",
48
- "zhin.js": "5.0.1"
48
+ "zhin.js": "5.0.2"
49
49
  },
50
50
  "peerDependenciesMeta": {
51
51
  "zhin.js": {
@@ -63,14 +63,14 @@
63
63
  "typescript": "^6.0.3",
64
64
  "vitest": "^4.1.10",
65
65
  "zod": "^4.4.3",
66
- "@zhin.js/agent": "1.0.6",
66
+ "@zhin.js/agent": "1.0.7",
67
67
  "@zhin.js/host-http": "1.0.3",
68
- "zhin.js": "5.0.1"
68
+ "zhin.js": "5.0.2"
69
69
  },
70
70
  "files": [
71
71
  "adapters",
72
72
  "commands",
73
- "plugin.ts",
73
+ "plugin.js",
74
74
  "schema.json",
75
75
  "src",
76
76
  "lib",
@@ -88,7 +88,7 @@
88
88
  "zhin": {
89
89
  "protocol": 1,
90
90
  "type": "plugin",
91
- "entry": "./plugin.ts",
91
+ "entry": "./plugin.js",
92
92
  "engine": "^1.0.0",
93
93
  "runtime": "trusted",
94
94
  "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 { registerTelegramPlatformPermitChecker } from "./lib/platform-permit.js";
5
+ import { telegramRuntimeStateToken } from "./lib/telegram-runtime-state.js";
6
+ export default definePlugin({
7
+ name: 'telegram',
8
+ metadata: {
9
+ displayName: 'Telegram Bot API Adapter',
10
+ },
11
+ setup(context) {
12
+ // 运行中 endpoint 注册表(telegram endpoint list 的"运行中"数据源)
13
+ context.resources.provide(telegramRuntimeStateToken, createEndpointRuntimeState());
14
+ // 平台权限门禁:chat_creator / chat_administrator / pin_messages 等(agent 工具 platformPermit)
15
+ return registerTelegramPlatformPermitChecker();
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 { registerTelegramPlatformPermitChecker } from './src/platform-permit.js';
4
- import { telegramRuntimeStateToken } from './src/telegram-runtime-state.js';
5
-
6
- export default definePlugin({
7
- name: 'telegram',
8
- metadata: {
9
- displayName: 'Telegram Bot API Adapter',
10
- },
11
- setup(context) {
12
- // 运行中 endpoint 注册表(telegram endpoint list 的"运行中"数据源)
13
- context.resources.provide(telegramRuntimeStateToken, createEndpointRuntimeState());
14
- // 平台权限门禁:chat_creator / chat_administrator / pin_messages 等(agent 工具 platformPermit)
15
- return registerTelegramPlatformPermitChecker();
16
- },
17
- });