@zhin.js/adapter-github 5.0.9 → 5.0.11
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 +24 -0
- package/adapters/github.js +2 -2
- package/adapters/github.ts +2 -2
- package/lib/endpoint.d.ts +2 -2
- package/lib/github-endpoint-commands.js +2 -2
- package/lib/github-runtime-state.js +1 -1
- package/lib/oauth-users.d.ts +1 -1
- package/lib/protocol.js +1 -1
- package/package.json +12 -15
- package/plugin.js +2 -2
- package/src/endpoint.ts +2 -2
- package/src/github-endpoint-commands.ts +2 -2
- package/src/github-runtime-state.ts +1 -1
- package/src/oauth-users.ts +1 -1
- package/src/protocol.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @zhin.js/adapter-github
|
|
2
2
|
|
|
3
|
+
## 5.0.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- eb84b77: fix: 更新文档,建立正确的依赖关系
|
|
8
|
+
- Updated dependencies [d3920e9]
|
|
9
|
+
- @zhin.js/core@1.5.10
|
|
10
|
+
- zhin.js@6.0.10
|
|
11
|
+
- @zhin.js/adapter@1.1.10
|
|
12
|
+
- @zhin.js/agent@1.1.11
|
|
13
|
+
|
|
14
|
+
## 5.0.10
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [e4757a8]
|
|
19
|
+
- Updated dependencies [c3c0ebf]
|
|
20
|
+
- @zhin.js/command@1.0.13
|
|
21
|
+
- @zhin.js/host-http@1.0.10
|
|
22
|
+
- @zhin.js/agent@1.1.10
|
|
23
|
+
- @zhin.js/core@1.5.9
|
|
24
|
+
- @zhin.js/adapter@1.1.9
|
|
25
|
+
- zhin.js@6.0.9
|
|
26
|
+
|
|
3
27
|
## 5.0.9
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/adapters/github.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Convention entry: discover `adapters/github.ts` → defineAdapter.
|
|
4
4
|
* Implementation lives under `src/` (endpoint / webhook / oauth / protocol).
|
|
5
5
|
*/
|
|
6
|
-
import { defineAdapter } from '
|
|
6
|
+
import { defineAdapter } from 'zhin.js/adapter';
|
|
7
7
|
import { messageGatewayToken } from '@zhin.js/core/runtime';
|
|
8
8
|
import { httpHostToken } from '@zhin.js/host-http';
|
|
9
|
-
import { databaseHostToken, } from '
|
|
9
|
+
import { databaseHostToken, } from 'zhin.js';
|
|
10
10
|
import { GithubEndpoint } from "../lib/endpoint.js";
|
|
11
11
|
import { githubRuntimeStateToken } from "../lib/github-runtime-state.js";
|
|
12
12
|
import { resolveGithubConfig, } from "../lib/protocol.js";
|
package/adapters/github.ts
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* Convention entry: discover `adapters/github.ts` → defineAdapter.
|
|
3
3
|
* Implementation lives under `src/` (endpoint / webhook / oauth / protocol).
|
|
4
4
|
*/
|
|
5
|
-
import { defineAdapter, type AdapterContext } from '
|
|
5
|
+
import { defineAdapter, type AdapterContext } from 'zhin.js/adapter';
|
|
6
6
|
import { messageGatewayToken } from '@zhin.js/core/runtime';
|
|
7
7
|
import { httpHostToken } from '@zhin.js/host-http';
|
|
8
8
|
import {
|
|
9
9
|
databaseHostToken,
|
|
10
10
|
type PluginDatabaseHost,
|
|
11
|
-
} from '
|
|
11
|
+
} from 'zhin.js';
|
|
12
12
|
import { GithubEndpoint } from '../src/endpoint.js';
|
|
13
13
|
import { githubRuntimeStateToken } from '../src/github-runtime-state.js';
|
|
14
14
|
import {
|
package/lib/endpoint.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { EndpointInstance, EndpointSendRequest } from '
|
|
1
|
+
import type { EndpointInstance, EndpointSendRequest } from 'zhin.js/adapter';
|
|
2
2
|
import type { MessageGateway } from '@zhin.js/core/runtime';
|
|
3
3
|
import type { HttpHost } from '@zhin.js/host-http';
|
|
4
|
-
import type { CapabilityId, PluginDatabaseHost } from '
|
|
4
|
+
import type { CapabilityId, PluginDatabaseHost } from 'zhin.js';
|
|
5
5
|
import { GhClient } from './gh-client.js';
|
|
6
6
|
import { type GithubInboundComment, type ResolvedGithubConfig } from './protocol.js';
|
|
7
7
|
import { WorkspaceManager } from './workspace-manager.js';
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* resolvePrivateKey)本就支持 PEM 内容或文件路径,故 add 采用**内联路径**形式:
|
|
7
7
|
* `github.endpoint add mybot app_id=123456 private_key=./data/mybot.pem`。
|
|
8
8
|
*/
|
|
9
|
-
import { createEndpointCommands } from '
|
|
10
|
-
import { defineCommand } from '
|
|
9
|
+
import { createEndpointCommands } from 'zhin.js/adapter';
|
|
10
|
+
import { defineCommand } from 'zhin.js/command';
|
|
11
11
|
import { githubRuntimeStateToken } from './github-runtime-state.js';
|
|
12
12
|
export const githubEndpointCommands = createEndpointCommands({
|
|
13
13
|
adapterKey: 'github',
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* GitHub 插件实例的运行时状态:adapter create() 注册的 endpoint 列表。
|
|
3
3
|
* 由 plugin.ts setup() provide,adapter create 与 `github.endpoint` 命令共享(同一 owner generation)。
|
|
4
4
|
*/
|
|
5
|
-
import { defineEndpointRuntimeStateToken } from '
|
|
5
|
+
import { defineEndpointRuntimeStateToken } from 'zhin.js/adapter';
|
|
6
6
|
export const githubRuntimeStateToken = defineEndpointRuntimeStateToken('github');
|
package/lib/oauth-users.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DatabaseHost, PluginDatabaseHost } from '
|
|
1
|
+
import type { DatabaseHost, PluginDatabaseHost } from 'zhin.js';
|
|
2
2
|
export declare const GITHUB_OAUTH_USERS_TABLE = "github_oauth_users";
|
|
3
3
|
export declare const GITHUB_OAUTH_USERS_SCHEMA: {
|
|
4
4
|
readonly id: {
|
package/lib/protocol.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Canonicalization is owned by gateway/core before endpoint.send.
|
|
4
4
|
*/
|
|
5
5
|
import { createHmac, timingSafeEqual } from 'node:crypto';
|
|
6
|
-
import { pickCredential } from '
|
|
6
|
+
import { pickCredential } from 'zhin.js/adapter';
|
|
7
7
|
import { isMediaRef } from '@zhin.js/core';
|
|
8
8
|
import { formatCompact, getLogger } from '@zhin.js/logger';
|
|
9
9
|
const logger = getLogger('github');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-github",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.11",
|
|
4
4
|
"description": "Zhin.js GitHub adapter for Plugin Runtime (App auth + webhook)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -41,22 +41,19 @@
|
|
|
41
41
|
"directory": "plugins/adapters/github"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@zhin.js/adapter": "1.1.
|
|
45
|
-
"@zhin.js/
|
|
46
|
-
"@zhin.js/
|
|
47
|
-
"@zhin.js/host-http": "1.0.9",
|
|
44
|
+
"@zhin.js/adapter": "1.1.10",
|
|
45
|
+
"@zhin.js/core": "1.5.10",
|
|
46
|
+
"@zhin.js/host-http": "1.0.10",
|
|
48
47
|
"@zhin.js/im-contract": "1.0.3",
|
|
49
|
-
"@zhin.js/logger": "1.0.76"
|
|
50
|
-
"@zhin.js/plugin-runtime": "1.1.6"
|
|
48
|
+
"@zhin.js/logger": "1.0.76"
|
|
51
49
|
},
|
|
52
50
|
"peerDependencies": {
|
|
53
51
|
"zod": "^4.0.0",
|
|
54
|
-
"@zhin.js/adapter": "1.1.
|
|
55
|
-
"@zhin.js/agent": "1.1.
|
|
56
|
-
"@zhin.js/core": "1.5.
|
|
57
|
-
"@zhin.js/host-http": "1.0.
|
|
58
|
-
"
|
|
59
|
-
"zhin.js": "6.0.8"
|
|
52
|
+
"@zhin.js/adapter": "1.1.10",
|
|
53
|
+
"@zhin.js/agent": "1.1.11",
|
|
54
|
+
"@zhin.js/core": "1.5.10",
|
|
55
|
+
"@zhin.js/host-http": "1.0.10",
|
|
56
|
+
"zhin.js": "6.0.10"
|
|
60
57
|
},
|
|
61
58
|
"peerDependenciesMeta": {
|
|
62
59
|
"zhin.js": {
|
|
@@ -74,8 +71,8 @@
|
|
|
74
71
|
"typescript": "^6.0.3",
|
|
75
72
|
"vitest": "^4.1.10",
|
|
76
73
|
"zod": "^4.4.3",
|
|
77
|
-
"@zhin.js/agent": "1.1.
|
|
78
|
-
"zhin.js": "6.0.
|
|
74
|
+
"@zhin.js/agent": "1.1.11",
|
|
75
|
+
"zhin.js": "6.0.10"
|
|
79
76
|
},
|
|
80
77
|
"files": [
|
|
81
78
|
"adapters",
|
package/plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Generated by build-plugin-runtime-entries.mjs. Do not edit.
|
|
2
|
-
import { createEndpointRuntimeState } from '
|
|
3
|
-
import { definePlugin, databaseHostToken } from '
|
|
2
|
+
import { createEndpointRuntimeState } from 'zhin.js/adapter';
|
|
3
|
+
import { definePlugin, databaseHostToken } from 'zhin.js';
|
|
4
4
|
import { githubRuntimeStateToken } from "./lib/github-runtime-state.js";
|
|
5
5
|
import { defineGithubOauthUsersTable } from "./lib/oauth-users.js";
|
|
6
6
|
/**
|
package/src/endpoint.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* GithubEndpoint — lifecycle, outbound send, inbound admit.
|
|
3
3
|
*/
|
|
4
4
|
import path from 'node:path';
|
|
5
|
-
import type { EndpointInstance, EndpointSendRequest } from '
|
|
5
|
+
import type { EndpointInstance, EndpointSendRequest } from 'zhin.js/adapter';
|
|
6
6
|
import type { MessageGateway } 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
|
-
import type { CapabilityId, PluginDatabaseHost } from '
|
|
9
|
+
import type { CapabilityId, PluginDatabaseHost } from 'zhin.js';
|
|
10
10
|
import { GhClient } from './gh-client.js';
|
|
11
11
|
import { registerGithubAgentEndpoint } from './github-agent-deps.js';
|
|
12
12
|
import { lookupGithubOauthAccessToken } from './oauth-users.js';
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* resolvePrivateKey)本就支持 PEM 内容或文件路径,故 add 采用**内联路径**形式:
|
|
7
7
|
* `github.endpoint add mybot app_id=123456 private_key=./data/mybot.pem`。
|
|
8
8
|
*/
|
|
9
|
-
import { createEndpointCommands } from '
|
|
10
|
-
import { defineCommand } from '
|
|
9
|
+
import { createEndpointCommands } from 'zhin.js/adapter';
|
|
10
|
+
import { defineCommand } from 'zhin.js/command';
|
|
11
11
|
import { githubRuntimeStateToken } from './github-runtime-state.js';
|
|
12
12
|
|
|
13
13
|
export const githubEndpointCommands = createEndpointCommands({
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* GitHub 插件实例的运行时状态:adapter create() 注册的 endpoint 列表。
|
|
3
3
|
* 由 plugin.ts setup() provide,adapter create 与 `github.endpoint` 命令共享(同一 owner generation)。
|
|
4
4
|
*/
|
|
5
|
-
import { defineEndpointRuntimeStateToken } from '
|
|
5
|
+
import { defineEndpointRuntimeStateToken } from 'zhin.js/adapter';
|
|
6
6
|
|
|
7
7
|
export const githubRuntimeStateToken = defineEndpointRuntimeStateToken('github');
|
package/src/oauth-users.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* github_oauth_users — SSOT for Runtime user-token binding (gh bind / Endpoint lookup).
|
|
3
3
|
*/
|
|
4
4
|
import { formatCompact, getLogger } from '@zhin.js/logger';
|
|
5
|
-
import type { DatabaseHost, PluginDatabaseHost } from '
|
|
5
|
+
import type { DatabaseHost, PluginDatabaseHost } from 'zhin.js';
|
|
6
6
|
|
|
7
7
|
const logger = getLogger('github');
|
|
8
8
|
|
package/src/protocol.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { createHmac, timingSafeEqual } from 'node:crypto';
|
|
7
7
|
import type { IncomingMessage } from 'node:http';
|
|
8
|
-
import { pickCredential } from '
|
|
8
|
+
import { pickCredential } from 'zhin.js/adapter';
|
|
9
9
|
import { isMediaRef } from '@zhin.js/core';
|
|
10
10
|
import type { ConversationRef } from '@zhin.js/im-contract';
|
|
11
11
|
import { formatCompact, getLogger } from '@zhin.js/logger';
|