@openclaw/whatsapp 2026.5.9-beta.1 → 2026.5.10-beta.2

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 (60) hide show
  1. package/dist/{access-control-hFVqAWSd.js → access-control-CdP8S3rJ.js} +66 -111
  2. package/dist/{action-runtime-flTHnBac.js → action-runtime-CMhO8liB.js} +1 -1
  3. package/dist/action-runtime-api.js +1 -1
  4. package/dist/action-runtime.runtime.js +1 -1
  5. package/dist/api.js +13 -13
  6. package/dist/{auth-store-CG0eSZ0D.js → auth-store-CjEimXKX.js} +3 -3
  7. package/dist/{channel-Dnv-QeNE.js → channel-BxntAClG.js} +12 -12
  8. package/dist/channel-config-api.js +1 -1
  9. package/dist/channel-plugin-api.js +1 -1
  10. package/dist/{channel-react-action-LOuxBqX6.js → channel-react-action-DJvzhIPw.js} +1 -1
  11. package/dist/{channel.runtime-CCZpOzbU.js → channel.runtime-CNdPCK3G.js} +5 -5
  12. package/dist/{channel.setup-CV0OjAwl.js → channel.setup-BqlcEVzR.js} +4 -4
  13. package/dist/{connection-controller-d8D2iUBj.js → connection-controller-DX2phM7V.js} +2 -2
  14. package/dist/constants.js +1 -1
  15. package/dist/contract-api.js +7 -7
  16. package/dist/{directory-config-BNCbgnmy.js → directory-config-o-muXLgk.js} +1 -1
  17. package/dist/directory-contract-api.js +1 -1
  18. package/dist/doctor-contract-api.js +1 -1
  19. package/dist/{identity-DhaC0MoD.js → identity-KxdJfH7p.js} +1 -1
  20. package/dist/legacy-session-surface-api.js +1 -1
  21. package/dist/legacy-state-migrations-api.js +1 -1
  22. package/dist/light-runtime-api.js +3 -3
  23. package/dist/{login-B_u009k0.js → login-DV99D0IN.js} +4 -4
  24. package/dist/{login-qr-C0b7I7hu.js → login-qr-cKndAXTv.js} +3 -3
  25. package/dist/login-qr-runtime.js +1 -1
  26. package/dist/{monitor-5u0dVXnB.js → monitor-mfy3Mmq-.js} +29 -15
  27. package/dist/{outbound-adapter-BoHBD2S7.js → outbound-adapter-B9ZW8sht.js} +3 -3
  28. package/dist/{outbound-base-CCx7atwc.js → outbound-base-MVpg2zU2.js} +3 -3
  29. package/dist/{outbound-media-contract-Dzi1ILTd.js → outbound-media-contract-BzWwBppP.js} +1 -1
  30. package/dist/outbound-payload-test-api.js +1 -1
  31. package/dist/{quoted-message-BXs55Teh.js → quoted-message-DQ6hAr34.js} +1 -1
  32. package/dist/runtime-api.js +11 -11
  33. package/dist/security-contract-api.js +1 -1
  34. package/dist/{send-api-DoycpOvC.js → send-api-DsbCqDre.js} +3 -3
  35. package/dist/{send-CLBN7TZv.js → send-u88yh8Hw.js} +2 -3
  36. package/dist/{session-BXC3R43P.js → session-DeIU_vjJ.js} +2 -2
  37. package/dist/{session.runtime-CVhtXjTk.js → session.runtime-B9VlYnWQ.js} +1 -1
  38. package/dist/{setup-surface-RbOpXjSR.js → setup-finalize-D3YuMUBs.js} +5 -52
  39. package/dist/setup-plugin-api.js +1 -1
  40. package/dist/setup-surface-CHjYlKJc.js +45 -0
  41. package/dist/{shared-h4cwNeYT.js → shared-CgYT3IzU.js} +7 -7
  42. package/dist/test-api.js +2 -2
  43. package/dist/{text-runtime-DFFwk5z6.js → text-runtime-DBKC9uEi.js} +27 -2
  44. package/package.json +5 -5
  45. package/dist/rolldown-runtime-RkAeH_Qm.js +0 -27
  46. /package/dist/{active-listener-DTbKS-j-.js → active-listener-D2NHQ5Og.js} +0 -0
  47. /package/dist/{agent-tools-login-DpRxLNRB.js → agent-tools-login-DYKYW5Nh.js} +0 -0
  48. /package/dist/{audio-preflight.runtime-MmkB-pgX.js → audio-preflight.runtime-CIFjeaEN.js} +0 -0
  49. /package/dist/{command-policy-O8sRnqUV.js → command-policy-BgZRZ31o.js} +0 -0
  50. /package/dist/{config-schema-Dmo66Ubb.js → config-schema-cSC7M4YA.js} +0 -0
  51. /package/dist/{constants-DLGCIbfl.js → constants-yKXGCGU9.js} +0 -0
  52. /package/dist/{doctor-A9tXm9Om.js → doctor-BrgepDUP.js} +0 -0
  53. /package/dist/{group-session-contract-B8QBn0I2.js → group-session-contract-DL-SLclv.js} +0 -0
  54. /package/dist/{reply-resolver.runtime-rIVWohXr.js → reply-resolver.runtime-CROyXXQh.js} +0 -0
  55. /package/dist/{runtime-6fZ67abR.js → runtime-DdodQB8G.js} +0 -0
  56. /package/dist/{runtime-group-policy-Gp1lQ0at.js → runtime-group-policy-BH_U23qp.js} +0 -0
  57. /package/dist/{security-contract-DqH8JDX6.js → security-contract-BzlZFreO.js} +0 -0
  58. /package/dist/{session-contract-B0efQf9P.js → session-contract-BNUscPf4.js} +0 -0
  59. /package/dist/{setup-core-DZKvpzbH.js → setup-core-DnhO0PjG.js} +0 -0
  60. /package/dist/{state-migrations-Bm0S67yH.js → state-migrations-CtdIArlK.js} +0 -0
@@ -1,15 +1,20 @@
1
+ import { r as isSelfChatMode, t as text_runtime_exports } from "./text-runtime-DBKC9uEi.js";
1
2
  import { a as resolveWhatsAppAccount } from "./accounts-BDqgpFEB.js";
2
- import { r as isSelfChatMode, t as text_runtime_exports } from "./text-runtime-DFFwk5z6.js";
3
- import { a as getSelfIdentity, o as getSenderIdentity } from "./identity-DhaC0MoD.js";
4
- import { t as resolveWhatsAppRuntimeGroupPolicy } from "./runtime-group-policy-Gp1lQ0at.js";
3
+ import { a as getSelfIdentity, o as getSenderIdentity } from "./identity-KxdJfH7p.js";
4
+ import { t as resolveWhatsAppRuntimeGroupPolicy } from "./runtime-group-policy-BH_U23qp.js";
5
5
  import { defaultRuntime } from "openclaw/plugin-sdk/runtime-env";
6
- import { expandAllowFromWithAccessGroups, readStoreAllowFromForDmPolicy, resolveDmGroupAccessWithCommandGate, resolveDmGroupAccessWithLists, resolveEffectiveAllowFromLists } from "openclaw/plugin-sdk/security-runtime";
7
6
  import { resolveChannelGroupPolicy, resolveChannelGroupRequireMention } from "openclaw/plugin-sdk/channel-policy";
8
7
  import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
9
8
  import { upsertChannelPairingRequest } from "openclaw/plugin-sdk/conversation-runtime";
10
9
  import { resolveDefaultGroupPolicy, warnMissingProviderGroupPolicyFallbackOnce } from "openclaw/plugin-sdk/runtime-group-policy";
10
+ import { resolveStableChannelMessageIngress } from "openclaw/plugin-sdk/channel-ingress-runtime";
11
11
  import { resolveGroupSessionKey } from "openclaw/plugin-sdk/session-store-runtime";
12
12
  //#region extensions/whatsapp/src/inbound-policy.ts
