@zhin.js/adapter-wecom 4.0.14 → 5.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-wecom
2
2
 
3
+ ## 5.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
  ## 4.0.14
4
18
 
5
19
  ### Patch Changes
package/adapters/wecom.js CHANGED
@@ -12,6 +12,7 @@ import { wecomRuntimeStateToken } from "../lib/wecom-runtime-state.js";
12
12
  export { WecomEndpoint } from "../lib/endpoint.js";
13
13
  export default defineAdapter({
14
14
  capabilities: ['inbound', 'outbound'],
15
+ operations: ['recall'],
15
16
  // image 段全部经 /cgi-bin/media/upload 物化为 media_id(url 下载后上传、
16
17
  // base64/path 直接上传、file 引用直用 media_id);无卡片交互面,交互段降级纯文本。
17
18
  segments: {
package/adapters/wecom.ts CHANGED
@@ -17,6 +17,7 @@ export type { WecomEndpointOptions, WecomFetch } from '../src/endpoint.js';
17
17
 
18
18
  export default defineAdapter<WecomAdapterConfig>({
19
19
  capabilities: ['inbound', 'outbound'],
20
+ operations: ['recall'],
20
21
  // image 段全部经 /cgi-bin/media/upload 物化为 media_id(url 下载后上传、
21
22
  // base64/path 直接上传、file 引用直用 media_id);无卡片交互面,交互段降级纯文本。
22
23
  segments: {
package/lib/endpoint.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WecomEndpoint — lifecycle, outbound send, inbound admit, OpenAPI helpers for agent tools.
3
3
  */
4
- import type { EndpointInstance, EndpointSendRequest } from 'zhin.js/adapter';
4
+ import { type EndpointControl, type EndpointInstance, 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';
@@ -31,6 +31,7 @@ export interface WecomEndpointOptions {
31
31
  */
32
32
  export declare class WecomEndpoint implements EndpointInstance {
33
33
  #private;
34
+ readonly control: EndpointControl;
34
35
  constructor(options: WecomEndpointOptions);
35
36
  /** Used by webhook handler. */
36
37
  get isOpen(): boolean;
package/lib/endpoint.js CHANGED
@@ -1,3 +1,7 @@
1
+ /**
2
+ * WecomEndpoint — lifecycle, outbound send, inbound admit, OpenAPI helpers for agent tools.
3
+ */
4
+ import { createRecallEndpointControl, } from 'zhin.js/adapter';
1
5
  import { formatCompact, getAdapterLogger } from '@zhin.js/logger';
2
6
  import { registerWecomAgentEndpoint } from './wecom-agent-deps.js';
3
7
  import { buildMediaUploadForm, readOutboundImageMedia, resolveMediaBinary, } from './media-upload.js';
@@ -12,6 +16,7 @@ import { receiveWecomSideEvent } from './side-event-dispatch.js';
12
16
  export class WecomEndpoint {
13
17
  #logger;
14
18
  #options;
19
+ control = createRecallEndpointControl((id) => this.recallMessage(id));
15
20
  #fetch;
16
21
  #routeReleases = [];
17
22
  #accessToken = { access_token: '', expires_in: 0, timestamp: 0 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhin.js/adapter-wecom",
3
- "version": "4.0.14",
3
+ "version": "5.0.0",
4
4
  "description": "Zhin.js WeCom (企业微信) adapter for Plugin Runtime (HTTP webhook)",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -34,21 +34,21 @@
34
34
  "directory": "plugins/adapters/wecom"
35
35
  },
36
36
  "dependencies": {
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
  },
43
43
  "peerDependencies": {
44
44
  "zod": "^4.0.0",
45
- "@zhin.js/adapter": "1.1.11",
46
- "@zhin.js/agent": "1.1.14",
45
+ "@zhin.js/adapter": "1.2.0",
46
+ "@zhin.js/agent": "1.1.15",
47
47
  "@zhin.js/command": "1.0.15",
48
- "@zhin.js/core": "1.5.12",
49
- "@zhin.js/host-http": "1.0.11",
48
+ "@zhin.js/core": "1.5.13",
49
+ "@zhin.js/host-http": "1.0.12",
50
50
  "@zhin.js/permission": "1.0.3",
51
- "zhin.js": "6.0.12"
51
+ "zhin.js": "6.0.13"
52
52
  },
53
53
  "peerDependenciesMeta": {
54
54
  "@zhin.js/agent": {
@@ -69,8 +69,8 @@
69
69
  "typescript": "^6.0.3",
70
70
  "vitest": "^4.1.10",
71
71
  "zod": "^4.4.3",
72
- "@zhin.js/agent": "1.1.14",
73
- "zhin.js": "6.0.12"
72
+ "@zhin.js/agent": "1.1.15",
73
+ "zhin.js": "6.0.13"
74
74
  },
75
75
  "files": [
76
76
  "adapters",
package/src/endpoint.ts CHANGED
@@ -1,7 +1,12 @@
1
1
  /**
2
2
  * WecomEndpoint — lifecycle, outbound send, inbound admit, OpenAPI helpers for agent tools.
3
3
  */
4
- import type { EndpointInstance, EndpointSendRequest } from 'zhin.js/adapter';
4
+ import {
5
+ createRecallEndpointControl,
6
+ type EndpointControl,
7
+ type EndpointInstance,
8
+ type EndpointSendRequest,
9
+ } from 'zhin.js/adapter';
5
10
  import type { MessageGateway, SideEventGateway } from '@zhin.js/core/runtime';
6
11
  import type { HttpHost, HttpRouteRegistration } from '@zhin.js/host-http';
7
12
  import { formatCompact, getAdapterLogger } from '@zhin.js/logger';
@@ -59,6 +64,7 @@ export class WecomEndpoint implements EndpointInstance {
59
64
  readonly #logger!: ReturnType<typeof getAdapterLogger>;
60
65
 
61
66
  readonly #options: WecomEndpointOptions;
67
+ readonly control: EndpointControl = createRecallEndpointControl((id) => this.recallMessage(id));
62
68
  readonly #fetch: WecomFetch;
63
69
  #routeReleases: HttpRouteRegistration[] = [];
64
70
  #accessToken: AccessToken = { access_token: '', expires_in: 0, timestamp: 0 };