@zhin.js/adapter-weixin-ilink 1.1.18 → 1.1.19

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +7 -7
  3. package/adapters/weixin-ilink/index.js +3 -16
  4. package/adapters/weixin-ilink/index.ts +2 -16
  5. package/commands/weixin-ilink/endpoint/definition.js +1 -3
  6. package/commands/weixin-ilink/endpoint/definition.ts +1 -3
  7. package/lib/adapter.d.ts +19 -0
  8. package/lib/adapter.js +18 -0
  9. package/lib/cdn-upload.d.ts +1 -0
  10. package/lib/cdn-upload.js +4 -0
  11. package/lib/client.d.ts +49 -20
  12. package/lib/client.js +510 -55
  13. package/lib/console-spec.js +1 -1
  14. package/lib/console.d.ts +1 -1
  15. package/lib/console.js +2 -5
  16. package/lib/endpoint.d.ts +11 -39
  17. package/lib/endpoint.js +30 -429
  18. package/lib/ilink-api.d.ts +2 -0
  19. package/lib/ilink-api.js +6 -0
  20. package/lib/index.d.ts +2 -1
  21. package/lib/index.js +2 -1
  22. package/lib/media-download.d.ts +10 -2
  23. package/lib/media-download.js +77 -11
  24. package/lib/outbound-media.d.ts +1 -1
  25. package/lib/outbound-media.js +13 -6
  26. package/lib/pic-decrypt.d.ts +14 -2
  27. package/lib/pic-decrypt.js +11 -7
  28. package/lib/upload.d.ts +1 -1
  29. package/lib/upload.js +7 -4
  30. package/lib/weixin-send-media.js +4 -0
  31. package/lib/weixin-send.js +3 -0
  32. package/package.json +12 -12
  33. package/plugin.js +0 -3
  34. package/src/adapter.ts +24 -0
  35. package/src/cdn-upload.ts +5 -0
  36. package/src/client.ts +611 -70
  37. package/src/console-spec.ts +1 -1
  38. package/src/console.ts +2 -5
  39. package/src/endpoint.ts +34 -550
  40. package/src/ilink-api.ts +8 -0
  41. package/src/index.ts +1 -1
  42. package/src/media-download.ts +84 -51
  43. package/src/outbound-media.ts +19 -4
  44. package/src/pic-decrypt.ts +26 -18
  45. package/src/upload.ts +7 -4
  46. package/src/weixin-send-media.ts +4 -0
  47. package/src/weixin-send.ts +3 -0
  48. package/lib/weixin-ilink-runtime-state.d.ts +0 -1
  49. package/lib/weixin-ilink-runtime-state.js +0 -6
  50. package/src/weixin-ilink-runtime-state.ts +0 -7
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # @zhin.js/adapter-weixin-ilink
2
2
 
