@zhin.js/adapter-satori 5.0.11 → 5.0.13
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 +28 -0
- package/adapters/satori.js +4 -1
- package/adapters/satori.ts +4 -1
- package/lib/endpoint.d.ts +3 -1
- package/package.json +11 -11
- package/src/endpoint.ts +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @zhin.js/adapter-satori
|
|
2
2
|
|
|
3
|
+
## 5.0.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5969c5b: Add SideEventGateway so adapters forward notice/request/system into HandlerIndex. HandlerContext now exposes only generation-safe capabilities and prompt ports; live Endpoint escape hatches are removed.
|
|
8
|
+
- Updated dependencies [5969c5b]
|
|
9
|
+
- Updated dependencies [d336a3f]
|
|
10
|
+
- Updated dependencies [5969c5b]
|
|
11
|
+
- Updated dependencies [5969c5b]
|
|
12
|
+
- Updated dependencies [974772e]
|
|
13
|
+
- Updated dependencies [5969c5b]
|
|
14
|
+
- Updated dependencies [2f786bd]
|
|
15
|
+
- Updated dependencies [1312ca0]
|
|
16
|
+
- Updated dependencies [985fa22]
|
|
17
|
+
- @zhin.js/im-contract@1.0.4
|
|
18
|
+
- @zhin.js/core@1.5.12
|
|
19
|
+
- @zhin.js/adapter@1.1.11
|
|
20
|
+
- @zhin.js/host-http@1.0.11
|
|
21
|
+
- @zhin.js/command@1.0.15
|
|
22
|
+
- zhin.js@6.0.12
|
|
23
|
+
|
|
24
|
+
## 5.0.12
|
|
25
|
+
|
|
26
|
+
### Patch Changes
|
|
27
|
+
|
|
28
|
+
- @zhin.js/core@1.5.11
|
|
29
|
+
- zhin.js@6.0.11
|
|
30
|
+
|
|
3
31
|
## 5.0.11
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/adapters/satori.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Convention entry: discover `adapters/satori.ts` → defineAdapter.
|
|
4
4
|
*/
|
|
5
5
|
import { defineAdapter } from 'zhin.js/adapter';
|
|
6
|
-
import { messageGatewayToken } from '@zhin.js/core/runtime';
|
|
6
|
+
import { messageGatewayToken, sideEventGatewayToken } from '@zhin.js/core/runtime';
|
|
7
7
|
import { httpHostToken } from '@zhin.js/host-http';
|
|
8
8
|
import { SatoriWebhookEndpoint, SatoriWsEndpoint } from "../lib/endpoint.js";
|
|
9
9
|
import { resolveSatoriConfig, } from "../lib/protocol.js";
|
|
@@ -19,6 +19,7 @@ export default defineAdapter({
|
|
|
19
19
|
create(context) {
|
|
20
20
|
const config = resolveSatoriConfig(context.config);
|
|
21
21
|
const gateway = context.use(messageGatewayToken);
|
|
22
|
+
const sideEvents = context.use(sideEventGatewayToken);
|
|
22
23
|
// 注册到插件运行时状态(satori.endpoint list 的"运行中"数据源)
|
|
23
24
|
context.use(satoriRuntimeStateToken).endpoints.set(config.id, {
|
|
24
25
|
id: config.id,
|
|
@@ -28,6 +29,7 @@ export default defineAdapter({
|
|
|
28
29
|
return new SatoriWebhookEndpoint({
|
|
29
30
|
id: context.id,
|
|
30
31
|
gateway,
|
|
32
|
+
sideEvents,
|
|
31
33
|
http: context.use(httpHostToken),
|
|
32
34
|
config,
|
|
33
35
|
});
|
|
@@ -35,6 +37,7 @@ export default defineAdapter({
|
|
|
35
37
|
return new SatoriWsEndpoint({
|
|
36
38
|
id: context.id,
|
|
37
39
|
gateway,
|
|
40
|
+
sideEvents,
|
|
38
41
|
config,
|
|
39
42
|
});
|
|
40
43
|
},
|
package/adapters/satori.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Convention entry: discover `adapters/satori.ts` → defineAdapter.
|
|
3
3
|
*/
|
|
4
4
|
import { defineAdapter } from 'zhin.js/adapter';
|
|
5
|
-
import { messageGatewayToken } from '@zhin.js/core/runtime';
|
|
5
|
+
import { messageGatewayToken, sideEventGatewayToken } from '@zhin.js/core/runtime';
|
|
6
6
|
import { httpHostToken } from '@zhin.js/host-http';
|
|
7
7
|
import { SatoriWebhookEndpoint, SatoriWsEndpoint } from '../src/endpoint.js';
|
|
8
8
|
import {
|
|
@@ -30,6 +30,7 @@ export default defineAdapter<SatoriAdapterConfig>({
|
|
|
30
30
|
create(context) {
|
|
31
31
|
const config = resolveSatoriConfig(context.config);
|
|
32
32
|
const gateway = context.use(messageGatewayToken);
|
|
33
|
+
const sideEvents = context.use(sideEventGatewayToken);
|
|
33
34
|
// 注册到插件运行时状态(satori.endpoint list 的"运行中"数据源)
|
|
34
35
|
context.use(satoriRuntimeStateToken).endpoints.set(config.id, {
|
|
35
36
|
id: config.id,
|
|
@@ -39,6 +40,7 @@ export default defineAdapter<SatoriAdapterConfig>({
|
|
|
39
40
|
return new SatoriWebhookEndpoint({
|
|
40
41
|
id: context.id,
|
|
41
42
|
gateway,
|
|
43
|
+
sideEvents,
|
|
42
44
|
http: context.use(httpHostToken),
|
|
43
45
|
config,
|
|
44
46
|
});
|
|
@@ -46,6 +48,7 @@ export default defineAdapter<SatoriAdapterConfig>({
|
|
|
46
48
|
return new SatoriWsEndpoint({
|
|
47
49
|
id: context.id,
|
|
48
50
|
gateway,
|
|
51
|
+
sideEvents,
|
|
49
52
|
config,
|
|
50
53
|
});
|
|
51
54
|
},
|
package/lib/endpoint.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* SatoriEndpoint — WebSocket and webhook lifecycle, outbound, admit.
|
|
3
3
|
*/
|
|
4
4
|
import { type EndpointInstance, type EndpointManagement, type EndpointSendRequest } from 'zhin.js/adapter';
|
|
5
|
-
import type { MessageGateway } from '@zhin.js/core/runtime';
|
|
5
|
+
import type { MessageGateway, SideEventGateway } from '@zhin.js/core/runtime';
|
|
6
6
|
import type { HttpHost } from '@zhin.js/host-http';
|
|
7
7
|
import type { CapabilityId } from 'zhin.js';
|
|
8
8
|
import { callSatoriApi, type ResolvedSatoriWebhookConfig, type ResolvedSatoriWsConfig, type SatoriEventBody, type SatoriLogin } from './protocol.js';
|
|
@@ -11,6 +11,7 @@ export type SatoriApiCaller = typeof callSatoriApi;
|
|
|
11
11
|
export interface SatoriWsEndpointOptions {
|
|
12
12
|
readonly id: CapabilityId;
|
|
13
13
|
readonly gateway: MessageGateway;
|
|
14
|
+
readonly sideEvents?: SideEventGateway;
|
|
14
15
|
readonly config: ResolvedSatoriWsConfig;
|
|
15
16
|
readonly createWebSocket?: CreateSatoriWebSocket;
|
|
16
17
|
readonly callApi?: SatoriApiCaller;
|
|
@@ -33,6 +34,7 @@ export declare class SatoriWsEndpoint implements EndpointInstance {
|
|
|
33
34
|
export interface SatoriWebhookEndpointOptions {
|
|
34
35
|
readonly id: CapabilityId;
|
|
35
36
|
readonly gateway: MessageGateway;
|
|
37
|
+
readonly sideEvents?: SideEventGateway;
|
|
36
38
|
readonly http: HttpHost;
|
|
37
39
|
readonly config: ResolvedSatoriWebhookConfig;
|
|
38
40
|
readonly callApi?: SatoriApiCaller;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-satori",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.13",
|
|
4
4
|
"description": "Zhin.js Satori adapter for Plugin Runtime (WebSocket client)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"ws": "^8.21.1",
|
|
42
|
-
"@zhin.js/adapter": "1.1.
|
|
43
|
-
"@zhin.js/core": "1.5.
|
|
44
|
-
"@zhin.js/host-http": "1.0.
|
|
45
|
-
"@zhin.js/im-contract": "1.0.
|
|
42
|
+
"@zhin.js/adapter": "1.1.11",
|
|
43
|
+
"@zhin.js/core": "1.5.12",
|
|
44
|
+
"@zhin.js/host-http": "1.0.11",
|
|
45
|
+
"@zhin.js/im-contract": "1.0.4",
|
|
46
46
|
"@zhin.js/logger": "1.0.76"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
@@ -50,14 +50,14 @@
|
|
|
50
50
|
"@types/ws": "^8.18.1",
|
|
51
51
|
"typescript": "^6.0.3",
|
|
52
52
|
"vitest": "^4.1.10",
|
|
53
|
-
"@zhin.js/host-http": "1.0.
|
|
54
|
-
"zhin.js": "6.0.
|
|
53
|
+
"@zhin.js/host-http": "1.0.11",
|
|
54
|
+
"zhin.js": "6.0.12"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@zhin.js/adapter": "1.1.
|
|
58
|
-
"@zhin.js/command": "1.0.
|
|
59
|
-
"@zhin.js/core": "1.5.
|
|
60
|
-
"zhin.js": "6.0.
|
|
57
|
+
"@zhin.js/adapter": "1.1.11",
|
|
58
|
+
"@zhin.js/command": "1.0.15",
|
|
59
|
+
"@zhin.js/core": "1.5.12",
|
|
60
|
+
"zhin.js": "6.0.12"
|
|
61
61
|
},
|
|
62
62
|
"peerDependenciesMeta": {
|
|
63
63
|
"@zhin.js/command": {
|
package/src/endpoint.ts
CHANGED
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
type EndpointManagement,
|
|
12
12
|
type EndpointSendRequest,
|
|
13
13
|
} from 'zhin.js/adapter';
|
|
14
|
-
import type { MessageGateway } from '@zhin.js/core/runtime';
|
|
14
|
+
import type { MessageGateway, SideEventGateway } from '@zhin.js/core/runtime';
|
|
15
15
|
import type { HttpHost, HttpRouteRegistration } from '@zhin.js/host-http';
|
|
16
16
|
import { formatCompact, getAdapterLogger } from '@zhin.js/logger';
|
|
17
17
|
import type { CapabilityId } from 'zhin.js';
|
|
@@ -48,6 +48,7 @@ export type SatoriApiCaller = typeof callSatoriApi;
|
|
|
48
48
|
export interface SatoriWsEndpointOptions {
|
|
49
49
|
readonly id: CapabilityId;
|
|
50
50
|
readonly gateway: MessageGateway;
|
|
51
|
+
readonly sideEvents?: SideEventGateway;
|
|
51
52
|
readonly config: ResolvedSatoriWsConfig;
|
|
52
53
|
readonly createWebSocket?: CreateSatoriWebSocket;
|
|
53
54
|
readonly callApi?: SatoriApiCaller;
|
|
@@ -307,6 +308,7 @@ export class SatoriWsEndpoint implements EndpointInstance {
|
|
|
307
308
|
export interface SatoriWebhookEndpointOptions {
|
|
308
309
|
readonly id: CapabilityId;
|
|
309
310
|
readonly gateway: MessageGateway;
|
|
311
|
+
readonly sideEvents?: SideEventGateway;
|
|
310
312
|
readonly http: HttpHost;
|
|
311
313
|
readonly config: ResolvedSatoriWebhookConfig;
|
|
312
314
|
readonly callApi?: SatoriApiCaller;
|