@zhin.js/adapter-weixin-ilink 5.0.13 → 6.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,15 @@
1
1
  # @zhin.js/adapter-weixin-ilink
2
2
 
3
+ ## 6.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 [f2c532f]
9
+ - @zhin.js/adapter@1.2.0
10
+ - @zhin.js/core@1.5.13
11
+ - zhin.js@6.0.13
12
+
3
13
  ## 5.0.13
4
14
 
5
15
  ### Patch Changes
@@ -10,6 +10,7 @@ import { weixinIlinkRuntimeStateToken } from "../lib/weixin-ilink-runtime-state.
10
10
  export { WeixinIlinkEndpoint } from "../lib/endpoint.js";
11
11
  export default defineAdapter({
12
12
  capabilities: ['inbound', 'outbound'],
13
+ operations: ['typing'],
13
14
  // 所有媒体(url 下载 / base64 落盘 / 本地 path)统一物化后走 CDN 上传(sendWeixinMediaFile),
14
15
  // 无直发面;微信无卡片交互面,交互段降级纯文本。
15
16
  segments: {
@@ -21,6 +21,7 @@ export type {
21
21
 
22
22
  export default defineAdapter<WeixinIlinkAdapterConfig>({
23
23
  capabilities: ['inbound', 'outbound'],
24
+ operations: ['typing'],
24
25
  // 所有媒体(url 下载 / base64 落盘 / 本地 path)统一物化后走 CDN 上传(sendWeixinMediaFile),
25
26
  // 无直发面;微信无卡片交互面,交互段降级纯文本。
26
27
  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, EndpointInstance, EndpointManagement, 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 { getUpdates, notifyStart, notifyStop } from './ilink-api.js';
@@ -24,6 +24,7 @@ export interface WeixinIlinkEndpointOptions {
24
24
  export declare class WeixinIlinkEndpoint implements EndpointInstance {
25
25
  #private;
26
26
  readonly management: EndpointManagement;
27
+ readonly control: EndpointControl;
27
28
  constructor(options: WeixinIlinkEndpointOptions);
28
29
  get hasCredentials(): boolean;
29
30
  /** Live endpoint 名(context token 按 account 名分桶,management 推导对端用)。 */
package/lib/endpoint.js CHANGED
@@ -43,6 +43,9 @@ export class WeixinIlinkEndpoint {
43
43
  #open = false;
44
44
  #started = false;
45
45
  management = createWeixinIlinkEndpointManagement(this);
46
+ control = Object.freeze({
47
+ typing: (conversation, active) => this.sendTypingToUser(conversation.id, active === false ? 2 : 1),
48
+ });
46
49
  constructor(options) {
47
50
  this.#logger = getAdapterLogger('weixin-ilink', options.config.id);
48
51
  this.#options = options;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-weixin-ilink",
3
- "version": "5.0.13",
3
+ "version": "6.0.0",
4
4
  "type": "module",
5
5
  "description": "Zhin.js Weixin iLink (ClawBot) adapter for Plugin Runtime (long-poll)",
6
6
  "main": "./lib/index.js",
@@ -48,16 +48,16 @@
48
48
  }
49
49
  },
50
50
  "dependencies": {
51
- "@zhin.js/adapter": "1.1.11",
52
- "@zhin.js/core": "1.5.12",
51
+ "@zhin.js/adapter": "1.2.0",
52
+ "@zhin.js/core": "1.5.13",
53
53
  "@zhin.js/im-contract": "1.0.4",
54
54
  "@zhin.js/logger": "1.0.76"
55
55
  },
56
56
  "peerDependencies": {
57
- "@zhin.js/adapter": "1.1.11",
57
+ "@zhin.js/adapter": "1.2.0",
58
58
  "@zhin.js/command": "1.0.15",
59
- "@zhin.js/core": "1.5.12",
60
- "zhin.js": "6.0.12"
59
+ "@zhin.js/core": "1.5.13",
60
+ "zhin.js": "6.0.13"
61
61
  },
62
62
  "peerDependenciesMeta": {
63
63
  "@zhin.js/command": {
@@ -71,7 +71,7 @@
71
71
  "@types/node": "^26.1.2",
72
72
  "typescript": "^6.0.3",
73
73
  "vitest": "^4.1.10",
74
- "zhin.js": "6.0.12"
74
+ "zhin.js": "6.0.13"
75
75
  },
76
76
  "ilink_appid": "bot",
77
77
  "engines": {
package/src/endpoint.ts CHANGED
@@ -6,6 +6,7 @@ import fs from 'node:fs';
6
6
  import path from 'node:path';
7
7
  import type {
8
8
  EndpointFriend,
9
+ EndpointControl,
9
10
  EndpointInstance,
10
11
  EndpointManagement,
11
12
  EndpointSendRequest,
@@ -107,6 +108,12 @@ export class WeixinIlinkEndpoint implements EndpointInstance {
107
108
  #open = false;
108
109
  #started = false;
109
110
  readonly management: EndpointManagement = createWeixinIlinkEndpointManagement(this);
111
+ readonly control: EndpointControl = Object.freeze<EndpointControl>({
112
+ typing: (conversation, active) => this.sendTypingToUser(
113
+ conversation.id,
114
+ active === false ? 2 : 1,
115
+ ),
116
+ });
110
117
 
111
118
  constructor(options: WeixinIlinkEndpointOptions) {
112
119
  this.#logger = getAdapterLogger('weixin-ilink', options.config.id);