@zhin.js/adapter-milky 6.0.12 → 6.0.14

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,45 @@
1
1
  # @zhin.js/adapter-milky
2
2
 
3
+ ## 6.0.14
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 [0c82a7e]
11
+ - Updated dependencies [b9217e4]
12
+ - Updated dependencies [5969c5b]
13
+ - Updated dependencies [5969c5b]
14
+ - Updated dependencies [974772e]
15
+ - Updated dependencies [5969c5b]
16
+ - Updated dependencies [5969c5b]
17
+ - Updated dependencies [2f786bd]
18
+ - Updated dependencies [63d89f9]
19
+ - Updated dependencies [71c7cdd]
20
+ - Updated dependencies [3cca0ea]
21
+ - Updated dependencies [1312ca0]
22
+ - Updated dependencies [985fa22]
23
+ - Updated dependencies [04b861d]
24
+ - Updated dependencies [a23d544]
25
+ - Updated dependencies [8cddabf]
26
+ - Updated dependencies [dbe5081]
27
+ - @zhin.js/im-contract@1.0.4
28
+ - @zhin.js/core@1.5.12
29
+ - @zhin.js/adapter@1.1.11
30
+ - @zhin.js/agent@1.1.14
31
+ - @zhin.js/host-http@1.0.11
32
+ - @zhin.js/command@1.0.15
33
+ - zhin.js@6.0.12
34
+
35
+ ## 6.0.13
36
+
37
+ ### Patch Changes
38
+
39
+ - @zhin.js/core@1.5.11
40
+ - @zhin.js/agent@1.1.13
41
+ - zhin.js@6.0.11
42
+
3
43
  ## 6.0.12
4
44
 
5
45
  ### Patch Changes