3
+ ## 1.1.19
4
+
5
+ ### Patch Changes
6
+
7
+ - 2c3610a: Move account lifecycle ownership into the generic Adapter base and let native Endpoints retain their SDK Client inheritance. Infer platform-specific operation Sessions from a single adapter registry while preserving command parameter, option, configuration and factory inference.
8
+
9
+ Bind message replies, management ports, login challenges and Agent cancellation to the captured account incarnation. Persist runtime account intent with encrypted, revision-checked Host storage; keep account management independent of Root process restarts. Require explicit operator confirmation before importing existing accounts, and give replacement accounts a new identity without inheriting previous Sessions.
10
+
11
+ Expose account save, start, stop, update and replacement through the existing adapter Console, with exact account ownership, truthful pending/unknown outcomes and no startup configuration or environment-file rewrites.
12
+
13
+ Complete the target migration across every adapter, the public authoring API, generators, examples and Console. This intentionally removes the old create factory, inheritable Endpoint/ClientEndpoint classes, Client descriptors and file-rewrite account management; plugin authors must use createAdapter, native Client inheritance and the single AdapterRegistry. Satori and OneBot12 require explicit platform/userId selection, and WeCom requires a separate agentId.
14
+
15
+ Verify opaque credential changes before the same configuration snapshot is committed. Drain admitted native callbacks across close/rollback, cancel target work on stop, and keep raw transport parsing, platform ACK timing and SDK native methods under their existing owners. Account metadata conceals credentials carried in URLs.
16
+
17
+ - a9f4e48: PATCH COMPATIBILITY CUTOVER: this batch intentionally changes plugin APIs. The maintainer explicitly chose patch releases with declared version boundaries. Upgrade the complete tested dependency set; patch numbering does not promise compatibility with the removed interfaces.
18
+
19
+ The first planned floors are zhin.js 1.1.19, Core 1.1.54, Adapter 1.1.26, FeatureKit 1.1.10, Plugin Runtime 1.1.18, Runtime/Isolate 1.1.16 and Agent 1.1.45. Keep old-interface plugins with the earlier locked stack until they are migrated. Adapter's independent Feature API changes from 1.0.0 to 2.0.0; official consumers declare ^2.0.0. Existing Feature API admission rejects explicitly incompatible ranges; omitted API metadata keeps its existing behavior and does not certify compatibility. Runtime engine and patch-only release gates remain unchanged.
20
+
21
+ Use the native-Client Adapter target contract, canonical FeatureKit AdapterRegistry augmentation and named Endpoint control/management requests. Route message controls from canonical message/conversation refs; retain exact source authority and propagate caller/account/explicit-Root-stop cancellation. Replace removed Agent activity feedback exports with source-bound feedback. HMR pause/resume belongs to concrete plugin instances; plugins choose accepted-work policy without changing Controller commit/rollback authority. Cooperative worker/process control cancellation does not kill an isolate or reopen retired business admission.
22
+
23
+ Provide authenticated historical-data preview, exact selected binding, transactional application, authoritative inspection and explicit resumption, including active games. Preserve before-images and journals; never replay an unconfirmed effect, infer an account from an alias, or reuse historical permission grants. Owner V2 approvals remain inactive legacy data, while new writes use V3. Rollback requires matching software, lockfile and verified data; installing old code alone cannot read a new V3 approval file. Conflicting after-images are never overwritten.
24
+
25
+ See docs/plans/adapter-operation-version-boundaries.md and the Chinese/English upgrade guide for the complete version inventory, custom-plugin changes, acceptance and recovery sequence. These code and metadata changes do not authorize merging, publication, deployment, login, production migration or removal of installed workspace patches.
26
+
27
+ - Updated dependencies [2c3610a]
28
+ - Updated dependencies [a9f4e48]
29
+ - Updated dependencies [f8505b0]
30
+ - @zhin.js/adapter@1.1.26
31
+ - @zhin.js/feature-kit@1.1.10
32
+ - @zhin.js/core@1.1.54
33
+ - @zhin.js/client@1.1.22
34
+ - @zhin.js/page@1.1.11
35
+
3
36
  ## 1.1.18
4
37
 
5
38
  ### Patch Changes
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  | 项 | weixin-ilink | wechat-mp |
10
10
  |---|---|---|
11
11
  | 账号类型 | 个人微信(ClawBot) | 微信公众号 |
12
- | 入站 | 长轮询 `getupdates` → `Endpoint.emit(...)` | Webhook(`httpHostToken`) |
12
+ | 入站 | 长轮询 `getupdates` → `endpointSpec.events` | Webhook(`httpHostToken`) |
13
13
  | 登录 | 扫码 / 侧车凭证 / `botToken` | AppId/Secret/Token |
14
14
  | 群聊 | 不支持(仅私聊) | 支持 |
15
15
 
@@ -59,7 +59,7 @@ data/weixin-ilink/<id>/credentials.json
59
59
 
60
60
  回复必须携带入站时缓存的 `context_token`(按 `endpointId + peerUserId`)。若用户久未发消息导致 token 缺失,出站会拒绝并打 warn。
61
61
 
62
- 出站经 Runtime:`OutboundMessageService` → `endpoint.send({ conversation, payload })`(`conversation` 为入站归一化出的 `ConversationRef`,kind 恒为 `private`,`id` 即对端 user_id)。
62
+ 出站经 Runtime:`OutboundMessageService` → `createEndpointSpecification` 注册的 send 钩子(`conversation` 为入站归一化出的 `ConversationRef`,kind 恒为 `private`,`id` 即对端 user_id)。
63
63
 
64
64
  **图文限制**:微信单条消息不支持图文混排。适配器会自动:
65
65
 
@@ -68,13 +68,13 @@ data/weixin-ilink/<id>/credentials.json
68
68
 
69
69
  ## Console 页面
70
70
 
