@openclaw/whatsapp 2026.8.1-beta.3 → 2026.8.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 (263) hide show
  1. package/dist/{accounts-BX2fZUyR.js → accounts-CeKQbu_s.js} +9 -26
  2. package/dist/{action-runtime-pM-ExU0l.js → action-runtime-Bw0loEdy.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} +13 -6
  6. package/dist/{agent-tools-login-BjRpD-JQ.js → agent-tools-login-B-2qZPzc.js} +12 -3
  7. package/dist/api.js +10 -10
  8. package/dist/{approval-handler.runtime-CkMMvUjk.js → approval-handler.runtime-DeyPb57-.js} +3 -3
  9. package/dist/{approval-reactions-Jyr1JaAK.js → approval-reactions-DGDA6hQ7.js} +7 -5
  10. package/dist/{auth-store-CtpBqH5S.js → auth-store-DTj1H9pv.js} +5 -3
  11. package/dist/{channel-DRMYRfZ8.js → channel-DxMmDjqK.js} +26 -24
  12. package/dist/channel-config-api.js +1 -1
  13. package/dist/channel-plugin-api.js +1 -1
  14. package/dist/{channel-react-action-CstrR0CT.js → channel-react-action-BUp7Wbfr.js} +3 -3
  15. package/dist/{channel.runtime-X3JC2gaq.js → channel.runtime-BwSnyXRX.js} +4 -4
  16. package/dist/{channel.setup-DhBBhbQv.js → channel.setup-aOFLSQyw.js} +1 -1
  17. package/dist/{config-schema-BQP5YCeK.js → config-schema-BYA6e_Ii.js} +6 -4
  18. package/dist/{connection-controller-CIYuBJrs.js → connection-controller-BvkxsbWi.js} +2 -2
  19. package/dist/{constants-HU41RHGI.js → constants-C7m81BNe.js} +1 -1
  20. package/dist/{directory-config-P7_3U73Z.js → directory-config-LgxYJLWY.js} +3 -3
  21. package/dist/directory-contract-api.js +1 -1
  22. package/dist/{group-session-key-DmFc_Cqi.js → group-session-key-KUguLmSZ.js} +4 -4
  23. package/dist/index.js +4 -4
  24. package/dist/light-runtime-api.js +2 -2
  25. package/dist/{login-BkpKpndm.js → login-Bk_jiXKD.js} +6 -5
  26. package/dist/{login-qr-1dpv6jjT.js → login-qr-B3m61NqA.js} +43 -20
  27. package/dist/login-qr-runtime.js +1 -1
  28. package/dist/{monitor-IzwQKizW.js → monitor-CTsyo-HE.js} +185 -162
  29. package/dist/{question-reactions-D3eAeB0i.js → question-reactions-B9D6MHXZ.js} +1 -1
  30. package/dist/runtime-api.js +9 -9
  31. package/dist/{send-CwvTU4RI.js → send-DiPjiygK.js} +54 -29
  32. package/dist/{send-api-obOSm2cC.js → send-api-kFcuhSiY.js} +43 -41
  33. package/dist/{setup-finalize-n4K2I2gJ.js → setup-finalize-CqH5wTK5.js} +7 -6
  34. package/dist/setup-plugin-api.js +1 -1
  35. package/dist/{setup-surface-Cwn3zyxK.js → setup-surface-Dm3T6S8t.js} +3 -3
  36. package/dist/{shared-wg42NKFB.js → shared-DDjonGys.js} +7 -6
  37. package/dist/{socket-close-2T0_jZTN.js → socket-close-CpkkJZCU.js} +9 -6
  38. package/dist/{targets-runtime-TMk0lGuy.js → targets-runtime-RBjx3pg_.js} +1 -2
  39. package/dist/{text-runtime-CaKLhowd.js → text-runtime-DyfmcATV.js} +1 -1
  40. package/node_modules/baileys/lib/Defaults/index.js +1 -1
  41. package/node_modules/baileys/lib/Socket/business.d.ts.map +1 -1
  42. package/node_modules/baileys/lib/Socket/chats.d.ts +1 -0
  43. package/node_modules/baileys/lib/Socket/chats.d.ts.map +1 -1
  44. package/node_modules/baileys/lib/Socket/chats.js +10 -5
  45. package/node_modules/baileys/lib/Socket/chats.js.map +1 -1
  46. package/node_modules/baileys/lib/Socket/communities.d.ts.map +1 -1
  47. package/node_modules/baileys/lib/Socket/groups.d.ts.map +1 -1
  48. package/node_modules/baileys/lib/Socket/index.d.ts.map +1 -1
  49. package/node_modules/baileys/lib/Socket/messages-recv.d.ts.map +1 -1
  50. package/node_modules/baileys/lib/Socket/messages-send.d.ts.map +1 -1
  51. package/node_modules/baileys/lib/Socket/newsletter.d.ts.map +1 -1
  52. package/node_modules/baileys/lib/Socket/socket.d.ts.map +1 -1
  53. package/node_modules/baileys/lib/Socket/socket.js +3 -0
  54. package/node_modules/baileys/lib/Socket/socket.js.map +1 -1
  55. package/node_modules/baileys/lib/Types/index.d.ts +1 -0
  56. package/node_modules/baileys/lib/Types/index.d.ts.map +1 -1
  57. package/node_modules/baileys/lib/Types/index.js.map +1 -1
  58. package/node_modules/baileys/lib/Utils/browser-utils.d.ts.map +1 -1
  59. package/node_modules/baileys/lib/Utils/browser-utils.js +1 -0
  60. package/node_modules/baileys/lib/Utils/browser-utils.js.map +1 -1
  61. package/node_modules/baileys/lib/Utils/generics.d.ts +1 -0
  62. package/node_modules/baileys/lib/Utils/generics.d.ts.map +1 -1
  63. package/node_modules/baileys/lib/Utils/generics.js +1 -1
  64. package/node_modules/baileys/lib/Utils/generics.js.map +1 -1
  65. package/node_modules/baileys/lib/Utils/tc-token-utils.d.ts.map +1 -1
  66. package/node_modules/baileys/lib/Utils/tc-token-utils.js +3 -2
  67. package/node_modules/baileys/lib/Utils/tc-token-utils.js.map +1 -1
  68. package/node_modules/baileys/lib/Utils/validate-connection.d.ts.map +1 -1
  69. package/node_modules/baileys/lib/Utils/validate-connection.js +9 -2
  70. package/node_modules/baileys/lib/Utils/validate-connection.js.map +1 -1
  71. package/node_modules/baileys/node_modules/content-type/README.md +2 -0
  72. package/node_modules/baileys/node_modules/content-type/dist/index.d.ts +20 -0
  73. package/node_modules/baileys/node_modules/content-type/dist/index.js +20 -14
  74. package/node_modules/baileys/node_modules/content-type/dist/index.js.map +1 -1
  75. package/node_modules/baileys/node_modules/content-type/package.json +1 -1
  76. package/node_modules/baileys/node_modules/file-type/package.json +1 -1
  77. package/node_modules/baileys/node_modules/file-type/readme.md +3 -0
  78. package/node_modules/baileys/node_modules/file-type/source/detectors/zip.js +6 -1
  79. package/node_modules/baileys/node_modules/file-type/source/index.d.ts +3 -0
  80. package/node_modules/baileys/node_modules/file-type/source/index.js +25 -13
  81. package/node_modules/baileys/node_modules/music-metadata/LICENSE.txt +9 -9
  82. package/node_modules/baileys/node_modules/music-metadata/README.md +878 -878
  83. package/node_modules/baileys/node_modules/music-metadata/lib/ParseError.d.ts +1 -1
  84. package/node_modules/baileys/node_modules/music-metadata/lib/ParseError.js +1 -1
  85. package/node_modules/baileys/node_modules/music-metadata/lib/asf/AsfObject.d.ts +1 -4
  86. package/node_modules/baileys/node_modules/music-metadata/lib/asf/AsfObject.js +66 -30
  87. package/node_modules/baileys/node_modules/music-metadata/lib/asf/AsfParser.d.ts +5 -1
  88. package/node_modules/baileys/node_modules/music-metadata/lib/asf/AsfParser.js +94 -25
  89. package/node_modules/baileys/node_modules/music-metadata/lib/dsf/DsfChunk.js +2 -2
  90. package/node_modules/baileys/node_modules/music-metadata/lib/dsf/DsfParser.js +38 -13
  91. package/node_modules/baileys/node_modules/music-metadata/lib/mp4/AtomToken.js +2 -1
  92. package/node_modules/baileys/node_modules/music-metadata/lib/mp4/MP4Parser.js +34 -7
  93. package/node_modules/baileys/node_modules/music-metadata/lib/ogg/speex/SpeexStream.d.ts +7 -0
  94. package/node_modules/baileys/node_modules/music-metadata/lib/ogg/speex/SpeexStream.js +13 -0
  95. package/node_modules/baileys/node_modules/music-metadata/lib/riff/RiffChunk.js +1 -1
  96. package/node_modules/baileys/node_modules/music-metadata/package.json +156 -156
  97. package/node_modules/baileys/node_modules/process-warning/.github/dependabot.yml +42 -2
  98. package/node_modules/baileys/node_modules/process-warning/.github/workflows/ci.yml +12 -1
  99. package/node_modules/baileys/node_modules/process-warning/.github/workflows/lock-threads.yml +19 -0
  100. package/node_modules/baileys/node_modules/process-warning/LICENSE +1 -1
  101. package/node_modules/baileys/node_modules/process-warning/README.md +41 -2
  102. package/node_modules/baileys/node_modules/process-warning/index.js +85 -17
  103. package/node_modules/baileys/node_modules/process-warning/package.json +6 -7
  104. package/node_modules/baileys/node_modules/process-warning/test/emit-once-only.test.js +3 -3
  105. package/node_modules/baileys/node_modules/process-warning/test/emit-reset.test.js +4 -4
  106. package/node_modules/baileys/node_modules/process-warning/test/emit-unlimited.test.js +2 -2
  107. package/node_modules/baileys/node_modules/process-warning/test/spy-warning.test.js +143 -0
  108. package/node_modules/baileys/node_modules/process-warning/types/index.d.ts +15 -1
  109. package/node_modules/baileys/node_modules/process-warning/types/index.tst.ts +48 -0
  110. package/node_modules/baileys/node_modules/protobufjs/README.md +61 -84
  111. package/node_modules/baileys/node_modules/protobufjs/dist/light/protobuf.js +66 -45
  112. package/node_modules/baileys/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  113. package/node_modules/baileys/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  114. package/node_modules/baileys/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  115. package/node_modules/baileys/node_modules/protobufjs/dist/minimal/protobuf.js +47 -40
  116. package/node_modules/baileys/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
  117. package/node_modules/baileys/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
  118. package/node_modules/baileys/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
  119. package/node_modules/baileys/node_modules/protobufjs/dist/protobuf.js +92 -68
  120. package/node_modules/baileys/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  121. package/node_modules/baileys/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  122. package/node_modules/baileys/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  123. package/node_modules/baileys/node_modules/protobufjs/ext/descriptor.js +26 -10
  124. package/node_modules/baileys/node_modules/protobufjs/index.d.ts +3 -0
  125. package/node_modules/baileys/node_modules/protobufjs/package.json +1 -1
  126. package/node_modules/baileys/node_modules/protobufjs/src/converter.js +5 -1
  127. package/node_modules/baileys/node_modules/protobufjs/src/enum.js +5 -2
  128. package/node_modules/baileys/node_modules/protobufjs/src/field.js +6 -1
  129. package/node_modules/baileys/node_modules/protobufjs/src/parse.js +26 -23
  130. package/node_modules/baileys/node_modules/protobufjs/src/reader.js +36 -9
  131. package/node_modules/baileys/node_modules/protobufjs/src/util/codegen.js +3 -1
  132. package/node_modules/baileys/node_modules/protobufjs/src/util/utf8.js +2 -28
  133. package/node_modules/baileys/node_modules/protobufjs/src/writer.js +7 -1
  134. package/node_modules/baileys/node_modules/ws/lib/permessage-deflate.js +3 -1
  135. package/node_modules/baileys/node_modules/ws/package.json +1 -1
  136. package/node_modules/baileys/package.json +1 -1
  137. package/node_modules/typebox/build/format/date.d.mts +1 -1
  138. package/node_modules/typebox/build/format/date.mjs +1 -1
  139. package/node_modules/typebox/build/format/date_time.d.mts +2 -2
  140. package/node_modules/typebox/build/format/date_time.mjs +3 -3
  141. package/node_modules/typebox/build/format/email.d.mts +1 -1
  142. package/node_modules/typebox/build/format/email.mjs +2 -2
  143. package/node_modules/typebox/build/format/hostname.mjs +2 -10
  144. package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
  145. package/node_modules/typebox/build/format/idn_email.mjs +3 -3
  146. package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
  147. package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
  148. package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
  149. package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
  150. package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
  151. package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
  152. package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
  153. package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
  154. package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
  155. package/node_modules/typebox/build/format/idna/idn-hostname.mjs +41 -0
  156. package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
  157. package/node_modules/typebox/build/format/idna/index.mjs +2 -0
  158. package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
  159. package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
  160. package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
  161. package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
  162. package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
  163. package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
  164. package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
  165. package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
  166. package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
  167. package/node_modules/typebox/build/format/ipv4.mjs +2 -32
  168. package/node_modules/typebox/build/format/ipv6.mjs +2 -61
  169. package/node_modules/typebox/build/format/iri.d.mts +2 -2
  170. package/node_modules/typebox/build/format/iri.mjs +26 -8
  171. package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
  172. package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
  173. package/node_modules/typebox/build/format/regex.d.mts +1 -2
  174. package/node_modules/typebox/build/format/regex.mjs +2 -6
  175. package/node_modules/typebox/build/format/time.d.mts +2 -2
  176. package/node_modules/typebox/build/format/time.mjs +19 -14
  177. package/node_modules/typebox/build/format/uri.d.mts +1 -1
  178. package/node_modules/typebox/build/format/uri.mjs +3 -130
  179. package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
  180. package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
  181. package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
  182. package/node_modules/typebox/build/format/uri_template.mjs +4 -5
  183. package/node_modules/typebox/build/format/url.d.mts +3 -3
  184. package/node_modules/typebox/build/format/url.mjs +4 -5
  185. package/node_modules/typebox/build/guard/emit.d.mts +3 -1
  186. package/node_modules/typebox/build/guard/emit.mjs +12 -5
  187. package/node_modules/typebox/build/guard/guard.d.mts +8 -2
  188. package/node_modules/typebox/build/guard/guard.mjs +25 -4
  189. package/node_modules/typebox/build/guard/string.d.mts +2 -2
  190. package/node_modules/typebox/build/guard/string.mjs +7 -7
  191. package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
  192. package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
  193. package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
  194. package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
  195. package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
  196. package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
  197. package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
  198. package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
  199. package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
  200. package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
  201. package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
  202. package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
  203. package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
  204. package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
  205. package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
  206. package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
  207. package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
  208. package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
  209. package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
  210. package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
  211. package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
  212. package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
  213. package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
  214. package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
  215. package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
  216. package/node_modules/typebox/build/schema/types/index.mjs +0 -2
  217. package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
  218. package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
  219. package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
  220. package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
  221. package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
  222. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
  223. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
  224. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
  225. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
  226. package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
  227. package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
  228. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
  229. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
  230. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
  231. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
  232. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
  233. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
  234. package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
  235. package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
  236. package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
  237. package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
  238. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
  239. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
  240. package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
  241. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
  242. package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
  243. package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
  244. package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
  245. package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
  246. package/node_modules/typebox/build/type/script/parser.mjs +27 -23
  247. package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
  248. package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
  249. package/node_modules/typebox/package.json +27 -27
  250. package/node_modules/typebox/readme.md +79 -82
  251. package/openclaw.plugin.json +2 -1
  252. package/package.json +6 -6
  253. package/node_modules/baileys/node_modules/process-warning/types/index.test-d.ts +0 -36
  254. package/node_modules/typebox/build/format/_idna.d.mts +0 -2
  255. package/node_modules/typebox/build/format/_idna.mjs +0 -246
  256. package/node_modules/typebox/build/format/_puny.d.mts +0 -1
  257. package/node_modules/typebox/build/format/_puny.mjs +0 -77
  258. package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
  259. package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
  260. package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
  261. package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
  262. package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
  263. 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-pM-ExU0l.js";
