@zhin.js/adapter-github 5.0.13 → 5.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,37 @@
1
1
  # @zhin.js/adapter-github
2
2
 
3
+ ## 5.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
+
3
35
  ## 5.0.13
4
36
 
5
37
  ### Patch Changes
@@ -4,7 +4,7 @@
4
4
  * Implementation lives under `src/` (endpoint / webhook / oauth / protocol).
5
5
  */
6
6
  import { defineAdapter } from 'zhin.js/adapter';
7
- import { messageGatewayToken } from '@zhin.js/core/runtime';
7
+ import { messageGatewayToken, sideEventGatewayToken } from '@zhin.js/core/runtime';
8
8
  import { httpHostToken } from '@zhin.js/host-http';
9
9
  import { databaseHostToken, } from 'zhin.js';
10
10
  import { GithubEndpoint } from "../lib/endpoint.js";
@@ -28,6 +28,8 @@ export default defineAdapter({
28
28
  },
29
29
  create(context) {
30
30
  const config = resolveGithubConfig(context.config);
31
+ const gateway = context.use(messageGatewayToken);
32
+ const sideEvents = context.use(sideEventGatewayToken);
31
33
  const database = optionalDatabase(context);
32
34
  // 注册到插件运行时状态(github.endpoint list 的"运行中"数据源)
33
35
  context.use(githubRuntimeStateToken).endpoints.set(config.id, {
@@ -37,7 +39,8 @@ export default defineAdapter({
37
39
  if (config.webhookSecret) {
38
40
  return new GithubEndpoint({
39
41
  id: context.id,
40
- gateway: context.use(messageGatewayToken),
42
+ gateway,
43
+ sideEvents,
41
44
  http: context.use(httpHostToken),
42
45
  database,
43
46
  config,
@@ -46,7 +49,8 @@ export default defineAdapter({
46
49
  // API-only: Issue/PR send + agent tools without webhook.
47
50
  return new GithubEndpoint({
48
51
  id: context.id,
49
- gateway: context.use(messageGatewayToken),
52
+ gateway,
53
+ sideEvents,
50
54
  database,
51
55
  config,
52
56
  });
@@ -3,7 +3,7 @@
3
3
  * Implementation lives under `src/` (endpoint / webhook / oauth / protocol).
4
4
  */
5
5
  import { defineAdapter, type AdapterContext } 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 {
9
9
  databaseHostToken,
@@ -36,6 +36,8 @@ export default defineAdapter<GithubAdapterConfig>({
36
36
  },
37
37
  create(context) {
38
38
  const config = resolveGithubConfig(context.config);
39
+ const gateway = context.use(messageGatewayToken);
40
+ const sideEvents = context.use(sideEventGatewayToken);
39
41
  const database = optionalDatabase(context);
40
42
  // 注册到插件运行时状态(github.endpoint list 的"运行中"数据源)
41
43
  context.use(githubRuntimeStateToken).endpoints.set(config.id, {
@@ -45,7 +47,8 @@ export default defineAdapter<GithubAdapterConfig>({
45
47
  if (config.webhookSecret) {
46
48
  return new GithubEndpoint({
47
49
  id: context.id,
48
- gateway: context.use(messageGatewayToken),
50
+ gateway,
51
+ sideEvents,
49
52
  http: context.use(httpHostToken),
50
53
  database,
51
54
  config,
@@ -54,7 +57,8 @@ export default defineAdapter<GithubAdapterConfig>({
54
57
  // API-only: Issue/PR send + agent tools without webhook.
55
58
  return new GithubEndpoint({
56
59
  id: context.id,
57
- gateway: context.use(messageGatewayToken),
60
+ gateway,
61
+ sideEvents,
58
62
  database,
59
63
  config,
60
64
  });
package/lib/endpoint.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { EndpointInstance, 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, PluginDatabaseHost } from 'zhin.js';
5
5
  import { GhClient } from './gh-client.js';
@@ -8,6 +8,7 @@ import { WorkspaceManager } from './workspace-manager.js';
8
8
  export interface GithubEndpointOptions {
9
9
  readonly id: CapabilityId;
10
10
  readonly gateway: MessageGateway;
11
+ readonly sideEvents?: SideEventGateway;
11
12
  readonly http?: HttpHost;
12
13
  readonly database?: PluginDatabaseHost;
13
14
  readonly config: ResolvedGithubConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-github",
3
- "version": "5.0.13",
3
+ "version": "5.0.14",
4
4
  "description": "Zhin.js GitHub adapter for Plugin Runtime (App auth + webhook)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -41,20 +41,20 @@
41
41
  "directory": "plugins/adapters/github"
42
42
  },
43
43
  "dependencies": {
44
- "@zhin.js/adapter": "1.1.10",
45
- "@zhin.js/core": "1.5.11",
46
- "@zhin.js/host-http": "1.0.10",
47
- "@zhin.js/im-contract": "1.0.3",
44
+ "@zhin.js/adapter": "1.1.11",
45
+ "@zhin.js/core": "1.5.12",
46
+ "@zhin.js/host-http": "1.0.11",
47
+ "@zhin.js/im-contract": "1.0.4",
48
48
  "@zhin.js/logger": "1.0.76"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "zod": "^4.0.0",
52
- "@zhin.js/adapter": "1.1.10",
53
- "@zhin.js/agent": "1.1.13",
54
- "@zhin.js/command": "1.0.14",
55
- "@zhin.js/core": "1.5.11",
56
- "@zhin.js/host-http": "1.0.10",
57
- "zhin.js": "6.0.11"
52
+ "@zhin.js/adapter": "1.1.11",
53
+ "@zhin.js/agent": "1.1.14",
54
+ "@zhin.js/command": "1.0.15",
55
+ "@zhin.js/core": "1.5.12",
56
+ "@zhin.js/host-http": "1.0.11",
57
+ "zhin.js": "6.0.12"
58
58
  },
59
59
  "peerDependenciesMeta": {
60
60
  "@zhin.js/agent": {
@@ -75,8 +75,8 @@
75
75
  "typescript": "^6.0.3",
76
76
  "vitest": "^4.1.10",
77
77
  "zod": "^4.4.3",
78
- "@zhin.js/agent": "1.1.13",
79
- "zhin.js": "6.0.11"
78
+ "@zhin.js/agent": "1.1.14",
79
+ "zhin.js": "6.0.12"
80
80
  },
81
81
  "files": [
82
82
  "adapters",
package/src/endpoint.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import path from 'node:path';
5
5
  import type { EndpointInstance, EndpointSendRequest } from 'zhin.js/adapter';
6
- import type { MessageGateway } from '@zhin.js/core/runtime';
6
+ import type { MessageGateway, SideEventGateway } from '@zhin.js/core/runtime';
7
7
  import type { HttpHost, HttpRouteRegistration } from '@zhin.js/host-http';
8
8
  import { formatCompact, getAdapterLogger } from '@zhin.js/logger';
9
9
  import type { CapabilityId, PluginDatabaseHost } from 'zhin.js';
@@ -25,6 +25,7 @@ import { WorkspaceManager } from './workspace-manager.js';
25
25
  export interface GithubEndpointOptions {
26
26
  readonly id: CapabilityId;
27
27
  readonly gateway: MessageGateway;
28
+ readonly sideEvents?: SideEventGateway;
28
29
  readonly http?: HttpHost;
29
30
  readonly database?: PluginDatabaseHost;
30
31
  readonly config: ResolvedGithubConfig;