@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,23 +1,24 @@
1
- import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-BX2fZUyR.js";
2
- import { c as normalizeWhatsAppPayloadTextPreservingIndentation, d as listWhatsAppSendResultMessageIds, f as mergeWhatsAppAcceptedSendError, g as withWhatsAppLogicalDeliveryActivity, h as rememberWhatsAppPartialSend, l as prepareWhatsAppOutboundMedia, m as rememberWhatsAppAcceptedSend, o as normalizeWhatsAppOutboundPayload, p as normalizeWhatsAppSendResult, r as sendReactionWhatsApp, v as resolveWhatsAppReactionLevel } from "./send-CwvTU4RI.js";
1
+ import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-CeKQbu_s.js";
2
+ import { c as normalizeWhatsAppPayloadTextPreservingIndentation, d as listWhatsAppSendResultMessageIds, f as mergeWhatsAppAcceptedSendError, g as withWhatsAppLogicalDeliveryActivity, h as rememberWhatsAppPartialSend, l as prepareWhatsAppOutboundMedia, m as rememberWhatsAppAcceptedSend, o as normalizeWhatsAppOutboundPayload, p as normalizeWhatsAppSendResult, r as sendReactionWhatsApp, v as resolveWhatsAppReactionLevel } from "./send-DiPjiygK.js";
3
3
  import { i as getWhatsAppRuntime } from "./runtime-BLlToOi6.js";
4
4
  import { r as getWhatsAppConnectionController } from "./connection-controller-runtime-context-DG0tuYuw.js";
5
- import { a as markdownToWhatsAppChunks, c as toWhatsappJid, l as toWhatsappJidWithLid, n as isSelfChatMode, o as resolveEquivalentWhatsAppDirectChatJids, r as jidToE164, s as resolveJidToE164 } from "./targets-runtime-TMk0lGuy.js";
6
- import { t as normalizeE164 } from "./text-runtime-CaKLhowd.js";
7
- import { a as cacheInboundMessageMeta, i as buildQuotedMessageOptions, n as resolveWhatsAppGroupSessionRoute, o as lookupInboundMessageMeta, r as resolveWhatsAppLegacyGroupSessionKey } from "./group-session-key-DmFc_Cqi.js";
8
- import { C as getMentionIdentities, D as getSenderIdentity, E as getSelfIdentity, O as identitiesOverlap, S as getComparableIdentityValues, T as getReplyContext, g as readWebSelfId, k as resolveComparableIdentity, o as getWebAuthAgeMs, r as WhatsAppAuthUnstableError, v as readWebSelfIdentityForDecision, w as getPrimaryIdentityId } from "./auth-store-CtpBqH5S.js";
5
+ import { a as markdownToWhatsAppChunks, c as toWhatsappJid, l as toWhatsappJidWithLid, n as isSelfChatMode, o as resolveEquivalentWhatsAppDirectChatJids, r as jidToE164, s as resolveJidToE164 } from "./targets-runtime-RBjx3pg_.js";
6
+ import { t as normalizeE164 } from "./text-runtime-DyfmcATV.js";
7
+ import { a as cacheInboundMessageMeta, i as buildQuotedMessageOptions, n as resolveWhatsAppGroupSessionRoute, o as lookupInboundMessageMeta, r as resolveWhatsAppLegacyGroupSessionKey } from "./group-session-key-KUguLmSZ.js";
8
+ import { C as getMentionIdentities, D as getSenderIdentity, E as getSelfIdentity, O as identitiesOverlap, S as getComparableIdentityValues, T as getReplyContext, g as readWebSelfId, k as resolveComparableIdentity, o as getWebAuthAgeMs, r as WhatsAppAuthUnstableError, v as readWebSelfIdentityForDecision, w as getPrimaryIdentityId } from "./auth-store-DTj1H9pv.js";
9
9
  import { n as resolveWhatsAppGroupsConfigPath } from "./group-config-path-BGyzT9Lg.js";
10
- import { a as waitForWaConnection, c as isWhatsAppSocketOperationTimeoutError, d as withWhatsAppSocketOperationTimeout, l as resolveWhatsAppSocketOperationTimeoutMs, r as createWaSocket, s as createWhatsAppSocketOperationTimeoutAdapter, u as resolveWhatsAppSocketTiming } from "./socket-close-2T0_jZTN.js";
10
+ import { a as waitForWaConnection, c as isWhatsAppSocketOperationTimeoutError, d as withWhatsAppSocketOperationTimeout, l as resolveWhatsAppSocketOperationTimeoutMs, r as createWaSocket, s as createWhatsAppSocketOperationTimeoutAdapter, u as resolveWhatsAppSocketTiming } from "./socket-close-CpkkJZCU.js";
11
11
  import { n as getStatusCode, t as formatError } from "./session-errors-JuazczrA.js";
12
12
  import { t as BufferJSON } from "./session.runtime-Nsqaehbd.js";
13
- import { _ as resolveInboundMediaMimetype, a as addWhatsAppImagePreviewFields, c as extractContextInfo, d as extractMediaKind, f as extractMentionedJids, g as projectWhatsAppInboundMessage, h as hasInboundUserContent, i as resolveWhatsAppOutboundMentions, l as extractExternalAdReplyContext, n as addWhatsAppOutboundMentionsToContent, o as describeReplyContext, p as extractText, r as mayContainWhatsAppOutboundMention, s as extractContactContext, t as createWebSendApi, u as extractLocationData } from "./send-api-obOSm2cC.js";
13
+ import { _ as resolveInboundMediaMimetype, a as addWhatsAppImagePreviewFields, c as extractContextInfo, d as extractMediaKind, f as extractMentionedJids, g as projectWhatsAppInboundMessage, h as hasInboundUserContent, i as resolveWhatsAppOutboundMentions, l as extractExternalAdReplyContext, n as addWhatsAppOutboundMentionsToContent, o as describeReplyContext, p as extractText, r as mayContainWhatsAppOutboundMention, s as extractContactContext, t as createWebSendApi, u as extractLocationData } from "./send-api-kFcuhSiY.js";
14
14
  import { t as resolveWhatsAppRuntimeGroupPolicy } from "./runtime-group-policy-DeSRFXEV.js";
