@zhin.js/adapter-kook 7.0.9 → 7.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/README.md +1 -1
- package/adapters/kook.js +1 -1
- package/adapters/kook.ts +1 -1
- package/lib/endpoint.d.ts +2 -2
- package/lib/kook-endpoint-commands.js +2 -2
- package/lib/kook-runtime-state.d.ts +1 -1
- package/lib/kook-runtime-state.js +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/kook-endpoint-commands.ts +2 -2
- package/src/kook-runtime-state.ts +1 -1
- package/src/protocol.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @zhin.js/adapter-kook
|
|
2
2
|
|
|
3
|
+
## 7.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
|
+
## 7.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
|
## 7.0.9
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ pnpm add @zhin.js/adapter-kook
|
|
|
21
21
|
- `@zhin.js/adapter` — 约定式 `adapters/kook.ts`(`defineAdapter`)
|
|
22
22
|
- `@zhin.js/core` — `messageGatewayToken` 入站/出站
|
|
23
23
|
- `@zhin.js/host-http` — Webhook 模式 POST 路由(WebSocket 不需要)
|
|
24
|
-
-
|
|
24
|
+
- `zhin.js` — `plugin.ts`(`definePlugin`)
|
|
25
25
|
- 配置经插件 `schema.json` 落到 `plugins.<instanceKey>`
|
|
26
26
|
- **WebSocket 路径无需** `@zhin.js/host-http` / `@zhin.js/host-router`
|
|
27
27
|
|
package/adapters/kook.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Convention entry: discover `adapters/kook.ts` → defineAdapter.
|
|
4
4
|
* Implementation lives under `src/` (endpoint / webhook / ws / 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
9
|
import { KookWebhookEndpoint, KookWebsocketEndpoint, } from "../lib/endpoint.js";
|
package/adapters/kook.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Convention entry: discover `adapters/kook.ts` → defineAdapter.
|
|
3
3
|
* Implementation lives under `src/` (endpoint / webhook / ws / protocol).
|
|
4
4
|
*/
|
|
5
|
-
import { defineAdapter } from '
|
|
5
|
+
import { defineAdapter } 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 {
|
package/lib/endpoint.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { EndpointInstance, EndpointManagement, EndpointSendRequest } from '
|
|
1
|
+
import type { EndpointInstance, EndpointManagement, 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 } from '
|
|
4
|
+
import type { CapabilityId } from 'zhin.js';
|
|
5
5
|
import { type KookInboundMessage, type ResolvedKookWebhookConfig, type ResolvedKookWebsocketConfig } from './protocol.js';
|
|
6
6
|
import { type CreateKookClient, type KookClientTransport } from './ws.js';
|
|
7
7
|
export interface KookEndpointOptions {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* `kook.endpoint` 命令族:由 @zhin.js/adapter 的 createEndpointCommands 套件生成。
|
|
3
3
|
* commands/endpoint/ 下的 list / add / remove 直接默认导出这三项。
|
|
4
4
|
*/
|
|
5
|
-
import { createEndpointCommands } from '
|
|
6
|
-
import { defineCommand } from '
|
|
5
|
+
import { createEndpointCommands } from 'zhin.js/adapter';
|
|
6
|
+
import { defineCommand } from 'zhin.js/command';
|
|
7
7
|
import { kookRuntimeStateToken } from './kook-runtime-state.js';
|
|
8
8
|
export const kookEndpointCommands = createEndpointCommands({
|
|
9
9
|
adapterKey: 'kook',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const kookRuntimeStateToken: import("
|
|
1
|
+
export declare const kookRuntimeStateToken: import("zhin.js").Token<import("@zhin.js/adapter").EndpointRuntimeState>;
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* KOOK 插件实例的运行时状态:adapter create() 注册的 endpoint 列表。
|
|
3
3
|
* 由 plugin.ts setup() provide,adapter create 与 `kook.endpoint` 命令共享(同一 owner generation)。
|
|
4
4
|
*/
|
|
5
|
-
import { defineEndpointRuntimeStateToken } from '
|
|
5
|
+
import { defineEndpointRuntimeStateToken } from 'zhin.js/adapter';
|
|
6
6
|
export const kookRuntimeStateToken = defineEndpointRuntimeStateToken('kook');
|
package/lib/protocol.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { createDecipheriv, timingSafeEqual } from 'node:crypto';
|
|
6
6
|
import { inflateSync } from 'node:zlib';
|
|
7
|
-
import { pickCredential } from '
|
|
7
|
+
import { pickCredential } from 'zhin.js/adapter';
|
|
8
8
|
import { isMediaRef } from '@zhin.js/core';
|
|
9
9
|
import { formatCompact, getLogger } from '@zhin.js/logger';
|
|
10
10
|
const logger = getLogger('kook');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-kook",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.11",
|
|
4
4
|
"description": "Zhin.js KOOK adapter for Plugin Runtime (WebSocket gateway or Webhook)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -34,22 +34,19 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"kook-client": "^1.0.4",
|
|
37
|
-
"@zhin.js/adapter": "1.1.
|
|
38
|
-
"@zhin.js/
|
|
39
|
-
"@zhin.js/
|
|
40
|
-
"@zhin.js/host-http": "1.0.9",
|
|
37
|
+
"@zhin.js/adapter": "1.1.10",
|
|
38
|
+
"@zhin.js/core": "1.5.10",
|
|
39
|
+
"@zhin.js/host-http": "1.0.10",
|
|
41
40
|
"@zhin.js/im-contract": "1.0.3",
|
|
42
41
|
"@zhin.js/logger": "1.0.76",
|
|
43
|
-
"@zhin.js/permission": "1.0.2"
|
|
44
|
-
"@zhin.js/plugin-runtime": "1.1.6"
|
|
42
|
+
"@zhin.js/permission": "1.0.2"
|
|
45
43
|
},
|
|
46
44
|
"peerDependencies": {
|
|
47
45
|
"zod": "^4.0.0",
|
|
48
|
-
"@zhin.js/adapter": "1.1.
|
|
49
|
-
"@zhin.js/agent": "1.1.
|
|
50
|
-
"@zhin.js/core": "1.5.
|
|
51
|
-
"
|
|
52
|
-
"zhin.js": "6.0.8"
|
|
46
|
+
"@zhin.js/adapter": "1.1.10",
|
|
47
|
+
"@zhin.js/agent": "1.1.11",
|
|
48
|
+
"@zhin.js/core": "1.5.10",
|
|
49
|
+
"zhin.js": "6.0.10"
|
|
53
50
|
},
|
|
54
51
|
"peerDependenciesMeta": {
|
|
55
52
|
"zhin.js": {
|
|
@@ -67,9 +64,9 @@
|
|
|
67
64
|
"typescript": "^6.0.3",
|
|
68
65
|
"vitest": "^4.1.10",
|
|
69
66
|
"zod": "^4.4.3",
|
|
70
|
-
"@zhin.js/agent": "1.1.
|
|
71
|
-
"@zhin.js/host-http": "1.0.
|
|
72
|
-
"zhin.js": "6.0.
|
|
67
|
+
"@zhin.js/agent": "1.1.11",
|
|
68
|
+
"@zhin.js/host-http": "1.0.10",
|
|
69
|
+
"zhin.js": "6.0.10"
|
|
73
70
|
},
|
|
74
71
|
"files": [
|
|
75
72
|
"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 } from '
|
|
2
|
+
import { createEndpointRuntimeState } from 'zhin.js/adapter';
|
|
3
|
+
import { definePlugin } from 'zhin.js';
|
|
4
4
|
import { permissionHostToken } from '@zhin.js/permission';
|
|
5
5
|
import { checkKookPlatformPermit } from "./lib/platform-permit.js";
|
|
6
6
|
import { kookRuntimeStateToken } from "./lib/kook-runtime-state.js";
|
package/src/endpoint.ts
CHANGED
|
@@ -8,11 +8,11 @@ import type {
|
|
|
8
8
|
EndpointInstance,
|
|
9
9
|
EndpointManagement,
|
|
10
10
|
EndpointSendRequest,
|
|
11
|
-
} from '
|
|
11
|
+
} from 'zhin.js/adapter';
|
|
12
12
|
import type { MessageGateway } from '@zhin.js/core/runtime';
|
|
13
13
|
import type { HttpHost, HttpRouteRegistration } from '@zhin.js/host-http';
|
|
14
14
|
import { formatCompact, getAdapterLogger } from '@zhin.js/logger';
|
|
15
|
-
import type { CapabilityId } from '
|
|
15
|
+
import type { CapabilityId } from 'zhin.js';
|
|
16
16
|
import { registerKookAgentEndpoint } from './kook-agent-deps.js';
|
|
17
17
|
import {
|
|
18
18
|
formatInboundContent,
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* `kook.endpoint` 命令族:由 @zhin.js/adapter 的 createEndpointCommands 套件生成。
|
|
3
3
|
* commands/endpoint/ 下的 list / add / remove 直接默认导出这三项。
|
|
4
4
|
*/
|
|
5
|
-
import { createEndpointCommands } from '
|
|
6
|
-
import { defineCommand } from '
|
|
5
|
+
import { createEndpointCommands } from 'zhin.js/adapter';
|
|
6
|
+
import { defineCommand } from 'zhin.js/command';
|
|
7
7
|
import { kookRuntimeStateToken } from './kook-runtime-state.js';
|
|
8
8
|
|
|
9
9
|
export const kookEndpointCommands = createEndpointCommands({
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* KOOK 插件实例的运行时状态:adapter create() 注册的 endpoint 列表。
|
|
3
3
|
* 由 plugin.ts setup() provide,adapter create 与 `kook.endpoint` 命令共享(同一 owner generation)。
|
|
4
4
|
*/
|
|
5
|
-
import { defineEndpointRuntimeStateToken } from '
|
|
5
|
+
import { defineEndpointRuntimeStateToken } from 'zhin.js/adapter';
|
|
6
6
|
|
|
7
7
|
export const kookRuntimeStateToken = defineEndpointRuntimeStateToken('kook');
|
package/src/protocol.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
import { createDecipheriv, timingSafeEqual } from 'node:crypto';
|
|
7
7
|
import { inflateSync } from 'node:zlib';
|
|
8
8
|
import type { IncomingMessage } from 'node:http';
|
|
9
|
-
import { pickCredential } from '
|
|
9
|
+
import { pickCredential } from 'zhin.js/adapter';
|
|
10
10
|
import { isMediaRef } from '@zhin.js/core';
|
|
11
11
|
import type { ConversationRef } from '@zhin.js/im-contract';
|
|
12
12
|
import { formatCompact, getLogger } from '@zhin.js/logger';
|