3
- import { i as sendTypingWhatsApp, n as sendPollWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./send-CwvTU4RI.js";
2
+ import { n as whatsAppActionRuntime, t as handleWhatsAppAction } from "./action-runtime-Bw0loEdy.js";
3
+ import { i as sendTypingWhatsApp, n as sendPollWhatsApp, r as sendReactionWhatsApp, t as sendMessageWhatsApp } from "./send-DiPjiygK.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-CtpBqH5S.js";
8
- import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-HU41RHGI.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-DTj1H9pv.js";
8
+ import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-C7m81BNe.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-2T0_jZTN.js";
10
+ import { a as waitForWaConnection, i as newConnectionId, r as createWaSocket } from "./socket-close-CpkkJZCU.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-obOSm2cC.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-IzwQKizW.js";
14
- import { t as loginWeb } from "./login-BkpKpndm.js";
12
+ import { p as extractText, s as extractContactContext, u as extractLocationData } from "./send-api-kFcuhSiY.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-CTsyo-HE.js";
14
+ import { t as loginWeb } from "./login-Bk_jiXKD.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,13 +1,14 @@
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";
5
5
  import "./normalize-C7Hkc_vE.js";
6
- import { a as markdownToWhatsAppChunks, c as toWhatsappJid } from "./targets-runtime-TMk0lGuy.js";
7
- import { a as stripToolCallXmlTags, i as sanitizeAssistantVisibleTextWithProfile, r as sanitizeAssistantVisibleText } from "./text-runtime-CaKLhowd.js";
6
+ import { a as markdownToWhatsAppChunks, c as toWhatsappJid } from "./targets-runtime-RBjx3pg_.js";
7
+ import { a as stripToolCallXmlTags, i as sanitizeAssistantVisibleTextWithProfile, r as sanitizeAssistantVisibleText } from "./text-runtime-DyfmcATV.js";
8
8
  import path from "node:path";
9
9
  import { normalizeStringEntries, normalizeUniqueStringEntries, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
10
10
  import { resolveReactionLevel } from "openclaw/plugin-sdk/status-helpers";
11
+ import { createMessageReceiptFromOutboundResults, createReplyToFanout, listMessageReceiptPlatformIds, sanitizeForPlainText } from "openclaw/plugin-sdk/channel-outbound";
11
12
  import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
12
13
  import { generateSecureUuid } from "openclaw/plugin-sdk/core";
13
14
  import { PlatformMessageNotDispatchedError } from "openclaw/plugin-sdk/error-runtime";
@@ -22,17 +23,17 @@ import { extensionForMime, mediaKindFromMime, mimeTypeFromFilePath, normalizeMim
22
23
  import { AsyncLocalStorage } from "node:async_hooks";
23
24
  import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
24
25
  import { createChannelPartialDeliveryError, isChannelPartialDeliveryError } from "openclaw/plugin-sdk/channel-inbound";
25
- import { createMessageReceiptFromOutboundResults, listMessageReceiptPlatformIds, sanitizeForPlainText } from "openclaw/plugin-sdk/channel-outbound";
26
26
  import { MEDIA_FFMPEG_MAX_AUDIO_DURATION_SECS, transcodeAudioBufferToOpus } from "openclaw/plugin-sdk/media-runtime";
27
27
  import { resolveOutboundMediaUrls } from "openclaw/plugin-sdk/reply-payload";
28
28
  //#region extensions/whatsapp/src/reaction-level.ts
29
29
  /** Resolve the effective reaction level and its implications for WhatsApp. */
30
30
  function resolveWhatsAppReactionLevel(params) {
31
+ const account = resolveMergedWhatsAppAccountConfig({
32
+ cfg: params.cfg,
33
+ accountId: params.accountId
34
+ });
31
35
  return resolveReactionLevel({
32
- value: resolveMergedWhatsAppAccountConfig({
33
- cfg: params.cfg,
34
- accountId: params.accountId
35
- }).reactionLevel,
36
+ value: account.reactionLevel,
36
37
  defaultLevel: "minimal",
37
38
  invalidFallback: "minimal"
38
39
  });
@@ -494,9 +495,10 @@ async function sendMessageWhatsAppInActivityScope(to, body, options) {
494
495
  accountId: resolvedAccountId ?? options.accountId
495
496
  });
496
497
  const accountIdForFormatting = resolvedAccountId ?? options.accountId;
497
- const textLimit = Math.min(resolveTextChunkLimit(cfg, "whatsapp", accountIdForFormatting, { fallbackLimit: 4e3 }), 4096);
498
- const textChunks = markdownToWhatsAppChunks(text, textLimit, tableMode, resolveChunkMode(cfg, "whatsapp", accountIdForFormatting));
499
- text = textChunks.shift() ?? "";
498
+ const requestedLimit = options.formatting?.textLimit ?? Infinity;
499
+ const textLimit = Math.min(requestedLimit > 0 ? requestedLimit : Infinity, resolveTextChunkLimit(cfg, "whatsapp", accountIdForFormatting, { fallbackLimit: 4e3 }), 4096);
500
+ const textChunks = markdownToWhatsAppChunks(text, textLimit, tableMode, options.formatting?.chunkMode ?? resolveChunkMode(cfg, "whatsapp", accountIdForFormatting));
501
+ text = textChunks.shift() ?? text;
500
502
  if (!text && !hasMedia) return {
501
503
  messageId: "",
502
504
  toJid: jid
@@ -565,30 +567,52 @@ async function sendMessageWhatsAppInActivityScope(to, body, options) {
565
567
  }
566
568
  }
567
569
  const accountId = Boolean(options.accountId?.trim()) ? resolvedAccountId : void 0;
568
- const sendOptions = options.gifPlayback || forceDocumentDelivery || accountId || documentFileName || options.quotedMessageKey ? {
570
+ const trailingTextChunks = [visibleTextAfterVoice, ...textChunks].filter((chunk) => Boolean(chunk));
571
+ const reportProgress = trailingTextChunks.length > 0 ? options.onDeliveryResult : void 0;
572
+ const sendOptions = options.gifPlayback || forceDocumentDelivery || accountId || documentFileName ? {
569
573
  ...options.gifPlayback ? { gifPlayback: true } : {},
570
574
  ...forceDocumentDelivery ? { asDocument: true } : {},
571
575
  ...documentFileName ? { fileName: documentFileName } : {},
572
- ...options.quotedMessageKey ? { quotedMessageKey: options.quotedMessageKey } : {},
573
576
  accountId
574
577
  } : void 0;
575
- const result = requireWhatsAppAcceptedSendResult(sendOptions ? await active.sendMessage(to, text, mediaBuffer, mediaType, sendOptions) : await active.sendMessage(to, text, mediaBuffer, mediaType));
576
- acceptedResults.push(result);
577
- const messageId = result.messageId;
578
- const sentRemoteJid = resolveActualSentRemoteJid(result, jid);
579
- const trailingTextChunks = [visibleTextAfterVoice, ...textChunks].filter((chunk) => Boolean(chunk));
578
+ const quotedSendOptions = options.quotedMessageKey ? {
579
+ ...sendOptions,
580
+ quotedMessageKey: options.quotedMessageKey
581
+ } : sendOptions;
582
+ const nextReplyToId = createReplyToFanout({
583
+ replyToId: options.quotedMessageKey?.id,
584
+ replyToIdSource: options.replyToIdSource,
585
+ replyToMode: options.replyToMode
586
+ });
587
+ const sendPart = async (part, buffer, mime) => {
588
+ await options.onPlatformSendDispatch?.();
589
+ const replyToId = nextReplyToId();
590
+ const partOptions = replyToId ? quotedSendOptions : sendOptions;
591
+ const accepted = requireWhatsAppAcceptedSendResult(partOptions ? await active.sendMessage(to, part, buffer, mime, partOptions) : await active.sendMessage(to, part, buffer, mime));
592
+ acceptedResults.push(accepted);
593
+ const result = {
594
+ messageId: accepted.messageId,
595
+ toJid: resolveActualSentRemoteJid(accepted, jid)
596
+ };
597
+ return {
598
+ ...result,
599
+ ...reportProgress ? { receipt: createMessageReceiptFromOutboundResults({
600
+ results: [{
601
+ channel: "whatsapp",
602
+ ...result
603
+ }],
604
+ kind: buffer ? "media" : "text",
605
+ replyToId
606
+ }) } : {}
607
+ };
608
+ };
609
+ const result = await sendPart(text, mediaBuffer, mediaType);
610
+ const { messageId, toJid: sentRemoteJid } = result;
580
611
  if (trailingTextChunks.length > 0) {
581
- await options.onDeliveryResult?.({
582
- messageId,
583
- toJid: sentRemoteJid
584
- });
612
+ await reportProgress?.(result);
585
613
  for (const trailingText of trailingTextChunks) {
586
- const trailingResult = requireWhatsAppAcceptedSendResult(sendOptions ? await active.sendMessage(to, trailingText, void 0, void 0, sendOptions) : await active.sendMessage(to, trailingText, void 0, void 0));
587
- acceptedResults.push(trailingResult);
588
- await options.onDeliveryResult?.({
589
- messageId: trailingResult.messageId,
590
- toJid: resolveActualSentRemoteJid(trailingResult, jid)
591
- });
614
+ const trailingResult = await sendPart(trailingText);
615
+ await reportProgress?.(trailingResult);
592
616
  }
593
617
  }
594
618
  const durationMs = Date.now() - startedAt;
@@ -639,7 +663,8 @@ async function sendReactionWhatsApp(chatJid, messageId, emoji, options) {
639
663
  messageId
640
664
  });
641
665
  try {
642
- const redactedJid = redactIdentifier(toWhatsappJid(chatJid));
666
+ const jid = toWhatsappJid(chatJid);
667
+ const redactedJid = redactIdentifier(jid);
643
668
  outboundLog.info(`Sending reaction "${emoji}" -> message ${messageId}`);
644
669
  logger.info({
645
670
  chatJid: redactedJid,
@@ -1,10 +1,10 @@
1
1
  import { n as isWhatsAppNewsletterJid } from "./normalize-target-CugRyONv.js";
2
- import { _ as resolveWhatsAppDocumentFileName, f as mergeWhatsAppAcceptedSendError, m as rememberWhatsAppAcceptedSend, p as normalizeWhatsAppSendResult, u as combineWhatsAppSendResults } from "./send-CwvTU4RI.js";
2
+ import { _ as resolveWhatsAppDocumentFileName, f as mergeWhatsAppAcceptedSendError, m as rememberWhatsAppAcceptedSend, p as normalizeWhatsAppSendResult, u as combineWhatsAppSendResults } from "./send-DiPjiygK.js";
3
3
  import "./normalize-C7Hkc_vE.js";
4
- import { c as toWhatsappJid, l as toWhatsappJidWithLid, r as jidToE164 } from "./targets-runtime-TMk0lGuy.js";
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-CtpBqH5S.js";
4
+ import { c as toWhatsappJid, l as toWhatsappJidWithLid, r as jidToE164 } from "./targets-runtime-RBjx3pg_.js";
5
+ import "./text-runtime-DyfmcATV.js";
6
+ import { i as buildQuotedMessageOptions } from "./group-session-key-KUguLmSZ.js";
7
+ import { k as resolveComparableIdentity } from "./auth-store-DTj1H9pv.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";
@@ -401,7 +401,7 @@ async function addWhatsAppImagePreviewFields(content) {
401
401
  //#endregion
402
402
  //#region extensions/whatsapp/src/inbound/outbound-mentions.ts
403
403
  const CODE_FENCE_RE = /```[\s\S]*?```/g;
404
- const INLINE_CODE_RE = /`[^`\n]+`/g;
404
+ const INLINE_CODE_RE = /(?<=(?:^|[^\\])(?:\\\\)*)(`+)[\s\S]*?(?:(?<!`)\1(?!`)|$)/g;
405
405
  const OUTBOUND_MENTION_RE = /@(\+?\d+)/g;
406
406
  const KNOWN_USER_JID_RE = /^(\d+)(?::\d+)?@(s\.whatsapp\.net|hosted|lid|hosted\.lid|c\.us)$/i;
407
407
  const PHONE_JID_DOMAIN_RE = /^(s\.whatsapp\.net|hosted|c\.us)$/i;
@@ -625,43 +625,44 @@ function createWebSendApi(params) {
625
625
  text,
626
626
  mentionedJids: []
627
627
  } : await resolveMentions(jid, text);
628
- if (mediaBuffer && mediaType) if (sendOptions?.asDocument === true && supportsForcedDocumentMediaType(mediaType)) payload = {
629
- document: mediaBuffer,
630
- fileName: resolveWhatsAppDocumentFileName({
631
- fileName: sendOptions?.fileName,
628
+ if (mediaBuffer && mediaType) {
629
+ if (sendOptions?.asDocument === true && supportsForcedDocumentMediaType(mediaType)) payload = {
630
+ document: mediaBuffer,
631
+ fileName: resolveWhatsAppDocumentFileName({
632
+ fileName: sendOptions?.fileName,
633
+ mimetype: mediaType
634
+ }),
635
+ caption: resolvedPayloadText.text || void 0,
632
636
  mimetype: mediaType
633
- }),
634
- caption: resolvedPayloadText.text || void 0,
635
- mimetype: mediaType
636
- };
637
- else if (mediaType.startsWith("image/")) payload = await addWhatsAppImagePreviewFields({
638
- image: mediaBuffer,
639
- caption: resolvedPayloadText.text || void 0,
640
- mimetype: mediaType
641
- });
642
- else if (mediaType.startsWith("audio/")) payload = {
643
- audio: mediaBuffer,
644
- ptt: true,
645
- mimetype: mediaType
646
- };
647
- else if (mediaType.startsWith("video/")) {
648
- const gifPlayback = sendOptions?.gifPlayback;
649
- payload = {
650
- video: mediaBuffer,
637
+ };
638
+ else if (mediaType.startsWith("image/")) payload = await addWhatsAppImagePreviewFields({
639
+ image: mediaBuffer,
651
640
  caption: resolvedPayloadText.text || void 0,
652
- mimetype: mediaType,
653
- ...gifPlayback ? { gifPlayback: true } : {}
641
+ mimetype: mediaType
642
+ });
643
+ else if (mediaType.startsWith("audio/")) payload = {
644
+ audio: mediaBuffer,
645
+ ptt: true,
646
+ mimetype: mediaType
654
647
  };
655
- } else payload = {
656
- document: mediaBuffer,
657
- fileName: resolveWhatsAppDocumentFileName({
658
- fileName: sendOptions?.fileName,
648
+ else if (mediaType.startsWith("video/")) {
649
+ const gifPlayback = sendOptions?.gifPlayback;
650
+ payload = {
651
+ video: mediaBuffer,
652
+ caption: resolvedPayloadText.text || void 0,
653
+ mimetype: mediaType,
654
+ ...gifPlayback ? { gifPlayback: true } : {}
655
+ };
656
+ } else payload = {
657
+ document: mediaBuffer,
658
+ fileName: resolveWhatsAppDocumentFileName({
659
+ fileName: sendOptions?.fileName,
660
+ mimetype: mediaType
661
+ }),
662
+ caption: resolvedPayloadText.text || void 0,
659
663
  mimetype: mediaType
660
- }),
661
- caption: resolvedPayloadText.text || void 0,
662
- mimetype: mediaType
663
- };
664
- else payload = { text: resolvedPayloadText.text };
664
+ };
665
+ } else payload = { text: resolvedPayloadText.text };
665
666
  payload = addWhatsAppOutboundMentionsToContent(payload, resolvedPayloadText.mentionedJids);
666
667
  const quotedOpts = buildQuotedMessageOptions({
667
668
  messageId: sendOptions?.quotedMessageKey?.id,
@@ -717,7 +718,7 @@ function createWebSendApi(params) {
717
718
  },
718
719
  sendReaction: async (chatJid, messageId, emoji, fromMe, participant) => {
719
720
  const jid = resolveOutboundJid(chatJid);
720
- return normalizeWhatsAppSendResult(await params.sock.sendMessage(jid, { react: {
721
+ const result = await params.sock.sendMessage(jid, { react: {
721
722
  text: emoji,
722
723
  key: {
723
724
  remoteJid: jid,
@@ -725,7 +726,8 @@ function createWebSendApi(params) {
725
726
  fromMe,
726
727
  participant: participant ? toWhatsappJid(participant) : void 0
727
728
  }
728
- } }), "reaction");
729
+ } });
730
+ return normalizeWhatsAppSendResult(result, "reaction");
729
731
  },
730
732
  sendComposingTo: async (to) => {
731
733
  const jid = resolveOutboundJid(to);
@@ -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-wg42NKFB.js";
6
- import { DEFAULT_ACCOUNT_ID, createSetupTranslator, splitSetupEntries } from "openclaw/plugin-sdk/setup";
5
+ import { r as whatsappSetupAdapter } from "./shared-DDjonGys.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) {
@@ -94,7 +94,7 @@ async function detectWhatsAppLinked(cfg, accountId) {
94
94
  async function promptWhatsAppOwnerAllowFrom(params) {
95
95
  const { prompter, existingAllowFrom } = params;
96
96
  await prompter.note(t("wizard.whatsapp.ownerNumberNote"), t("wizard.whatsapp.numberTitle"));
97
- const normalized = normalizeWhatsAppAllowFromEntry(trimPromptText(await prompter.text({
97
+ const entry = await prompter.text({
98
98
  message: t("wizard.whatsapp.personalNumberPrompt"),
99
99
  placeholder: "+15555550123",
100
100
  initialValue: existingAllowFrom[0],
@@ -103,7 +103,8 @@ async function promptWhatsAppOwnerAllowFrom(params) {
103
103
  if (!raw) return t("common.required");
104
104
  if (!normalizeWhatsAppAllowFromEntry(raw)) return `Invalid number: ${raw}`;
105
105
  }
106
- })));
106
+ });
107
+ const normalized = normalizeWhatsAppAllowFromEntry(trimPromptText(entry));
107
108
  if (!normalized) throw new Error("Invalid WhatsApp owner number (expected E.164 after validation).");
108
109
  return {
109
110
  normalized,
@@ -295,7 +296,7 @@ async function finalizeWhatsAppSetup(params) {
295
296
  };
296
297
  let loginWeb;
297
298
  try {
298
- ({loginWeb} = await import("./login-BkpKpndm.js").then((n) => n.n));
299
+ ({loginWeb} = await import("./login-Bk_jiXKD.js").then((n) => n.n));
299
300
  } catch (error) {
300
301
  await reportLoginFailure(error);
301
302
  }
@@ -1,2 +1,2 @@
1
- import { t as whatsappSetupPlugin } from "./channel.setup-DhBBhbQv.js";
1
+ import { t as whatsappSetupPlugin } from "./channel.setup-aOFLSQyw.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-CtpBqH5S.js";
3
+ import { a as formatWhatsAppWebAuthStatusState, h as readWebAuthState } from "./auth-store-DTj1H9pv.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-n4K2I2gJ.js")).finalizeWhatsAppSetup(params),
39
+ finalize: async (params) => await (await import("./setup-finalize-CqH5wTK5.js")).finalizeWhatsAppSetup(params),
40
40
  disable: (cfg) => setSetupChannelEnabled(cfg, channel, false),
41
41
  onAccountRecorded: (accountId, options) => {
42
42
  options?.onAccountId?.(channel, accountId);
@@ -1,7 +1,7 @@
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
- import { t as WhatsAppChannelConfigSchema } from "./config-schema-BQP5YCeK.js";
4
+ import { t as WhatsAppChannelConfigSchema } from "./config-schema-BYA6e_Ii.js";
5
5
  import { n as whatsappDoctor } from "./doctor-CwzVXKoE.js";
6
6
  import { t as resolveWhatsAppConfigPath } from "./group-config-path-BGyzT9Lg.js";
7
7
  import { t as resolveLegacyGroupSessionKey } from "./group-session-contract-DDnZSsJ1.js";
@@ -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-CtpBqH5S.js").then((n) => n.i));
23
+ const loadWhatsAppAuthStore = createLazyRuntimeModule(() => import("./auth-store-DTj1H9pv.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-X3JC2gaq.js");
30
+ return await import("./channel.runtime-BwSnyXRX.js");
31
31
  });
32
32
  //#endregion
33
33
  //#region extensions/whatsapp/src/config-accessors.ts
@@ -96,7 +96,8 @@ function applyGroupAllowFromFromStore(params) {
96
96
  return changed ? next : params.cfg;
97
97
  }
98
98
  async function applyWhatsAppSecurityConfigFixes(params) {
99
- const normalized = normalizeUniqueStringEntries(await readChannelAllowFromStore("whatsapp", params.env, DEFAULT_ACCOUNT_ID).catch(() => []));
99
+ const fromStore = await readChannelAllowFromStore("whatsapp", params.env, DEFAULT_ACCOUNT_ID).catch(() => []);
100
+ const normalized = normalizeUniqueStringEntries(fromStore);
100
101
  if (normalized.length === 0) return {
101
102
  config: params.cfg,
102
103
  changes: []
@@ -115,7 +116,7 @@ async function applyWhatsAppSecurityConfigFixes(params) {
115
116
  //#region extensions/whatsapp/src/shared.ts
116
117
  const WHATSAPP_CHANNEL = "whatsapp";
117
118
  async function loadWhatsAppSetupSurface() {
118
- return await import("./setup-surface-Cwn3zyxK.js");
119
+ return await import("./setup-surface-Dm3T6S8t.js");
119
120
  }
120
121
  const whatsappSetupWizardProxy = createWhatsAppSetupWizardProxy(async () => (await loadWhatsAppSetupSurface()).whatsappSetupWizard);
121
122
  const whatsappConfigAdapter = createScopedChannelConfigAdapter({
@@ -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-CtpBqH5S.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-DTj1H9pv.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";
@@ -22,7 +22,7 @@ var WhatsAppConnectionOwnerBusyError = class extends Error {
22
22
  this.name = "WhatsAppConnectionOwnerBusyError";
23
23
  }
24
24
  };
25
- const OWNER_LOCK_STALE_MS = 5 * 6e4;
25
+ const OWNER_LOCK_STALE_MS = 3e5;
26
26
  const GATEWAY_LOCAL_OWNER_WAIT_MS = 15e4;
27
27
  const processOwners = /* @__PURE__ */ new Map();
28
28
  function ownershipCancelledError(signal) {
@@ -325,7 +325,8 @@ async function createWaSocket(printQr, verbose, opts = {}) {
325
325
  return await createWaSocketInternal(printQr, verbose, opts, "normal");
326
326
  }
327
327
  async function createWaSocketInternal(printQr, verbose, opts, receiveMode) {
328
- const logger = toPinoLikeLogger(getChildLogger({ module: "baileys" }, { level: verbose ? "info" : "silent" }), verbose ? "info" : "silent");
328
+ const baseLogger = getChildLogger({ module: "baileys" }, { level: verbose ? "info" : "silent" });
329
+ const logger = toPinoLikeLogger(baseLogger, verbose ? "info" : "silent");
329
330
  const authDir = resolveUserPath(opts.authDir ?? resolveDefaultWebAuthDir());
330
331
  await rejectUnsafeWebCredsPath(authDir);
331
332
  await opts.beforeCredentialPersistence?.();
@@ -357,13 +358,14 @@ async function createWaSocketInternal(printQr, verbose, opts, receiveMode) {
357
358
  else pendingSocketAbort = { error };
358
359
  opts.onCredentialPersistenceError?.(error);
359
360
  };
360
- const cachedSignalKeys = makeCacheableSignalKeyStore(opts.beforeCredentialPersistence ? {
361
+ const persistedSignalKeys = opts.beforeCredentialPersistence ? {
361
362
  ...state.keys,
362
363
  async set(data) {
363
364
  await opts.beforeCredentialPersistence?.();
364
365
  await state.keys.set(data);
365
366
  }
366
- } : state.keys, logger);
367
+ } : state.keys;
368
+ const cachedSignalKeys = makeCacheableSignalKeyStore(persistedSignalKeys, logger);
367
369
  const signalKeys = opts.beforeCredentialPersistence ? {
368
370
  ...cachedSignalKeys,
369
371
  get(type, ids) {
@@ -542,7 +544,8 @@ async function waitForWaConnection(sock, options = { timeout: "none" }) {
542
544
  }
543
545
  if (update.connection === "close") {
544
546
  cleanup();
545
- reject(toErrorObject(update.lastDisconnect?.error ?? update.lastDisconnect ?? /* @__PURE__ */ new Error("Connection closed"), "Non-Error rejection"));
547
+ const disconnectError = update.lastDisconnect?.error ?? update.lastDisconnect;
548
+ reject(toErrorObject(disconnectError ?? /* @__PURE__ */ new Error("Connection closed"), "Non-Error rejection"));
546
549
  }
547
550
  };
548
551
  sock.ev.on("connection.update", handler);
@@ -282,8 +282,7 @@ function markdownToWhatsAppChunks(text, limit, tableMode = "bullets", chunkMode
282
282
  if (!text.trim()) return chunkMarkdownTextWithMode(text, limit, chunkMode);
283
283
  const { ir, escapedMarkers } = prepareWhatsAppMarkdown(text, tableMode);
284
284
  const render = (chunk) => renderWhatsAppMarkdownIR(chunk, escapedMarkers);
285
- const rendered = render(ir);
286
- let chunks = ir.styles.length === 0 && ir.links.length === 0 ? chunkMarkdownTextWithMode(rendered, limit, chunkMode) : splitWhatsAppIRForChunkMode(ir, limit, chunkMode).flatMap((source) => renderMarkdownIRChunksWithinLimit({
285
+ let chunks = ir.styles.length === 0 && ir.links.length === 0 ? chunkMarkdownTextWithMode(render(ir), limit, chunkMode) : splitWhatsAppIRForChunkMode(ir, limit, chunkMode).flatMap((source) => renderMarkdownIRChunksWithinLimit({
287
286
  ir: source,
288
287
  limit,
289
288
  renderChunk: render,
@@ -1,4 +1,4 @@
1
- import "./targets-runtime-TMk0lGuy.js";
1
+ import "./targets-runtime-RBjx3pg_.js";
2
2
  import { sanitizeAssistantVisibleText, sanitizeAssistantVisibleTextWithProfile, stripToolCallXmlTags } from "openclaw/plugin-sdk/text-chunking";
3
3
  import { normalizeE164, resolveUserPath as resolveUserPath$1 } from "openclaw/plugin-sdk/text-utility-runtime";
4
4
  export { stripToolCallXmlTags as a, sanitizeAssistantVisibleTextWithProfile as i, resolveUserPath$1 as n, sanitizeAssistantVisibleText as r, normalizeE164 as t };
@@ -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,WAAW,EACX,UAAU,EACV,gBAAgB,EAGhB,iBAAiB,EAEjB,YAAY,EAEZ,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,aAAa,EAEb,UAAU,EACV,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAqBrD,OAAO,EACN,KAAK,UAAU,EAWf,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,UAAU,EAAa,MAAM,YAAY,CAAA;AAGlD,eAAO,MAAM,eAAe,GAAI,QAAQ,YAAY;;QA8BlD,oFAAoF;;QAEpF,+EAA+E;;QAE/E,iFAAiF;;;2BAqqB9C,OAAO,GAAG,OAAO,UAAU;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,cAAc,MAAM;;;;;;;;;;;;;;;;;;4BA2HnE,aAAa;+BArGV,UAAU,UAAU,MAAM;+BA8C1B,MAAM;6BA5GR,MAAM,SAAQ,SAAS,GAAG,OAAO,cAA0B,MAAM;;2BAjdnE,MAAM,EAAE;yCAaM,MAAM,EAAE;gCAepD,MAAM,WACF,aAAa,eACT;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;gCAmCN,MAAM;kCA0BJ,MAAM;8BAkBV,MAAM;6BAkBP,MAAM,UAAU,OAAO,GAAG,SAAS;2DAooBX,OAAO;+BAr1B7B,kBAAkB;mCAJd,sBAAsB;mCAQtB,cAAc;iCAIhB,oBAAoB;yCAIZ,cAAc;iCAItB,cAAc;uCAIR,mBAAmB;oCAItB,sBAAsB;8CAIZ,MAAM;8BAqPtB,MAAM,KAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;;sBA4jBxD,gBAAgB,OAAO,MAAM;2BA1gBlB,cAAc,GAAG,QAAQ,kBAAkB,MAAM,GAAG,MAAM;4BA6iB/D,MAAM,WAAW,KAAK,CAAC,eAAe,CAAC,cAAc;yBAYxD,MAAM;;oBAYX,MAAM,UAAU,eAAe;wBAc3B,MAAM,WAAW,MAAM;2BAcpB,MAAM,WAAW,MAAM;2BAcvB,MAAM,aAAa,MAAM,WAAW,MAAM;8BAevC,MAAM,aAAa,MAAM,WAAW,MAAM;gBAhGxD,MAAM,YAAY;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,QAAQ,OAAO;sCA+G7C,gBAAgB;kCAYpB,MAAM;;;;;;0DAxlC5B,GAAG,0BAA0B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAi7C/C,CAAA"}
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,WAAW,EACX,UAAU,EACV,gBAAgB,EAGhB,iBAAiB,EAEjB,YAAY,EAEZ,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,aAAa,EAEb,UAAU,EACV,kBAAkB,EAClB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,MAAM,UAAU,CAAA;AAEjB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAqBrD,OAAO,EACN,KAAK,UAAU,EAWf,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,UAAU,EAAa,MAAM,YAAY,CAAA;AAGlD,eAAO,MAAM,+BAA+B,GAC3C,MAAM,SAAS,GAAG,OAAO,EACzB,iBAAiB,UAAU,EAAE,KAC3B,UAAU,EAOZ,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,QAAQ,YAAY;;QA8BlD,oFAAoF;;QAEpF,+EAA+E;;QAE/E,iFAAiF;;;2BAkqB9C,OAAO,GAAG,OAAO,UAAU;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,cAAc,MAAM;;;;;;;;;;;;;;;;;;4BA2HnE,aAAa;+BArGV,UAAU,UAAU,MAAM;+BA8C1B,MAAM;6BAzGR,MAAM,SAAQ,SAAS,GAAG,OAAO,cAA0B,MAAM;;2BAjdnE,MAAM,EAAE;yCAaM,MAAM,EAAE;gCAepD,MAAM,WACF,aAAa,eACT;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;gCAmCN,MAAM;kCA0BJ,MAAM;8BAkBV,MAAM;6BAkBP,MAAM,UAAU,OAAO,GAAG,SAAS;2DAioBX,OAAO;+BAl1B7B,kBAAkB;mCAJd,sBAAsB;mCAQtB,cAAc;iCAIhB,oBAAoB;yCAIZ,cAAc;iCAItB,cAAc;uCAIR,mBAAmB;oCAItB,sBAAsB;8CAIZ,MAAM;8BAqPtB,MAAM,KAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC;;sBAyjBxD,gBAAgB,OAAO,MAAM;2BAvgBlB,cAAc,GAAG,QAAQ,kBAAkB,MAAM,GAAG,MAAM;4BA0iB/D,MAAM,WAAW,KAAK,CAAC,eAAe,CAAC,cAAc;yBAYxD,MAAM;;oBAYX,MAAM,UAAU,eAAe;wBAc3B,MAAM,WAAW,MAAM;2BAcpB,MAAM,WAAW,MAAM;2BAcvB,MAAM,aAAa,MAAM,WAAW,MAAM;8BAevC,MAAM,aAAa,MAAM,WAAW,MAAM;gBAhGxD,MAAM,YAAY;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,EAAE,QAAQ,OAAO;sCA+G7C,gBAAgB;kCAYpB,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;