@zhin.js/adapter-satori 4.0.1 → 4.0.3

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,30 @@
1
1
  # @zhin.js/adapter-satori
2
2
 
3
+ ## 4.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [45b3256]
8
+ - @zhin.js/core@1.4.3
9
+ - zhin.js@5.0.3
10
+
11
+ ## 4.0.2
12
+
13
+ ### Patch Changes
14
+
15
+ - d5cd4aa: Publish Plugin Runtime entry points and convention modules as JavaScript so
16
+ installed npm plugins load on Node without TypeScript stripping. Workspace
17
+ development continues to prefer TypeScript sources for local HMR.
18
+
19
+ Remove the unconsumed legacy game hub APIs from game-kit; game navigation and
20
+ records now use ordinary convention commands owned by the game hub plugin.
21
+
22
+ - Updated dependencies [d5cd4aa]
23
+ - @zhin.js/command@1.0.4
24
+ - zhin.js@5.0.2
25
+ - @zhin.js/adapter@1.1.2
26
+ - @zhin.js/core@1.4.2
27
+
3
28
  ## 4.0.1
4
29
 
5
30
  ### Patch Changes
@@ -0,0 +1,41 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ /**
3
+ * Convention entry: discover `adapters/satori.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 { SatoriWebhookEndpoint, SatoriWsEndpoint } from "../lib/endpoint.js";
9
+ import { resolveSatoriConfig, } from "../lib/protocol.js";
10
+ import { satoriRuntimeStateToken } from "../lib/satori-runtime-state.js";
11
+ export { SatoriWebhookEndpoint, SatoriWsEndpoint } from "../lib/endpoint.js";
12
+ export default defineAdapter({
13
+ capabilities: ['inbound', 'outbound'],
14
+ // Satori 协议 img/file 元素消费 url 与 base64 内联数据;无卡片交互面,交互段降级纯文本。
15
+ segments: {
16
+ outboundMedia: ['url', 'base64'],
17
+ interactive: 'text',
18
+ },
19
+ create(context) {
20
+ const config = resolveSatoriConfig(context.config);
21
+ const gateway = context.use(messageGatewayToken);
22
+ // 注册到插件运行时状态(satori endpoint list 的"运行中"数据源)
23
+ context.use(satoriRuntimeStateToken).endpoints.set(config.name, {
24
+ name: config.name,
25
+ mode: config.connection,
26
+ });
27
+ if (config.connection === 'webhook') {
28
+ return new SatoriWebhookEndpoint({
29
+ id: context.id,
30
+ gateway,
31
+ http: context.use(httpHostToken),
32
+ config,
33
+ });
34
+ }
35
+ return new SatoriWsEndpoint({
36
+ id: context.id,
37
+ gateway,
38
+ config,
39
+ });
40
+ },
41
+ });
@@ -0,0 +1,3 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ import { satoriEndpointCommands } from "../../../lib/satori-endpoint-commands.js";
3
+ export default satoriEndpointCommands.add;
@@ -0,0 +1,3 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ import { satoriEndpointCommands } from "../../lib/satori-endpoint-commands.js";
3
+ export default satoriEndpointCommands.list;
@@ -0,0 +1,3 @@
1
+ // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ import { satoriEndpointCommands } from "../../../lib/satori-endpoint-commands.js";
3
+ export default satoriEndpointCommands.remove;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-satori",
3
- "version": "4.0.1",
3
+ "version": "4.0.3",
4
4
  "description": "Zhin.js Satori adapter for Plugin Runtime (WebSocket client)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -15,7 +15,7 @@
15
15
  "files": [
16
16
  "adapters",
17
17
  "commands",
18
- "plugin.ts",
18
+ "plugin.js",
19
19
  "schema.json",
20
20
  "src",
21
21
  "lib",
@@ -39,9 +39,9 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "ws": "^8.21.0",
42
- "@zhin.js/adapter": "1.1.1",
43
- "@zhin.js/command": "1.0.3",
44
- "@zhin.js/core": "1.4.1",
42
+ "@zhin.js/adapter": "1.1.2",
43
+ "@zhin.js/command": "1.0.4",
44
+ "@zhin.js/core": "1.4.3",
45
45
  "@zhin.js/host-http": "1.0.3",
46
46
  "@zhin.js/logger": "1.0.75",
47
47
  "@zhin.js/plugin-runtime": "1.1.1"
@@ -54,10 +54,10 @@
54
54
  "@zhin.js/host-http": "1.0.3"
55
55
  },
56
56
  "peerDependencies": {
57
- "@zhin.js/adapter": "1.1.1",
58
- "@zhin.js/core": "1.4.1",
57
+ "@zhin.js/adapter": "1.1.2",
58
+ "@zhin.js/core": "1.4.3",
59
59
  "@zhin.js/plugin-runtime": "1.1.1",
60
- "zhin.js": "5.0.1"
60
+ "zhin.js": "5.0.3"
61
61
  },
62
62
  "peerDependenciesMeta": {
63
63
  "zhin.js": {
@@ -79,7 +79,7 @@
79
79
  "zhin": {
80
80
  "protocol": 1,
81
81
  "type": "plugin",
82
- "entry": "./plugin.ts",
82
+ "entry": "./plugin.js",
83
83
  "engine": "^1.0.0",
84
84
  "runtime": "trusted",
85
85
  "features": [
package/plugin.js ADDED
@@ -0,0 +1,14 @@
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 { satoriRuntimeStateToken } from "./lib/satori-runtime-state.js";
5
+ export default definePlugin({
6
+ name: 'satori',
7
+ metadata: {
8
+ displayName: 'Satori Adapter',
9
+ },
10
+ setup(context) {
11
+ // 运行中 endpoint 注册表(satori endpoint list 的"运行中"数据源)
12
+ context.resources.provide(satoriRuntimeStateToken, createEndpointRuntimeState());
13
+ },
14
+ });
package/plugin.ts DELETED
@@ -1,14 +0,0 @@
1
- import { createEndpointRuntimeState } from '@zhin.js/adapter';
2
- import { definePlugin } from '@zhin.js/plugin-runtime';
3
- import { satoriRuntimeStateToken } from './src/satori-runtime-state.js';
4
-
5
- export default definePlugin({
6
- name: 'satori',
7
- metadata: {
8
- displayName: 'Satori Adapter',
9
- },
10
- setup(context) {
11
- // 运行中 endpoint 注册表(satori endpoint list 的"运行中"数据源)
12
- context.resources.provide(satoriRuntimeStateToken, createEndpointRuntimeState());
13
- },
14
- });