@openclaw/whatsapp 2026.8.1-beta.2 → 2026.8.1

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 (242) hide show
  1. package/dist/{accounts-BX2fZUyR.js → accounts-CeKQbu_s.js} +9 -26
  2. package/dist/{action-runtime-B4e3XFOY.js → action-runtime-YA_Yvunu.js} +2 -2
  3. package/dist/action-runtime-api.js +1 -1
  4. package/dist/action-runtime.runtime.js +1 -1
  5. package/dist/{call-tool-api.js → agent-tools-api.js} +11 -4
  6. package/dist/{agent-tools-login-BjRpD-JQ.js → agent-tools-login-B-2qZPzc.js} +12 -3
  7. package/dist/api.js +7 -7
  8. package/dist/{approval-handler.runtime-fgGZhALv.js → approval-handler.runtime-C7jZ8rsD.js} +3 -3
  9. package/dist/{approval-reactions-CmtJCxe_.js → approval-reactions-rpaNVHzZ.js} +11 -15
  10. package/dist/{auth-store-B_DQIdzp.js → auth-store-CtpBqH5S.js} +3 -6
  11. package/dist/{channel-DJVQHz_V.js → channel-Dx09AAmX.js} +11 -13
  12. package/dist/channel-plugin-api.js +1 -1
  13. package/dist/{channel-react-action-d6OacTNj.js → channel-react-action-n9a8Hk5i.js} +14 -12
  14. package/dist/{channel.runtime-RxuNGZ7w.js → channel.runtime-D_PjmeMT.js} +4 -4
  15. package/dist/{channel.setup-Cmvd967u.js → channel.setup-CRJQiWbh.js} +1 -1
  16. package/dist/{connection-controller-CUyZgGpf.js → connection-controller-CIYuBJrs.js} +2 -2
  17. package/dist/{directory-config-Pc4f07wB.js → directory-config-Ci8Jjsw4.js} +3 -3
  18. package/dist/directory-contract-api.js +1 -1
  19. package/dist/{group-session-key-DmFc_Cqi.js → group-session-key-CH9jJIVQ.js} +1 -1
  20. package/dist/index.js +4 -4
  21. package/dist/light-runtime-api.js +2 -2
  22. package/dist/{login-D6_rfxTZ.js → login-1u5WcfTn.js} +4 -4
  23. package/dist/{login-qr-B0VyVSqQ.js → login-qr-B_1sr0hk.js} +38 -17
  24. package/dist/login-qr-runtime.js +1 -1
  25. package/dist/{monitor-BCe5Mm-1.js → monitor-CySzv38g.js} +156 -564
  26. package/dist/{question-reactions-D3eAeB0i.js → question-reactions-B9D6MHXZ.js} +1 -1
  27. package/dist/runtime-api.js +8 -8
  28. package/dist/{send-prK8F7Vj.js → send-C3S-NqyO.js} +24 -10
  29. package/dist/{send-api-DimZST3E.js → send-api-C-FFC1p_.js} +46 -36
  30. package/dist/{setup-finalize-D3n71Uyx.js → setup-finalize-CRzMpx84.js} +4 -4
  31. package/dist/setup-plugin-api.js +1 -1
  32. package/dist/{setup-surface-BCZszf3l.js → setup-surface-ym4doiv3.js} +3 -3
  33. package/dist/{shared-Dp9M3ZPX.js → shared-D3B14d45.js} +12 -6
  34. package/dist/{socket-close-09FojDO2.js → socket-close-2T0_jZTN.js} +1 -1
  35. package/node_modules/baileys/lib/Defaults/index.js +1 -1
  36. package/node_modules/baileys/lib/Socket/business.d.ts.map +1 -1
  37. package/node_modules/baileys/lib/Socket/chats.d.ts +1 -0
  38. package/node_modules/baileys/lib/Socket/chats.d.ts.map +1 -1
  39. package/node_modules/baileys/lib/Socket/chats.js +10 -5
  40. package/node_modules/baileys/lib/Socket/chats.js.map +1 -1
  41. package/node_modules/baileys/lib/Socket/communities.d.ts.map +1 -1
  42. package/node_modules/baileys/lib/Socket/groups.d.ts.map +1 -1
  43. package/node_modules/baileys/lib/Socket/index.d.ts.map +1 -1
  44. package/node_modules/baileys/lib/Socket/messages-recv.d.ts.map +1 -1
  45. package/node_modules/baileys/lib/Socket/messages-send.d.ts.map +1 -1
  46. package/node_modules/baileys/lib/Socket/newsletter.d.ts.map +1 -1
  47. package/node_modules/baileys/lib/Socket/socket.d.ts.map +1 -1
  48. package/node_modules/baileys/lib/Socket/socket.js +3 -0
  49. package/node_modules/baileys/lib/Socket/socket.js.map +1 -1
  50. package/node_modules/baileys/lib/Types/index.d.ts +1 -0
  51. package/node_modules/baileys/lib/Types/index.d.ts.map +1 -1
  52. package/node_modules/baileys/lib/Types/index.js.map +1 -1
  53. package/node_modules/baileys/lib/Utils/browser-utils.d.ts.map +1 -1
  54. package/node_modules/baileys/lib/Utils/browser-utils.js +1 -0
  55. package/node_modules/baileys/lib/Utils/browser-utils.js.map +1 -1
  56. package/node_modules/baileys/lib/Utils/generics.d.ts +1 -0
  57. package/node_modules/baileys/lib/Utils/generics.d.ts.map +1 -1
  58. package/node_modules/baileys/lib/Utils/generics.js +1 -1
  59. package/node_modules/baileys/lib/Utils/generics.js.map +1 -1
  60. package/node_modules/baileys/lib/Utils/tc-token-utils.d.ts.map +1 -1
  61. package/node_modules/baileys/lib/Utils/tc-token-utils.js +3 -2
  62. package/node_modules/baileys/lib/Utils/tc-token-utils.js.map +1 -1
  63. package/node_modules/baileys/lib/Utils/validate-connection.d.ts.map +1 -1
  64. package/node_modules/baileys/lib/Utils/validate-connection.js +9 -2
  65. package/node_modules/baileys/lib/Utils/validate-connection.js.map +1 -1
  66. package/node_modules/baileys/node_modules/content-type/README.md +2 -0
  67. package/node_modules/baileys/node_modules/content-type/dist/index.d.ts +20 -0
  68. package/node_modules/baileys/node_modules/content-type/dist/index.js +20 -14
  69. package/node_modules/baileys/node_modules/content-type/dist/index.js.map +1 -1
  70. package/node_modules/baileys/node_modules/content-type/package.json +1 -1
  71. package/node_modules/baileys/node_modules/file-type/package.json +1 -1
  72. package/node_modules/baileys/node_modules/file-type/readme.md +3 -0
  73. package/node_modules/baileys/node_modules/file-type/source/detectors/zip.js +6 -1
  74. package/node_modules/baileys/node_modules/file-type/source/index.d.ts +3 -0
  75. package/node_modules/baileys/node_modules/file-type/source/index.js +25 -13
  76. package/node_modules/baileys/node_modules/music-metadata/LICENSE.txt +9 -9
  77. package/node_modules/baileys/node_modules/music-metadata/README.md +878 -878
  78. package/node_modules/baileys/node_modules/music-metadata/lib/ParseError.d.ts +1 -1
  79. package/node_modules/baileys/node_modules/music-metadata/lib/ParseError.js +1 -1
  80. package/node_modules/baileys/node_modules/music-metadata/lib/asf/AsfObject.d.ts +1 -4
  81. package/node_modules/baileys/node_modules/music-metadata/lib/asf/AsfObject.js +66 -30
  82. package/node_modules/baileys/node_modules/music-metadata/lib/asf/AsfParser.d.ts +5 -1
  83. package/node_modules/baileys/node_modules/music-metadata/lib/asf/AsfParser.js +94 -25
  84. package/node_modules/baileys/node_modules/music-metadata/lib/dsf/DsfChunk.js +2 -2
  85. package/node_modules/baileys/node_modules/music-metadata/lib/dsf/DsfParser.js +38 -13
  86. package/node_modules/baileys/node_modules/music-metadata/lib/mp4/AtomToken.js +2 -1
  87. package/node_modules/baileys/node_modules/music-metadata/lib/mp4/MP4Parser.js +34 -7
  88. package/node_modules/baileys/node_modules/music-metadata/lib/ogg/speex/SpeexStream.d.ts +7 -0
  89. package/node_modules/baileys/node_modules/music-metadata/lib/ogg/speex/SpeexStream.js +13 -0
  90. package/node_modules/baileys/node_modules/music-metadata/lib/riff/RiffChunk.js +1 -1
  91. package/node_modules/baileys/node_modules/music-metadata/package.json +156 -156
  92. package/node_modules/baileys/node_modules/protobufjs/README.md +61 -84
  93. package/node_modules/baileys/node_modules/protobufjs/dist/light/protobuf.js +66 -45
  94. package/node_modules/baileys/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  95. package/node_modules/baileys/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  96. package/node_modules/baileys/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  97. package/node_modules/baileys/node_modules/protobufjs/dist/minimal/protobuf.js +47 -40
  98. package/node_modules/baileys/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
  99. package/node_modules/baileys/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
  100. package/node_modules/baileys/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
  101. package/node_modules/baileys/node_modules/protobufjs/dist/protobuf.js +92 -68
  102. package/node_modules/baileys/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  103. package/node_modules/baileys/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  104. package/node_modules/baileys/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  105. package/node_modules/baileys/node_modules/protobufjs/ext/descriptor.js +26 -10
  106. package/node_modules/baileys/node_modules/protobufjs/index.d.ts +3 -0
  107. package/node_modules/baileys/node_modules/protobufjs/package.json +1 -1
  108. package/node_modules/baileys/node_modules/protobufjs/src/converter.js +5 -1
  109. package/node_modules/baileys/node_modules/protobufjs/src/enum.js +5 -2
  110. package/node_modules/baileys/node_modules/protobufjs/src/field.js +6 -1
  111. package/node_modules/baileys/node_modules/protobufjs/src/parse.js +26 -23
  112. package/node_modules/baileys/node_modules/protobufjs/src/reader.js +36 -9
  113. package/node_modules/baileys/node_modules/protobufjs/src/util/codegen.js +3 -1
  114. package/node_modules/baileys/node_modules/protobufjs/src/util/utf8.js +2 -28
  115. package/node_modules/baileys/node_modules/protobufjs/src/writer.js +7 -1
  116. package/node_modules/baileys/package.json +1 -1
  117. package/node_modules/typebox/build/format/date.d.mts +1 -1
  118. package/node_modules/typebox/build/format/date.mjs +1 -1
  119. package/node_modules/typebox/build/format/date_time.d.mts +2 -2
  120. package/node_modules/typebox/build/format/date_time.mjs +3 -3
  121. package/node_modules/typebox/build/format/email.d.mts +1 -1
  122. package/node_modules/typebox/build/format/email.mjs +2 -2
  123. package/node_modules/typebox/build/format/hostname.mjs +2 -10
  124. package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
  125. package/node_modules/typebox/build/format/idn_email.mjs +3 -3
  126. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
  127. package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
  128. package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
  129. package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
  130. package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
  131. package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
  132. package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
  133. package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
  134. package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
  135. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +23 -0
  136. package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
  137. package/node_modules/typebox/build/format/idna/index.mjs +2 -0
  138. package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
  139. package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
  140. package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
  141. package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
  142. package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
  143. package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
  144. package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
  145. package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
  146. package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
  147. package/node_modules/typebox/build/format/ipv4.mjs +2 -32
  148. package/node_modules/typebox/build/format/ipv6.mjs +2 -61
  149. package/node_modules/typebox/build/format/iri.d.mts +2 -2
  150. package/node_modules/typebox/build/format/iri.mjs +26 -8
  151. package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
  152. package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
  153. package/node_modules/typebox/build/format/regex.d.mts +1 -2
  154. package/node_modules/typebox/build/format/regex.mjs +2 -6
  155. package/node_modules/typebox/build/format/time.d.mts +2 -2
  156. package/node_modules/typebox/build/format/time.mjs +19 -14
  157. package/node_modules/typebox/build/format/uri.d.mts +1 -1
  158. package/node_modules/typebox/build/format/uri.mjs +3 -130
  159. package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
  160. package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
  161. package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
  162. package/node_modules/typebox/build/format/uri_template.mjs +4 -5
  163. package/node_modules/typebox/build/format/url.d.mts +3 -3
  164. package/node_modules/typebox/build/format/url.mjs +4 -5
  165. package/node_modules/typebox/build/guard/emit.d.mts +3 -1
  166. package/node_modules/typebox/build/guard/emit.mjs +12 -5
  167. package/node_modules/typebox/build/guard/guard.d.mts +8 -2
  168. package/node_modules/typebox/build/guard/guard.mjs +25 -4
  169. package/node_modules/typebox/build/guard/string.d.mts +2 -2
  170. package/node_modules/typebox/build/guard/string.mjs +7 -7
  171. package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
  172. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
  173. package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
  174. package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
  175. package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
  176. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
  177. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
  178. package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
  179. package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
  180. package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
  181. package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
  182. package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
  183. package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
  184. package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
  185. package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
  186. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
  187. package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
  188. package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
  189. package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
  190. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
  191. package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
  192. package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
  193. package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
  194. package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
  195. package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
  196. package/node_modules/typebox/build/schema/types/index.mjs +0 -2
  197. package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
  198. package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
  199. package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
  200. package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
  201. package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
  202. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
  203. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
  204. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
  205. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
  206. package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
  207. package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
  208. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
  209. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
  210. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
  211. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
  212. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
  213. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
  214. package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
  215. package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
  216. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
  217. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
  218. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
  219. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
  220. package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
  221. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
  222. package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
  223. package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
  224. package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
  225. package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
  226. package/node_modules/typebox/build/type/script/parser.mjs +27 -23
  227. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
  228. package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
  229. package/node_modules/typebox/package.json +27 -27
  230. package/node_modules/typebox/readme.md +79 -82
  231. package/openclaw.plugin.json +2 -1
  232. package/package.json +6 -6
  233. package/node_modules/typebox/build/format/_idna.d.mts +0 -2
  234. package/node_modules/typebox/build/format/_idna.mjs +0 -246
  235. package/node_modules/typebox/build/format/_puny.d.mts +0 -1
  236. package/node_modules/typebox/build/format/_puny.mjs +0 -77
  237. package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
  238. package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
  239. package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
  240. package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
  241. package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
  242. package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