15
- import { c as computeBackoff, d as resolveReconnectPolicy, f as sleepWithAbort, l as newConnectionId, n as WHATSAPP_WATCHDOG_TIMEOUT_ERROR, r as WhatsAppConnectionController, s as DEFAULT_RECONNECT_POLICY, u as resolveHeartbeatSeconds } from "./connection-controller-CIYuBJrs.js";
16
- import { n as maybeResolveWhatsAppApprovalReaction } from "./approval-reactions-Jyr1JaAK.js";
17
- import { t as maybeResolveWhatsAppQuestionReaction } from "./question-reactions-D3eAeB0i.js";
18
- import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
15
+ import { c as computeBackoff, d as resolveReconnectPolicy, f as sleepWithAbort, l as newConnectionId, n as WHATSAPP_WATCHDOG_TIMEOUT_ERROR, r as WhatsAppConnectionController, s as DEFAULT_RECONNECT_POLICY, u as resolveHeartbeatSeconds } from "./connection-controller-BvkxsbWi.js";
16
+ import { n as maybeResolveWhatsAppApprovalReaction } from "./approval-reactions-DGDA6hQ7.js";
17
+ import { t as maybeResolveWhatsAppQuestionReaction } from "./question-reactions-B9D6MHXZ.js";
18
+ import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
19
19
  import { filterSupplementalContextItems, resolvePinnedMainDmOwnerFromAllowlist } from "openclaw/plugin-sdk/security-runtime";
20
20
  import { createAckReactionHandle, createStatusReactionController, logAckFailure, removeAckReactionHandleAfterReply, shouldAckReaction } from "openclaw/plugin-sdk/channel-feedback";
21
+ import { bindIngressLifecycleToReplyOptions, createChannelIngressMonitor, createChannelMessageReplyPipeline, createMessageReceiptFromOutboundResults, listMessageReceiptPlatformIds, resolveChannelMessageSourceReplyDeliveryMode, resolveChannelStreamingBlockEnabled } from "openclaw/plugin-sdk/channel-outbound";
21
22
  import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
22
23
  import { PlatformMessageNotDispatchedError } from "openclaw/plugin-sdk/error-runtime";