71
- 启动后打开 Console 的「微信 iLink」页(地址 `/weixin-ilink`),可以:
71
+ 在所属插件的 Console 页面管理账号:查看配置与运行状态,添加、编辑、启动、停止、替换或删除账号。首次修改启动账号前,管理员需确认迁移清单;保留原身份与历史。此后保存到 Host 运行时存储,不改启动配置或 `.env`,无需重启进程。
72
72
 
73
- - 查看运行中的连接、点「测试连接」做连通性诊断;
74
- - 增删 `plugins.weixin-ilink.endpoints`(凭据写入 `.env`,配置里只保留 `${ENV}` 引用);
75
- - 如果适配器要求登录,页面会显示 LoginAssist 的扫码 / 滑块 / 设备确认待办;
73
+ 新增仅保存,需手动启动;运行账号的普通配置更新只重连该账号。身份变化走明确替换,新账号不会继承旧 Session 或登录状态。账号凭据变化先按平台实际只读接口核验;平台无法核验时需明确替换。空白或遮蔽的密码不会覆盖既有密码。
76
74
 
77
- 读取需要 `weixin-ilink:read`,写操作需要 `weixin-ilink:write`;管理员 full token 不受限。页面里的「添加 endpoint」等价于原来的 `weixin-ilink endpoint add`。
75
+ 读取需要 `weixin-ilink:read`,写入需要 `weixin-ilink:write`;首次迁移还需管理员身份。无持久化存储时管理操作不可用,提交结果未知时先刷新核实,不重复提交。
76
+
77
+ 未提供 `botToken` 时,启动沿既有凭据文件或日志二维码登录流程;本平台当前没有 Console 二维码待办。新账号的状态目录按内部实例身份隔离。
78
78
 
79
79
  ## 故障排查
80
80
 
@@ -1,11 +1,10 @@
1
1
  // Generated by build-plugin-runtime-entries.mjs. Do not edit.
2
+ import { WeixinIlinkAdapter } from "../../lib/adapter.js";
2
3
  /**
3
4
  * Convention entry: discover `adapters/weixin-ilink/index.ts` → defineAdapter.
4
5
  */
5
6
  import { defineAdapter } from 'zhin.js/adapter';
6
- import { WeixinIlinkEndpoint } from "../../lib/endpoint.js";
7
- import { resolveWeixinIlinkConfig, } from "../../lib/protocol.js";
8
- import { weixinIlinkRuntimeStateToken } from "../../lib/weixin-ilink-runtime-state.js";
7
+ import {} from "../../lib/protocol.js";
9
8
  export { WeixinIlinkEndpoint } from "../../lib/endpoint.js";