package/adapters/milky.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Convention entry: discover `adapters/milky.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 { MilkySseEndpoint, MilkyWebhookEndpoint, MilkyWssEndpoint, MilkyWsEndpoint, } from "../lib/endpoint.js";
9
9
  import { resolveMilkyConfig, } from "../lib/protocol.js";
@@ -19,6 +19,7 @@ export default defineAdapter({
19
19
  create(context) {
20
20
  const config = resolveMilkyConfig(context.config);
21
21
  const gateway = context.use(messageGatewayToken);
22
+ const sideEvents = context.use(sideEventGatewayToken);
22
23
  // 注册到插件运行时状态(milky.endpoint list 的"运行中"数据源)
23
24
  context.use(milkyRuntimeStateToken).endpoints.set(config.id, {
24
25
  id: config.id,
@@ -28,6 +29,7 @@ export default defineAdapter({
28
29
  return new MilkyWebhookEndpoint({
29
30
  id: context.id,
30
31
  gateway,
32
+ sideEvents,
31
33
  http: context.use(httpHostToken),
32
34
  config,
33
35
  });
@@ -36,6 +38,7 @@ export default defineAdapter({
36
38
  return new MilkyWssEndpoint({
37
39
  id: context.id,
38
40
  gateway,
41
+ sideEvents,
39
42
  http: context.use(httpHostToken),
40
43
  config,
41
44
  });
@@ -44,12 +47,14 @@ export default defineAdapter({
44
47
  return new MilkySseEndpoint({
45
48
  id: context.id,
46
49
  gateway,
50
+ sideEvents,
47
51
  config,
48
52
  });
49
53
  }
50
54
  return new MilkyWsEndpoint({
51
55
  id: context.id,
52
56
  gateway,
57
+ sideEvents,
53
58
  config,
54
59
  });
55
60
  },
package/adapters/milky.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Convention entry: discover `adapters/milky.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 {
8
8
  MilkySseEndpoint,
@@ -42,6 +42,7 @@ export default defineAdapter<MilkyAdapterConfig>({
42
42
  create(context) {
43
43
  const config = resolveMilkyConfig(context.config);
44
44
  const gateway = context.use(messageGatewayToken);
45
+ const sideEvents = context.use(sideEventGatewayToken);
45
46
  // 注册到插件运行时状态(milky.endpoint list 的"运行中"数据源)
46
47
  context.use(milkyRuntimeStateToken).endpoints.set(config.id, {
47
48
  id: config.id,
@@ -51,6 +52,7 @@ export default defineAdapter<MilkyAdapterConfig>({
51
52
  return new MilkyWebhookEndpoint({
52
53
  id: context.id,
53
54
  gateway,
55
+ sideEvents,
54
56
  http: context.use(httpHostToken),
55
57
  config,
56
58
  });
@@ -59,6 +61,7 @@ export default defineAdapter<MilkyAdapterConfig>({
59
61
  return new MilkyWssEndpoint({
60
62
  id: context.id,
61
63
  gateway,
64
+ sideEvents,
62
65
  http: context.use(httpHostToken),
63
66
  config,
64
67
  });
@@ -67,12 +70,14 @@ export default defineAdapter<MilkyAdapterConfig>({
67
70
  return new MilkySseEndpoint({
68
71
  id: context.id,
69
72
  gateway,
73
+ sideEvents,
70
74
  config,
71
75
  });
72
76
  }
73
77
  return new MilkyWsEndpoint({
74
78
  id: context.id,
75
79
  gateway,
80
+ sideEvents,
76
81
  config,
77
82
  });
78
83
  },
@@ -2,7 +2,7 @@
2
2
  * Milky SSE client endpoint — GET text/event-stream on /event.
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 { CapabilityId } from 'zhin.js';
7
7
  import { callApi, type MilkyEvent, type MilkySseConfig } from './protocol.js';
8
8
  import { type SseClientHandle } from './sse-client.js';
@@ -16,6 +16,7 @@ export type CreateMilkySseStream = (options: {
16
16
  export interface MilkySseEndpointOptions {
17
17
  readonly id: CapabilityId;
18
18
  readonly gateway: MessageGateway;
19
+ readonly sideEvents?: SideEventGateway;
19
20
  readonly config: MilkySseConfig;
20
21
  readonly createSseStream?: CreateMilkySseStream;
21
22
  readonly callApi?: typeof callApi;
@@ -1,11 +1,12 @@
1
1
  import type { EndpointInstance, EndpointManagement, EndpointSendRequest } from 'zhin.js/adapter';
2
- import type { MessageGateway } from '@zhin.js/core/runtime';
2
+ import type { MessageGateway, SideEventGateway } from '@zhin.js/core/runtime';
3
3
  import type { HttpHost } from '@zhin.js/host-http';
4
4
  import type { CapabilityId } from 'zhin.js';
5
5
  import { callApi, type MilkyEvent, type MilkyWebhookConfig } from './protocol.js';
6
6
  export interface MilkyWebhookEndpointOptions {
7
7
  readonly id: CapabilityId;
8
8
  readonly gateway: MessageGateway;
9
+ readonly sideEvents?: SideEventGateway;
9
10
  readonly http: HttpHost;
10
11
  readonly config: MilkyWebhookConfig;
11
12
  readonly callApi?: typeof callApi;
@@ -1,11 +1,12 @@
1
1
  import { type EndpointInstance, type EndpointManagement, type EndpointSendRequest } from 'zhin.js/adapter';
2
- import type { MessageGateway } from '@zhin.js/core/runtime';
2
+ import type { MessageGateway, SideEventGateway } from '@zhin.js/core/runtime';
3
3
  import type { CapabilityId } from 'zhin.js';
4
4
  import { callApi, type MilkyEvent, type MilkyWsConfig } from './protocol.js';
5
5
  import type { MilkyWsCreateOptions, MilkyWsSocket } from './ws-types.js';
6
6
  export interface MilkyWsEndpointOptions {
7
7
  readonly id: CapabilityId;
8
8
  readonly gateway: MessageGateway;
9
+ readonly sideEvents?: SideEventGateway;
9
10
  readonly config: MilkyWsConfig;
10
11
  readonly createWebSocket?: (url: string, options: MilkyWsCreateOptions) => MilkyWsSocket;
11
12
  readonly callApi?: typeof callApi;
@@ -1,11 +1,12 @@
1
1
  import type { EndpointInstance, EndpointManagement, EndpointSendRequest } from 'zhin.js/adapter';
2
- import type { MessageGateway } from '@zhin.js/core/runtime';
2
+ import type { MessageGateway, SideEventGateway } from '@zhin.js/core/runtime';
3
3
  import type { HttpHost } from '@zhin.js/host-http';
4
4
  import type { CapabilityId } from 'zhin.js';
5
5
  import { callApi, type MilkyEvent, type MilkyWssConfig } from './protocol.js';
6
6
  export interface MilkyWssEndpointOptions {
7
7
  readonly id: CapabilityId;
8
8
  readonly gateway: MessageGateway;
9
+ readonly sideEvents?: SideEventGateway;
9
10
  readonly http: HttpHost;
10
11
  readonly config: MilkyWssConfig;
11
12
  readonly callApi?: typeof callApi;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-milky",
3
- "version": "6.0.12",
3
+ "version": "6.0.14",
4
4
  "description": "Zhin.js Milky adapter for Plugin Runtime (WebSocket client)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -40,10 +40,10 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "ws": "^8.21.1",
43
- "@zhin.js/adapter": "1.1.10",
44
- "@zhin.js/core": "1.5.10",
45
- "@zhin.js/host-http": "1.0.10",
46
- "@zhin.js/im-contract": "1.0.3",
43
+ "@zhin.js/adapter": "1.1.11",
44
+ "@zhin.js/core": "1.5.12",
45
+ "@zhin.js/host-http": "1.0.11",
46
+ "@zhin.js/im-contract": "1.0.4",
47
47
  "@zhin.js/logger": "1.0.76"
48
48
  },
49
49
  "devDependencies": {
@@ -52,17 +52,17 @@
52
52
  "typescript": "^6.0.3",
53
53
  "vitest": "^4.1.10",
54
54
  "zod": "^4.4.3",
55
- "@zhin.js/agent": "1.1.12",
56
- "@zhin.js/host-http": "1.0.10",
57
- "zhin.js": "6.0.10"
55
+ "@zhin.js/agent": "1.1.14",
56
+ "@zhin.js/host-http": "1.0.11",
57
+ "zhin.js": "6.0.12"
58
58
  },
59
59
  "peerDependencies": {
60
60
  "zod": "^4.0.0",
61
- "@zhin.js/adapter": "1.1.10",
62
- "@zhin.js/agent": "1.1.12",
63
- "@zhin.js/command": "1.0.14",
64
- "@zhin.js/core": "1.5.10",
65
- "zhin.js": "6.0.10"
61
+ "@zhin.js/adapter": "1.1.11",
62
+ "@zhin.js/agent": "1.1.14",
63
+ "@zhin.js/command": "1.0.15",
64
+ "@zhin.js/core": "1.5.12",
65
+ "zhin.js": "6.0.12"
66
66
  },
67
67
  "peerDependenciesMeta": {
68
68
  "@zhin.js/agent": {
@@ -9,7 +9,7 @@ import {
9
9
  type EndpointManagement,
10
10
  type EndpointSendRequest,
11
11
  } from 'zhin.js/adapter';
12
- import type { MessageGateway } from '@zhin.js/core/runtime';
12
+ import type { MessageGateway, SideEventGateway } from '@zhin.js/core/runtime';
13
13
  import { formatCompact, getAdapterLogger } from '@zhin.js/logger';
14
14
  import type { CapabilityId } from 'zhin.js';
15
15
  import { createMilkyEndpointManagement } from './endpoint-management.js';
@@ -46,6 +46,7 @@ export type CreateMilkySseStream = (options: {
46
46
  export interface MilkySseEndpointOptions {
47
47
  readonly id: CapabilityId;
48
48
  readonly gateway: MessageGateway;
49
+ readonly sideEvents?: SideEventGateway;
49
50
  readonly config: MilkySseConfig;
50
51
  readonly createSseStream?: CreateMilkySseStream;
51
52
  readonly callApi?: typeof callApi;
@@ -7,7 +7,7 @@ import type {
7
7
  EndpointManagement,
8
8
  EndpointSendRequest,
9
9
  } from 'zhin.js/adapter';
10
- import type { MessageGateway } from '@zhin.js/core/runtime';
10
+ import type { MessageGateway, SideEventGateway } from '@zhin.js/core/runtime';
11
11
  import type { HttpHost, HttpRouteRegistration } from '@zhin.js/host-http';
12
12
  import { formatCompact, getAdapterLogger } from '@zhin.js/logger';
13
13
  import type { CapabilityId } from 'zhin.js';
@@ -36,6 +36,7 @@ import {
36
36
  export interface MilkyWebhookEndpointOptions {
37
37
  readonly id: CapabilityId;
38
38
  readonly gateway: MessageGateway;
39
+ readonly sideEvents?: SideEventGateway;
39
40
  readonly http: HttpHost;
40
41
  readonly config: MilkyWebhookConfig;
41
42
  readonly callApi?: typeof callApi;
@@ -10,7 +10,7 @@ import {
10
10
  type EndpointManagement,
11
11
  type EndpointSendRequest,
12
12
  } from 'zhin.js/adapter';
13
- import type { MessageGateway } from '@zhin.js/core/runtime';
13
+ import type { MessageGateway, SideEventGateway } from '@zhin.js/core/runtime';
14
14
  import { formatCompact, getAdapterLogger } from '@zhin.js/logger';
15
15
  import type { CapabilityId } from 'zhin.js';
16
16
  import { createMilkyEndpointManagement } from './endpoint-management.js';
@@ -41,6 +41,7 @@ const WS_OPEN = 1;
41
41
  export interface MilkyWsEndpointOptions {
42
42
  readonly id: CapabilityId;
43
43
  readonly gateway: MessageGateway;
44
+ readonly sideEvents?: SideEventGateway;
44
45
  readonly config: MilkyWsConfig;
45
46
  readonly createWebSocket?: (
46
47
  url: string,
@@ -7,7 +7,7 @@ import type {
7
7
  EndpointManagement,
8
8
  EndpointSendRequest,
9
9
  } from 'zhin.js/adapter';
10
- import type { MessageGateway } from '@zhin.js/core/runtime';
10
+ import type { MessageGateway, SideEventGateway } from '@zhin.js/core/runtime';
11
11
  import type { HttpHost, WsConnection } from '@zhin.js/host-http';
12
12
  import { formatCompact, getAdapterLogger } from '@zhin.js/logger';
13
13
  import type { CapabilityId } from 'zhin.js';
@@ -39,6 +39,7 @@ const WS_OPEN = 1;
39
39
  export interface MilkyWssEndpointOptions {
40
40
  readonly id: CapabilityId;
41
41
  readonly gateway: MessageGateway;
42
+ readonly sideEvents?: SideEventGateway;
42
43
  readonly http: HttpHost;
43
44
  readonly config: MilkyWssConfig;
44
45
  readonly callApi?: typeof callApi;