@zhin.js/adapter-qq 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-qq
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/qq.js CHANGED
@@ -11,6 +11,7 @@ import { qqRuntimeStateToken } from "../lib/qq-runtime-state.js";
11
11
  export { QqHttpEndpoint, QqWebsocketEndpoint, } from "../lib/endpoint.js";
12
12
  export default defineAdapter({
13
13
  capabilities: ['inbound', 'outbound'],
14
+ operations: ['recall'],
14
15
  // 媒体 url 直发,base64/path 由 SDK formatMediaData 物化走 /files 上传;
15
16
  // markdown/keyboard 原生按钮承载交互段。
16
17
  segments: {
package/adapters/qq.ts CHANGED
@@ -32,6 +32,7 @@ declare module '@zhin.js/core' {
32
32
 
33
33
  export default defineAdapter<QqAdapterConfig>({
34
34
  capabilities: ['inbound', 'outbound'],
35
+ operations: ['recall'],
35
36
  // 媒体 url 直发,base64/path 由 SDK formatMediaData 物化走 /files 上传;
36
37
  // markdown/keyboard 原生按钮承载交互段。
37
38
  segments: {
package/lib/endpoint.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * QQ endpoints — lifecycle, outbound, admit, agent tool surface.
3
3
  */
4
- import type { EndpointInstance, EndpointManagement, EndpointSendRequest } from 'zhin.js/adapter';
4
+ import { type EndpointControl, type EndpointInstance, type EndpointManagement, type EndpointSendRequest } from 'zhin.js/adapter';
5
5
  import type { MessageGateway, SideEventGateway } from '@zhin.js/core/runtime';
6
6
  import type { HttpHost } from '@zhin.js/host-http';
7
7
  import type { CapabilityId } from 'zhin.js';
@@ -20,6 +20,7 @@ export interface QqEndpointOptions {
20
20
  export declare class QqWebsocketEndpoint implements EndpointInstance {
21
21
  #private;
22
22
  readonly management: EndpointManagement;
23
+ readonly control: EndpointControl;
23
24
  constructor(options: QqEndpointOptions);
24
25
  /** Live endpoint 名(Console/AdapterIndex 展示用,如 bot appid 别名)。 */
25
26
  get name(): string;
@@ -52,6 +53,7 @@ export interface QqHttpEndpointOptions {
52
53
  export declare class QqHttpEndpoint implements EndpointInstance {
53
54
  #private;
54
55
  readonly management: EndpointManagement;
56
+ readonly control: EndpointControl;
55
57
  constructor(options: QqHttpEndpointOptions);
56
58
  /** Live endpoint 名(Console/AdapterIndex 展示用)。 */
57
59
  get name(): string;
package/lib/endpoint.js CHANGED
@@ -1,3 +1,7 @@
1
+ /**
2
+ * QQ endpoints — lifecycle, outbound, admit, agent tool surface.
3
+ */
4
+ import { createRecallEndpointControl, } from 'zhin.js/adapter';
1
5
  import { formatCompact, getAdapterLogger, truncatePreview } from '@zhin.js/logger';
2
6
  import { formatOutbound } from './outbound.js';
3
7
  import { registerQqAgentEndpoint } from './qq-agent-deps.js';
@@ -14,6 +18,7 @@ export class QqWebsocketEndpoint {
14
18
  #started = false;
15
19
  #unregisterAgent;
16
20
  management = createQqEndpointManagement(this);
21
+ control = createRecallEndpointControl((id) => this.recallMessage(id));
17
22
  constructor(options) {
18
23
  this.#logger = getAdapterLogger('qq', options.config.id);
19
24
  this.#options = options;
@@ -202,6 +207,7 @@ export class QqHttpEndpoint {
202
207
  #started = false;
203
208
  #unregisterAgent;
204
209
  management = createQqEndpointManagement(this);
210
+ control = createRecallEndpointControl((id) => this.recallMessage(id));
205
211
  constructor(options) {
206
212
  this.#logger = getAdapterLogger('qq', options.config.id);
207
213
  this.#options = options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-qq",
3
- "version": "7.0.14",
3
+ "version": "8.0.0",
4
4
  "description": "Zhin.js QQ Official adapter for Plugin Runtime (WebSocket gateway)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -35,21 +35,21 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "qq-official-bot": "^1.2.3",
38
- "@zhin.js/adapter": "1.1.11",
39
- "@zhin.js/core": "1.5.12",
40
- "@zhin.js/host-http": "1.0.11",
38
+ "@zhin.js/adapter": "1.2.0",
39
+ "@zhin.js/core": "1.5.13",
40
+ "@zhin.js/host-http": "1.0.12",
41
41
  "@zhin.js/im-contract": "1.0.4",
42
42
  "@zhin.js/logger": "1.0.76",
43
43
  "@zhin.js/permission": "1.0.3"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "zod": "^4.0.0",
47
- "@zhin.js/adapter": "1.1.11",
48
- "@zhin.js/agent": "1.1.14",
47
+ "@zhin.js/adapter": "1.2.0",
48
+ "@zhin.js/agent": "1.1.15",
49
49
  "@zhin.js/command": "1.0.15",
50
- "@zhin.js/core": "1.5.12",
50
+ "@zhin.js/core": "1.5.13",
51
51
  "@zhin.js/middleware": "1.0.12",
52
- "zhin.js": "6.0.12"
52
+ "zhin.js": "6.0.13"
53
53
  },
54
54
  "peerDependenciesMeta": {
55
55
  "@zhin.js/agent": {
@@ -73,9 +73,9 @@
73
73
  "typescript": "^6.0.3",
74
74
  "vitest": "^4.1.10",
75
75
  "zod": "^4.4.3",
76
- "@zhin.js/agent": "1.1.14",
77
- "@zhin.js/host-http": "1.0.11",
78
- "zhin.js": "6.0.12"
76
+ "@zhin.js/agent": "1.1.15",
77
+ "@zhin.js/host-http": "1.0.12",
78
+ "zhin.js": "6.0.13"
79
79
  },
80
80
  "files": [
81
81
  "adapters",
package/src/endpoint.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  /**
2
2
  * QQ endpoints — lifecycle, outbound, admit, agent tool surface.
3
3
  */
4
- import type {
5
- EndpointChannel,
6
- EndpointInstance,
7
- EndpointManagement,
8
- EndpointSendRequest,
4
+ import {
5
+ createRecallEndpointControl,
6
+ type EndpointControl,
7
+ type EndpointChannel,
8
+ type EndpointInstance,
9
+ type EndpointManagement,
10
+ type EndpointSendRequest,
9
11
  } from 'zhin.js/adapter';
10
12
  import type { MessageGateway, SideEventGateway } from '@zhin.js/core/runtime';
11
13
  import type { HttpHost } from '@zhin.js/host-http';
@@ -64,6 +66,7 @@ export class QqWebsocketEndpoint implements EndpointInstance {
64
66
  #started = false;
65
67
  #unregisterAgent?: () => void;
66
68
  readonly management: EndpointManagement = createQqEndpointManagement(this);
69
+ readonly control: EndpointControl = createRecallEndpointControl((id) => this.recallMessage(id));
67
70
 
68
71
  constructor(options: QqEndpointOptions) {
69
72
  this.#logger = getAdapterLogger('qq', options.config.id);
@@ -291,6 +294,7 @@ export class QqHttpEndpoint implements EndpointInstance {
291
294
  #started = false;
292
295
  #unregisterAgent?: () => void;
293
296
  readonly management: EndpointManagement = createQqEndpointManagement(this);
297
+ readonly control: EndpointControl = createRecallEndpointControl((id) => this.recallMessage(id));
294
298
 
295
299
  constructor(options: QqHttpEndpointOptions) {
296
300
  this.#logger = getAdapterLogger('qq', options.config.id);