@@ -1,5 +1,5 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { a as resolveWhatsAppAccount } from "./accounts-BX2fZUyR.js";
2
+ import { a as resolveWhatsAppAccount } from "./accounts-CeKQbu_s.js";
3
3
  import { createQuestionReactionTargetStore, questionGatewayRuntime } from "openclaw/plugin-sdk/question-gateway-runtime";
4
4
  //#region extensions/whatsapp/src/question-reactions.ts
5
5
  var question_reactions_exports = /* @__PURE__ */ __exportAll({
@@ -1,16 +1,16 @@
1
1
  import { c as resolveWebCredsPath, r as hasWebCredsSync, s as resolveWebCredsBackupPath } from "./creds-files-W6B3EMZ8.js";
2
- import { n as whatsAppActionRuntime, t as handleWhatsAppAction } from "./action-runtime-B4e3XFOY.js";
3
- import { i as sendTypingWhatsApp, n as sendPollWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./send-prK8F7Vj.js";
2
+ import { n as whatsAppActionRuntime, t as handleWhatsAppAction } from "./action-runtime-YA_Yvunu.js";
3
+ import { i as sendTypingWhatsApp, n as sendPollWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./send-C3S-NqyO.js";
4
4
  import { a as setWhatsAppRuntime } from "./runtime-BLlToOi6.js";
5
5
  import { startWebLoginWithQr, waitForWebLogin } from "./login-qr-runtime.js";
6
- import { t as createWhatsAppLoginTool } from "./agent-tools-login-BjRpD-JQ.js";
7
- import { M as waitForCredsSaveQueueWithTimeout, N as writeCredsJsonAtomically, _ as readWebSelfIdentity, a as formatWhatsAppWebAuthStatusState, b as restoreCredsFromBackupIfNeeded, c as logoutWeb, d as readWebAuthExistsBestEffort, f as readWebAuthExistsForDecision, g as readWebSelfId, h as readWebAuthState, j as waitForCredsSaveQueue, l as pickWebChannel, m as readWebAuthSnapshotBestEffort, n as WHATSAPP_AUTH_UNSTABLE_CODE, o as getWebAuthAgeMs, p as readWebAuthSnapshot, r as WhatsAppAuthUnstableError, s as logWebSelfId, t as WA_WEB_AUTH_DIR, u as readCredsJsonRaw, v as readWebSelfIdentityForDecision, x as webAuthExists, y as resolveDefaultWebAuthDir } from "./auth-store-B_DQIdzp.js";
6
+ import { t as createWhatsAppLoginTool } from "./agent-tools-login-B-2qZPzc.js";
7
+ import { M as waitForCredsSaveQueueWithTimeout, N as writeCredsJsonAtomically, _ as readWebSelfIdentity, a as formatWhatsAppWebAuthStatusState, b as restoreCredsFromBackupIfNeeded, c as logoutWeb, d as readWebAuthExistsBestEffort, f as readWebAuthExistsForDecision, g as readWebSelfId, h as readWebAuthState, j as waitForCredsSaveQueue, l as pickWebChannel, m as readWebAuthSnapshotBestEffort, n as WHATSAPP_AUTH_UNSTABLE_CODE, o as getWebAuthAgeMs, p as readWebAuthSnapshot, r as WhatsAppAuthUnstableError, s as logWebSelfId, t as WA_WEB_AUTH_DIR, u as readCredsJsonRaw, v as readWebSelfIdentityForDecision, x as webAuthExists, y as resolveDefaultWebAuthDir } from "./auth-store-CtpBqH5S.js";
8
8
  import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-HU41RHGI.js";
9
9
  import { n as resolveWebAccountId, t as getActiveWebListener } from "./active-listener-BEjWsCNM.js";
10
- import { a as waitForWaConnection, i as newConnectionId, r as createWaSocket } from "./socket-close-09FojDO2.js";
10
+ import { a as waitForWaConnection, i as newConnectionId, r as createWaSocket } from "./socket-close-2T0_jZTN.js";
11
11
  import { n as getStatusCode, t as formatError } from "./session-errors-JuazczrA.js";
12
- import { p as extractText, s as extractContactContext, u as extractLocationData } from "./send-api-DimZST3E.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-BCe5Mm-1.js";
14
- import { t as loginWeb } from "./login-D6_rfxTZ.js";
12
+ import { p as extractText, s as extractContactContext, u as extractLocationData } from "./send-api-C-FFC1p_.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-CySzv38g.js";
14
+ import { t as loginWeb } from "./login-1u5WcfTn.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, 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,4 +1,4 @@
1
- import { a as resolveWhatsAppAccount, c as resolveMergedWhatsAppAccountConfig, s as resolveWhatsAppMediaMaxBytes } from "./accounts-BX2fZUyR.js";
1
+ import { a as resolveWhatsAppAccount, c as resolveMergedWhatsAppAccountConfig, s as resolveWhatsAppMediaMaxBytes } from "./accounts-CeKQbu_s.js";
2
2
  import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-CB5SOWjc.js";
3
3
  import { n as isWhatsAppNewsletterJid } from "./normalize-target-CugRyONv.js";
4
4
  import { r as getWhatsAppConnectionController } from "./connection-controller-runtime-context-DG0tuYuw.js";
@@ -461,6 +461,9 @@ function resolveActualSentRemoteJid(result, fallbackJid) {
461
461
  return fallbackJid;
462
462
  }
463
463
  async function sendMessageWhatsApp(to, body, options) {
464
+ return await sendWhatsAppUploadFile(to, body, options);
465
+ }
466
+ async function sendWhatsAppUploadFile(to, body, options) {
464
467
  return await withWhatsAppLogicalDeliveryActivity(() => sendMessageWhatsAppInActivityScope(to, body, options));
465
468
  }
466
469
  async function sendMessageWhatsAppInActivityScope(to, body, options) {
@@ -493,7 +496,7 @@ async function sendMessageWhatsAppInActivityScope(to, body, options) {
493
496
  const accountIdForFormatting = resolvedAccountId ?? options.accountId;
494
497
  const textLimit = Math.min(resolveTextChunkLimit(cfg, "whatsapp", accountIdForFormatting, { fallbackLimit: 4e3 }), 4096);
495
498
  const textChunks = markdownToWhatsAppChunks(text, textLimit, tableMode, resolveChunkMode(cfg, "whatsapp", accountIdForFormatting));
496
- text = textChunks.shift() ?? "";
499
+ text = textChunks.shift() ?? text;
497
500
  if (!text && !hasMedia) return {
498
501
  messageId: "",
499
502
  toJid: jid
@@ -514,13 +517,24 @@ async function sendMessageWhatsAppInActivityScope(to, body, options) {
514
517
  let forceDocumentDelivery = false;
515
518
  let media;
516
519
  if (mediaPayload) media = await prepareWhatsAppOutboundMedia(mediaPayload, primaryMediaUrl);
517
- else if (primaryMediaUrl) media = await prepareWhatsAppOutboundMedia(await loadOutboundMediaFromUrl(primaryMediaUrl, {
518
- maxBytes: resolveWhatsAppMediaMaxBytes(account),
519
- optimizeImages: options.forceDocument ? false : void 0,
520
- mediaAccess: options.mediaAccess,
521
- mediaLocalRoots: options.mediaLocalRoots,
522
- mediaReadFile: options.mediaReadFile
523
- }), primaryMediaUrl);
520
+ else if (primaryMediaUrl) {
521
+ const loadedMedia = await loadOutboundMediaFromUrl(primaryMediaUrl, {
522
+ maxBytes: resolveWhatsAppMediaMaxBytes(account),
523
+ optimizeImages: options.forceDocument ? false : void 0,
524
+ mediaAccess: options.mediaAccess,
525
+ mediaLocalRoots: options.mediaLocalRoots,
526
+ mediaReadFile: options.mediaReadFile
527
+ });
528
+ const mediaWithRequestedType = options.contentType ? {
529
+ ...loadedMedia,
530
+ contentType: options.contentType,
531
+ kind: void 0
532
+ } : loadedMedia;
533
+ media = await prepareWhatsAppOutboundMedia(options.fileName ? {
534
+ ...mediaWithRequestedType,
535
+ fileName: options.fileName
536
+ } : mediaWithRequestedType, primaryMediaUrl);
537
+ }
524
538
  if (media) {
525
539
  const mediaSendState = buildWhatsAppMediaSendState({
526
540
  media,
@@ -694,4 +708,4 @@ async function sendPollWhatsApp(to, poll, options) {
694
708
  }
695
709
  }
696
710
  //#endregion
697
- export { resolveWhatsAppReactionLevel as _, normalizeWhatsAppOutboundPayload as a, prepareWhatsAppOutboundMedia as c, mergeWhatsAppAcceptedSendError as d, normalizeWhatsAppSendResult as f, resolveWhatsAppDocumentFileName as g, withWhatsAppLogicalDeliveryActivity as h, sendTypingWhatsApp as i, combineWhatsAppSendResults as l, rememberWhatsAppPartialSend as m, sendPollWhatsApp as n, normalizeWhatsAppPayloadText as o, rememberWhatsAppAcceptedSend as p, sendReactionWhatsApp as r, normalizeWhatsAppPayloadTextPreservingIndentation as s, sendMessageWhatsApp as t, listWhatsAppSendResultMessageIds as u };
711
+ export { resolveWhatsAppDocumentFileName as _, sendWhatsAppUploadFile as a, normalizeWhatsAppPayloadTextPreservingIndentation as c, listWhatsAppSendResultMessageIds as d, mergeWhatsAppAcceptedSendError as f, withWhatsAppLogicalDeliveryActivity as g, rememberWhatsAppPartialSend as h, sendTypingWhatsApp as i, prepareWhatsAppOutboundMedia as l, rememberWhatsAppAcceptedSend as m, sendPollWhatsApp as n, normalizeWhatsAppOutboundPayload as o, normalizeWhatsAppSendResult as p, sendReactionWhatsApp as r, normalizeWhatsAppPayloadText as s, sendMessageWhatsApp as t, combineWhatsAppSendResults as u, resolveWhatsAppReactionLevel as v };
@@ -1,10 +1,10 @@
1
1
  import { n as isWhatsAppNewsletterJid } from "./normalize-target-CugRyONv.js";
2
- import { d as mergeWhatsAppAcceptedSendError, f as normalizeWhatsAppSendResult, g as resolveWhatsAppDocumentFileName, l as combineWhatsAppSendResults, p as rememberWhatsAppAcceptedSend } from "./send-prK8F7Vj.js";
2
+ import { _ as resolveWhatsAppDocumentFileName, f as mergeWhatsAppAcceptedSendError, m as rememberWhatsAppAcceptedSend, p as normalizeWhatsAppSendResult, u as combineWhatsAppSendResults } from "./send-C3S-NqyO.js";
3
3
  import "./normalize-C7Hkc_vE.js";
4
4
  import { c as toWhatsappJid, l as toWhatsappJidWithLid, r as jidToE164 } from "./targets-runtime-TMk0lGuy.js";
5
5
  import "./text-runtime-CaKLhowd.js";
6
- import { i as buildQuotedMessageOptions } from "./group-session-key-DmFc_Cqi.js";
7
- import { k as resolveComparableIdentity } from "./auth-store-B_DQIdzp.js";
6
+ import { i as buildQuotedMessageOptions } from "./group-session-key-CH9jJIVQ.js";
7
+ import { k as resolveComparableIdentity } from "./auth-store-CtpBqH5S.js";
8
8
  import { isRecord, normalizeLowercaseStringOrEmpty, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
9
9
  import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
10
10
  import { formatLocationText } from "openclaw/plugin-sdk/channel-inbound";
@@ -97,7 +97,7 @@ function getFutureProofInnerMessage(message) {
97
97
  }
98
98
  }
99
99
  }
100
- function buildMessageChain(message) {
100
+ function projectWhatsAppInboundMessage(message) {
101
101
  const chain = [];
102
102
  let current = normalizeMessageContent(message);
103
103
  while (current && chain.length < 4) {
@@ -106,8 +106,14 @@ function buildMessageChain(message) {
106
106
  }
107
107
  return chain;
108
108
  }
109
+ function isWhatsAppInboundMessageProjection(message) {
110
+ return Array.isArray(message);
111
+ }
112
+ function resolveWhatsAppInboundMessageProjection(message) {
113
+ return isWhatsAppInboundMessageProjection(message) ? message : projectWhatsAppInboundMessage(message);
114
+ }
109
115
  function findMessageSection(rawMessage, sectionNames) {
110
- const chain = buildMessageChain(rawMessage);
116
+ const chain = projectWhatsAppInboundMessage(rawMessage);
111
117
  for (const name of sectionNames) for (const message of chain) {
112
118
  const value = message[name];
113
119
  if (isRecord(value)) return {
@@ -117,7 +123,7 @@ function findMessageSection(rawMessage, sectionNames) {
117
123
  }
118
124
  }
119
125
  function unwrapMessage(message) {
120
- return buildMessageChain(message).at(-1);
126
+ return resolveWhatsAppInboundMessageProjection(message).at(-1);
121
127
  }
122
128
  function extractContextInfoFromMessage(message) {
123
129
  const contentType = getContentType(message);
@@ -142,13 +148,13 @@ function extractContextInfoFromMessage(message) {
142
148
  }
143
149
  }
144
150
  function extractContextInfo(message) {
145
- for (const candidate of buildMessageChain(message)) {
151
+ for (const candidate of resolveWhatsAppInboundMessageProjection(message)) {
146
152
  const contextInfo = extractContextInfoFromMessage(candidate);
147
153
  if (contextInfo) return contextInfo;
148
154
  }
149
155
  }
150
- function extractMentionedJids(rawMessage) {
151
- const mentionedJids = extractContextInfo(rawMessage)?.mentionedJid?.filter(Boolean);
156
+ function extractMentionedJids(message) {
157
+ const mentionedJids = extractContextInfo(message)?.mentionedJid?.filter(Boolean);
152
158
  if (!mentionedJids?.length) return;
153
159
  return uniqueStrings(mentionedJids);
154
160
  }
@@ -163,8 +169,9 @@ function extractNativeFlowResponseText(response) {
163
169
  return;
164
170
  }
165
171
  }
166
- function extractText(rawMessage) {
167
- const message = unwrapMessage(rawMessage);
172
+ function extractText(source) {
173
+ const projection = resolveWhatsAppInboundMessageProjection(source);
174
+ const message = unwrapMessage(projection);
168
175
  if (!message) return;
169
176
  const extracted = extractMessageContent(message);
170
177
  const candidates = [message, extracted && extracted !== message ? extracted : void 0];
@@ -192,11 +199,11 @@ function extractText(rawMessage) {
192
199
  if (pollText) return pollText;
193
200
  }
194
201
  }
195
- const contactPlaceholder = extractContactPlaceholder(message) ?? (extracted && extracted !== message ? extractContactPlaceholder(extracted) : void 0);
202
+ const contactPlaceholder = extractContactPlaceholder(projection) ?? (extracted && extracted !== message ? extractContactPlaceholder(extracted) : void 0);
196
203
  if (contactPlaceholder) return contactPlaceholder;
197
204
  }
198
- function extractExternalAdReplyContext(rawMessage) {
199
- const message = unwrapMessage(rawMessage);
205
+ function extractExternalAdReplyContext(source) {
206
+ const message = unwrapMessage(source);
200
207
  const adReply = message?.imageMessage?.contextInfo?.externalAdReply ?? message?.videoMessage?.contextInfo?.externalAdReply;
201
208
  if (!adReply) return;
202
209
  const title = adReply.title?.trim() || void 0;
@@ -208,8 +215,8 @@ function extractExternalAdReplyContext(rawMessage) {
208
215
  body
209
216
  } : void 0;
210
217
  }
211
- function extractMediaKind(rawMessage) {
212
- const message = unwrapMessage(rawMessage);
218
+ function extractMediaKind(source) {
219
+ const message = unwrapMessage(source);
213
220
  if (!message) return;
214
221
  if (message.imageMessage) return "image";
215
222
  if (message.videoMessage || message.ptvMessage) return "video";
@@ -217,15 +224,15 @@ function extractMediaKind(rawMessage) {
217
224
  if (message.documentMessage) return "document";
218
225
  if (message.stickerMessage) return "sticker";
219
226
  }
220
- function extractContactPlaceholder(rawMessage) {
221
- const contactContext = extractContactContext(rawMessage);
227
+ function extractContactPlaceholder(source) {
228
+ const contactContext = extractContactContext(source);
222
229
  if (!contactContext) return;
223
230
  if (contactContext.kind === "contact") return "<contact>";
224
231
  const suffix = contactContext.total === 1 ? "contact" : "contacts";
225
232
  return `<contacts: ${contactContext.total} ${suffix}>`;
226
233
  }
227
- function extractContactContext(rawMessage) {
228
- const message = unwrapMessage(rawMessage);
234
+ function extractContactContext(source) {
235
+ const message = unwrapMessage(source);
229
236
  if (!message) return;
230
237
  const contact = message.contactMessage ?? void 0;
231
238
  if (contact) {
@@ -261,8 +268,8 @@ function describeContact(input) {
261
268
  phones: parsed.phones
262
269
  };
263
270
  }
264
- function extractLocationData(rawMessage) {
265
- const message = unwrapMessage(rawMessage);
271
+ function extractLocationData(source) {
272
+ const message = unwrapMessage(source);
266
273
  if (!message) return null;
267
274
  const live = message.liveLocationMessage ?? void 0;
268
275
  if (live) {
@@ -305,10 +312,11 @@ function extractLocationData(rawMessage) {
305
312
  }
306
313
  return null;
307
314
  }
308
- function describeReplyContext(rawMessage) {
309
- const message = unwrapMessage(rawMessage);
315
+ function describeReplyContext(source) {
316
+ const projection = resolveWhatsAppInboundMessageProjection(source);
317
+ const message = unwrapMessage(projection);
310
318
  if (!message) return null;
311
- const contextInfo = extractContextInfo(message);
319
+ const contextInfo = extractContextInfo(projection.length === 1 && projection[0] === message ? projection : projectWhatsAppInboundMessage(message));
312
320
  const quoted = normalizeMessageContent(contextInfo?.quotedMessage);
313
321
  if (!quoted && !contextInfo?.stanzaId) return null;
314
322
  const senderJid = contextInfo?.participant ?? void 0;
@@ -321,10 +329,11 @@ function describeReplyContext(rawMessage) {
321
329
  body: "[quoted message unavailable]",
322
330
  sender
323
331
  };
324
- const location = extractLocationData(quoted);
332
+ const quotedProjection = projectWhatsAppInboundMessage(quoted);
333
+ const location = extractLocationData(quotedProjection);
325
334
  const locationText = location ? formatLocationText(location) : void 0;
326
- const body = [extractText(quoted), locationText].filter(Boolean).join("\n").trim();
327
- const mediaKind = extractMediaKind(quoted);
335
+ const body = [extractText(quotedProjection), locationText].filter(Boolean).join("\n").trim();
336
+ const mediaKind = extractMediaKind(quotedProjection);
328
337
  const media = mediaKind ? {
329
338
  kind: mediaKind,
330
339
  contentType: resolveInboundMediaMimetype(quoted)
@@ -352,12 +361,13 @@ function hasInteractiveResponseContent(message) {
352
361
  * `messages.upsert` stream as real messages but should not trigger pairing
353
362
  * access-control side effects.
354
363
  */
355
- function hasInboundUserContent(rawMessage) {
356
- if (!rawMessage) return false;
357
- if (extractText(rawMessage)) return true;
358
- if (extractMediaKind(rawMessage)) return true;
359
- if (extractLocationData(rawMessage)) return true;
360
- for (const candidate of buildMessageChain(rawMessage)) if (hasInteractiveResponseContent(candidate)) return true;
364
+ function hasInboundUserContent(source) {
365
+ const projection = resolveWhatsAppInboundMessageProjection(source);
366
+ if (projection.length === 0) return false;
367
+ if (extractText(projection)) return true;
368
+ if (extractMediaKind(projection)) return true;
369
+ if (extractLocationData(projection)) return true;
370
+ for (const candidate of projection) if (hasInteractiveResponseContent(candidate)) return true;
361
371
  return false;
362
372
  }
363
373
  //#endregion
@@ -391,7 +401,7 @@ async function addWhatsAppImagePreviewFields(content) {
391
401
  //#endregion
392
402
  //#region extensions/whatsapp/src/inbound/outbound-mentions.ts
393
403
  const CODE_FENCE_RE = /```[\s\S]*?```/g;
394
- const INLINE_CODE_RE = /`[^`\n]+`/g;
404
+ const INLINE_CODE_RE = /(?<=(?:^|[^\\])(?:\\\\)*)(`+)[\s\S]*?(?:(?<!`)\1(?!`)|$)/g;
395
405
  const OUTBOUND_MENTION_RE = /@(\+?\d+)/g;
396
406
  const KNOWN_USER_JID_RE = /^(\d+)(?::\d+)?@(s\.whatsapp\.net|hosted|lid|hosted\.lid|c\.us)$/i;
397
407
  const PHONE_JID_DOMAIN_RE = /^(s\.whatsapp\.net|hosted|c\.us)$/i;
@@ -725,4 +735,4 @@ function createWebSendApi(params) {
725
735
  };
726
736
  }
727
737
  //#endregion
728
- export { addWhatsAppImagePreviewFields as a, extractContextInfo as c, extractMediaKind as d, extractMentionedJids as f, resolveInboundMediaMimetype as g, hasInboundUserContent as h, resolveWhatsAppOutboundMentions as i, extractExternalAdReplyContext as l, findMessageSection as m, addWhatsAppOutboundMentionsToContent as n, describeReplyContext as o, extractText as p, mayContainWhatsAppOutboundMention as r, extractContactContext as s, createWebSendApi as t, extractLocationData as u };
738
+ export { resolveInboundMediaMimetype as _, addWhatsAppImagePreviewFields as a, extractContextInfo as c, extractMediaKind as d, extractMentionedJids as f, projectWhatsAppInboundMessage as g, hasInboundUserContent as h, resolveWhatsAppOutboundMentions as i, extractExternalAdReplyContext as l, findMessageSection as m, addWhatsAppOutboundMentionsToContent as n, describeReplyContext as o, extractText as p, mayContainWhatsAppOutboundMention as r, extractContactContext as s, createWebSendApi as t, extractLocationData as u };
@@ -1,10 +1,10 @@
1
- import { a as resolveWhatsAppAccount, o as resolveWhatsAppAuthDir } from "./accounts-BX2fZUyR.js";
1
+ import { a as resolveWhatsAppAccount, o as resolveWhatsAppAuthDir } from "./accounts-CeKQbu_s.js";
2
2
  import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-CB5SOWjc.js";
3
3
  import { r as hasWebCredsSync } from "./creds-files-W6B3EMZ8.js";
4
4
  import { a as normalizeWhatsAppAllowFromEntries, o as normalizeWhatsAppAllowFromEntry } from "./normalize-target-CugRyONv.js";
5
- import { r as whatsappSetupAdapter } from "./shared-Dp9M3ZPX.js";
6
- import { DEFAULT_ACCOUNT_ID, createSetupTranslator, splitSetupEntries } from "openclaw/plugin-sdk/setup";
5
+ import { r as whatsappSetupAdapter } from "./shared-D3B14d45.js";
7
6
  import { formatCliCommand, formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
7
+ import { DEFAULT_ACCOUNT_ID, createSetupTranslator, splitSetupEntries } from "openclaw/plugin-sdk/setup";
8
8
  //#region extensions/whatsapp/src/setup-finalize.ts
9
9
  const t = createSetupTranslator();
10
10
  function trimPromptText(value) {
@@ -295,7 +295,7 @@ async function finalizeWhatsAppSetup(params) {
295
295
  };
296
296
  let loginWeb;
297
297
  try {
298
- ({loginWeb} = await import("./login-D6_rfxTZ.js").then((n) => n.n));
298
+ ({loginWeb} = await import("./login-1u5WcfTn.js").then((n) => n.n));
299
299
  } catch (error) {
300
300
  await reportLoginFailure(error);
301
301
  }
@@ -1,2 +1,2 @@
1
- import { t as whatsappSetupPlugin } from "./channel.setup-Cmvd967u.js";
1
+ import { t as whatsappSetupPlugin } from "./channel.setup-CRJQiWbh.js";
2
2
  export { whatsappSetupPlugin };
@@ -1,6 +1,6 @@
1
- import { o as resolveWhatsAppAuthDir } from "./accounts-BX2fZUyR.js";
1
+ import { o as resolveWhatsAppAuthDir } from "./accounts-CeKQbu_s.js";
2
2
  import { t as listAccountIds } from "./account-ids-CB5SOWjc.js";
3
- import { a as formatWhatsAppWebAuthStatusState, h as readWebAuthState } from "./auth-store-B_DQIdzp.js";
3
+ import { a as formatWhatsAppWebAuthStatusState, h as readWebAuthState } from "./auth-store-CtpBqH5S.js";
4
4
  import { DEFAULT_ACCOUNT_ID, createSetupTranslator, setSetupChannelEnabled } from "openclaw/plugin-sdk/setup";
5
5
  //#region extensions/whatsapp/src/setup-surface.ts
6
6
  const t = createSetupTranslator();
@@ -36,7 +36,7 @@ const whatsappSetupWizard = {
36
36
  },
37
37
  resolveShouldPromptAccountIds: ({ shouldPromptAccountIds }) => shouldPromptAccountIds,
38
38
  credentials: [],
39
- finalize: async (params) => await (await import("./setup-finalize-D3n71Uyx.js")).finalizeWhatsAppSetup(params),
39
+ finalize: async (params) => await (await import("./setup-finalize-CRzMpx84.js")).finalizeWhatsAppSetup(params),
40
40
  disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
41
41
  onAccountRecorded: (accountId, options) => {
42
42
  options?.onAccountId?.(channel, accountId);
@@ -1,4 +1,4 @@
1
- import { a as resolveWhatsAppAccount, n as hasAnyWhatsAppAuth } from "./accounts-BX2fZUyR.js";
1
+ import { a as resolveWhatsAppAccount, n as hasAnyWhatsAppAuth } from "./accounts-CeKQbu_s.js";
2
2
  import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-CB5SOWjc.js";
3
3
  import { a as normalizeWhatsAppAllowFromEntries } from "./normalize-target-CugRyONv.js";
4
4
  import { t as WhatsAppChannelConfigSchema } from "./config-schema-BQP5YCeK.js";
@@ -12,7 +12,7 @@ import { normalizeE164 } from "openclaw/plugin-sdk/account-resolution";
12
12
  import { createChannelPluginBase } from "openclaw/plugin-sdk/core";
13
13
  import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
14
14
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
15
- import { buildChannelGroupsScopeTree, collectOpenGroupPolicyRouteAllowlistWarnings, createAllowlistProviderGroupPolicyWarningCollector, resolveScopeRequireMention, resolveScopeToolsPolicy } from "openclaw/plugin-sdk/channel-policy";
15
+ import { buildChannelGroupsScopeTree, collectOpenGroupPolicyRouteAllowlistWarnings, createAllowlistProviderGroupPolicyWarningCollector, createConditionalWarningCollector, resolveScopeRequireMention, resolveScopeToolsPolicy } from "openclaw/plugin-sdk/channel-policy";
16
16
  import { defineChannelSetupContract } from "openclaw/plugin-sdk/channel-setup";
17
17
  import { createPatchedAccountSetupAdapter } from "openclaw/plugin-sdk/setup";
18
18
  import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
@@ -20,14 +20,14 @@ import { adaptScopedAccountAccessor, createScopedChannelConfigAdapter, createSco
20
20
  import { createDelegatedSetupWizardProxy } from "openclaw/plugin-sdk/setup-runtime";
21
21
  import { readChannelAllowFromStore } from "openclaw/plugin-sdk/channel-pairing";
22
22
  //#region extensions/whatsapp/src/channel-runtime-loader.ts
23
- const loadWhatsAppAuthStore = createLazyRuntimeModule(() => import("./auth-store-B_DQIdzp.js").then((n) => n.i));
23
+ const loadWhatsAppAuthStore = createLazyRuntimeModule(() => import("./auth-store-CtpBqH5S.js").then((n) => n.i));
24
24
  async function readWhatsAppAccountLinkState(authDir) {
25
25
  const state = await (await loadWhatsAppAuthStore()).readWebAuthState(authDir);
26
26
  return state === "unstable" ? "unknown" : state;
27
27
  }
28
28
  const loadWhatsAppChannelRuntime = createLazyRuntimeModule(async () => {
29
29
  await loadWhatsAppAuthStore();
30
- return await import("./channel.runtime-RxuNGZ7w.js");
30
+ return await import("./channel.runtime-D_PjmeMT.js");
31
31
  });
32
32
  //#endregion
33
33
  //#region extensions/whatsapp/src/config-accessors.ts
@@ -115,7 +115,7 @@ async function applyWhatsAppSecurityConfigFixes(params) {
115
115
  //#region extensions/whatsapp/src/shared.ts
116
116
  const WHATSAPP_CHANNEL = "whatsapp";
117
117
  async function loadWhatsAppSetupSurface() {
118
- return await import("./setup-surface-BCZszf3l.js");
118
+ return await import("./setup-surface-ym4doiv3.js");
119
119
  }
120
120
  const whatsappSetupWizardProxy = createWhatsAppSetupWizardProxy(async () => (await loadWhatsAppSetupSurface()).whatsappSetupWizard);
121
121
  const whatsappConfigAdapter = createScopedChannelConfigAdapter({
@@ -209,6 +209,12 @@ function createWhatsAppPluginBase(params) {
209
209
  }
210
210
  })
211
211
  });
212
+ const collectWhatsAppOpenGroupFindings = createConditionalWarningCollector.findings({
213
+ collectWarnings: collectWhatsAppSecurityWarnings,
214
+ checkId: "channels.whatsapp.groups.open",
215
+ severity: "critical",
216
+ title: "WhatsApp security warning"
217
+ });
212
218
  const base = createChannelPluginBase({
213
219
  id: WHATSAPP_CHANNEL,
214
220
  meta: {
@@ -270,7 +276,7 @@ function createWhatsAppPluginBase(params) {
270
276
  security: {
271
277
  applyConfigFixes: applyWhatsAppSecurityConfigFixes,
272
278
  resolveDmPolicy: whatsappResolveDmPolicy,
273
- collectWarnings: collectWhatsAppSecurityWarnings
279
+ collectWarnings: collectWhatsAppOpenGroupFindings
274
280
  },
275
281
  doctor: whatsappDoctor,
276
282
  setupContract: params.setupContract,
@@ -1,5 +1,5 @@
1
1
  import { c as resolveWebCredsPath, s as resolveWebCredsBackupPath, t as assertWebCredsPathRegularFileOrMissing } from "./creds-files-W6B3EMZ8.js";
2
- import { A as enqueueCredsSave, M as waitForCredsSaveQueueWithTimeout, N as writeCredsJsonAtomically, P as writeWebCredsRawAtomically, b as restoreCredsFromBackupIfNeeded, u as readCredsJsonRaw, y as resolveDefaultWebAuthDir } from "./auth-store-B_DQIdzp.js";
2
+ import { A as enqueueCredsSave, M as waitForCredsSaveQueueWithTimeout, N as writeCredsJsonAtomically, P as writeWebCredsRawAtomically, b as restoreCredsFromBackupIfNeeded, u as readCredsJsonRaw, y as resolveDefaultWebAuthDir } from "./auth-store-CtpBqH5S.js";
3
3
  import { n as getStatusCode } from "./session-errors-JuazczrA.js";
4
4
  import { a as makeWASocket, i as makeCacheableSignalKeyStore, n as createBaileysSignalRepository, r as fetchLatestBaileysVersion, s as useMultiFileAuthState } from "./session.runtime-Nsqaehbd.js";
5
5
  import { VERSION, formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
@@ -2,7 +2,7 @@ import { proto } from '../../WAProto/index.js';
2
2
  import { makeLibSignalRepository } from '../Signal/libsignal.js';
3
3
  import { Browsers } from '../Utils/browser-utils.js';
4
4
  import logger from '../Utils/logger.js';
5
- const version = [2, 3000, 1035194821];
5
+ const version = [2, 3000, 1043857760];
6
6
  export const UNAUTHORIZED_CODES = [401, 403, 419];
7
7
  export const DEFAULT_ORIGIN = 'https://web.whatsapp.com';
8
8
  export const CALL_VIDEO_PREFIX = 'https://call.whatsapp.com/video/';
@@ -1 +1 @@
1
- {"version":3,"file":"business.d.ts","sourceRoot":"","sources":["../../src/Socket/business.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC5G,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAA;AAUnE,OAAO,EAAE,KAAK,UAAU,EAAqC,MAAM,aAAa,CAAA;AAIhF,eAAO,MAAM,kBAAkB,GAAI,QAAQ,YAAY;;+BA8Od,MAAM,eAAe,MAAM;yCAjGjB,iBAAiB;;;;2BAmD/B,MAAM;;;4BAkIL,aAAa;gCAwCT,MAAM,EAAE;;;+BA9ET,MAAM,UAAU,aAAa;kCAxR1B,0BAA0B;8BA2E9B,aAAa;2BAoChB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsSqvnB,CAAC;;;;;;;;;0DAhX9wnB,GAAG,0BAChB,GAAH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8WF,CAAA"}
1
+ {"version":3,"file":"business.d.ts","sourceRoot":"","sources":["../../src/Socket/business.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAC5G,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAA;AAUnE,OAAO,EAAE,KAAK,UAAU,EAAqC,MAAM,aAAa,CAAA;AAIhF,eAAO,MAAM,kBAAkB,GAAI,QAAQ,YAAY;;+BA8Od,MAAM,eAAe,MAAM;yCAjGjB,iBAAiB;;;;2BAmD/B,MAAM;;;4BAkIL,aAAa;gCAwCT,MAAM,EAAE;;;+BA9ET,MAAM,UAAU,aAAa;kCAxR1B,0BAA0B;8BA2E9B,aAAa;2BAoChB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAsS6+nB,CAAC;;;;;;;;;0DAhXtgoB,GAAG,0BAChB,GAAH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8WF,CAAA"}
@@ -5,6 +5,7 @@ import type { QuickReplyAction } from '../Types/Bussines.js';
5
5
  import type { LabelActionBody } from '../Types/Label.js';
6
6
  import { type BinaryNode } from '../WABinary/index.js';
7
7
  import { USyncQuery } from '../WAUSync/index.js';
8
+ export declare const buildProfilePictureQueryContent: (type: "preview" | "image", tcTokenContent?: BinaryNode[]) => BinaryNode[];
8
9
  export declare const makeChatsSocket: (config: SocketConfig) => {
9
10
  serverProps: {
10
11
  /** AB prop 10518: gate tctoken on 1:1 messages. Default true (safe: avoids 463). */
@@ -1 +1 @@
1
- {"version":3,"file":"chats.d.ts","sourceRoot":"","sources":["../../src/Socket/chats.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAE9C,OAAO,KAAK,EACX,WAA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MAAM;;;;;;0DAjmC5B,GAAG,0BAA0B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA07C/C,CAAA"}
@@ -11,6 +11,13 @@ import { buildTcTokenFromJid } from '../Utils/tc-token-utils.js';
11
11
  import { getBinaryNodeChild, getBinaryNodeChildren, isHostedLidUser, isHostedPnUser, isLidUser, isPnUser, jidDecode, jidNormalizedUser, reduceBinaryNodeToDictionary, S_WHATSAPP_NET } from '../WABinary/index.js';
12
12
  import { USyncQuery, USyncUser } from '../WAUSync/index.js';
13
13
  import { makeSocket } from './socket.js';
14
+ export const buildProfilePictureQueryContent = (type, tcTokenContent) => {
15
+ const picture = { tag: 'picture', attrs: { type, query: 'url' } };
16
+ if (tcTokenContent?.length) {
17
+ picture.content = tcTokenContent;
18
+ }
19
+ return [picture];
20
+ };
14
21
  export const makeChatsSocket = (config) => {
15
22
  const { logger, markOnlineOnConnect, fireInitQueries, appStateMacVerification, shouldIgnoreJid, shouldSyncHistoryMessage, getMessage } = config;
16
23
  const sock = makeSocket(config);
@@ -546,7 +553,6 @@ export const makeChatsSocket = (config) => {
546
553
  * type = "image for the high res picture"
547
554
  */
548
555
  const profilePictureUrl = async (jid, type = 'preview', timeoutMs) => {
549
- const baseContent = [{ tag: 'picture', attrs: { type, query: 'url' } }];
550
556
  // WA Web only includes tctoken for user JIDs (not groups/newsletters)
551
557
  // and never for own profile pic (Chat model for self has no tcToken).
552
558
  // Including tctoken for own JID causes the server to never respond.
@@ -554,12 +560,11 @@ export const makeChatsSocket = (config) => {
554
560
  const isUserJid = isPnUser(normalizedJid) || isLidUser(normalizedJid);
555
561
  const me = authState.creds.me;
556
562
  const isSelf = me && (normalizedJid === jidNormalizedUser(me.id) || (me.lid && normalizedJid === jidNormalizedUser(me.lid)));
557
- let content = baseContent;
563
+ let tcTokenContent;
558
564
  if (serverProps.profilePicPrivacyToken && isUserJid && !isSelf) {
559
- content = await buildTcTokenFromJid({
565
+ tcTokenContent = await buildTcTokenFromJid({
560
566
  authState,
561
567
  jid: normalizedJid,
562
- baseContent,
563
568
  getLIDForPN
564
569
  });
565
570
  }
@@ -572,7 +577,7 @@ export const makeChatsSocket = (config) => {
572
577
  type: 'get',
573
578
  xmlns: 'w:profile:picture'
574
579
  },
575
- content
580
+ content: buildProfilePictureQueryContent(type, tcTokenContent)
576
581
  }, timeoutMs);
577
582
  const child = getBinaryNodeChild(result, 'picture');
578
583
  return child?.attrs?.url;