23
24
  import { createSubsystemLogger, getChildLogger, redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
@@ -26,9 +27,8 @@ import { createSubsystemLogger as createSubsystemLogger$1, defaultRuntime, forma
26
27
  import { registerChannelRuntimeContext } from "openclaw/plugin-sdk/channel-runtime-context";
27
28
  import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
28
29
  import { buildChannelInboundEventContext, createChannelPartialDeliveryError, filterChannelInboundQuoteContext, formatInboundEnvelope, formatInboundEnvelope as formatInboundEnvelope$1, formatInboundMediaUnavailableText, formatLocationText, formatMediaPlaceholderText, hasVisibleInboundReplyDispatch, isChannelPartialDeliveryError, readAgentRunTerminalOutcome, resolveInboundSessionEnvelopeContext, resolveInboundSupplementalSenderAllowed, runChannelInboundEvent, shouldDebounceTextInbound, toInboundMediaFactsWithMetadata, toLocationContext } from "openclaw/plugin-sdk/channel-inbound";
29
- import { bindIngressLifecycleToReplyOptions, createChannelIngressMonitor, createChannelMessageReplyPipeline, createMessageReceiptFromOutboundResults, listMessageReceiptPlatformIds, resolveChannelMessageSourceReplyDeliveryMode, resolveChannelStreamingBlockEnabled } from "openclaw/plugin-sdk/channel-outbound";
30
30
  import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/media-runtime";
31
- import { isReasoningReplyPayload, resolveSendableOutboundReplyParts, sendMediaWithLeadingCaption } from "openclaw/plugin-sdk/reply-payload";
31
+ import { isReasoningReplyPayload, resolveSendableOutboundReplyParts, resolveTextChunksWithFallback, sendMediaWithLeadingCaption } from "openclaw/plugin-sdk/reply-payload";
32
32
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
33
33
  import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
34
34
  import { DisconnectReason, downloadMediaMessage, isHostedLidUser, isHostedPnUser, isJidGroup, isJidGroup as isJidGroup$1, jidDecode, jidEncode, jidNormalizedUser, normalizeMessageContent as normalizeMessageContent$1 } from "baileys";
@@ -357,7 +357,7 @@ function createWhatsAppIngressMonitor(params) {
357
357
  deliver: (admission, lifecycle) => params.dispatch(admission, lifecycle),
358
358
  pollIntervalMs: params.pollIntervalMs,
359
359
  retention: {
360
- completedTtlMs: 10080 * 60 * 1e3,
360
+ completedTtlMs: 6048e5,
361
361
  completedMaxEntries: 5e3,
362
362
  failedMaxEntries: 450
363
363
  },
@@ -381,7 +381,7 @@ function createWhatsAppIngressMonitor(params) {
381
381
  }
382
382
  //#endregion
383
383
  //#region extensions/whatsapp/src/inbound/group-metadata-cache.ts
384
- const GROUP_META_TTL_MS = 300 * 1e3;
384
+ const GROUP_META_TTL_MS = 3e5;
385
385
  const WHATSAPP_GROUP_METADATA_CACHE_MAX_ENTRIES = 500;
386
386
  function resolveGroupMetadataExpiresAt(nowRaw = Date.now()) {
387
387
  const now = asDateTimestampMs(nowRaw);
@@ -416,8 +416,7 @@ function readGroupMetadataCacheEntry(cache, jid) {
416
416
  function createWhatsAppGroupMetadataCacheOwner(params) {
417
417
  const reconnectCache = params.reconnectCache ?? /* @__PURE__ */ new Map();
418
418
  const localCache = /* @__PURE__ */ new Map();
419
- const publishedJids = /* @__PURE__ */ new Set();
420
- const invalidatedJids = /* @__PURE__ */ new Set();
419
+ const groupMetadataGenerations = /* @__PURE__ */ new Map();
421
420
  const detachListeners = [];
422
421
  let closed = false;
423
422
  let started = false;
@@ -447,46 +446,51 @@ function createWhatsAppGroupMetadataCacheOwner(params) {
447
446
  });
448
447
  const rememberFullUpdate = (jid, meta) => {
449
448
  if (closed) return;
449
+ groupMetadataGenerations.set(jid, {});
450
450
  rememberWhatsAppBaileysCacheEntry(params.baileysCache, jid, meta, GROUP_META_TTL_MS);
451
- publishedJids.add(jid);
452
- invalidatedJids.delete(jid);
453
451
  rememberGroupMetadataCacheEntry(reconnectCache, jid, summarizeForReconnect(meta));
454
452
  localCache.delete(jid);
455
453
  };
456
454
  const forgetFullMetadata = (jid) => {
455
+ groupMetadataGenerations.set(jid, {});
457
456
  params.baileysCache?.delete(jid);
458
457
  reconnectCache.delete(jid);
459
458
  localCache.delete(jid);
460
- publishedJids.delete(jid);
461
- invalidatedJids.add(jid);
462
459
  };
463
460
  const get = async (jid) => {
464
- const cached = readGroupMetadataCacheEntry(localCache, jid);
465
- if (cached) return cached;
466
- try {
467
- const hydratedEntry = params.baileysCache?.get(jid);
468
- const providerMetadata = params.baileysCache ? readWhatsAppBaileysCacheEntry(params.baileysCache, jid) : void 0;
469
- const hydratedMetadata = providerMetadata?.participants?.length ? providerMetadata : void 0;
470
- const meta = hydratedMetadata ?? await (params.getCurrentSock() ?? params.sock).groupMetadata(jid);
471
- if (!hydratedMetadata) rememberWhatsAppBaileysCacheEntry(params.baileysCache, jid, meta, GROUP_META_TTL_MS);
472
- publishedJids.add(jid);
473
- const entry = await summarize(meta);
474
- if (hydratedMetadata && hydratedEntry) entry.expires = hydratedEntry.expiresAt;
475
- rememberGroupMetadataCacheEntry(reconnectCache, jid, {
476
- subject: entry.subject,
477
- expires: entry.expires
478
- });
479
- rememberGroupMetadataCacheEntry(localCache, jid, entry);
480
- return entry;
481
- } catch (error) {
482
- const hydrated = readGroupMetadataCacheEntry(reconnectCache, jid);
483
- if (hydrated) {
484
- rememberGroupMetadataCacheEntry(localCache, jid, hydrated);
485
- params.logVerbose(`Using cached group metadata for ${jid} after fetch failure: ${String(error)}`);
486
- return hydrated;
461
+ for (;;) {
462
+ if (closed) return { expires: resolveGroupMetadataExpiresAt() ?? 0 };
463
+ const cached = readGroupMetadataCacheEntry(localCache, jid);
464
+ if (cached) return cached;
465
+ const generation = groupMetadataGenerations.get(jid);
466
+ try {
467
+ const hydratedEntry = params.baileysCache?.get(jid);
468
+ const providerMetadata = params.baileysCache ? readWhatsAppBaileysCacheEntry(params.baileysCache, jid) : void 0;
469
+ const hydratedMetadata = providerMetadata?.participants?.length ? providerMetadata : void 0;
470
+ const meta = hydratedMetadata ?? await (params.getCurrentSock() ?? params.sock).groupMetadata(jid);
471
+ if (closed || groupMetadataGenerations.get(jid) !== generation) continue;
472
+ const entry = await summarize(meta);
473
+ if (closed || groupMetadataGenerations.get(jid) !== generation) continue;
474
+ if (hydratedMetadata && hydratedEntry) entry.expires = hydratedEntry.expiresAt;
475
+ else rememberWhatsAppBaileysCacheEntry(params.baileysCache, jid, meta, GROUP_META_TTL_MS);
476
+ groupMetadataGenerations.set(jid, {});
477
+ rememberGroupMetadataCacheEntry(reconnectCache, jid, {
478
+ subject: entry.subject,
479
+ expires: entry.expires
480
+ });
481
+ rememberGroupMetadataCacheEntry(localCache, jid, entry);
482
+ return entry;
483
+ } catch (error) {
484
+ if (closed || groupMetadataGenerations.get(jid) !== generation) continue;
485
+ const hydrated = readGroupMetadataCacheEntry(reconnectCache, jid);
486
+ if (hydrated) {
487
+ rememberGroupMetadataCacheEntry(localCache, jid, hydrated);
488
+ params.logVerbose(`Using cached group metadata for ${jid} after fetch failure: ${String(error)}`);
489
+ return hydrated;
490
+ }
491
+ params.logVerbose(`Failed to fetch group metadata for ${jid}: ${String(error)}`);
492
+ return { expires: resolveGroupMetadataExpiresAt() ?? 0 };
487
493
  }
488
- params.logVerbose(`Failed to fetch group metadata for ${jid}: ${String(error)}`);
489
- return { expires: resolveGroupMetadataExpiresAt() ?? 0 };
490
494
  }
491
495
  };
492
496
  const resolveOutboundMentions = async (jid, text) => {
@@ -494,10 +498,11 @@ function createWhatsAppGroupMetadataCacheOwner(params) {
494
498
  text,
495
499
  mentionedJids: []
496
500
  };
501
+ const meta = await get(jid);
497
502
  return resolveWhatsAppOutboundMentions({
498
503
  chatJid: jid,
499
504
  text,
500
- participants: (await get(jid)).mentionParticipants
505
+ participants: meta.mentionParticipants
501
506
  });
502
507
  };
503
508
  const applyOutboundMentions = async (jid, content) => {
@@ -544,10 +549,10 @@ function createWhatsAppGroupMetadataCacheOwner(params) {
544
549
  try {
545
550
  const groups = await params.sock.groupFetchAllParticipating();
546
551
  if (closed) return;
547
- for (const [jid, meta] of Object.entries(groups ?? {})) if (meta && !publishedJids.has(jid) && !invalidatedJids.has(jid)) {
552
+ for (const [jid, meta] of Object.entries(groups ?? {})) if (meta && !groupMetadataGenerations.has(jid)) {
548
553
  rememberGroupMetadataCacheEntry(reconnectCache, jid, summarizeForReconnect(meta));
549
554
  rememberWhatsAppBaileysCacheEntry(params.baileysCache, jid, meta, GROUP_META_TTL_MS);
550
- publishedJids.add(jid);
555
+ groupMetadataGenerations.set(jid, {});
551
556
  }
552
557
  params.logVerbose(`Hydrated ${Object.keys(groups ?? {}).length} participating groups on connect`);
553
558
  } catch (error) {
@@ -744,26 +749,28 @@ function createWhatsAppInboundMessageDebouncer(options) {
744
749
  function unwrapMessage(message) {
745
750
  return normalizeMessageContent$1(message);
746
751
  }
747
- async function downloadInboundMedia(msg, sock, maxBytes = 50 * 1024 * 1024, normalizedMessage) {
752
+ async function downloadInboundMedia(msg, sock, maxBytes = 52428800, normalizedMessage) {
748
753
  const message = normalizedMessage ?? unwrapMessage(msg.message);
749
754
  if (!message) return;
750
755
  const mimetype = resolveInboundMediaMimetype(message);
751
756
  const fileName = message.documentMessage?.fileName ?? void 0;
752
757
  if (!message.imageMessage && !message.videoMessage && !message.ptvMessage && !message.documentMessage && !message.audioMessage && !message.stickerMessage) return;
758
+ const stream = await downloadMediaMessage(msg, "stream", {}, {
759
+ reuploadRequest: sock.updateMediaMessage,
760
+ logger: sock.logger
761
+ });
753
762
  return {
754
- saved: await saveMediaStream(await downloadMediaMessage(msg, "stream", {}, {
755
- reuploadRequest: sock.updateMediaMessage,
756
- logger: sock.logger
757
- }), mimetype, "inbound", maxBytes, fileName).catch((err) => {
758
- if (err instanceof Error && /Media exceeds/i.test(err.message)) throw new Error(`Media exceeds ${Math.round(maxBytes / (1024 * 1024))}MB limit`);
763
+ saved: await saveMediaStream(stream, mimetype, "inbound", maxBytes, fileName).catch((err) => {
764
+ if (err instanceof Error && /Media exceeds/i.test(err.message)) throw new Error(`Media exceeds ${Math.round(maxBytes / 1048576)}MB limit`);
759
765
  throw err;
760
766
  }),
761
767
  mimetype,
762
768
  fileName
763
769
  };
764
770
  }
765
- async function downloadQuotedInboundMedia(msg, sock, maxBytes = 50 * 1024 * 1024) {
766
- const contextInfo = extractContextInfo(unwrapMessage(msg.message));
771
+ async function downloadQuotedInboundMedia(msg, sock, maxBytes = 52428800) {
772
+ const message = unwrapMessage(msg.message);
773
+ const contextInfo = extractContextInfo(message);
767
774
  if (!contextInfo?.quotedMessage) return;
768
775
  const quotedMessage = contextInfo.quotedMessage;
769
776
  const self = sock.user;
@@ -788,7 +795,9 @@ async function downloadQuotedInboundMedia(msg, sock, maxBytes = 50 * 1024 * 1024
788
795
  const inboundMediaLogger = createSubsystemLogger("gateway/channels/whatsapp").child("inbound");
789
796
  const MAX_MEDIA_ERROR_MESSAGE_CHARS = 256;
790
797
  function sanitizeMediaErrorMessage(error) {
791
- return truncateUtf16Safe(redactToolPayloadText(error instanceof Error ? error.message : String(error)).replace(/https?:\/\/\S+/giu, "[redacted-url]").replace(/\b[^@\s]+@[a-z][a-z\d.-]*\b/giu, "[redacted-jid]").replace(/\+?\d[\d ().-]{6,}\d/gu, "[redacted-phone]").split("\n", 1)[0]?.trim() || "unknown error", MAX_MEDIA_ERROR_MESSAGE_CHARS);
798
+ const rawMessage = error instanceof Error ? error.message : String(error);
799
+ const redacted = redactToolPayloadText(rawMessage).replace(/https?:\/\/\S+/giu, "[redacted-url]").replace(/\b[^@\s]+@[a-z][a-z\d.-]*\b/giu, "[redacted-jid]").replace(/\+?\d[\d ().-]{6,}\d/gu, "[redacted-phone]");
800
+ return truncateUtf16Safe(redacted.split("\n", 1)[0]?.trim() || "unknown error", MAX_MEDIA_ERROR_MESSAGE_CHARS);
792
801
  }
793
802
  function logMediaMaterializationFailure(params) {
794
803
  const errorClass = params.error instanceof Error && /^[A-Za-z][A-Za-z0-9_.-]{0,63}$/u.test(params.error.name) ? params.error.name : "Error";
@@ -997,7 +1006,7 @@ async function checkInboundAccessControl(params) {
997
1006
  //#endregion
998
1007
  //#region extensions/whatsapp/src/inbound/dedupe.ts
999
1008
  const recentOutboundMessages = createDedupeCache({
1000
- ttlMs: 20 * 6e4,
1009
+ ttlMs: 12e5,
1001
1010
  maxSize: 5e3
1002
1011
  });
1003
1012
  function buildMessageKey(params) {
@@ -1211,11 +1220,13 @@ function createWhatsAppMessageDeliveryCoordinator(options) {
1211
1220
  };
1212
1221
  const reply = async (text, optionsResult) => {
1213
1222
  const resolved = await groupMetadata.resolveOutboundMentions(chatJid, text);
1214
- return normalizeWhatsAppSendResult(await sendTrackedMessage(chatJid, addWhatsAppOutboundMentionsToContent({ text: resolved.text }, resolved.mentionedJids), optionsResult), "text");
1223
+ const result = await sendTrackedMessage(chatJid, addWhatsAppOutboundMentionsToContent({ text: resolved.text }, resolved.mentionedJids), optionsResult);
1224
+ return normalizeWhatsAppSendResult(result, "text");
1215
1225
  };
1216
1226
  const sendMedia = async (payload, optionsValue) => {
1217
1227
  const previewPayload = await addWhatsAppImagePreviewFields(payload);
1218
- return normalizeWhatsAppSendResult(await sendTrackedMessage(chatJid, await groupMetadata.applyOutboundMentions(chatJid, previewPayload), optionsValue), "media");
1228
+ const result = await sendTrackedMessage(chatJid, await groupMetadata.applyOutboundMentions(chatJid, previewPayload), optionsValue);
1229
+ return normalizeWhatsAppSendResult(result, "media");
1219
1230
  };
1220
1231
  const timestamp = inbound.messageTimestampMs;
1221
1232
  const mentionedJids = enriched.mentionedJids;
@@ -1435,14 +1446,15 @@ function createWhatsAppMessageDeliveryCoordinator(options) {
1435
1446
  finishPreparation(void 0);
1436
1447
  const inbound = await normalizeInboundMessage(msg);
1437
1448
  if (inbound) await maybeMarkNonSelfChatReadReceipt(inbound, buildReadReceiptTarget(inbound));
1438
- } else if (result.kind === "durable" && result.queueResult.kind === "accepted") if (skipRecentOutboundEcho) finishPreparation(null);
1439
- else try {
1440
- finishPreparation(await normalizeInboundMessage(msg), true);
1441
- } catch (error) {
1442
- finishPreparation(void 0);
1443
- inboundLogger.warn({ error: formatError(error) }, "failed preparing WhatsApp inbound identity; durable drain will normalize again");
1444
- }
1445
- else finishPreparation(void 0);
1449
+ } else if (result.kind === "durable" && result.queueResult.kind === "accepted") {
1450
+ if (skipRecentOutboundEcho) finishPreparation(null);
1451
+ else try {
1452
+ finishPreparation(await normalizeInboundMessage(msg), true);
1453
+ } catch (error) {
1454
+ finishPreparation(void 0);
1455
+ inboundLogger.warn({ error: formatError(error) }, "failed preparing WhatsApp inbound identity; durable drain will normalize again");
1456
+ }
1457
+ } else finishPreparation(void 0);
1446
1458
  }
1447
1459
  };
1448
1460
  const handleMessagesUpsertEvent = (upsert) => {
@@ -1510,7 +1522,7 @@ function createWhatsAppMessageDeliveryCoordinator(options) {
1510
1522
  //#region extensions/whatsapp/src/inbound/socket-session.ts
1511
1523
  const LOGGED_OUT_STATUS = DisconnectReason.loggedOut;
1512
1524
  const RECONNECT_IN_PROGRESS_ERROR = "no active socket - reconnection in progress";
1513
- const BAILEYS_MESSAGE_TTL_MS = 600 * 1e3;
1525
+ const BAILEYS_MESSAGE_TTL_MS = 6e5;
1514
1526
  function isDirectUserJid(jid) {
1515
1527
  return /^(\d+)(?::\d+)?@(s\.whatsapp\.net|c\.us|lid|hosted|hosted\.lid)$/i.test(jid.trim());
1516
1528
  }
@@ -2466,11 +2478,13 @@ async function applyGroupGating(params) {
2466
2478
  conversationId
2467
2479
  }) !== "always";
2468
2480
  const replyContext = getReplyContext(params.msg, params.authDir);
2481
+ const implicitReplyToSelf = params.selfChatMode === true && identitiesOverlap(self, sender);
2482
+ const implicitMentionKinds = implicitMentionKindWhen("quoted_bot", !implicitReplyToSelf && identitiesOverlap(self, replyContext?.sender));
2469
2483
  const mentionDecision = resolveInboundMentionDecision({
2470
2484
  facts: {
2471
2485
  canDetectMention: true,
2472
2486
  wasMentioned,
2473
- implicitMentionKinds: implicitMentionKindWhen("quoted_bot", !(params.selfChatMode === true && identitiesOverlap(self, sender)) && identitiesOverlap(self, replyContext?.sender))
2487
+ implicitMentionKinds
2474
2488
  },
2475
2489
  policy: {
2476
2490
  isGroup: true,
@@ -2648,7 +2662,8 @@ function isLikelyWhatsAppCryptoError(reason) {
2648
2662
  if (typeof value === "function") return value.name ? `[function ${value.name}]` : "[function]";
2649
2663
  return Object.prototype.toString.call(value);
2650
2664
  };
2651
- const haystack = normalizeLowercaseStringOrEmpty(reason instanceof Error ? `${reason.message}\n${reason.stack ?? ""}` : formatReason(reason));
2665
+ const raw = reason instanceof Error ? `${reason.message}\n${reason.stack ?? ""}` : formatReason(reason);
2666
+ const haystack = normalizeLowercaseStringOrEmpty(raw);
2652
2667
  if (!(haystack.includes("unsupported state or unable to authenticate data") || haystack.includes("bad mac"))) return false;
2653
2668
  return haystack.includes("baileys") || haystack.includes("noise-handler") || haystack.includes("aesdecryptgcm");
2654
2669
  }
@@ -2713,6 +2728,11 @@ async function deliverWebReplyInActivityScope(params) {
2713
2728
  const isGroupConversation = transport.conversationKind === "group";
2714
2729
  const replyStarted = Date.now();
2715
2730
  const sendResults = [];
2731
+ const acceptedMediaUrls = /* @__PURE__ */ new Set();
2732
+ const recordMediaAccepted = (mediaUrl) => {
2733
+ acceptedMediaUrls.add(mediaUrl);
2734
+ params.onMediaAccepted?.(mediaUrl);
2735
+ };
2716
2736
  const finishDelivery = () => {
2717
2737
  const receipt = createWhatsAppReplyDeliveryReceipt(sendResults);
2718
2738
  return {
@@ -2721,20 +2741,22 @@ async function deliverWebReplyInActivityScope(params) {
2721
2741
  providerAccepted: sendResults.some((result) => result.providerAccepted)
2722
2742
  };
2723
2743
  };
2724
- const preserveAcceptedDeliveryError = (error, kind) => {
2744
+ const preserveAcceptedDeliveryError = (error, kind, mediaUrl) => {
2725
2745
  const sendKind = kind ?? sendResults[0]?.kind ?? "text";
2726
- if (isChannelPartialDeliveryError(error)) rememberWhatsAppPartialSend({
2727
- error,
2728
- kind: sendKind,
2729
- results: sendResults
2730
- });
2746
+ if (isChannelPartialDeliveryError(error)) {
2747
+ if (rememberWhatsAppPartialSend({
2748
+ error,
2749
+ kind: sendKind,
2750
+ results: sendResults
2751
+ }) && mediaUrl) recordMediaAccepted(mediaUrl);
2752
+ }
2731
2753
  return mergeWhatsAppAcceptedSendError({
2732
2754
  error,
2733
2755
  kind: sendKind,
2734
2756
  results: sendResults
2735
2757
  });
2736
2758
  };
2737
- const rememberSendResult = (result) => {
2759
+ const rememberSendResult = (result, mediaUrl) => {
2738
2760
  if (!result) return;
2739
2761
  try {
2740
2762
  rememberWhatsAppAcceptedSend({
@@ -2745,6 +2767,8 @@ async function deliverWebReplyInActivityScope(params) {
2745
2767
  } catch (error) {
2746
2768
  if (sendResults.some((accepted) => accepted.providerAccepted)) throw preserveAcceptedDeliveryError(error, result.kind);
2747
2769
  throw error;
2770
+ } finally {
2771
+ if (mediaUrl && sendResults.includes(result)) recordMediaAccepted(mediaUrl);
2748
2772
  }
2749
2773
  };
2750
2774
  if (isReasoningReplyPayload(replyResult)) {
@@ -2754,7 +2778,8 @@ async function deliverWebReplyInActivityScope(params) {
2754
2778
  const tableMode = params.tableMode ?? "code";
2755
2779
  const chunkMode = params.chunkMode ?? "length";
2756
2780
  const normalizedReply = params.normalizedReplyResult ?? normalizeWhatsAppOutboundPayload(replyResult, { normalizeText: normalizeWhatsAppPayloadTextPreservingIndentation });
2757
- const textChunks = markdownToWhatsAppChunks(normalizedReply.text ?? "", textLimit, tableMode, chunkMode);
2781
+ const text = normalizedReply.text ?? "";
2782
+ const textChunks = resolveTextChunksWithFallback(text, markdownToWhatsAppChunks(text, textLimit, tableMode, chunkMode));
2758
2783
  const mediaList = normalizedReply.mediaUrls ?? [];
2759
2784
  const getQuote = () => {
2760
2785
  if (!replyResult.replyToId) return;
@@ -2768,7 +2793,7 @@ async function deliverWebReplyInActivityScope(params) {
2768
2793
  media: cached?.media
2769
2794
  });
2770
2795
  };
2771
- const sendWithRetry = async (fn, label, kind) => {
2796
+ const sendWithRetry = async (fn, label, kind, mediaUrl) => {
2772
2797
  try {
2773
2798
  return await sendWhatsAppOutboundWithRetry({
2774
2799
  send: fn,
@@ -2777,7 +2802,7 @@ async function deliverWebReplyInActivityScope(params) {
2777
2802
  }
2778
2803
  });
2779
2804
  } catch (error) {
2780
- if (isChannelPartialDeliveryError(error) || sendResults.some((result) => result.providerAccepted)) throw preserveAcceptedDeliveryError(error, kind);
2805
+ if (isChannelPartialDeliveryError(error) || sendResults.some((result) => result.providerAccepted)) throw preserveAcceptedDeliveryError(error, kind, mediaUrl);
2781
2806
  throw error;
2782
2807
  }
2783
2808
  };
@@ -2810,52 +2835,39 @@ async function deliverWebReplyInActivityScope(params) {
2810
2835
  }
2811
2836
  const remainingText = [...textChunks];
2812
2837
  const leadingCaption = remainingText.shift() || "";
2813
- let acceptedIdsBeforeCurrentMedia = /* @__PURE__ */ new Set();
2814
2838
  await sendMediaWithLeadingCaption({
2815
2839
  mediaUrls: mediaList,
2816
2840
  caption: leadingCaption,
2817
2841
  send: async ({ mediaUrl, caption }) => {
2818
- acceptedIdsBeforeCurrentMedia = new Set(sendResults.flatMap(listWhatsAppSendResultMessageIds));
2819
2842
  const media = await prepareWhatsAppOutboundMedia(await loadWebMedia(mediaUrl, {
2820
2843
  maxBytes: maxMediaBytes,
2821
2844
  localRoots: params.mediaLocalRoots
2822
2845
  }), mediaUrl);
2823
2846
  if (shouldLogVerbose()) {
2824
- logVerbose(`Web auto-reply media size: ${(media.buffer.length / (1024 * 1024)).toFixed(2)}MB`);
2847
+ logVerbose(`Web auto-reply media size: ${(media.buffer.length / 1048576).toFixed(2)}MB`);
2825
2848
  logVerbose(`Web auto-reply media source: ${mediaUrl} (kind ${media.kind})`);
2826
2849
  }
2827
- if (media.kind === "image") {
2828
- const quote = getQuote();
2829
- rememberSendResult(await sendWithRetry(() => transport.sendMedia({
2830
- image: media.buffer,
2831
- caption,
2832
- mimetype: media.mimetype
2833
- }, quote), "media:image", "media"));
2834
- } else if (media.kind === "audio") {
2835
- const quote = getQuote();
2836
- rememberSendResult(await sendWithRetry(() => transport.sendMedia({
2837
- audio: media.buffer,
2838
- ptt: true,
2839
- mimetype: media.mimetype
2840
- }, quote), "media:audio", "media"));
2841
- if (caption) rememberSendResult(await sendWithRetry(() => transport.reply(caption, quote), "media:audio-text", "text"));
2842
- } else if (media.kind === "video") {
2843
- const quote = getQuote();
2844
- rememberSendResult(await sendWithRetry(() => transport.sendMedia({
2845
- video: media.buffer,
2846
- caption,
2847
- mimetype: media.mimetype
2848
- }, quote), "media:video", "media"));
2849
- } else {
2850
- const quote = getQuote();
2851
- rememberSendResult(await sendWithRetry(() => transport.sendMedia({
2852
- document: media.buffer,
2853
- fileName: media.fileName,
2854
- caption,
2855
- mimetype: media.mimetype
2856
- }, quote), "media:document", "media"));
2857
- }
2858
- whatsappOutboundLog.info(`Sent media reply to ${conversationId} (${(media.buffer.length / (1024 * 1024)).toFixed(2)}MB)`);
2850
+ const quote = getQuote();
2851
+ const mediaContent = media.kind === "image" ? {
2852
+ image: media.buffer,
2853
+ caption
2854
+ } : media.kind === "audio" ? {
2855
+ audio: media.buffer,
2856
+ ptt: true
2857
+ } : media.kind === "video" ? {
2858
+ video: media.buffer,
2859
+ caption
2860
+ } : {
2861
+ document: media.buffer,
2862
+ fileName: media.fileName,
2863
+ caption
2864
+ };
2865
+ rememberSendResult(await sendWithRetry(() => transport.sendMedia({
2866
+ ...mediaContent,
2867
+ mimetype: media.mimetype
2868
+ }, quote), `media:${media.kind}`, "media", mediaUrl), mediaUrl);
2869
+ if (media.kind === "audio" && caption) rememberSendResult(await sendWithRetry(() => transport.reply(caption, quote), "media:audio-text", "text"));
2870
+ whatsappOutboundLog.info(`Sent media reply to ${conversationId} (${(media.buffer.length / 1048576).toFixed(2)}MB)`);
2859
2871
  replyLogger.info({
2860
2872
  correlationId: transport.correlationId ?? newConnectionId(),
2861
2873
  connectionId: connectionId ?? null,
@@ -2869,7 +2881,7 @@ async function deliverWebReplyInActivityScope(params) {
2869
2881
  }, "auto-reply sent (media)");
2870
2882
  },
2871
2883
  onError: async ({ error, mediaUrl, caption, isFirst }) => {
2872
- if (sendResults.some((result) => listWhatsAppSendResultMessageIds(result).some((messageId) => !acceptedIdsBeforeCurrentMedia.has(messageId)))) throw preserveAcceptedDeliveryError(error);
2884
+ if (acceptedMediaUrls.has(mediaUrl)) throw preserveAcceptedDeliveryError(error);
2873
2885
  whatsappOutboundLog.error(`Failed sending web media to ${conversationId}: ${formatError(error)}`);
2874
2886
  replyLogger.warn({
2875
2887
  err: error,
@@ -3072,9 +3084,6 @@ function resolveWhatsAppDeliverablePayload(payload, info) {
3072
3084
  }
3073
3085
  return payload;
3074
3086
  }
3075
- function getWhatsAppPayloadMediaUrls(payload) {
3076
- return new Set(normalizeStringEntries([...Array.isArray(payload.mediaUrls) ? payload.mediaUrls : [], ...typeof payload.mediaUrl === "string" ? [payload.mediaUrl] : []]));
3077
- }
3078
3087
  function hasWhatsAppMediaUrlOverlap(left, right) {
3079
3088
  for (const url of left) if (right.has(url)) return true;
3080
3089
  return false;
@@ -3122,16 +3131,28 @@ function createWhatsAppMediaOnlyReplyCoalescer(params) {
3122
3131
  return finalization;
3123
3132
  },
3124
3133
  flushNonDuplicateMedia: (mediaUrls) => flushWhere((pending) => !hasWhatsAppMediaUrlOverlap(pending.mediaUrls, mediaUrls)),
3125
- dropDuplicateMedia(mediaUrls) {
3134
+ supersedeMedia(mediaUrl) {
3126
3135
  const flushResult = {
3127
3136
  delivered: 0,
3128
3137
  droppedDuplicateMedia: 0
3129
3138
  };
3130
3139
  const retained = [];
3131
- for (const pending of pendingMediaOnlyPayloads.splice(0)) if (hasWhatsAppMediaUrlOverlap(pending.mediaUrls, mediaUrls)) {
3132
- pending.resolveFinalization(whatsAppReplyDeliveryVisibility(false));
3133
- flushResult.droppedDuplicateMedia += 1;
3134
- } else retained.push(pending);
3140
+ for (const pending of pendingMediaOnlyPayloads.splice(0)) {
3141
+ if (pending.mediaUrls.delete(mediaUrl)) {
3142
+ flushResult.droppedDuplicateMedia += 1;
3143
+ const mediaUrls = [...pending.mediaUrls];
3144
+ pending.payload = {
3145
+ ...pending.payload,
3146
+ mediaUrl: mediaUrls[0],
3147
+ mediaUrls
3148
+ };
3149
+ }
3150
+ if (pending.mediaUrls.size === 0) {
3151
+ pending.resolveFinalization(whatsAppReplyDeliveryVisibility(false));
3152
+ continue;
3153
+ }
3154
+ retained.push(pending);
3155
+ }
3135
3156
  pendingMediaOnlyPayloads.push(...retained);
3136
3157
  return flushResult;
3137
3158
  },
@@ -3140,7 +3161,7 @@ function createWhatsAppMediaOnlyReplyCoalescer(params) {
3140
3161
  }
3141
3162
  function logWhatsAppMediaOnlyFlushResult(result) {
3142
3163
  if (!shouldLogVerbose$1()) return;
3143
- if (result.droppedDuplicateMedia > 0) logVerbose$1(`Dropped ${result.droppedDuplicateMedia} deferred media-only WhatsApp reply payload(s) superseded by captioned media`);
3164
+ if (result.droppedDuplicateMedia > 0) logVerbose$1(`Superseded ${result.droppedDuplicateMedia} deferred WhatsApp attachment(s) with accepted replacement media`);
3144
3165
  if (result.delivered > 0) logVerbose$1(`Flushed ${result.delivered} deferred media-only WhatsApp reply payload(s)`);
3145
3166
  }
3146
3167
  function resolveWhatsAppResponsePrefix(params) {
@@ -3202,7 +3223,8 @@ async function prepareWhatsAppInboundContext(params) {
3202
3223
  from: conversationId,
3203
3224
  sender: {
3204
3225
  id: params.sender.id ?? params.sender.e164,
3205
- name: params.sender.name
3226
+ name: params.sender.name,
3227
+ isSelf: params.msg.platform.fromMe === true
3206
3228
  },
3207
3229
  conversation: {
3208
3230
  kind: conversationKind,
@@ -3311,7 +3333,8 @@ function createWhatsAppReplyPlan(params) {
3311
3333
  didSendReply = true;
3312
3334
  if (shouldLogVerbose$1()) {
3313
3335
  const reply = resolveSendableOutboundReplyParts(payload);
3314
- logVerbose$1(`Reply body: ${payload.text != null ? reply.text : "<media>"}${reply.hasMedia ? " (media)" : ""} -> ${conversationId}`);
3336
+ const preview = payload.text != null ? reply.text : "<media>";
3337
+ logVerbose$1(`Reply body: ${preview}${reply.hasMedia ? " (media)" : ""} -> ${conversationId}`);
3315
3338
  }
3316
3339
  };
3317
3340
  const deliverNormalizedPayload = async (normalizedDeliveryPayload, info, options) => {
@@ -3330,7 +3353,8 @@ function createWhatsAppReplyPlan(params) {
3330
3353
  replyLogger: params.replyLogger,
3331
3354
  connectionId: params.connectionId,
3332
3355
  skipLog: false,
3333
- tableMode
3356
+ tableMode,
3357
+ onMediaAccepted: options?.onMediaAccepted
3334
3358
  });
3335
3359
  } catch (error) {
3336
3360
  if (isWhatsAppVisibleDeliveryError(error) && !isChannelPartialDeliveryError(error)) throw createChannelPartialDeliveryError(error, {
@@ -3392,7 +3416,7 @@ function createWhatsAppReplyPlan(params) {
3392
3416
  } : normalizedOutboundPayload;
3393
3417
  const reply = resolveSendableOutboundReplyParts(normalizedDeliveryPayload);
3394
3418
  if (!reply.hasMedia && !reply.text.trim()) return normalizedDeliveryPayload;
3395
- const mediaUrls = getWhatsAppPayloadMediaUrls(normalizedDeliveryPayload);
3419
+ const mediaUrls = new Set(normalizedDeliveryPayload.mediaUrls);
3396
3420
  logWhatsAppMediaOnlyFlushResult(reply.hasMedia ? shouldDeferWhatsAppMediaOnlyPayload({
3397
3421
  info,
3398
3422
  mediaUrls,
@@ -3426,7 +3450,7 @@ function createWhatsAppReplyPlan(params) {
3426
3450
  const reply = resolveSendableOutboundReplyParts(normalizedDeliveryPayload);
3427
3451
  if (!reply.hasMedia && !reply.text.trim()) return whatsAppReplyDeliveryVisibility(false);
3428
3452
  if (!reply.hasMedia) return await deliverNormalizedPayload(normalizedDeliveryPayload, info, { recordDelivery: false });
3429
- const mediaUrls = getWhatsAppPayloadMediaUrls(normalizedDeliveryPayload);
3453
+ const mediaUrls = new Set(normalizedDeliveryPayload.mediaUrls);
3430
3454
  if (shouldDeferWhatsAppMediaOnlyPayload({
3431
3455
  info,
3432
3456
  mediaUrls,
@@ -3439,14 +3463,10 @@ function createWhatsAppReplyPlan(params) {
3439
3463
  payload: normalizedDeliveryPayload
3440
3464
  })
3441
3465
  };
3442
- try {
3443
- const result = await deliverNormalizedPayload(normalizedDeliveryPayload, info);
3444
- if (result.visibleReplySent) logWhatsAppMediaOnlyFlushResult(mediaOnlyCoalescer.dropDuplicateMedia(mediaUrls));
3445
- return result;
3446
- } catch (error) {
3447
- if (isWhatsAppVisibleDeliveryError(error)) logWhatsAppMediaOnlyFlushResult(mediaOnlyCoalescer.dropDuplicateMedia(mediaUrls));
3448
- throw error;
3449
- }
3466
+ return await deliverNormalizedPayload(normalizedDeliveryPayload, info, { onMediaAccepted: (mediaUrl) => {
3467
+ didSendReply = true;
3468
+ logWhatsAppMediaOnlyFlushResult(mediaOnlyCoalescer.supersedeMedia(mediaUrl));
3469
+ } });
3450
3470
  },
3451
3471
  onDelivered: (payload, _info, result) => {
3452
3472
  if (!resolveSendableOutboundReplyParts(payload).hasMedia && result?.visibleReplySent === true) recordDeliveredPayload(payload);
@@ -3711,27 +3731,30 @@ async function processMessage(params) {
3711
3731
  }) : void 0;
3712
3732
  if (conversationKind === "group") {
3713
3733
  const history = visibleGroupHistory ?? [];
3714
- if (history.length > 0) combinedBody = buildHistoryContextFromEntries({
3715
- entries: history.map((m) => ({
3734
+ if (history.length > 0) {
3735
+ const historyEntries = history.map((m) => ({
3716
3736
  sender: m.sender,
3717
3737
  body: m.body,
3718
3738
  timestamp: m.timestamp,
3719
3739
  media: m.media
3720
- })),
3721
- currentMessage: combinedBody,
3722
- excludeLast: false,
3723
- formatEntry: (entry) => {
3724
- return formatInboundEnvelope$1({
3725
- channel: "WhatsApp",
3726
- from: conversationId,
3727
- timestamp: entry.timestamp,
3728
- body: [entry.body, formatMediaPlaceholderText(entry.media ?? [])].filter(Boolean).join("\n"),
3729
- chatType: "group",
3730
- senderLabel: entry.sender,
3731
- envelope: envelopeOptions
3732
- });
3733
- }
3734
- });
3740
+ }));
3741
+ combinedBody = buildHistoryContextFromEntries({
3742
+ entries: historyEntries,
3743
+ currentMessage: combinedBody,
3744
+ excludeLast: false,
3745
+ formatEntry: (entry) => {
3746
+ return formatInboundEnvelope$1({
3747
+ channel: "WhatsApp",
3748
+ from: conversationId,
3749
+ timestamp: entry.timestamp,
3750
+ body: [entry.body, formatMediaPlaceholderText(entry.media ?? [])].filter(Boolean).join("\n"),
3751
+ chatType: "group",
3752
+ senderLabel: entry.sender,
3753
+ envelope: envelopeOptions
3754
+ });
3755
+ }
3756
+ });
3757
+ }
3735
3758
  shouldClearGroupHistory = !(params.suppressGroupHistoryClear ?? false);
3736
3759
  }
3737
3760
  const statusReactionController = params.statusReactionController ?? (params.cfg.messages?.statusReactions?.enabled === true && !params.ackAlreadySent ? await createWhatsAppStatusReactionController({
@@ -4258,8 +4281,8 @@ function normalizeReconnectAccountId(accountId) {
4258
4281
  function isRetryableAuthUnstableError(error) {
4259
4282
  return error instanceof WhatsAppAuthUnstableError || typeof error === "object" && error !== null && "code" in error && error.code === "whatsapp-auth-unstable";
4260
4283
  }
4261
- const DEFAULT_TRANSPORT_TIMEOUT_MS = 300 * 1e3;
4262
- const WHATSAPP_RECONNECT_CATCH_UP_MAX_MS = 20 * 6e4;
4284
+ const DEFAULT_TRANSPORT_TIMEOUT_MS = 3e5;
4285
+ const WHATSAPP_RECONNECT_CATCH_UP_MAX_MS = 12e5;
4263
4286
  async function monitorWebChannel(verbose, listenerFactory = attachWebInboxToSocket, keepAlive = true, replyResolver, runtime = defaultRuntime, abortSignal, tuning = {}) {
4264
4287
  const activeReplyResolver = replyResolver ?? (await loadReplyResolverRuntime()).getReplyFromConfig;
4265
4288
  const runId = newConnectionId();
@@ -4304,9 +4327,9 @@ async function monitorWebChannel(verbose, listenerFactory = attachWebInboxToSock
4304
4327
  };
4305
4328
  process.once("SIGINT", handleSigint);
4306
4329
  const transportTimeoutMs = tuning.transportTimeoutMs ?? DEFAULT_TRANSPORT_TIMEOUT_MS;
4307
- const messageTimeoutMs = tuning.messageTimeoutMs ?? 1800 * 1e3;
4330
+ const messageTimeoutMs = tuning.messageTimeoutMs ?? 18e5;
4308
4331
  const reconnectCatchUpWindowMs = Math.min(Math.max(messageTimeoutMs, 6e4), WHATSAPP_RECONNECT_CATCH_UP_MAX_MS);
4309
- const watchdogCheckMs = tuning.watchdogCheckMs ?? 60 * 1e3;
4332
+ const watchdogCheckMs = tuning.watchdogCheckMs ?? 6e4;
4310
4333
  const controller = new WhatsAppConnectionController({
4311
4334
  accountId: account.accountId,
4312
4335
  authDir: account.authDir,