@zhin.js/adapter-kook 7.0.14 → 8.0.0

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,19 @@
1
1
  # @zhin.js/adapter-kook
2
2
 
3
+ ## 8.0.0
4
+
5
+ ### Patch Changes
6
+
7
+ - f2c532f: Expose exact per-Endpoint message operations through one validated Adapter capability model, route Core control calls through declared active capabilities, and connect existing recall, edit, reaction, and typing implementations across platform adapters.
8
+ - Updated dependencies [b10d058]
9
+ - Updated dependencies [f2c532f]
10
+ - Updated dependencies [3dbf990]
11
+ - @zhin.js/host-http@1.0.12
12
+ - @zhin.js/adapter@1.2.0
13
+ - @zhin.js/core@1.5.13
14
+ - @zhin.js/agent@1.1.15
15
+ - zhin.js@6.0.13
16
+
3
17
  ## 7.0.14
4
18
 
5
19
  ### Patch Changes
package/adapters/kook.js CHANGED
@@ -12,6 +12,7 @@ import { kookRuntimeStateToken } from "../lib/kook-runtime-state.js";
12
12
  export { KookWebhookEndpoint, KookWebsocketEndpoint, } from "../lib/endpoint.js";
13
13
  export default defineAdapter({
14
14
  capabilities: ['inbound', 'outbound'],
15
+ operations: ['recall'],
15
16
  // KOOK 图片消息消费远程 URL;KMarkdown 由 endpoint codec 原生消费;
16
17
  // 无按钮交互面,交互段降级纯文本。
17
18
  segments: {
package/adapters/kook.ts CHANGED
@@ -27,6 +27,7 @@ export type { CreateKookClient, KookClientTransport } from '../src/ws.js';
27
27
 
28
28
  export default defineAdapter<KookAdapterConfig>({
29
29
  capabilities: ['inbound', 'outbound'],
30
+ operations: ['recall'],
30
31
  // KOOK 图片消息消费远程 URL;KMarkdown 由 endpoint codec 原生消费;
31
32
  // 无按钮交互面,交互段降级纯文本。
32
33
  segments: {
package/lib/endpoint.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { EndpointInstance, EndpointManagement, EndpointSendRequest } from 'zhin.js/adapter';
1
+ import { type EndpointControl, type EndpointInstance, type EndpointManagement, type EndpointSendRequest } from 'zhin.js/adapter';
2
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';
@@ -14,6 +14,7 @@ export interface KookEndpointOptions {
14
14
  export declare class KookWebsocketEndpoint implements EndpointInstance {
15
15
  #private;
16
16
  readonly management: EndpointManagement;
17
+ readonly control: EndpointControl;
17
18
  constructor(options: KookEndpointOptions);
18
19
  start(): Promise<void>;
19
20
  open(): void;
@@ -51,6 +52,7 @@ export interface KookWebhookEndpointOptions {
51
52
  export declare class KookWebhookEndpoint implements EndpointInstance {
52
53
  #private;
53
54
  readonly management: EndpointManagement;
55
+ readonly control: EndpointControl;
54
56
  constructor(options: KookWebhookEndpointOptions);
55
57
  /** Used by webhook handler. */
56
58
  get isOpen(): boolean;
package/lib/endpoint.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { createRecallEndpointControl, } from 'zhin.js/adapter';
1
2
  import { formatCompact, getAdapterLogger } from '@zhin.js/logger';
2
3
  import { registerKookAgentEndpoint } from './kook-agent-deps.js';
3
4
  import { formatInboundContent, formatOutboundKmarkdown, isKookBotMentioned, kookInboundConversation, senderDisplayName, } from './protocol.js';
@@ -13,6 +14,7 @@ export class KookWebsocketEndpoint {
13
14
  #started = false;
14
15
  #unregisterAgent;
15
16
  management = createKookEndpointManagement(() => this.#requireClient());
17
+ control = createRecallEndpointControl((id) => this.recallMessage(id));
16
18
  constructor(options) {
17
19
  this.#logger = getAdapterLogger('kook', options.config.id);
18
20
  this.#options = options;
@@ -166,6 +168,7 @@ export class KookWebhookEndpoint {
166
168
  #started = false;
167
169
  #unregisterAgent;
168
170
  management = createKookEndpointManagement(() => this.#requireClient());
171
+ control = createRecallEndpointControl((id) => this.recallMessage(id));
169
172
  constructor(options) {
170
173
  this.#logger = getAdapterLogger('kook', options.config.id);
171
174
  this.#options = options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-kook",
3
- "version": "7.0.14",
3
+ "version": "8.0.0",
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,20 +34,20 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "kook-client": "^1.0.4",
37
- "@zhin.js/adapter": "1.1.11",
38
- "@zhin.js/core": "1.5.12",
39
- "@zhin.js/host-http": "1.0.11",
37
+ "@zhin.js/adapter": "1.2.0",
38
+ "@zhin.js/core": "1.5.13",
39
+ "@zhin.js/host-http": "1.0.12",
40
40
  "@zhin.js/im-contract": "1.0.4",
41
41
  "@zhin.js/logger": "1.0.76",
42
42
  "@zhin.js/permission": "1.0.3"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "zod": "^4.0.0",
46
- "@zhin.js/adapter": "1.1.11",
47
- "@zhin.js/agent": "1.1.14",
46
+ "@zhin.js/adapter": "1.2.0",
47
+ "@zhin.js/agent": "1.1.15",
48
48
  "@zhin.js/command": "1.0.15",
49
- "@zhin.js/core": "1.5.12",
50
- "zhin.js": "6.0.12"
49
+ "@zhin.js/core": "1.5.13",
50
+ "zhin.js": "6.0.13"
51
51
  },
52
52
  "peerDependenciesMeta": {
53
53
  "@zhin.js/agent": {
@@ -68,9 +68,9 @@
68
68
  "typescript": "^6.0.3",
69
69
  "vitest": "^4.1.10",
70
70
  "zod": "^4.4.3",
71
- "@zhin.js/agent": "1.1.14",
72
- "@zhin.js/host-http": "1.0.11",
73
- "zhin.js": "6.0.12"
71
+ "@zhin.js/agent": "1.1.15",
72
+ "@zhin.js/host-http": "1.0.12",
73
+ "zhin.js": "6.0.13"
74
74
  },
75
75
  "files": [
76
76
  "adapters",
package/src/endpoint.ts CHANGED
@@ -2,12 +2,14 @@
2
2
  * KookEndpoint — lifecycle, outbound, admit, OpenAPI helpers for agent tools.
3
3
  */
4
4
  import { Client } from 'kook-client';
5
- import type {
6
- EndpointChannel,
7
- EndpointGroup,
8
- EndpointInstance,
9
- EndpointManagement,
10
- EndpointSendRequest,
5
+ import {
6
+ createRecallEndpointControl,
7
+ type EndpointControl,
8
+ type EndpointChannel,
9
+ type EndpointGroup,
10
+ type EndpointInstance,
11
+ type EndpointManagement,
12
+ type EndpointSendRequest,
11
13
  } from 'zhin.js/adapter';
12
14
  import type { MessageGateway, SideEventGateway } from '@zhin.js/core/runtime';
13
15
  import type { HttpHost, HttpRouteRegistration } from '@zhin.js/host-http';
@@ -52,6 +54,7 @@ export class KookWebsocketEndpoint implements EndpointInstance {
52
54
  #started = false;
53
55
  #unregisterAgent?: () => void;
54
56
  readonly management: EndpointManagement = createKookEndpointManagement(() => this.#requireClient());
57
+ readonly control: EndpointControl = createRecallEndpointControl((id) => this.recallMessage(id));
55
58
 
56
59
  constructor(options: KookEndpointOptions) {
57
60
  this.#logger = getAdapterLogger('kook', options.config.id);
@@ -226,6 +229,7 @@ export class KookWebhookEndpoint implements EndpointInstance {
226
229
  #started = false;
227
230
  #unregisterAgent?: () => void;
228
231
  readonly management: EndpointManagement = createKookEndpointManagement(() => this.#requireClient());
232
+ readonly control: EndpointControl = createRecallEndpointControl((id) => this.recallMessage(id));
229
233
 
230
234
  constructor(options: KookWebhookEndpointOptions) {
231
235
  this.#logger = getAdapterLogger('kook', options.config.id);