13
+ function normalizeWhatsAppIngressPhone(value) {
14
+ const trimmed = value.trim();
15
+ if (!trimmed) return null;
16
+ return (0, text_runtime_exports.normalizeE164)(trimmed);
17
+ }
13
18
  function resolveGroupConversationId(conversationId) {
14
19
  return resolveGroupSessionKey({
15
20
  From: conversationId,
@@ -17,11 +22,9 @@ function resolveGroupConversationId(conversationId) {
17
22
  Provider: "whatsapp"
18
23
  })?.id ?? conversationId;
19
24
  }
20
- function isNormalizedSenderAllowed(allowEntries, sender) {
21
- if (allowEntries.includes("*")) return true;
22
- const normalizedSender = (0, text_runtime_exports.normalizeE164)(sender ?? "");
23
- if (!normalizedSender) return false;
24
- return new Set(allowEntries.map((entry) => (0, text_runtime_exports.normalizeE164)(entry)).filter((entry) => Boolean(entry))).has(normalizedSender);
25
+ function maybeSamePhoneDmAllowFrom(params) {
26
+ if (params.isGroup || !params.dmSenderId || !params.policy.isSamePhone(params.dmSenderId)) return [];
27
+ return [params.dmSenderId];
25
28
  }
26
29
  function buildResolvedWhatsAppGroupConfig(params) {
27
30
  return { channels: { whatsapp: {
@@ -37,11 +40,7 @@ function resolveWhatsAppInboundPolicy(params) {
37
40
  const configuredAllowFrom = account.allowFrom ?? [];
38
41
  const dmPolicy = account.dmPolicy ?? "pairing";
39
42
  const dmAllowFrom = configuredAllowFrom.length > 0 ? configuredAllowFrom : params.selfE164 ? [params.selfE164] : [];
40
- const groupAllowFrom = account.groupAllowFrom ?? (configuredAllowFrom.length > 0 ? configuredAllowFrom : void 0) ?? [];
41
- const { effectiveGroupAllowFrom } = resolveEffectiveAllowFromLists({
42
- allowFrom: configuredAllowFrom,
43
- groupAllowFrom
44
- });
43
+ const groupAllowFrom = (Array.isArray(account.groupAllowFrom) && account.groupAllowFrom.length > 0 ? account.groupAllowFrom : void 0) ?? (configuredAllowFrom.length > 0 ? configuredAllowFrom : void 0) ?? [];
45
44
  const defaultGroupPolicy = resolveDefaultGroupPolicy(params.cfg);
46
45
  const { groupPolicy, providerMissingFallbackApplied } = resolveWhatsAppRuntimeGroupPolicy({
47
46
  providerConfigPresent: params.cfg.channels?.whatsapp !== void 0,
@@ -62,15 +61,12 @@ function resolveWhatsAppInboundPolicy(params) {
62
61
  groupAllowFrom,
63
62
  isSelfChat: account.selfChatMode ?? isSelfChatMode(params.selfE164, configuredAllowFrom),
64
63
  providerMissingFallbackApplied,
65
- shouldReadStorePairingApprovals: dmPolicy !== "allowlist",
66
64
  isSamePhone,
67
- isDmSenderAllowed: (allowEntries, sender) => isSamePhone(sender) || isNormalizedSenderAllowed(allowEntries, sender),
68
- isGroupSenderAllowed: (allowEntries, sender) => isNormalizedSenderAllowed(allowEntries, sender),
69
65
  resolveConversationGroupPolicy: (conversationId) => resolveChannelGroupPolicy({
70
66
  cfg: resolvedGroupCfg,
71
67
  channel: "whatsapp",
72
68
  groupId: resolveGroupConversationId(conversationId),
73
- hasGroupAllowFrom: effectiveGroupAllowFrom.length > 0
69
+ hasGroupAllowFrom: groupAllowFrom.length > 0
74
70
  }),
75
71
  resolveConversationRequireMention: (conversationId) => resolveChannelGroupRequireMention({
76
72
  cfg: resolvedGroupCfg,
@@ -79,9 +75,40 @@ function resolveWhatsAppInboundPolicy(params) {
79
75
  })
80
76
  };
81
77
  }
78
+ async function resolveWhatsAppIngressAccess(params) {
79
+ const samePhoneDmAllowFrom = maybeSamePhoneDmAllowFrom({
80
+ isGroup: params.isGroup,
81
+ policy: params.policy,
82
+ dmSenderId: params.dmSenderId
83
+ });
84
+ const dmAllowFrom = [...params.policy.dmAllowFrom, ...samePhoneDmAllowFrom];
85
+ return await resolveStableChannelMessageIngress({
86
+ channelId: "whatsapp",
87
+ accountId: params.policy.account.accountId,
88
+ identity: {
89
+ key: "whatsapp-sender-phone",
90
+ kind: "phone",
91
+ normalize: normalizeWhatsAppIngressPhone,
92
+ sensitivity: "pii",
93
+ entryIdPrefix: "whatsapp-entry"
94
+ },
95
+ cfg: params.cfg,
96
+ useDefaultPairingStore: true,
97
+ subject: { stableId: params.senderId ?? "" },
98
+ conversation: {
99
+ kind: params.isGroup ? "group" : "direct",
100
+ id: params.conversationId
101
+ },
102
+ dmPolicy: params.policy.dmPolicy,
103
+ groupPolicy: params.policy.groupPolicy,
104
+ policy: { groupAllowFromFallbackToAllowFrom: false },
105
+ allowFrom: dmAllowFrom,
106
+ groupAllowFrom: params.policy.groupAllowFrom,
107
+ command: params.includeCommand === true ? {} : void 0
108
+ });
109
+ }
82
110
  async function resolveWhatsAppCommandAuthorized(params) {
83
- const useAccessGroups = params.cfg.commands?.useAccessGroups !== false;
84
- if (!useAccessGroups) return true;
111
+ if (!(params.cfg.commands?.useAccessGroups !== false)) return true;
85
112
  const self = getSelfIdentity(params.msg);
86
113
  const policy = params.policy ?? resolveWhatsAppInboundPolicy({
87
114
  cfg: params.cfg,
@@ -92,52 +119,16 @@ async function resolveWhatsAppCommandAuthorized(params) {
92
119
  const sender = getSenderIdentity(params.msg);
93
120
  const dmSender = sender.e164 ?? params.msg.from ?? "";
94
121
  const groupSender = sender.e164 ?? "";
95
- const normalizedSender = (0, text_runtime_exports.normalizeE164)(isGroup ? groupSender : dmSender);
96
- if (!normalizedSender) return false;
97
- const storeAllowFrom = isGroup || !policy.shouldReadStorePairingApprovals ? [] : await readStoreAllowFromForDmPolicy({
98
- provider: "whatsapp",
99
- accountId: policy.account.accountId,
100
- dmPolicy: policy.dmPolicy,
101
- shouldRead: policy.shouldReadStorePairingApprovals
102
- });
103
- const isSenderAllowed = (senderId, allowEntries) => isGroup ? policy.isGroupSenderAllowed(allowEntries, senderId) : policy.isDmSenderAllowed(allowEntries, senderId);
104
- const [allowFrom, groupAllowFrom] = await Promise.all([expandAllowFromWithAccessGroups({
105
- cfg: params.cfg,
106
- allowFrom: policy.dmAllowFrom,
107
- channel: "whatsapp",
108
- accountId: policy.account.accountId,
109
- senderId: normalizedSender,
110
- isSenderAllowed
111
- }), expandAllowFromWithAccessGroups({
122
+ if (!(0, text_runtime_exports.normalizeE164)(isGroup ? groupSender : dmSender)) return false;
123
+ return (await resolveWhatsAppIngressAccess({
112
124
  cfg: params.cfg,
113
- allowFrom: policy.groupAllowFrom,
114
- channel: "whatsapp",
115
- accountId: policy.account.accountId,
116
- senderId: normalizedSender,
117
- isSenderAllowed
118
- })]);
119
- const dmStoreAllowFrom = isGroup ? [] : await expandAllowFromWithAccessGroups({
120
- cfg: params.cfg,
121
- allowFrom: storeAllowFrom,
122
- channel: "whatsapp",
123
- accountId: policy.account.accountId,
124
- senderId: normalizedSender,
125
- isSenderAllowed
126
- });
127
- return resolveDmGroupAccessWithCommandGate({
125
+ policy,
128
126
  isGroup,
129
- dmPolicy: policy.dmPolicy,
130
- groupPolicy: policy.groupPolicy,
131
- allowFrom,
132
- groupAllowFrom,
133
- storeAllowFrom: dmStoreAllowFrom,
134
- isSenderAllowed: (allowEntries) => isGroup ? policy.isGroupSenderAllowed(allowEntries, groupSender) : policy.isDmSenderAllowed(allowEntries, dmSender),
135
- command: {
136
- useAccessGroups,
137
- allowTextCommands: true,
138
- hasControlCommand: true
139
- }
140
- }).commandAuthorized;
127
+ conversationId: params.msg.conversationId ?? params.msg.chatId ?? params.msg.from,
128
+ senderId: isGroup ? groupSender : dmSender,
129
+ dmSenderId: dmSender,
130
+ includeCommand: true
131
+ })).commandAccess.authorized;
141
132
  }
142
133
  //#endregion
143
134
  //#region extensions/whatsapp/src/inbound/access-control.ts
@@ -152,12 +143,6 @@ async function checkInboundAccessControl(params) {
152
143
  accountId: params.accountId,
153
144
  selfE164: params.selfE164
154
145
  });
155
- const storeAllowFrom = params.group ? [] : await readStoreAllowFromForDmPolicy({
156
- provider: "whatsapp",
157
- accountId: policy.account.accountId,
158
- dmPolicy: policy.dmPolicy,
159
- shouldRead: policy.shouldReadStorePairingApprovals
160
- });
161
146
  const pairingGraceMs = typeof params.pairingGraceMs === "number" && params.pairingGraceMs > 0 ? params.pairingGraceMs : PAIRING_REPLY_HISTORY_GRACE_MS;
162
147
  const suppressPairingReply = typeof params.connectedAtMs === "number" && typeof params.messageTimestampMs === "number" && params.messageTimestampMs < params.connectedAtMs - pairingGraceMs;
163
148
  warnMissingProviderGroupPolicyFallbackOnce({
@@ -166,47 +151,17 @@ async function checkInboundAccessControl(params) {
166
151
  accountId: policy.account.accountId,
167
152
  log: (message) => logWhatsAppVerbose(params.verbose, message)
168
153
  });
169
- const accessGroupSenderId = params.group ? params.senderE164 ?? params.from : params.from;
170
- const isAccessGroupSenderAllowed = (senderId, allowEntries) => {
171
- return params.group ? policy.isGroupSenderAllowed(allowEntries, senderId) : policy.isDmSenderAllowed(allowEntries, senderId);
172
- };
173
- const [allowFrom, groupAllowFrom] = await Promise.all([expandAllowFromWithAccessGroups({
174
- cfg: params.cfg,
175
- allowFrom: params.group ? policy.configuredAllowFrom : policy.dmAllowFrom,
176
- channel: "whatsapp",
177
- accountId: policy.account.accountId,
178
- senderId: accessGroupSenderId,
179
- isSenderAllowed: isAccessGroupSenderAllowed
180
- }), expandAllowFromWithAccessGroups({
154
+ const { senderAccess } = await resolveWhatsAppIngressAccess({
181
155
  cfg: params.cfg,
182
- allowFrom: policy.groupAllowFrom,
183
- channel: "whatsapp",
184
- accountId: policy.account.accountId,
185
- senderId: accessGroupSenderId,
186
- isSenderAllowed: isAccessGroupSenderAllowed
187
- })]);
188
- const dmStoreAllowFrom = params.group ? [] : await expandAllowFromWithAccessGroups({
189
- cfg: params.cfg,
190
- allowFrom: storeAllowFrom,
191
- channel: "whatsapp",
192
- accountId: policy.account.accountId,
193
- senderId: accessGroupSenderId,
194
- isSenderAllowed: isAccessGroupSenderAllowed
195
- });
196
- const access = resolveDmGroupAccessWithLists({
156
+ policy,
197
157
  isGroup: params.group,
198
- dmPolicy: policy.dmPolicy,
199
- groupPolicy: policy.groupPolicy,
200
- allowFrom,
201
- groupAllowFrom,
202
- storeAllowFrom: dmStoreAllowFrom,
203
- isSenderAllowed: (allowEntries) => {
204
- return params.group ? policy.isGroupSenderAllowed(allowEntries, params.senderE164) : policy.isDmSenderAllowed(allowEntries, params.from);
205
- }
158
+ conversationId: params.remoteJid,
159
+ senderId: params.group ? params.senderE164 : params.from,
160
+ dmSenderId: params.from
206
161
  });
207
- if (params.group && access.decision !== "allow") {
208
- if (access.reason === "groupPolicy=disabled") logWhatsAppVerbose(params.verbose, "Blocked group message (groupPolicy: disabled)");
209
- else if (access.reason === "groupPolicy=allowlist (empty allowlist)") logWhatsAppVerbose(params.verbose, "Blocked group message (groupPolicy: allowlist, no groupAllowFrom)");
162
+ if (params.group && senderAccess.decision !== "allow") {
163
+ if (senderAccess.reasonCode === "group_policy_disabled") logWhatsAppVerbose(params.verbose, "Blocked group message (groupPolicy: disabled)");
164
+ else if (senderAccess.reasonCode === "group_policy_empty_allowlist") logWhatsAppVerbose(params.verbose, "Blocked group message (groupPolicy: allowlist, no groupAllowFrom)");
210
165
  else logWhatsAppVerbose(params.verbose, `Blocked group message from ${params.senderE164 ?? "unknown sender"} (groupPolicy: allowlist)`);
211
166
  return {
212
167
  allowed: false,
@@ -225,7 +180,7 @@ async function checkInboundAccessControl(params) {
225
180
  resolvedAccountId: policy.account.accountId
226
181
  };
227
182
  }
228
- if (access.decision === "block" && access.reason === "dmPolicy=disabled") {
183
+ if (senderAccess.decision === "block" && senderAccess.reasonCode === "dm_policy_disabled") {
229
184
  logWhatsAppVerbose(params.verbose, "Blocked dm (dmPolicy: disabled)");
230
185
  return {
231
186
  allowed: false,
@@ -234,7 +189,7 @@ async function checkInboundAccessControl(params) {
234
189
  resolvedAccountId: policy.account.accountId
235
190
  };
236
191
  }
237
- if (access.decision === "pairing" && !policy.isSamePhone(params.from)) {
192
+ if (senderAccess.decision === "pairing" && !policy.isSamePhone(params.from)) {
238
193
  const candidate = params.from;
239
194
  if (suppressPairingReply) logWhatsAppVerbose(params.verbose, `Skipping pairing reply for historical DM from ${candidate}.`);
240
195
  else await createChannelPairingChallengeIssuer({
@@ -266,7 +221,7 @@ async function checkInboundAccessControl(params) {
266
221
  resolvedAccountId: policy.account.accountId
267
222
  };
268
223
  }
269
- if (access.decision !== "allow") {
224
+ if (senderAccess.decision !== "allow") {
270
225
  logWhatsAppVerbose(params.verbose, `Blocked unauthorized sender ${params.from} (dmPolicy=${policy.dmPolicy})`);
271
226
  return {
272
227
  allowed: false,
@@ -1,7 +1,7 @@
1
1
  import { a as resolveWhatsAppAccount } from "./accounts-BDqgpFEB.js";
2
2
  import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-CQ3Y1i0g.js";
3
3
  import { t as resolveWhatsAppReactionLevel } from "./reaction-level-CRVEVAfi.js";
4
- import { r as sendReactionWhatsApp } from "./send-CLBN7TZv.js";
4
+ import { r as sendReactionWhatsApp } from "./send-u88yh8Hw.js";
5
5
  import { ToolAuthorizationError, createActionGate, jsonResult, readReactionParams, readStringParam } from "openclaw/plugin-sdk/channel-actions";
6
6
  //#region extensions/whatsapp/src/action-runtime-target-auth.ts
7
7
  function resolveAuthorizedWhatsAppOutboundTarget(params) {
@@ -1,2 +1,2 @@
1
- import { t as handleWhatsAppAction } from "./action-runtime-flTHnBac.js";
1
+ import { t as handleWhatsAppAction } from "./action-runtime-CMhO8liB.js";
2
2
  export { handleWhatsAppAction };
@@ -1,2 +1,2 @@
1
- import { t as handleWhatsAppAction } from "./action-runtime-flTHnBac.js";
1
+ import { t as handleWhatsAppAction } from "./action-runtime-CMhO8liB.js";
2
2
  export { handleWhatsAppAction };
package/dist/api.js CHANGED
@@ -1,21 +1,21 @@
1
+ import { a as markdownToWhatsApp, i as jidToE164, n as assertWebChannel, o as resolveJidToE164, r as isSelfChatMode, s as toWhatsappJid, t as text_runtime_exports } from "./text-runtime-DBKC9uEi.js";
1
2
  import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-DG18xddX.js";
2
3
  import { a as resolveWhatsAppAccount, i as listWhatsAppAuthDirs, n as hasAnyWhatsAppAuth, o as resolveWhatsAppAuthDir, r as listEnabledWhatsAppAccounts, s as resolveWhatsAppMediaMaxBytes, t as DEFAULT_WHATSAPP_MEDIA_MAX_MB } from "./accounts-BDqgpFEB.js";
3
4
  import { a as normalizeWhatsAppAllowFromEntries, c as normalizeWhatsAppTarget, i as looksLikeWhatsAppTargetId, r as isWhatsAppUserTarget, s as normalizeWhatsAppMessagingTarget, t as isWhatsAppGroupJid } from "./normalize-target-nXxC_hxG.js";
4
5
  import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-CQ3Y1i0g.js";
5
6
  import "./reaction-level-CRVEVAfi.js";
6
- import { a as markdownToWhatsApp, i as jidToE164, n as assertWebChannel, o as resolveJidToE164, r as isSelfChatMode, s as toWhatsappJid, t as text_runtime_exports } from "./text-runtime-DFFwk5z6.js";
7
- import "./send-CLBN7TZv.js";
8
- import { t as whatsappPlugin } from "./channel-Dnv-QeNE.js";
9
- import { n as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS } from "./outbound-base-CCx7atwc.js";
10
- import { t as whatsappCommandPolicy } from "./command-policy-O8sRnqUV.js";
11
- import { a as resolveWhatsAppGroupToolPolicy, i as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupIntroHint } from "./shared-h4cwNeYT.js";
12
- import "./config-schema-Dmo66Ubb.js";
13
- import { t as whatsappSetupPlugin } from "./channel.setup-CV0OjAwl.js";
14
- import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-DLGCIbfl.js";
15
- import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-BNCbgnmy.js";
16
- import { t as __testing } from "./access-control-hFVqAWSd.js";
17
- import { p as extractText, t as createWebSendApi } from "./send-api-DoycpOvC.js";
18
- import { r as waitForWaConnection, t as createWaSocket } from "./session-BXC3R43P.js";
7
+ import "./send-u88yh8Hw.js";
8
+ import { t as whatsappPlugin } from "./channel-BxntAClG.js";
9
+ import { n as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS } from "./outbound-base-MVpg2zU2.js";
10
+ import { t as whatsappCommandPolicy } from "./command-policy-BgZRZ31o.js";
11
+ import { a as resolveWhatsAppGroupToolPolicy, i as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupIntroHint } from "./shared-CgYT3IzU.js";
12
+ import "./config-schema-cSC7M4YA.js";
13
+ import { t as whatsappSetupPlugin } from "./channel.setup-BqlcEVzR.js";
14
+ import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-yKXGCGU9.js";
15
+ import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-o-muXLgk.js";
16
+ import { t as __testing } from "./access-control-CdP8S3rJ.js";
17
+ import { p as extractText, t as createWebSendApi } from "./send-api-DsbCqDre.js";
18
+ import { r as waitForWaConnection, t as createWaSocket } from "./session-DeIU_vjJ.js";
19
19
  import "openclaw/plugin-sdk/channel-actions";
20
20
  import "openclaw/plugin-sdk/account-resolution";
21
21
  import "openclaw/plugin-sdk/core";
@@ -1,6 +1,6 @@
1
+ import { t as text_runtime_exports } from "./text-runtime-DBKC9uEi.js";
1
2
  import { n as resolveWebCredsBackupPath, r as resolveWebCredsPath } from "./creds-files-_2V8jzQa.js";
2
- import { t as text_runtime_exports } from "./text-runtime-DFFwk5z6.js";
3
- import { c as resolveComparableIdentity } from "./identity-DhaC0MoD.js";
3
+ import { c as resolveComparableIdentity } from "./identity-KxdJfH7p.js";
4
4
  import fs from "node:fs";
5
5
  import path from "node:path";
6
6
  import { resolveOAuthDir as resolveOAuthDir$1 } from "openclaw/plugin-sdk/state-paths";
@@ -14,7 +14,7 @@ const CREDS_FILE_MODE = 384;
14
14
  const CREDS_SAVE_FLUSH_TIMEOUT_MS = 15e3;
15
15
  const credsSaveQueues = /* @__PURE__ */ new Map();
16
16
  async function stringifyCreds(creds) {
17
- const { BufferJSON } = await import("./session.runtime-CVhtXjTk.js").then((n) => n.a);
17
+ const { BufferJSON } = await import("./session.runtime-B9VlYnWQ.js").then((n) => n.a);
18
18
  return JSON.stringify(creds, BufferJSON.replacer);
19
19
  }
20
20
  async function writeCredsJsonAtomically(authDir, creds) {
@@ -4,16 +4,16 @@ import { c as normalizeWhatsAppTarget, i as looksLikeWhatsAppTargetId, n as isWh
4
4
  import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-CQ3Y1i0g.js";
5
5
  import { t as resolveWhatsAppReactionLevel } from "./reaction-level-CRVEVAfi.js";
6
6
  import "./normalize-Y3eBdM8a.js";
7
- import { r as normalizeWhatsAppPayloadTextPreservingIndentation } from "./outbound-media-contract-Dzi1ILTd.js";
8
- import { i as sendTypingWhatsApp, n as sendPollWhatsApp, t as sendMessageWhatsApp } from "./send-CLBN7TZv.js";
9
- import { t as createWhatsAppLoginTool } from "./agent-tools-login-DpRxLNRB.js";
10
- import { t as createWhatsAppOutboundBase } from "./outbound-base-CCx7atwc.js";
11
- import { t as getWhatsAppRuntime } from "./runtime-6fZ67abR.js";
12
- import { t as whatsappCommandPolicy } from "./command-policy-O8sRnqUV.js";
13
- import { a as resolveWhatsAppGroupToolPolicy, c as formatWhatsAppConfigAllowFromEntries, i as resolveWhatsAppGroupRequireMention, n as loadWhatsAppChannelRuntime, o as resolveWhatsAppGroupIntroHint, r as whatsappSetupWizardProxy, s as resolveWhatsAppMentionStripRegexes, t as createWhatsAppPluginBase } from "./shared-h4cwNeYT.js";
14
- import { d as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-CG0eSZ0D.js";
15
- import { t as whatsappSetupAdapter } from "./setup-core-DZKvpzbH.js";
16
- import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-Bm0S67yH.js";
7
+ import { r as normalizeWhatsAppPayloadTextPreservingIndentation } from "./outbound-media-contract-BzWwBppP.js";
8
+ import { i as sendTypingWhatsApp, n as sendPollWhatsApp, t as sendMessageWhatsApp } from "./send-u88yh8Hw.js";
9
+ import { t as createWhatsAppLoginTool } from "./agent-tools-login-DYKYW5Nh.js";
10
+ import { t as createWhatsAppOutboundBase } from "./outbound-base-MVpg2zU2.js";
11
+ import { t as getWhatsAppRuntime } from "./runtime-DdodQB8G.js";
12
+ import { t as whatsappCommandPolicy } from "./command-policy-BgZRZ31o.js";
13
+ import { a as resolveWhatsAppGroupToolPolicy, c as formatWhatsAppConfigAllowFromEntries, i as resolveWhatsAppGroupRequireMention, n as loadWhatsAppChannelRuntime, o as resolveWhatsAppGroupIntroHint, r as whatsappSetupWizardProxy, s as resolveWhatsAppMentionStripRegexes, t as createWhatsAppPluginBase } from "./shared-CgYT3IzU.js";
14
+ import { d as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-CjEimXKX.js";
15
+ import { t as whatsappSetupAdapter } from "./setup-core-DnhO0PjG.js";
16
+ import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-CtdIArlK.js";
17
17
  import { createActionGate as createActionGate$1 } from "openclaw/plugin-sdk/channel-actions";
18
18
  import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
19
19
  import { buildChannelOutboundSessionRoute } from "openclaw/plugin-sdk/core";
@@ -322,8 +322,8 @@ function collectWhatsAppStatusIssues(accounts) {
322
322
  }
323
323
  //#endregion
324
324
  //#region extensions/whatsapp/src/channel.ts
325
- const loadWhatsAppDirectoryConfig = createLazyRuntimeModule(() => import("./directory-config-BNCbgnmy.js").then((n) => n.t));
326
- const loadWhatsAppChannelReactAction = createLazyRuntimeModule(() => import("./channel-react-action-LOuxBqX6.js"));
325
+ const loadWhatsAppDirectoryConfig = createLazyRuntimeModule(() => import("./directory-config-o-muXLgk.js").then((n) => n.t));
326
+ const loadWhatsAppChannelReactAction = createLazyRuntimeModule(() => import("./channel-react-action-DJvzhIPw.js"));
327
327
  function parseWhatsAppExplicitTarget(raw) {
328
328
  const normalized = normalizeWhatsAppTarget(raw);
329
329
  if (!normalized) return null;
@@ -1,2 +1,2 @@
1
- import { t as WhatsAppChannelConfigSchema } from "./config-schema-Dmo66Ubb.js";
1
+ import { t as WhatsAppChannelConfigSchema } from "./config-schema-cSC7M4YA.js";
2
2
  export { WhatsAppChannelConfigSchema };
@@ -1,2 +1,2 @@
1
- import { t as whatsappPlugin } from "./channel-Dnv-QeNE.js";
1
+ import { t as whatsappPlugin } from "./channel-BxntAClG.js";
2
2
  export { whatsappPlugin };
@@ -1,5 +1,5 @@
1
1
  import { c as normalizeWhatsAppTarget, t as isWhatsAppGroupJid } from "./normalize-target-nXxC_hxG.js";
2
- import { t as handleWhatsAppAction } from "./action-runtime-flTHnBac.js";
2
+ import { t as handleWhatsAppAction } from "./action-runtime-CMhO8liB.js";
3
3
  import "./normalize-Y3eBdM8a.js";
4
4
  import { readStringOrNumberParam, readStringParam as readStringParam$1, resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
5
5
  //#region extensions/whatsapp/src/channel-react-action.ts
@@ -1,9 +1,9 @@
1
1
  import { startWebLoginWithQr as startWebLoginWithQr$1, waitForWebLogin as waitForWebLogin$1 } from "./login-qr-runtime.js";
2
- import { a as getWebAuthAgeMs$1, b as webAuthExists$1, d as readWebAuthExistsForDecision$1, f as readWebAuthSnapshot$1, h as readWebSelfId$1, m as readWebAuthState$1, o as logWebSelfId$1, p as readWebAuthSnapshotBestEffort$1, s as logoutWeb$1, u as readWebAuthExistsBestEffort$1 } from "./auth-store-CG0eSZ0D.js";
3
- import { t as getActiveWebListener$1 } from "./active-listener-DTbKS-j-.js";
4
- import { t as monitorWebChannel$1 } from "./monitor-5u0dVXnB.js";
5
- import { t as loginWeb$1 } from "./login-B_u009k0.js";
6
- import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-RbOpXjSR.js";
2
+ import { a as getWebAuthAgeMs$1, b as webAuthExists$1, d as readWebAuthExistsForDecision$1, f as readWebAuthSnapshot$1, h as readWebSelfId$1, m as readWebAuthState$1, o as logWebSelfId$1, p as readWebAuthSnapshotBestEffort$1, s as logoutWeb$1, u as readWebAuthExistsBestEffort$1 } from "./auth-store-CjEimXKX.js";
3
+ import { t as getActiveWebListener$1 } from "./active-listener-D2NHQ5Og.js";
4
+ import { t as monitorWebChannel$1 } from "./monitor-mfy3Mmq-.js";
5
+ import { t as loginWeb$1 } from "./login-DV99D0IN.js";
6
+ import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-CHjYlKJc.js";
7
7
  //#region extensions/whatsapp/src/channel.runtime.ts
8
8
  function getActiveWebListener(...args) {
9
9
  return getActiveWebListener$1(...args);
@@ -1,7 +1,7 @@
1
- import { a as resolveWhatsAppGroupToolPolicy, i as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupIntroHint, r as whatsappSetupWizardProxy, t as createWhatsAppPluginBase } from "./shared-h4cwNeYT.js";
2
- import { m as readWebAuthState } from "./auth-store-CG0eSZ0D.js";
3
- import { t as whatsappSetupAdapter } from "./setup-core-DZKvpzbH.js";
4
- import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-Bm0S67yH.js";
1
+ import { a as resolveWhatsAppGroupToolPolicy, i as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupIntroHint, r as whatsappSetupWizardProxy, t as createWhatsAppPluginBase } from "./shared-CgYT3IzU.js";
2
+ import { m as readWebAuthState } from "./auth-store-CjEimXKX.js";
3
+ import { t as whatsappSetupAdapter } from "./setup-core-DnhO0PjG.js";
4
+ import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-CtdIArlK.js";
5
5
  //#region extensions/whatsapp/src/channel.setup.ts
6
6
  const whatsappSetupPlugin = {
7
7
  ...createWhatsAppPluginBase({
@@ -1,7 +1,7 @@
1
1
  import { n as registerWhatsAppConnectionController, r as unregisterWhatsAppConnectionController } from "./connection-controller-registry-D_iIGz5m.js";
2
2
  import { n as getStatusCode, t as formatError } from "./session-errors-CSuKZPub.js";
3
- import { s as logoutWeb } from "./auth-store-CG0eSZ0D.js";
4
- import { r as waitForWaConnection, t as createWaSocket } from "./session-BXC3R43P.js";
3
+ import { s as logoutWeb } from "./auth-store-CjEimXKX.js";
4
+ import { r as waitForWaConnection, t as createWaSocket } from "./session-DeIU_vjJ.js";
5
5
  import { clamp } from "openclaw/plugin-sdk/text-runtime";
6
6
  import { computeBackoff, info, sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
7
7
  import { DisconnectReason } from "@whiskeysockets/baileys";
package/dist/constants.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-DLGCIbfl.js";
1
+ import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-yKXGCGU9.js";
2
2
  export { DEFAULT_WEB_MEDIA_BYTES };
@@ -1,11 +1,11 @@
1
1
  import { c as normalizeWhatsAppTarget$1, t as isWhatsAppGroupJid$1 } from "./normalize-target-nXxC_hxG.js";
2
- import { t as whatsappCommandPolicy$1 } from "./command-policy-O8sRnqUV.js";
3
- import { t as resolveLegacyGroupSessionKey$1 } from "./group-session-contract-B8QBn0I2.js";
4
- import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-DqH8JDX6.js";
5
- import { r as isLegacyGroupSessionKey$1, t as canonicalizeLegacySessionKey$1 } from "./session-contract-B0efQf9P.js";
6
- import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-BNCbgnmy.js";
7
- import { t as resolveWhatsAppRuntimeGroupPolicy$1 } from "./runtime-group-policy-Gp1lQ0at.js";
8
- import { t as __testing } from "./access-control-hFVqAWSd.js";
2
+ import { t as whatsappCommandPolicy$1 } from "./command-policy-BgZRZ31o.js";
3
+ import { t as resolveLegacyGroupSessionKey$1 } from "./group-session-contract-DL-SLclv.js";
4
+ import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-BzlZFreO.js";
5
+ import { r as isLegacyGroupSessionKey$1, t as canonicalizeLegacySessionKey$1 } from "./session-contract-BNUscPf4.js";
6
+ import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-o-muXLgk.js";
7
+ import { t as resolveWhatsAppRuntimeGroupPolicy$1 } from "./runtime-group-policy-BH_U23qp.js";
8
+ import { t as __testing } from "./access-control-CdP8S3rJ.js";
9
9
  //#region extensions/whatsapp/contract-api.ts
10
10
  const canonicalizeLegacySessionKey = canonicalizeLegacySessionKey$1;
11
11
  const isLegacyGroupSessionKey = isLegacyGroupSessionKey$1;
@@ -1,4 +1,4 @@
1
- import { t as __exportAll } from "./rolldown-runtime-RkAeH_Qm.js";
1
+ import { l as __exportAll } from "./text-runtime-DBKC9uEi.js";
2
2
  import { t as resolveMergedWhatsAppAccountConfig } from "./account-config-CNQ33oav.js";
3
3
  import { c as normalizeWhatsAppTarget, t as isWhatsAppGroupJid } from "./normalize-target-nXxC_hxG.js";
4
4
  import "./normalize-Y3eBdM8a.js";
@@ -1,2 +1,2 @@
1
- import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-BNCbgnmy.js";
1
+ import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-o-muXLgk.js";
2
2
  export { listWhatsAppDirectoryGroupsFromConfig, listWhatsAppDirectoryPeersFromConfig };
@@ -1,4 +1,4 @@
1
- import { t as normalizeCompatibilityConfig$1 } from "./doctor-A9tXm9Om.js";
1
+ import { t as normalizeCompatibilityConfig$1 } from "./doctor-BrgepDUP.js";
2
2
  //#region extensions/whatsapp/src/doctor-contract.ts
3
3
  function normalizeCompatibilityConfig({ cfg }) {
4
4
  return normalizeCompatibilityConfig$1({ cfg });
@@ -1,4 +1,4 @@
1
- import { i as jidToE164, t as text_runtime_exports } from "./text-runtime-DFFwk5z6.js";
1
+ import { i as jidToE164, t as text_runtime_exports } from "./text-runtime-DBKC9uEi.js";
2
2
  //#region extensions/whatsapp/src/identity.ts
3
3
  const WHATSAPP_LID_RE = /@(lid|hosted\.lid)$/i;
4
4
  function normalizeDeviceScopedJid(jid) {
@@ -1,4 +1,4 @@
1
- import { r as isLegacyGroupSessionKey, t as canonicalizeLegacySessionKey } from "./session-contract-B0efQf9P.js";
1
+ import { r as isLegacyGroupSessionKey, t as canonicalizeLegacySessionKey } from "./session-contract-BNUscPf4.js";
2
2
  //#region extensions/whatsapp/legacy-session-surface-api.ts
3
3
  const whatsappLegacySessionSurface = {
4
4
  isLegacyGroupSessionKey,
@@ -1,2 +1,2 @@
1
- import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-Bm0S67yH.js";
1
+ import { t as detectWhatsAppLegacyStateMigrations } from "./state-migrations-CtdIArlK.js";
2
2
  export { detectWhatsAppLegacyStateMigrations };
@@ -1,5 +1,5 @@
1
1
  import { n as getStatusCode, t as formatError } from "./session-errors-CSuKZPub.js";
2
- import { t as createWhatsAppLoginTool } from "./agent-tools-login-DpRxLNRB.js";
3
- import { a as getWebAuthAgeMs, b as webAuthExists, c as pickWebChannel, h as readWebSelfId, o as logWebSelfId, s as logoutWeb, t as WA_WEB_AUTH_DIR } from "./auth-store-CG0eSZ0D.js";
4
- import { t as getActiveWebListener } from "./active-listener-DTbKS-j-.js";
2
+ import { t as createWhatsAppLoginTool } from "./agent-tools-login-DYKYW5Nh.js";
3
+ import { a as getWebAuthAgeMs, b as webAuthExists, c as pickWebChannel, h as readWebSelfId, o as logWebSelfId, s as logoutWeb, t as WA_WEB_AUTH_DIR } from "./auth-store-CjEimXKX.js";
4
+ import { t as getActiveWebListener } from "./active-listener-D2NHQ5Og.js";
5
5
  export { WA_WEB_AUTH_DIR, createWhatsAppLoginTool, formatError, getActiveWebListener, getStatusCode, getWebAuthAgeMs, logWebSelfId, logoutWeb, pickWebChannel, readWebSelfId, webAuthExists };
@@ -1,8 +1,8 @@
1
- import { t as __exportAll } from "./rolldown-runtime-RkAeH_Qm.js";
1
+ import { l as __exportAll } from "./text-runtime-DBKC9uEi.js";
2
2
  import { a as resolveWhatsAppAccount } from "./accounts-BDqgpFEB.js";
3
- import { y as restoreCredsFromBackupIfNeeded } from "./auth-store-CG0eSZ0D.js";
4
- import { a as renderQrTerminal, i as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-BXC3R43P.js";
5
- import { a as waitForWhatsAppLoginResult, i as closeWaSocketSoon } from "./connection-controller-d8D2iUBj.js";
3
+ import { y as restoreCredsFromBackupIfNeeded } from "./auth-store-CjEimXKX.js";
4
+ import { a as renderQrTerminal, i as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-DeIU_vjJ.js";
5
+ import { a as waitForWhatsAppLoginResult, i as closeWaSocketSoon } from "./connection-controller-DX2phM7V.js";
6
6
  import { logInfo } from "openclaw/plugin-sdk/text-runtime";
7
7
  import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
8
8
  import { danger, defaultRuntime, success } from "openclaw/plugin-sdk/runtime-env";
@@ -1,7 +1,7 @@
1
1
  import { a as resolveWhatsAppAccount } from "./accounts-BDqgpFEB.js";
2
- import { d as readWebAuthExistsForDecision, h as readWebSelfId, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-CG0eSZ0D.js";
3
- import { i as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-BXC3R43P.js";
4
- import { a as waitForWhatsAppLoginResult, r as closeWaSocket, t as WHATSAPP_LOGGED_OUT_QR_MESSAGE } from "./connection-controller-d8D2iUBj.js";
2
+ import { d as readWebAuthExistsForDecision, h as readWebSelfId, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-CjEimXKX.js";
3
+ import { i as resolveWhatsAppSocketTiming, t as createWaSocket } from "./session-DeIU_vjJ.js";
4
+ import { a as waitForWhatsAppLoginResult, r as closeWaSocket, t as WHATSAPP_LOGGED_OUT_QR_MESSAGE } from "./connection-controller-DX2phM7V.js";
5
5
  import { logInfo } from "openclaw/plugin-sdk/text-runtime";
6
6
  import { danger, defaultRuntime, info, success } from "openclaw/plugin-sdk/runtime-env";
7
7
  import { renderQrPngDataUrl } from "openclaw/plugin-sdk/media-runtime";
@@ -1,7 +1,7 @@
1
1
  //#region extensions/whatsapp/login-qr-runtime.ts
2
2
  let loginQrModulePromise = null;
3
3
  function loadLoginQrModule() {
4
- loginQrModulePromise ??= import("./login-qr-C0b7I7hu.js");
4
+ loginQrModulePromise ??= import("./login-qr-cKndAXTv.js");
5
5
  return loginQrModulePromise;
6
6
  }
7
7
  async function startWebLoginWithQr(...args) {
@@ -1,17 +1,17 @@
1
+ import { a as markdownToWhatsApp, i as jidToE164, o as resolveJidToE164, r as isSelfChatMode, t as text_runtime_exports } from "./text-runtime-DBKC9uEi.js";
1
2
  import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-BDqgpFEB.js";
2
3
  import { t as isWhatsAppGroupJid } from "./normalize-target-nXxC_hxG.js";
3
4
  import { t as resolveWhatsAppReactionLevel } from "./reaction-level-CRVEVAfi.js";
4
5
  import { n as getStatusCode, t as formatError } from "./session-errors-CSuKZPub.js";
5
- import { a as markdownToWhatsApp, i as jidToE164, o as resolveJidToE164, r as isSelfChatMode, t as text_runtime_exports } from "./text-runtime-DFFwk5z6.js";
6
- import { i as prepareWhatsAppOutboundMedia, o as sendWhatsAppOutboundWithRetry, r as normalizeWhatsAppPayloadTextPreservingIndentation, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-Dzi1ILTd.js";
7
- import { r as sendReactionWhatsApp } from "./send-CLBN7TZv.js";
8
- import { n as cacheInboundMessageMeta, r as lookupInboundMessageMeta, t as buildQuotedMessageOptions } from "./quoted-message-BXs55Teh.js";
9
- import { _ as readWebSelfIdentityForDecision, a as getWebAuthAgeMs, h as readWebSelfId, r as WhatsAppAuthUnstableError, s as logoutWeb } from "./auth-store-CG0eSZ0D.js";
10
- import { a as getSelfIdentity, c as resolveComparableIdentity, i as getReplyContext, n as getMentionIdentities, o as getSenderIdentity, r as getPrimaryIdentityId, s as identitiesOverlap, t as getComparableIdentityValues } from "./identity-DhaC0MoD.js";
11
- import { i as resolveWhatsAppInboundPolicy, n as checkInboundAccessControl, r as resolveWhatsAppCommandAuthorized } from "./access-control-hFVqAWSd.js";
12
- import { a as mayContainWhatsAppOutboundMention, c as extractContactContext, d as extractMediaPlaceholder, f as extractMentionedJids, i as addWhatsAppOutboundMentionsToContent, l as extractContextInfo, m as hasInboundUserContent, n as listWhatsAppSendResultMessageIds, o as resolveWhatsAppOutboundMentions, p as extractText, r as normalizeWhatsAppSendResult, s as describeReplyContext, t as createWebSendApi, u as extractLocationData } from "./send-api-DoycpOvC.js";
13
- import { i as resolveWhatsAppSocketTiming, r as waitForWaConnection, t as createWaSocket } from "./session-BXC3R43P.js";
14
- import { c as newConnectionId, d as sleepWithAbort, l as resolveHeartbeatSeconds, n as WhatsAppConnectionController, o as DEFAULT_RECONNECT_POLICY, s as computeBackoff, u as resolveReconnectPolicy } from "./connection-controller-d8D2iUBj.js";
6
+ import { i as prepareWhatsAppOutboundMedia, o as sendWhatsAppOutboundWithRetry, r as normalizeWhatsAppPayloadTextPreservingIndentation, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-BzWwBppP.js";
7
+ import { r as sendReactionWhatsApp } from "./send-u88yh8Hw.js";
8
+ import { n as cacheInboundMessageMeta, r as lookupInboundMessageMeta, t as buildQuotedMessageOptions } from "./quoted-message-DQ6hAr34.js";
9
+ import { _ as readWebSelfIdentityForDecision, a as getWebAuthAgeMs, h as readWebSelfId, r as WhatsAppAuthUnstableError, s as logoutWeb } from "./auth-store-CjEimXKX.js";
10
+ import { a as getSelfIdentity, c as resolveComparableIdentity, i as getReplyContext, n as getMentionIdentities, o as getSenderIdentity, r as getPrimaryIdentityId, s as identitiesOverlap, t as getComparableIdentityValues } from "./identity-KxdJfH7p.js";
11
+ import { i as resolveWhatsAppInboundPolicy, n as checkInboundAccessControl, r as resolveWhatsAppCommandAuthorized } from "./access-control-CdP8S3rJ.js";
12
+ import { a as mayContainWhatsAppOutboundMention, c as extractContactContext, d as extractMediaPlaceholder, f as extractMentionedJids, i as addWhatsAppOutboundMentionsToContent, l as extractContextInfo, m as hasInboundUserContent, n as listWhatsAppSendResultMessageIds, o as resolveWhatsAppOutboundMentions, p as extractText, r as normalizeWhatsAppSendResult, s as describeReplyContext, t as createWebSendApi, u as extractLocationData } from "./send-api-DsbCqDre.js";
13
+ import { i as resolveWhatsAppSocketTiming, r as waitForWaConnection, t as createWaSocket } from "./session-DeIU_vjJ.js";
14
+ import { c as newConnectionId, d as sleepWithAbort, l as resolveHeartbeatSeconds, n as WhatsAppConnectionController, o as DEFAULT_RECONNECT_POLICY, s as computeBackoff, u as resolveReconnectPolicy } from "./connection-controller-DX2phM7V.js";
15
15
  import { resolveAccountEntry } from "openclaw/plugin-sdk/account-core";
16
16
  import { getChildLogger, normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
17
17
  import { createAckReactionHandle, logAckFailure, removeAckReactionHandleAfterReply, shouldAckReactionForWhatsApp } from "openclaw/plugin-sdk/channel-feedback";
@@ -2003,11 +2003,18 @@ async function processMessage(params) {
2003
2003
  let audioTranscript = params.preflightAudioTranscript ?? void 0;
2004
2004
  const hasAudioBody = params.msg.mediaType?.startsWith("audio/") === true && params.msg.body === "<media:audio>";
2005
2005
  if (params.preflightAudioTranscript === void 0 && hasAudioBody && params.msg.mediaPath) try {
2006
- const { transcribeFirstAudio } = await import("./audio-preflight.runtime-MmkB-pgX.js");
2006
+ const { transcribeFirstAudio } = await import("./audio-preflight.runtime-CIFjeaEN.js");
2007
2007
  audioTranscript = await transcribeFirstAudio({
2008
2008
  ctx: {
2009
2009
  MediaPaths: [params.msg.mediaPath],
2010
- MediaTypes: params.msg.mediaType ? [params.msg.mediaType] : void 0
2010
+ MediaTypes: params.msg.mediaType ? [params.msg.mediaType] : void 0,
2011
+ From: params.msg.from,
2012
+ To: params.msg.to,
2013
+ Provider: "whatsapp",
2014
+ Surface: "whatsapp",
2015
+ OriginatingChannel: "whatsapp",
2016
+ OriginatingTo: conversationId,
2017
+ AccountId: params.route.accountId
2011
2018
  },
2012
2019
  cfg: params.cfg
2013
2020
  });
@@ -2317,11 +2324,18 @@ function createWebOnMessageHandler(params) {
2317
2324
  });
2318
2325
  ackAlreadySent = ackReaction !== null;
2319
2326
  try {
2320
- const { transcribeFirstAudio } = await import("./audio-preflight.runtime-MmkB-pgX.js");
2327
+ const { transcribeFirstAudio } = await import("./audio-preflight.runtime-CIFjeaEN.js");
2321
2328
  preflightAudioTranscript = await transcribeFirstAudio({
2322
2329
  ctx: {
2323
2330
  MediaPaths: [msg.mediaPath],
2324
- MediaTypes: msg.mediaType ? [msg.mediaType] : void 0
2331
+ MediaTypes: msg.mediaType ? [msg.mediaType] : void 0,
2332
+ From: msg.from,
2333
+ To: msg.to,
2334
+ Provider: "whatsapp",
2335
+ Surface: "whatsapp",
2336
+ OriginatingChannel: "whatsapp",
2337
+ OriginatingTo: conversationId,
2338
+ AccountId: route.accountId
2325
2339
  },
2326
2340
  cfg: params.cfg
2327
2341
  }) ?? null;
@@ -2433,7 +2447,7 @@ function isNonRetryableWebCloseStatus(statusCode) {
2433
2447
  }
2434
2448
  let replyResolverRuntimePromise = null;
2435
2449
  function loadReplyResolverRuntime() {
2436
- replyResolverRuntimePromise ??= import("./reply-resolver.runtime-rIVWohXr.js");
2450
+ replyResolverRuntimePromise ??= import("./reply-resolver.runtime-CROyXXQh.js");
2437
2451
  return replyResolverRuntimePromise;
2438
2452
  }
2439
2453
  function normalizeReconnectAccountId(accountId) {
@@ -1,12 +1,12 @@
1
1
  import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-CQ3Y1i0g.js";
2
- import { n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-Dzi1ILTd.js";
3
- import { t as createWhatsAppOutboundBase } from "./outbound-base-CCx7atwc.js";
2
+ import { n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-BzWwBppP.js";
3
+ import { t as createWhatsAppOutboundBase } from "./outbound-base-MVpg2zU2.js";
4
4
  import { shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
5
5
  import { chunkText } from "openclaw/plugin-sdk/reply-chunking";
6
6
  //#region extensions/whatsapp/src/outbound-adapter.ts
7
7
  let whatsAppSendModulePromise;
8
8
  function loadWhatsAppSendModule() {
9
- whatsAppSendModulePromise ??= import("./send-CLBN7TZv.js").then((n) => n.a);
9
+ whatsAppSendModulePromise ??= import("./send-u88yh8Hw.js").then((n) => n.a);
10
10
  return whatsAppSendModulePromise;
11
11
  }
12
12
  function normalizeOutboundText(text) {
@@ -1,6 +1,6 @@
1
- import { s as toWhatsappJid } from "./text-runtime-DFFwk5z6.js";
2
- import { n as normalizeWhatsAppPayloadText, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-Dzi1ILTd.js";
3
- import { i as lookupInboundMessageMetaForTarget } from "./quoted-message-BXs55Teh.js";
1
+ import { s as toWhatsappJid } from "./text-runtime-DBKC9uEi.js";
2
+ import { n as normalizeWhatsAppPayloadText, t as normalizeWhatsAppOutboundPayload } from "./outbound-media-contract-BzWwBppP.js";
3
+ import { i as lookupInboundMessageMetaForTarget } from "./quoted-message-DQ6hAr34.js";
4
4
  import { DEFAULT_ACCOUNT_ID, listCombinedAccountIds, normalizeOptionalAccountId, resolveListedDefaultAccountId } from "openclaw/plugin-sdk/account-core";
5
5
  import { createAttachedChannelResultAdapter } from "openclaw/plugin-sdk/channel-send-result";
6
6
  import { resolveOutboundSendDep } from "openclaw/plugin-sdk/outbound-send-deps";
@@ -1,5 +1,5 @@
1
+ import { t as text_runtime_exports } from "./text-runtime-DBKC9uEi.js";
1
2
  import { t as formatError } from "./session-errors-CSuKZPub.js";
2
- import { t as text_runtime_exports } from "./text-runtime-DFFwk5z6.js";
3
3
  import path from "node:path";
4
4
  import { MEDIA_FFMPEG_MAX_AUDIO_DURATION_SECS, runFfmpeg } from "openclaw/plugin-sdk/media-runtime";
5
5
  import { sanitizeForPlainText } from "openclaw/plugin-sdk/outbound-runtime";
@@ -1,2 +1,2 @@
1
- import { t as whatsappOutbound } from "./outbound-adapter-BoHBD2S7.js";
1
+ import { t as whatsappOutbound } from "./outbound-adapter-B9ZW8sht.js";
2
2
  export { whatsappOutbound };
@@ -1,4 +1,4 @@
1
- import { i as jidToE164 } from "./text-runtime-DFFwk5z6.js";
1
+ import { i as jidToE164 } from "./text-runtime-DBKC9uEi.js";
2
2
  //#region extensions/whatsapp/src/quoted-message.ts
3
3
  const CACHE_TTL_MS = 600 * 1e3;
4
4
  const MAX_ENTRIES = 500;
@@ -1,16 +1,16 @@
1
1
  import { n as resolveWebCredsBackupPath, r as resolveWebCredsPath, t as hasWebCredsSync } from "./creds-files-_2V8jzQa.js";
2
- import { n as whatsAppActionRuntime, t as handleWhatsAppAction } from "./action-runtime-flTHnBac.js";
2
+ import { n as whatsAppActionRuntime, t as handleWhatsAppAction } from "./action-runtime-CMhO8liB.js";
3
3
  import { n as getStatusCode, t as formatError } from "./session-errors-CSuKZPub.js";
4
- import { i as sendTypingWhatsApp, n as sendPollWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./send-CLBN7TZv.js";
4
+ import { i as sendTypingWhatsApp, n as sendPollWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./send-u88yh8Hw.js";
5
5
  import { startWebLoginWithQr, waitForWebLogin } from "./login-qr-runtime.js";
6
- import { t as createWhatsAppLoginTool } from "./agent-tools-login-DpRxLNRB.js";
7
- import { n as setWhatsAppRuntime } from "./runtime-6fZ67abR.js";
8
- import { C as waitForCredsSaveQueueWithTimeout, S as waitForCredsSaveQueue, _ as readWebSelfIdentityForDecision, a as getWebAuthAgeMs, b as webAuthExists, c as pickWebChannel, d as readWebAuthExistsForDecision, f as readWebAuthSnapshot, g as readWebSelfIdentity, h as readWebSelfId, i as formatWhatsAppWebAuthStatusState, l as readCredsJsonRaw, m as readWebAuthState, n as WHATSAPP_AUTH_UNSTABLE_CODE, o as logWebSelfId, p as readWebAuthSnapshotBestEffort, r as WhatsAppAuthUnstableError, s as logoutWeb, t as WA_WEB_AUTH_DIR, u as readWebAuthExistsBestEffort, v as resolveDefaultWebAuthDir, w as writeCredsJsonAtomically, y as restoreCredsFromBackupIfNeeded } from "./auth-store-CG0eSZ0D.js";
9
- import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-DLGCIbfl.js";
10
- import { c as extractContactContext, d as extractMediaPlaceholder, p as extractText, u as extractLocationData } from "./send-api-DoycpOvC.js";
11
- import { n as newConnectionId, r as waitForWaConnection, t as createWaSocket } from "./session-BXC3R43P.js";
12
- import { n as resolveWebAccountId, t as getActiveWebListener } from "./active-listener-DTbKS-j-.js";
13
- import { a as loadWebMediaRaw, c as monitorWebInbox, i as loadWebMedia, l as resetWebInboundDedupe, n as LocalMediaAccessError, o as optimizeImageToJpeg, r as getDefaultLocalRoots, s as optimizeImageToPng, t as monitorWebChannel } from "./monitor-5u0dVXnB.js";
14
- import { t as loginWeb } from "./login-B_u009k0.js";
6
+ import { t as createWhatsAppLoginTool } from "./agent-tools-login-DYKYW5Nh.js";
7
+ import { n as setWhatsAppRuntime } from "./runtime-DdodQB8G.js";
8
+ import { C as waitForCredsSaveQueueWithTimeout, S as waitForCredsSaveQueue, _ as readWebSelfIdentityForDecision, a as getWebAuthAgeMs, b as webAuthExists, c as pickWebChannel, d as readWebAuthExistsForDecision, f as readWebAuthSnapshot, g as readWebSelfIdentity, h as readWebSelfId, i as formatWhatsAppWebAuthStatusState, l as readCredsJsonRaw, m as readWebAuthState, n as WHATSAPP_AUTH_UNSTABLE_CODE, o as logWebSelfId, p as readWebAuthSnapshotBestEffort, r as WhatsAppAuthUnstableError, s as logoutWeb, t as WA_WEB_AUTH_DIR, u as readWebAuthExistsBestEffort, v as resolveDefaultWebAuthDir, w as writeCredsJsonAtomically, y as restoreCredsFromBackupIfNeeded } from "./auth-store-CjEimXKX.js";
9
+ import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-yKXGCGU9.js";
10
+ import { c as extractContactContext, d as extractMediaPlaceholder, p as extractText, u as extractLocationData } from "./send-api-DsbCqDre.js";
11
+ import { n as newConnectionId, r as waitForWaConnection, t as createWaSocket } from "./session-DeIU_vjJ.js";
12
+ import { n as resolveWebAccountId, t as getActiveWebListener } from "./active-listener-D2NHQ5Og.js";
13
+ import { a as loadWebMediaRaw, c as monitorWebInbox, i as loadWebMedia, l as resetWebInboundDedupe, n as LocalMediaAccessError, o as optimizeImageToJpeg, r as getDefaultLocalRoots, s as optimizeImageToPng, t as monitorWebChannel } from "./monitor-mfy3Mmq-.js";
14
+ import { t as loginWeb } from "./login-DV99D0IN.js";
15
15
  import { HEARTBEAT_PROMPT, HEARTBEAT_TOKEN, SILENT_REPLY_TOKEN, stripHeartbeatToken } from "openclaw/plugin-sdk/reply-runtime";
16
16
  export { DEFAULT_WEB_MEDIA_BYTES, HEARTBEAT_PROMPT, HEARTBEAT_TOKEN, LocalMediaAccessError, SILENT_REPLY_TOKEN, WA_WEB_AUTH_DIR, WHATSAPP_AUTH_UNSTABLE_CODE, WhatsAppAuthUnstableError, createWaSocket, createWhatsAppLoginTool, extractContactContext, extractLocationData, extractMediaPlaceholder, extractText, formatError, formatWhatsAppWebAuthStatusState, getActiveWebListener, getDefaultLocalRoots, getStatusCode, getWebAuthAgeMs, handleWhatsAppAction, hasWebCredsSync, loadWebMedia, loadWebMediaRaw, logWebSelfId, loginWeb, logoutWeb, monitorWebChannel, monitorWebInbox, newConnectionId, optimizeImageToJpeg, optimizeImageToPng, pickWebChannel, readCredsJsonRaw, readWebAuthExistsBestEffort, readWebAuthExistsForDecision, readWebAuthSnapshot, readWebAuthSnapshotBestEffort, readWebAuthState, readWebSelfId, readWebSelfIdentity, readWebSelfIdentityForDecision, resetWebInboundDedupe, resolveDefaultWebAuthDir, resolveWebAccountId, resolveWebCredsBackupPath, resolveWebCredsPath, restoreCredsFromBackupIfNeeded, sendMessageWhatsApp, sendPollWhatsApp, sendReactionWhatsApp, sendTypingWhatsApp, setWhatsAppRuntime, startWebLoginWithQr, stripHeartbeatToken, waitForCredsSaveQueue, waitForCredsSaveQueueWithTimeout, waitForWaConnection, waitForWebLogin, webAuthExists, whatsAppActionRuntime, writeCredsJsonAtomically };
@@ -1,2 +1,2 @@
1
- import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-DqH8JDX6.js";
1
+ import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-BzlZFreO.js";
2
2
  export { collectUnsupportedSecretRefConfigCandidates, unsupportedSecretRefSurfacePatterns };
@@ -1,8 +1,8 @@
1
+ import { c as toWhatsappJidWithLid, i as jidToE164, s as toWhatsappJid } from "./text-runtime-DBKC9uEi.js";
1
2
  import { n as isWhatsAppNewsletterJid } from "./normalize-target-nXxC_hxG.js";
2
3
  import "./normalize-Y3eBdM8a.js";
3
- import { c as toWhatsappJidWithLid, i as jidToE164, s as toWhatsappJid } from "./text-runtime-DFFwk5z6.js";
4
- import { t as buildQuotedMessageOptions } from "./quoted-message-BXs55Teh.js";
5
- import { c as resolveComparableIdentity } from "./identity-DhaC0MoD.js";
4
+ import { t as buildQuotedMessageOptions } from "./quoted-message-DQ6hAr34.js";
5
+ import { c as resolveComparableIdentity } from "./identity-KxdJfH7p.js";
6
6
  import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/text-runtime";
7
7
  import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
8
8
  import { createMessageReceiptFromOutboundResults, listMessageReceiptPlatformIds } from "openclaw/plugin-sdk/channel-message";
@@ -1,11 +1,10 @@
1
- import { t as __exportAll } from "./rolldown-runtime-RkAeH_Qm.js";
1
+ import { a as markdownToWhatsApp, l as __exportAll, s as toWhatsappJid } from "./text-runtime-DBKC9uEi.js";
2
2
  import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-DG18xddX.js";
3
3
  import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-BDqgpFEB.js";
4
4
  import { n as isWhatsAppNewsletterJid } from "./normalize-target-nXxC_hxG.js";
5
5
  import { t as getRegisteredWhatsAppConnectionController } from "./connection-controller-registry-D_iIGz5m.js";
6
6
  import "./normalize-Y3eBdM8a.js";
7
- import { a as markdownToWhatsApp, s as toWhatsappJid } from "./text-runtime-DFFwk5z6.js";
8
- import { a as resolveWhatsAppOutboundMediaUrls, i as prepareWhatsAppOutboundMedia, n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-Dzi1ILTd.js";
7
+ import { a as resolveWhatsAppOutboundMediaUrls, i as prepareWhatsAppOutboundMedia, n as normalizeWhatsAppPayloadText } from "./outbound-media-contract-BzWwBppP.js";
9
8
  import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
10
9
  import { generateSecureUuid } from "openclaw/plugin-sdk/core";
11
10
  import { redactIdentifier } from "openclaw/plugin-sdk/logging-core";
@@ -1,7 +1,7 @@
1
1
  import { n as resolveWebCredsBackupPath, r as resolveWebCredsPath } from "./creds-files-_2V8jzQa.js";
2
2
  import { n as getStatusCode } from "./session-errors-CSuKZPub.js";
3
- import { C as waitForCredsSaveQueueWithTimeout, l as readCredsJsonRaw, v as resolveDefaultWebAuthDir, w as writeCredsJsonAtomically, x as enqueueCredsSave, y as restoreCredsFromBackupIfNeeded } from "./auth-store-CG0eSZ0D.js";
4
- import { i as makeWASocket, n as fetchLatestBaileysVersion, o as useMultiFileAuthState, r as makeCacheableSignalKeyStore, t as DisconnectReason } from "./session.runtime-CVhtXjTk.js";
3
+ import { C as waitForCredsSaveQueueWithTimeout, l as readCredsJsonRaw, v as resolveDefaultWebAuthDir, w as writeCredsJsonAtomically, x as enqueueCredsSave, y as restoreCredsFromBackupIfNeeded } from "./auth-store-CjEimXKX.js";
4
+ import { i as makeWASocket, n as fetchLatestBaileysVersion, o as useMultiFileAuthState, r as makeCacheableSignalKeyStore, t as DisconnectReason } from "./session.runtime-B9VlYnWQ.js";
5
5
  import fs from "node:fs";
6
6
  import { ensureDir, resolveUserPath } from "openclaw/plugin-sdk/text-runtime";
7
7
  import { VERSION, formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
@@ -1,4 +1,4 @@
1
- import { t as __exportAll } from "./rolldown-runtime-RkAeH_Qm.js";
1
+ import { l as __exportAll } from "./text-runtime-DBKC9uEi.js";
2
2
  import { BufferJSON, DisconnectReason as DisconnectReason$1, fetchLatestBaileysVersion, makeCacheableSignalKeyStore, makeWASocket, useMultiFileAuthState } from "@whiskeysockets/baileys";
3
3
  //#region extensions/whatsapp/src/session.runtime.ts
4
4
  var session_runtime_exports = /* @__PURE__ */ __exportAll({
@@ -1,10 +1,9 @@
1
- import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-DG18xddX.js";
1
+ import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-DG18xddX.js";
2
2
  import { a as resolveWhatsAppAccount, o as resolveWhatsAppAuthDir } from "./accounts-BDqgpFEB.js";
3
3
  import { a as normalizeWhatsAppAllowFromEntries, o as normalizeWhatsAppAllowFromEntry } from "./normalize-target-nXxC_hxG.js";
4
- import { i as formatWhatsAppWebAuthStatusState, m as readWebAuthState } from "./auth-store-CG0eSZ0D.js";
5
- import { t as whatsappSetupAdapter } from "./setup-core-DZKvpzbH.js";
4
+ import { t as whatsappSetupAdapter } from "./setup-core-DnhO0PjG.js";
6
5
  import path from "node:path";
7
- import { DEFAULT_ACCOUNT_ID, pathExists, setSetupChannelEnabled, splitSetupEntries } from "openclaw/plugin-sdk/setup";
6
+ import { DEFAULT_ACCOUNT_ID, pathExists, splitSetupEntries } from "openclaw/plugin-sdk/setup";
8
7
  import { formatCliCommand, formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
9
8
  //#region extensions/whatsapp/src/setup-finalize.ts
10
9
  function trimPromptText(value) {
@@ -280,7 +279,7 @@ async function finalizeWhatsAppSetup(params) {
280
279
  message: linked ? "WhatsApp already linked. Re-link now?" : "Link WhatsApp now (QR)?",
281
280
  initialValue: !linked
282
281
  })) try {
283
- const { loginWeb } = await import("./login-B_u009k0.js").then((n) => n.n);
282
+ const { loginWeb } = await import("./login-DV99D0IN.js").then((n) => n.n);
284
283
  await loginWeb(false, void 0, params.runtime, accountId);
285
284
  } catch (error) {
286
285
  params.runtime.error(`WhatsApp login failed: ${String(error)}`);
@@ -296,50 +295,4 @@ async function finalizeWhatsAppSetup(params) {
296
295
  return { cfg: next };
297
296
  }
298
297
  //#endregion
299
- //#region extensions/whatsapp/src/setup-surface.ts
300
- const channel = "whatsapp";
301
- async function readWhatsAppSetupLinkState(cfg, accountId) {
302
- const { authDir } = resolveWhatsAppAuthDir({
303
- cfg,
304
- accountId
305
- });
306
- return await readWebAuthState(authDir);
307
- }
308
- const whatsappSetupWizard = {
309
- channel,
310
- status: {
311
- configuredLabel: "linked",
312
- unconfiguredLabel: "not linked",
313
- configuredHint: "linked",
314
- unconfiguredHint: "not linked",
315
- configuredScore: 5,
316
- unconfiguredScore: 4,
317
- resolveConfigured: async ({ cfg, accountId }) => {
318
- for (const resolvedAccountId of accountId ? [accountId] : listAccountIds(cfg)) if (await readWhatsAppSetupLinkState(cfg, resolvedAccountId) === "linked") return true;
319
- return false;
320
- },
321
- resolveStatusLines: async ({ cfg, accountId, configured }) => {
322
- const linkedAccountId = (await Promise.all((accountId ? [accountId] : listAccountIds(cfg)).map(async (resolvedAccountId) => ({
323
- accountId: resolvedAccountId,
324
- state: await readWhatsAppSetupLinkState(cfg, resolvedAccountId)
325
- })))).find((entry) => entry.state === "linked" || entry.state === "unstable");
326
- const labelAccountId = accountId ?? linkedAccountId?.accountId;
327
- return [`${labelAccountId ? `WhatsApp (${labelAccountId === DEFAULT_ACCOUNT_ID ? "default" : labelAccountId})` : "WhatsApp"}: ${configured ? formatWhatsAppWebAuthStatusState("linked") : formatWhatsAppWebAuthStatusState(linkedAccountId?.state ?? "not-linked")}`];
328
- }
329
- },
330
- resolveShouldPromptAccountIds: ({ shouldPromptAccountIds }) => shouldPromptAccountIds,
331
- credentials: [],
332
- finalize: async ({ cfg, accountId, forceAllowFrom, prompter, runtime }) => await finalizeWhatsAppSetup({
333
- cfg,
334
- accountId,
335
- forceAllowFrom,
336
- prompter,
337
- runtime
338
- }),
339
- disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
340
- onAccountRecorded: (accountId, options) => {
341
- options?.onAccountId?.(channel, accountId);
342
- }
343
- };
344
- //#endregion
345
- export { whatsappSetupWizard };
298
+ export { finalizeWhatsAppSetup };
@@ -1,2 +1,2 @@
1
- import { t as whatsappSetupPlugin } from "./channel.setup-CV0OjAwl.js";
1
+ import { t as whatsappSetupPlugin } from "./channel.setup-BqlcEVzR.js";
2
2
  export { whatsappSetupPlugin };
@@ -0,0 +1,45 @@
1
+ import { t as listAccountIds } from "./account-ids-DG18xddX.js";
2
+ import { o as resolveWhatsAppAuthDir } from "./accounts-BDqgpFEB.js";
3
+ import { i as formatWhatsAppWebAuthStatusState, m as readWebAuthState } from "./auth-store-CjEimXKX.js";
4
+ import { DEFAULT_ACCOUNT_ID, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup";
5
+ //#region extensions/whatsapp/src/setup-surface.ts
6
+ const channel = "whatsapp";
7
+ async function readWhatsAppSetupLinkState(cfg, accountId) {
8
+ const { authDir } = resolveWhatsAppAuthDir({
9
+ cfg,
10
+ accountId
11
+ });
12
+ return await readWebAuthState(authDir);
13
+ }
14
+ const whatsappSetupWizard = {
15
+ channel,
16
+ status: {
17
+ configuredLabel: "linked",
18
+ unconfiguredLabel: "not linked",
19
+ configuredHint: "linked",
20
+ unconfiguredHint: "not linked",
21
+ configuredScore: 5,
22
+ unconfiguredScore: 4,
23
+ resolveConfigured: async ({ cfg, accountId }) => {
24
+ for (const resolvedAccountId of accountId ? [accountId] : listAccountIds(cfg)) if (await readWhatsAppSetupLinkState(cfg, resolvedAccountId) === "linked") return true;
25
+ return false;
26
+ },
27
+ resolveStatusLines: async ({ cfg, accountId, configured }) => {
28
+ const linkedAccountId = (await Promise.all((accountId ? [accountId] : listAccountIds(cfg)).map(async (resolvedAccountId) => ({
29
+ accountId: resolvedAccountId,
30
+ state: await readWhatsAppSetupLinkState(cfg, resolvedAccountId)
31
+ })))).find((entry) => entry.state === "linked" || entry.state === "unstable");
32
+ const labelAccountId = accountId ?? linkedAccountId?.accountId;
33
+ return [`${labelAccountId ? `WhatsApp (${labelAccountId === DEFAULT_ACCOUNT_ID ? "default" : labelAccountId})` : "WhatsApp"}: ${configured ? formatWhatsAppWebAuthStatusState("linked") : formatWhatsAppWebAuthStatusState(linkedAccountId?.state ?? "not-linked")}`];
34
+ }
35
+ },
36
+ resolveShouldPromptAccountIds: ({ shouldPromptAccountIds }) => shouldPromptAccountIds,
37
+ credentials: [],
38
+ finalize: async (params) => await (await import("./setup-finalize-D3YuMUBs.js")).finalizeWhatsAppSetup(params),
39
+ disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
40
+ onAccountRecorded: (accountId, options) => {
41
+ options?.onAccountId?.(channel, accountId);
42
+ }
43
+ };
44
+ //#endregion
45
+ export { whatsappSetupWizard };
@@ -1,11 +1,11 @@
1
1
  import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-DG18xddX.js";
2
2
  import { a as resolveWhatsAppAccount, n as hasAnyWhatsAppAuth } from "./accounts-BDqgpFEB.js";
3
3
  import { a as normalizeWhatsAppAllowFromEntries } from "./normalize-target-nXxC_hxG.js";
4
- import { t as WhatsAppChannelConfigSchema } from "./config-schema-Dmo66Ubb.js";
5
- import { n as whatsappDoctor } from "./doctor-A9tXm9Om.js";
6
- import { t as resolveLegacyGroupSessionKey } from "./group-session-contract-B8QBn0I2.js";
7
- import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-DqH8JDX6.js";
8
- import { n as deriveLegacySessionChatType, r as isLegacyGroupSessionKey, t as canonicalizeLegacySessionKey } from "./session-contract-B0efQf9P.js";
4
+ import { t as WhatsAppChannelConfigSchema } from "./config-schema-cSC7M4YA.js";
5
+ import { n as whatsappDoctor } from "./doctor-BrgepDUP.js";
6
+ import { t as resolveLegacyGroupSessionKey } from "./group-session-contract-DL-SLclv.js";
7
+ import { n as unsupportedSecretRefSurfacePatterns, t as collectUnsupportedSecretRefConfigCandidates } from "./security-contract-BzlZFreO.js";
8
+ import { n as deriveLegacySessionChatType, r as isLegacyGroupSessionKey, t as canonicalizeLegacySessionKey } from "./session-contract-BNUscPf4.js";
9
9
  import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-core";
10
10
  import { normalizeE164 } from "openclaw/plugin-sdk/account-resolution";
11
11
  import { createChannelPluginBase, getChatChannelMeta } from "openclaw/plugin-sdk/core";
@@ -124,10 +124,10 @@ function resolveWhatsAppConfigPath(params) {
124
124
  return `${resolveWhatsAppGroupScopeBasePath(params)}.${params.field}`;
125
125
  }
126
126
  async function loadWhatsAppChannelRuntime() {
127
- return await import("./channel.runtime-CCZpOzbU.js");
127
+ return await import("./channel.runtime-CNdPCK3G.js");
128
128
  }
129
129
  async function loadWhatsAppSetupSurface() {
130
- return await import("./setup-surface-RbOpXjSR.js");
130
+ return await import("./setup-surface-CHjYlKJc.js");
131
131
  }
132
132
  const whatsappSetupWizardProxy = createWhatsAppSetupWizardProxy(async () => (await loadWhatsAppSetupSurface()).whatsappSetupWizard);
133
133
  const whatsappConfigAdapter = createScopedChannelConfigAdapter({
package/dist/test-api.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as resolveWhatsAppRuntimeGroupPolicy } from "./runtime-group-policy-Gp1lQ0at.js";
2
- import { t as whatsappOutbound } from "./outbound-adapter-BoHBD2S7.js";
1
+ import { t as resolveWhatsAppRuntimeGroupPolicy } from "./runtime-group-policy-BH_U23qp.js";
2
+ import { t as whatsappOutbound } from "./outbound-adapter-B9ZW8sht.js";
3
3
  export { resolveWhatsAppRuntimeGroupPolicy, whatsappOutbound };
@@ -1,9 +1,34 @@
1
- import { n as __reExport, t as __exportAll } from "./rolldown-runtime-RkAeH_Qm.js";
2
1
  import fs from "node:fs";
3
2
  import path from "node:path";
4
3
  import { CONFIG_DIR, escapeRegExp, resolveUserPath } from "openclaw/plugin-sdk/text-runtime";
5
4
  import { normalizeE164 } from "openclaw/plugin-sdk/account-resolution";
6
5
  import { logVerbose, shouldLogVerbose } from "openclaw/plugin-sdk/runtime-env";
6
+ //#region \0rolldown/runtime.js
7
+ var __defProp = Object.defineProperty;
8
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
+ var __getOwnPropNames = Object.getOwnPropertyNames;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __exportAll = (all, no_symbols) => {
12
+ let target = {};
13
+ for (var name in all) __defProp(target, name, {
14
+ get: all[name],
15
+ enumerable: true
16
+ });
17
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
18
+ return target;
19
+ };
20
+ var __copyProps = (to, from, except, desc) => {
21
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
22
+ key = keys[i];
23
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
24
+ get: ((k) => from[k]).bind(null, key),
25
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
26
+ });
27
+ }
28
+ return to;
29
+ };
30
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
31
+ //#endregion
7
32
  //#region extensions/whatsapp/src/targets-runtime.ts
8
33
  const WHATSAPP_FENCE_PLACEHOLDER = "\0FENCE";
9
34
  const WHATSAPP_INLINE_CODE_PLACEHOLDER = "\0CODE";
@@ -139,4 +164,4 @@ var text_runtime_exports = /* @__PURE__ */ __exportAll({
139
164
  import * as import_openclaw_plugin_sdk_text_runtime from "openclaw/plugin-sdk/text-runtime";
140
165
  __reExport(text_runtime_exports, import_openclaw_plugin_sdk_text_runtime);
141
166
  //#endregion
142
- export { markdownToWhatsApp as a, toWhatsappJidWithLid as c, jidToE164 as i, assertWebChannel as n, resolveJidToE164 as o, isSelfChatMode as r, toWhatsappJid as s, text_runtime_exports as t };
167
+ export { markdownToWhatsApp as a, toWhatsappJidWithLid as c, jidToE164 as i, __exportAll as l, assertWebChannel as n, resolveJidToE164 as o, isSelfChatMode as r, toWhatsappJid as s, text_runtime_exports as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openclaw/whatsapp",
3
- "version": "2026.5.9-beta.1",
3
+ "version": "2026.5.10-beta.2",
4
4
  "description": "OpenClaw WhatsApp channel plugin",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,7 +8,7 @@
8
8
  },
9
9
  "type": "module",
10
10
  "dependencies": {
11
- "@whiskeysockets/baileys": "7.0.0-rc.9",
11
+ "@whiskeysockets/baileys": "7.0.0-rc10",
12
12
  "https-proxy-agent": "^9.0.0",
13
13
  "jimp": "^1.6.1",
14
14
  "typebox": "1.1.38",
@@ -19,7 +19,7 @@
19
19
  "openclaw": "workspace:*"
20
20
  },
21
21
  "peerDependencies": {
22
- "openclaw": ">=2026.5.9-beta.1"
22
+ "openclaw": ">=2026.5.10-beta.2"
23
23
  },
24
24
  "peerDependenciesMeta": {
25
25
  "openclaw": {
@@ -61,10 +61,10 @@
61
61
  "minHostVersion": ">=2026.4.25"
62
62
  },
63
63
  "compat": {
64
- "pluginApi": ">=2026.5.9-beta.1"
64
+ "pluginApi": ">=2026.5.10-beta.2"
65
65
  },
66
66
  "build": {
67
- "openclawVersion": "2026.5.9-beta.1"
67
+ "openclawVersion": "2026.5.10-beta.2"
68
68
  },
69
69
  "release": {
70
70
  "publishToClawHub": true,
@@ -1,27 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __exportAll = (all, no_symbols) => {
7
- let target = {};
8
- for (var name in all) __defProp(target, name, {
9
- get: all[name],
10
- enumerable: true
11
- });
12
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
13
- return target;
14
- };
15
- var __copyProps = (to, from, except, desc) => {
16
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
17
- key = keys[i];
18
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
19
- get: ((k) => from[k]).bind(null, key),
20
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
21
- });
22
- }
23
- return to;
24
- };
25
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
26
- //#endregion
27
- export { __reExport as n, __exportAll as t };
File without changes