10
9
  export default defineAdapter({
11
10
  capabilities: ['inbound', 'outbound'],
@@ -16,17 +15,5 @@ export default defineAdapter({
16
15
  outboundMedia: ['upload'],
17
16
  interactive: 'text',
18
17
  },
19
- create(context) {
20
- const config = resolveWeixinIlinkConfig(context.config);
21
- // 注册到插件运行时状态(weixin-ilink endpoint list 的"运行中"数据源)
22
- context.use(weixinIlinkRuntimeStateToken).endpoints.set(config.id, {
23
- id: config.id,
24
- // iLink 仅长轮询一种接入方式,无 config.connection 字段
25
- mode: 'long-poll',
26
- });
27
- return new WeixinIlinkEndpoint({
28
- id: context.id,
29
- config,
30
- });
31
- },
18
+ createAdapter: () => new WeixinIlinkAdapter(),
32
19
  });
@@ -1,13 +1,11 @@
1
+ import { WeixinIlinkAdapter } from '../../src/adapter.js';
1
2
  /**
2
3
  * Convention entry: discover `adapters/weixin-ilink/index.ts` → defineAdapter.
3
4
  */
4
5
  import { defineAdapter } from 'zhin.js/adapter';
5
- import { WeixinIlinkEndpoint } from '../../src/endpoint.js';
6
6
  import {
7
- resolveWeixinIlinkConfig,
8
7
  type WeixinIlinkEndpointConfig,
9
8
  } from '../../src/protocol.js';
10
- import { weixinIlinkRuntimeStateToken } from '../../src/weixin-ilink-runtime-state.js';
11
9
 
12
10
  export { WeixinIlinkEndpoint } from '../../src/endpoint.js';
13
11
  export type {
@@ -27,17 +25,5 @@ export default defineAdapter<WeixinIlinkEndpointConfig>({
27
25
  outboundMedia: ['upload'],
28
26
  interactive: 'text',
29
27
  },
30
- create(context) {
31
- const config = resolveWeixinIlinkConfig(context.config);
32
- // 注册到插件运行时状态(weixin-ilink endpoint list 的"运行中"数据源)
33
- context.use(weixinIlinkRuntimeStateToken).endpoints.set(config.id, {
34
- id: config.id,
35
- // iLink 仅长轮询一种接入方式,无 config.connection 字段
36
- mode: 'long-poll',
37
- });
38
- return new WeixinIlinkEndpoint({
39
- id: context.id,
40
- config,
41
- });
42
- },
28
+ createAdapter: () => new WeixinIlinkAdapter(),
43
29
  });
@@ -5,13 +5,11 @@
5
5
  */
6
6
  import { createEndpointCommands } from 'zhin.js/adapter';
7
7
  import { defineCommand } from 'zhin.js/command';
8
- import { weixinIlinkRuntimeStateToken } from "../../../lib/weixin-ilink-runtime-state.js";
9
8
  export const weixinIlinkEndpointCommands = createEndpointCommands({
10
9
  adapterKey: 'weixin-ilink',
11
10
  adapterDisplayName: 'Weixin iLink',
12
11
  fields: [
13
- { key: 'botToken', required: true, env: true, description: 'iLink bot token' },
12
+ { key: 'botToken', env: true, description: 'iLink bot token' },
14
13
  ],
15
- running: (use) => use(weixinIlinkRuntimeStateToken).endpoints.values(),
16
14
  describeEntry: (entry) => `botToken: ${String(entry.botToken)}`,
17
15
  }, defineCommand);
@@ -4,14 +4,12 @@
4
4
  */
5
5
  import { createEndpointCommands } from 'zhin.js/adapter';
6
6
  import { defineCommand } from 'zhin.js/command';
7
- import { weixinIlinkRuntimeStateToken } from '../../../src/weixin-ilink-runtime-state.js';
8
7
 
9
8
  export const weixinIlinkEndpointCommands = createEndpointCommands({
10
9
  adapterKey: 'weixin-ilink',
11
10
  adapterDisplayName: 'Weixin iLink',
12
11
  fields: [
13
- { key: 'botToken', required: true, env: true, description: 'iLink bot token' },
12
+ { key: 'botToken', env: true, description: 'iLink bot token' },
14
13
  ],
15
- running: (use) => use(weixinIlinkRuntimeStateToken).endpoints.values(),
16
14
  describeEntry: (entry) => `botToken: ${String(entry.botToken)}`,
17
15
  }, defineCommand);
@@ -0,0 +1,19 @@
1
+ import { Adapter, type EndpointCreationContext } from 'zhin.js/adapter';
2
+ import { WeixinIlinkEndpoint } from './endpoint.js';
3
+ import { type WeixinIlinkEndpointConfig } from './protocol.js';
4
+ import type { WeixinIlinkClientEventMap } from './client.js';
5
+ export declare class WeixinIlinkAdapter extends Adapter<WeixinIlinkEndpoint, WeixinIlinkEndpointConfig, WeixinIlinkClientEventMap> {
6
+ get configurationIdentityFields(): readonly string[];
7
+ get configurationUpdateFields(): readonly string[];
8
+ get configurationIdentityProbeFields(): readonly string[];
9
+ protected prepareConfiguration(input: WeixinIlinkEndpointConfig, identity: Readonly<{
10
+ instanceId: string;
11
+ }>): WeixinIlinkEndpointConfig;
12
+ protected validateConfiguration(config: WeixinIlinkEndpointConfig): void;
13
+ protected createEndpoint(input: WeixinIlinkEndpointConfig, execution: EndpointCreationContext): WeixinIlinkEndpoint;
14
+ }
15
+ declare module '@zhin.js/feature-kit' {
16
+ interface AdapterRegistry {
17
+ readonly 'weixin-ilink': WeixinIlinkAdapter;
18
+ }
19
+ }
package/lib/adapter.js ADDED
@@ -0,0 +1,18 @@
1
+ import { join } from 'node:path';
2
+ import { Adapter } from 'zhin.js/adapter';
3
+ import { WeixinIlinkEndpoint } from './endpoint.js';
4
+ import { resolveWeixinIlinkConfig } from './protocol.js';
5
+ export class WeixinIlinkAdapter extends Adapter {
6
+ get configurationIdentityFields() { return ['id']; }
7
+ get configurationUpdateFields() { return ['botToken', 'botAgent', 'baseUrl', 'cdnBaseUrl', 'longPollTimeoutMs', 'dataDir']; }
8
+ get configurationIdentityProbeFields() { return ['botToken', 'baseUrl', 'dataDir']; }
9
+ prepareConfiguration(input, identity) {
10
+ const config = resolveWeixinIlinkConfig(input);
11
+ return { ...input, dataDir: join(config.dataDir, 'accounts', identity.instanceId) };
12
+ }
13
+ validateConfiguration(config) { resolveWeixinIlinkConfig(config); }
14
+ createEndpoint(input, execution) {
15
+ const config = resolveWeixinIlinkConfig(input);
16
+ return new WeixinIlinkEndpoint({ id: execution.canonicalId, config });
17
+ }
18
+ }
@@ -12,6 +12,7 @@ export declare function uploadBufferToCdn(params: {
12
12
  cdnBaseUrl: string;
13
13
  label: string;
14
14
  aeskey: Buffer;
15
+ abortSignal?: AbortSignal;
15
16
  }): Promise<{
16
17
  downloadParam: string;
17
18
  }>;
package/lib/cdn-upload.js CHANGED
@@ -11,6 +11,7 @@ const UPLOAD_MAX_RETRIES = 3;
11
11
  */
12
12
  export async function uploadBufferToCdn(params) {
13
13
  const { buf, uploadFullUrl, uploadParam, filekey, cdnBaseUrl, label, aeskey } = params;
14
+ params.abortSignal?.throwIfAborted();
14
15
  const ciphertext = encryptAesEcb(buf, aeskey);
15
16
  const trimmedFull = uploadFullUrl?.trim();
16
17
  let cdnUrl;
@@ -27,9 +28,11 @@ export async function uploadBufferToCdn(params) {
27
28
  let downloadParam;
28
29
  let lastError;
29
30
  for (let attempt = 1; attempt <= UPLOAD_MAX_RETRIES; attempt++) {
31
+ params.abortSignal?.throwIfAborted();
30
32
  try {
31
33
  const res = await fetch(cdnUrl, {
32
34
  method: "POST",
35
+ signal: params.abortSignal,
33
36
  headers: { "Content-Type": "application/octet-stream" },
34
37
  body: new Uint8Array(ciphertext),
35
38
  });
@@ -52,6 +55,7 @@ export async function uploadBufferToCdn(params) {
52
55
  break;
53
56
  }
54
57
  catch (err) {
58
+ params.abortSignal?.throwIfAborted();
55
59
  lastError = err;
56
60
  if (err instanceof Error && err.message.includes("client error"))
57
61
  throw err;
package/lib/client.d.ts CHANGED
@@ -1,35 +1,64 @@
1
- import type { WeixinContextTokenStore } from './context-store.js';
2
- import type { WeixinIlinkCredentials } from './credentials.js';
3
- import type { WeixinConfigManager } from './ilink-config-cache.js';
4
- import type { IlinkClientMetadata } from './ilink-meta.js';
5
- import type { ResolvedWeixinIlinkConfig } from './protocol.js';
1
+ import { EventEmitter } from 'node:events';
2
+ import { type EndpointControl, type EndpointManagement, type EndpointSendRequest, type EndpointOperationOptions } from 'zhin.js/adapter';
3
+ import type { CapabilityId } from 'zhin.js';
4
+ import { getUpdates, notifyStart, notifyStop } from './ilink-api.js';
5
+ import { IlinkClientMetadata } from './ilink-meta.js';
6
+ import { type WeixinIlinkCredentials, WeixinIlinkStateStore } from './credentials.js';
7
+ import { WeixinContextTokenStore } from './context-store.js';
8
+ import { IlinkSessionGuard } from './ilink-session-guard.js';
6
9
  import { sendMessageWeixin } from './weixin-send.js';
7
- /** Direct iLink API client backed by the Endpoint's live authenticated session. */
8
- export declare class WeixinIlinkClient {
9
- #private;
10
+ import { type ResolvedWeixinIlinkConfig, type WeixinMessageWithMedia } from './protocol.js';
11
+ export type WeixinIlinkSendText = typeof sendMessageWeixin;
12
+ export type WeixinIlinkNotifyStart = typeof notifyStart;
13
+ export type WeixinIlinkNotifyStop = typeof notifyStop;
14
+ export type WeixinIlinkGetUpdates = typeof getUpdates;
15
+ export interface WeixinIlinkEndpointOptions {
16
+ readonly id: CapabilityId;
10
17
  readonly config: ResolvedWeixinIlinkConfig;
11
- constructor(config: ResolvedWeixinIlinkConfig, metadata: IlinkClientMetadata, resolveCredentials: () => WeixinIlinkCredentials | null, resolveConfigManager: () => WeixinConfigManager | undefined, sendTextImpl: typeof sendMessageWeixin, contextTokens: WeixinContextTokenStore);
18
+ readonly resolveCredentials?: (config: ResolvedWeixinIlinkConfig, metadata: IlinkClientMetadata, state: WeixinIlinkStateStore, signal?: AbortSignal) => Promise<WeixinIlinkCredentials>;
19
+ /** Test / internal: override network side effects. */
20
+ readonly notifyStart?: WeixinIlinkNotifyStart;
21
+ readonly notifyStop?: WeixinIlinkNotifyStop;
22
+ readonly getUpdates?: WeixinIlinkGetUpdates;
23
+ readonly sendText?: WeixinIlinkSendText;
24
+ readonly state?: WeixinIlinkStateStore;
25
+ readonly contextTokens?: WeixinContextTokenStore;
26
+ readonly sessionGuard?: IlinkSessionGuard;
27
+ }
28
+ export declare class WeixinIlinkClient extends EventEmitter {
29
+ #private;
30
+ protected readonly endpointManagement: EndpointManagement;
31
+ protected readonly endpointControl: EndpointControl;
32
+ protected configName(): string;
33
+ get transportState(): import('zhin.js/adapter').EndpointTransportState | undefined;
34
+ protected executionSignal?: AbortSignal;
35
+ protected setExecutionSignal(signal: AbortSignal): void;
36
+ /** Native protocol work runs here; Endpoint attaches the framework receipt without replacing SDK APIs. */
37
+ protected receiveInboundCallback<T>(receive: () => T | Promise<T>): Promise<T>;
38
+ protected publishEvent(name: string, payload: unknown): Promise<unknown>;
39
+ protected publishAccepted(name: string, payload: unknown): Promise<void>;
40
+ protected publishPlatform(name: string, event: unknown): Promise<unknown>;
41
+ constructor(options: WeixinIlinkEndpointOptions);
12
42
  get credentials(): WeixinIlinkCredentials;
13
43
  get authenticated(): boolean;
14
44
  get apiBaseUrl(): string;
15
45
  get cdnBaseUrl(): string;
16
46
  contextToken(userId: string): string | undefined;
17
47
  reachableUserIds(): string[];
18
- sendText(to: string, text: string): Promise<{
48
+ sendText(to: string, text: string, options?: EndpointOperationOptions): Promise<{
19
49
  messageId: string;
20
50
  }>;
21
51
  sendMedia(to: string, filePath: string, text?: string): Promise<{
22
52
  messageId: string;
23
53
  }>;
24
- sendTyping(userId: string, status: number): Promise<boolean>;
54
+ sendTyping(userId: string, status: number, options?: EndpointOperationOptions): Promise<boolean>;
55
+ get hasCredentials(): boolean;
56
+ protected connectTransport(signal?: AbortSignal): Promise<void>;
57
+ protected openInput(): void;
58
+ protected closeInput(): void;
59
+ protected disconnectTransport(): Promise<void>;
60
+ protected sendPayload({ conversation, payload, signal }: EndpointSendRequest): Promise<string>;
61
+ /** Test / internal: admit a parsed message when the endpoint is open. */
62
+ admit(msg: WeixinMessageWithMedia, nativeEvent?: unknown): Promise<boolean>;
25
63
  }
26
64
  export type WeixinIlinkClientEventMap = Record<string, unknown>;
27
- declare module '@zhin.js/feature-kit' {
28
- interface AdapterClientRegistry {
29
- readonly 'weixin-ilink': {
30
- readonly client: WeixinIlinkClient;
31
- readonly events: WeixinIlinkClientEventMap;
32
- };
33
- }
34
- }
35
- export declare const weixinIlinkClient: import("@zhin.js/adapter").EndpointClientToken<WeixinIlinkClient, WeixinIlinkClientEventMap>;