@zhin.js/adapter-onebot11 6.0.14 → 7.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-onebot11
2
2
 
3
+ ## 7.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
  ## 6.0.14
4
18
 
5
19
  ### Patch Changes
@@ -13,6 +13,7 @@ export { OneBot11WsEndpoint } from "../lib/ws-endpoint.js";
13
13
  export { OneBot11WssEndpoint } from "../lib/wss-endpoint.js";
14
14
  export default defineAdapter({
15
15
  capabilities: ['inbound', 'outbound'],
16
+ operations: ['recall'],
16
17
  // OneBot file 参数原生消费 url / base64:// 媒体;无卡片交互面,交互段降级纯文本。
17
18
  segments: {
18
19
  outboundMedia: ['url', 'base64'],
@@ -26,6 +26,7 @@ declare module '@zhin.js/core' {
26
26
 
27
27
  export default defineAdapter<OneBot11AdapterConfig>({
28
28
  capabilities: ['inbound', 'outbound'],
29
+ operations: ['recall'],
29
30
  // OneBot file 参数原生消费 url / base64:// 媒体;无卡片交互面,交互段降级纯文本。
30
31
  segments: {
31
32
  outboundMedia: ['url', 'base64'],
@@ -1,4 +1,4 @@
1
- import { type EndpointInstance, type EndpointManagement, type 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 { CapabilityId } from 'zhin.js';
4
4
  import { type OneBot11Event, type OneBot11WsConfig } from './protocol.js';
@@ -13,6 +13,7 @@ export interface OneBot11WsEndpointOptions {
13
13
  export declare class OneBot11WsEndpoint implements EndpointInstance {
14
14
  #private;
15
15
  readonly management: EndpointManagement;
16
+ readonly control: EndpointControl;
16
17
  readonly content: import("@zhin.js/adapter").EndpointContentPort;
17
18
  constructor(options: OneBot11WsEndpointOptions);
18
19
  start(): Promise<void>;
@@ -2,7 +2,7 @@
2
2
  * OneBot11 WS client endpoint — outbound connect to OneBot implementation.
3
3
  */
4
4
  import WebSocket from 'ws';
5
- import { createEndpointLifecycle, } from 'zhin.js/adapter';
5
+ import { createRecallEndpointControl, createEndpointLifecycle, } from 'zhin.js/adapter';
6
6
  import { formatCompact, getAdapterLogger } from '@zhin.js/logger';
7
7
  import { createOneBot11EndpointManagement } from './endpoint-management.js';
8
8
  import { registerOnebot11AgentEndpoint } from './onebot11-agent-deps.js';
@@ -14,6 +14,7 @@ export class OneBot11WsEndpoint {
14
14
  #logger;
15
15
  #options;
16
16
  management = createOneBot11EndpointManagement(this);
17
+ control = createRecallEndpointControl((id) => this.recallMessage(id));
17
18
  content = createOneBot11ContentPort((action, params) => this.callApi(action, params));
18
19
  #lifecycle;
19
20
  #ws;
@@ -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';
@@ -13,6 +13,7 @@ export interface OneBot11WssEndpointOptions {
13
13
  export declare class OneBot11WssEndpoint implements EndpointInstance {
14
14
  #private;
15
15
  readonly management: EndpointManagement;
16
+ readonly control: EndpointControl;
16
17
  readonly content: import("@zhin.js/adapter").EndpointContentPort;
17
18
  constructor(options: OneBot11WssEndpointOptions);
18
19
  start(): Promise<void>;
@@ -2,6 +2,7 @@
2
2
  * OneBot11 reverse WSS endpoint — accepts inbound WebSocket from OneBot implementation.
3
3
  */
4
4
  import { clearInterval } from 'node:timers';
5
+ import { createRecallEndpointControl, } from 'zhin.js/adapter';
5
6
  import { formatCompact, getAdapterLogger } from '@zhin.js/logger';
6
7
  import { createOneBot11EndpointManagement } from './endpoint-management.js';
7
8
  import { registerOnebot11AgentEndpoint } from './onebot11-agent-deps.js';
@@ -14,6 +15,7 @@ export class OneBot11WssEndpoint {
14
15
  #logger;
15
16
  #options;
16
17
  management = createOneBot11EndpointManagement(this);
18
+ control = createRecallEndpointControl((id) => this.recallMessage(id));
17
19
  content = createOneBot11ContentPort((action, params) => this.callApi(action, params));
18
20
  #ws;
19
21
  #wsRelease;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-onebot11",
3
- "version": "6.0.14",
3
+ "version": "7.0.0",
4
4
  "description": "Zhin.js OneBot 11 adapter for Plugin Runtime (WebSocket client)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -41,9 +41,9 @@
41
41
  },
42
42
  "dependencies": {
43
43
  "ws": "^8.21.1",
44
- "@zhin.js/adapter": "1.1.11",
45
- "@zhin.js/core": "1.5.12",
46
- "@zhin.js/host-http": "1.0.11",
44
+ "@zhin.js/adapter": "1.2.0",
45
+ "@zhin.js/core": "1.5.13",
46
+ "@zhin.js/host-http": "1.0.12",
47
47
  "@zhin.js/im-contract": "1.0.4",
48
48
  "@zhin.js/logger": "1.0.76",
49
49
  "@zhin.js/permission": "1.0.3"
@@ -54,17 +54,17 @@
54
54
  "typescript": "^6.0.3",
55
55
  "vitest": "^4.1.10",
56
56
  "zod": "^4.4.3",
57
- "@zhin.js/agent": "1.1.14",
58
- "@zhin.js/host-http": "1.0.11",
59
- "zhin.js": "6.0.12"
57
+ "@zhin.js/agent": "1.1.15",
58
+ "@zhin.js/host-http": "1.0.12",
59
+ "zhin.js": "6.0.13"
60
60
  },
61
61
  "peerDependencies": {
62
62
  "zod": "^4.0.0",
63
- "@zhin.js/adapter": "1.1.11",
64
- "@zhin.js/agent": "1.1.14",
63
+ "@zhin.js/adapter": "1.2.0",
64
+ "@zhin.js/agent": "1.1.15",
65
65
  "@zhin.js/command": "1.0.15",
66
- "@zhin.js/core": "1.5.12",
67
- "zhin.js": "6.0.12"
66
+ "@zhin.js/core": "1.5.13",
67
+ "zhin.js": "6.0.13"
68
68
  },
69
69
  "peerDependenciesMeta": {
70
70
  "@zhin.js/agent": {
@@ -3,8 +3,10 @@
3
3
  */
4
4
  import WebSocket from 'ws';
5
5
  import {
6
+ createRecallEndpointControl,
6
7
  createEndpointLifecycle,
7
8
  type EndpointConnectHandle,
9
+ type EndpointControl,
8
10
  type EndpointInstance,
9
11
  type EndpointLifecycle,
10
12
  type EndpointManagement,
@@ -57,6 +59,7 @@ export class OneBot11WsEndpoint implements EndpointInstance {
57
59
 
58
60
  readonly #options: OneBot11WsEndpointOptions;
59
61
  readonly management: EndpointManagement = createOneBot11EndpointManagement(this);
62
+ readonly control: EndpointControl = createRecallEndpointControl((id) => this.recallMessage(id));
60
63
  readonly content = createOneBot11ContentPort((action, params) => this.callApi(action, params));
61
64
  readonly #lifecycle: EndpointLifecycle;
62
65
  #ws?: OneBot11WsSocket;
@@ -2,7 +2,13 @@
2
2
  * OneBot11 reverse WSS endpoint — accepts inbound WebSocket from OneBot implementation.
3
3
  */
4
4
  import { clearInterval } from 'node:timers';
5
- import type { EndpointInstance, EndpointManagement, EndpointSendRequest } from 'zhin.js/adapter';
5
+ import {
6
+ createRecallEndpointControl,
7
+ type EndpointControl,
8
+ type EndpointInstance,
9
+ type EndpointManagement,
10
+ type EndpointSendRequest,
11
+ } from 'zhin.js/adapter';
6
12
  import type { MessageGateway, SideEventGateway } from '@zhin.js/core/runtime';
7
13
  import type { HttpHost, WsConnection } from '@zhin.js/host-http';
8
14
  import { formatCompact, getAdapterLogger } from '@zhin.js/logger';
@@ -49,6 +55,7 @@ export class OneBot11WssEndpoint implements EndpointInstance {
49
55
 
50
56
  readonly #options: OneBot11WssEndpointOptions;
51
57
  readonly management: EndpointManagement = createOneBot11EndpointManagement(this);
58
+ readonly control: EndpointControl = createRecallEndpointControl((id) => this.recallMessage(id));
52
59
  readonly content = createOneBot11ContentPort((action, params) => this.callApi(action, params));
53
60
  #ws?: OneBot11WsSocket;
54
61
  #wsRelease?: () => void;