@agent-wechat/agent-wechat 0.15.5 → 0.15.6

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 (2) hide show
  1. package/dist/index.js +24 -17
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1083,7 +1083,7 @@ import { emptyPluginConfigSchema } from "openclaw/plugin-sdk/core";
1083
1083
 
1084
1084
  // src/channel.ts
1085
1085
  import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID2 } from "openclaw/plugin-sdk/account-id";
1086
- import { createChannelMessageAdapterFromOutbound } from "openclaw/plugin-sdk/channel-message";
1086
+ import { createChannelMessageAdapterFromOutbound } from "openclaw/plugin-sdk/channel-outbound";
1087
1087
 
1088
1088
  // src/types.ts
1089
1089
  function normalizeDmPolicy(policy) {
@@ -5538,7 +5538,7 @@ var agentConfigSchema = external_exports.object({
5538
5538
  });
5539
5539
 
5540
5540
  // src/monitor.ts
5541
- import { createChannelReplyPipeline } from "openclaw/plugin-sdk/channel-reply-pipeline";
5541
+ import { createChannelMessageReplyPipeline } from "openclaw/plugin-sdk/channel-outbound";
5542
5542
 
5543
5543
  // src/media-delivery.ts
5544
5544
  var MIME_BY_FORMAT = {
@@ -5945,8 +5945,7 @@ import {
5945
5945
  import {
5946
5946
  resolveAllowlistProviderRuntimeGroupPolicy,
5947
5947
  resolveDefaultGroupPolicy
5948
- } from "openclaw/plugin-sdk/config-runtime";
5949
- import { resolveSenderCommandAuthorization } from "openclaw/plugin-sdk/command-auth";
5948
+ } from "openclaw/plugin-sdk/runtime-group-policy";
5950
5949
  var INVISIBLE_TEXT_RE = /[\u200b-\u200f\u202a-\u202e\u2060-\u206f]/g;
5951
5950
  var WECHAT_MENTION_START_RE = /^[@@]/u;
5952
5951
  function unique(values) {
@@ -6120,20 +6119,28 @@ function resolveWeChatInboundAccessDecision(params) {
6120
6119
  return { allowed: true, reason: `dmPolicy=${params.policy.dmPolicy}` };
6121
6120
  }
6122
6121
  async function resolveWeChatCommandAuthorization(params) {
6122
+ if (!params.deps.shouldComputeCommandAuthorized(params.rawBody, params.cfg)) {
6123
+ return void 0;
6124
+ }
6123
6125
  const normalizedSenderId = normalizeWeChatId(params.senderId ?? "");
6124
- const { commandAuthorized } = await resolveSenderCommandAuthorization({
6125
- cfg: params.cfg,
6126
- rawBody: params.rawBody,
6127
- isGroup: params.isGroup,
6128
- dmPolicy: params.dmPolicy,
6129
- configuredAllowFrom: params.allowFromForCommands,
6130
- senderId: normalizedSenderId,
6131
- isSenderAllowed: (senderId, allowFrom) => isWeChatSenderAllowed(senderId, normalizeWeChatAllowFrom(allowFrom)),
6132
- readAllowFromStore: async () => normalizeWeChatAllowFrom(await params.deps.readAllowFromStore()),
6133
- shouldComputeCommandAuthorized: params.deps.shouldComputeCommandAuthorized,
6134
- resolveCommandAuthorizedFromAuthorizers: params.deps.resolveCommandAuthorizedFromAuthorizers
6126
+ const usesStore = !params.isGroup && params.dmPolicy !== "allowlist" && params.dmPolicy !== "open";
6127
+ const storeAllowFrom = usesStore ? normalizeWeChatAllowFrom(await params.deps.readAllowFromStore().catch(() => [])) : [];
6128
+ const configuredAllowFrom = normalizeWeChatAllowFrom(params.allowFromForCommands);
6129
+ const effectiveAllowFrom = unique([...configuredAllowFrom, ...storeAllowFrom]);
6130
+ const effectiveGroupAllowFrom = configuredAllowFrom;
6131
+ return params.deps.resolveCommandAuthorizedFromAuthorizers({
6132
+ useAccessGroups: true,
6133
+ authorizers: [
6134
+ {
6135
+ configured: effectiveAllowFrom.length > 0,
6136
+ allowed: isWeChatSenderAllowed(normalizedSenderId, effectiveAllowFrom)
6137
+ },
6138
+ {
6139
+ configured: effectiveGroupAllowFrom.length > 0,
6140
+ allowed: isWeChatSenderAllowed(normalizedSenderId, effectiveGroupAllowFrom)
6141
+ }
6142
+ ]
6135
6143
  });
6136
- return commandAuthorized;
6137
6144
  }
6138
6145
  function resolveWeChatMentionGate(params) {
6139
6146
  const implicitMention = params.implicitMention === true;
@@ -6646,7 +6653,7 @@ async function dispatchSegment(segment, client, chatId, chat, liveAccount, polic
6646
6653
  );
6647
6654
  }
6648
6655
  });
6649
- const { onModelSelected, ...prefixOptions } = createChannelReplyPipeline({
6656
+ const { onModelSelected, ...prefixOptions } = createChannelMessageReplyPipeline({
6650
6657
  cfg,
6651
6658
  agentId: route.agentId,
6652
6659
  channel: "agent-wechat",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-wechat/agent-wechat",
3
- "version": "0.15.5",
3
+ "version": "0.15.6",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -9,7 +9,7 @@
9
9
  "devDependencies": {
10
10
  "@types/node": "^22",
11
11
  "esbuild": "^0.25.0",
12
- "openclaw": "^2026.8.1",
12
+ "openclaw": "^2026.10.2",
13
13
  "typescript": "^5.4.5",
14
14
  "@agent-wechat/shared": "0.3.1"
15
15
  },