@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
@@ -2,7 +2,7 @@ import { n as listConfiguredAccountIds, r as resolveDefaultWhatsAppAccountId, t
2
2
  import { n as hasWebCredsRegularFileSync, r as hasWebCredsSync } from "./creds-files-W6B3EMZ8.js";
3
3
  import fs from "node:fs";
4
4
  import path from "node:path";
5
- import { DEFAULT_ACCOUNT_ID, mergeAccountConfig, normalizeAccountId, resolveAccountEntry, resolveMergedAccountConfig, resolveUserPath } from "openclaw/plugin-sdk/account-core";
5
+ import { DEFAULT_ACCOUNT_ID, normalizeAccountId, resolveAccountEntry, resolveMergedAccountConfig, resolveUserPath } from "openclaw/plugin-sdk/account-core";
6
6
  import { resolveOAuthDir } from "openclaw/plugin-sdk/state-paths";
7
7
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
8
8
  //#region extensions/whatsapp/src/account-config.ts
@@ -12,36 +12,19 @@ function resolveWhatsAppDefaultAccountSharedConfig(cfg) {
12
12
  const { enabled: _ignoredEnabled, name: _ignoredName, authDir: _ignoredAuthDir, selfChatMode: _ignoredSelfChatMode, ...sharedDefaults } = defaultAccount;
13
13
  return sharedDefaults;
14
14
  }
15
- function resolveWhatsAppAccountConfigForTest(cfg, accountId) {
16
- return resolveAccountEntry(cfg.channels?.whatsapp?.accounts, accountId);
17
- }
18
- function resolveMergedNamedWhatsAppAccountConfig(params) {
19
- const rootCfg = params.cfg.channels?.whatsapp;
20
- const accountConfig = resolveWhatsAppAccountConfigForTest(params.cfg, params.accountId);
21
- return {
22
- ...mergeAccountConfig({
23
- channelConfig: rootCfg,
24
- accountConfig: void 0,
25
- omitKeys: ["defaultAccount"]
26
- }),
27
- ...resolveWhatsAppDefaultAccountSharedConfig(params.cfg),
28
- ...accountConfig
29
- };
30
- }
31
15
  function resolveMergedWhatsAppAccountConfig(params) {
32
16
  const rootCfg = params.cfg.channels?.whatsapp;
33
17
  const accountId = params.accountId?.trim() || rootCfg?.defaultAccount || DEFAULT_ACCOUNT_ID;
34
- const base = resolveMergedAccountConfig({
35
- channelConfig: rootCfg,
36
- accounts: rootCfg?.accounts,
37
- accountId,
38
- omitKeys: ["defaultAccount"]
39
- });
40
18
  return {
41
19
  accountId,
42
- ...accountId === DEFAULT_ACCOUNT_ID ? base : resolveMergedNamedWhatsAppAccountConfig({
43
- cfg: params.cfg,
44
- accountId
20
+ ...resolveMergedAccountConfig({
21
+ channelConfig: {
22
+ ...rootCfg,
23
+ ...accountId === DEFAULT_ACCOUNT_ID ? void 0 : resolveWhatsAppDefaultAccountSharedConfig(params.cfg)
24
+ },
25
+ accounts: rootCfg?.accounts,
26
+ accountId,
27
+ omitKeys: ["defaultAccount"]
45
28
  })
46
29
  };
47
30
  }
@@ -1,6 +1,6 @@
1
- import { a as resolveWhatsAppAccount } from "./accounts-BX2fZUyR.js";
1
+ import { a as resolveWhatsAppAccount } from "./accounts-CeKQbu_s.js";
2
2
  import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-1GqbT1uX.js";
3
- import { r as sendReactionWhatsApp, v as resolveWhatsAppReactionLevel } from "./send-CwvTU4RI.js";
3
+ import { r as sendReactionWhatsApp, v as resolveWhatsAppReactionLevel } from "./send-DiPjiygK.js";
4
4
  import { ToolAuthorizationError, createActionGate, jsonResult, readReactionParams, readStringParam } from "openclaw/plugin-sdk/channel-actions";
5
5
  //#region extensions/whatsapp/src/action-runtime-target-auth.ts
6
6
  function resolveAuthorizedWhatsAppOutboundTarget(params) {
@@ -1,2 +1,2 @@
1
- import { t as handleWhatsAppAction } from "./action-runtime-pM-ExU0l.js";
1
+ import { t as handleWhatsAppAction } from "./action-runtime-Bw0loEdy.js";
2
2
  export { handleWhatsAppAction };
@@ -1,2 +1,2 @@
1
- import { t as handleWhatsAppAction } from "./action-runtime-pM-ExU0l.js";
1
+ import { t as handleWhatsAppAction } from "./action-runtime-Bw0loEdy.js";
2
2
  export { handleWhatsAppAction };
@@ -1,17 +1,18 @@
1
- import { a as resolveWhatsAppAccount } from "./accounts-BX2fZUyR.js";
1
+ import { a as resolveWhatsAppAccount } from "./accounts-CeKQbu_s.js";
2
2
  import { r as getWhatsAppConnectionController } from "./connection-controller-runtime-context-DG0tuYuw.js";
3
- import { s as resolveJidToE164 } from "./targets-runtime-TMk0lGuy.js";
3
+ import { s as resolveJidToE164 } from "./targets-runtime-RBjx3pg_.js";
4
+ import { n as registerWhatsAppLoginTool } from "./agent-tools-login-B-2qZPzc.js";
4
5
  import { createActionGate, stringEnum } from "openclaw/plugin-sdk/channel-actions";
5
6
  import path from "node:path";
6
7
  import { resolveOAuthDir } from "openclaw/plugin-sdk/state-paths";
7
8
  import { normalizeE164 } from "openclaw/plugin-sdk/account-resolution";
8
- import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
9
- import { Type } from "typebox";
10
9
  import fs from "node:fs/promises";
10
+ import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
11
11
  import { mulawToPcm } from "openclaw/plugin-sdk/realtime-voice";
12
12
  import { detectBinary } from "openclaw/plugin-sdk/setup-tools";
13
13
  import { resolvePreferredOpenClawTmpDir } from "openclaw/plugin-sdk/temp-path";
14
14
  import { jsonResult as jsonResult$1 } from "openclaw/plugin-sdk/tool-results";
15
+ import { Type } from "typebox";
15
16
  //#region extensions/whatsapp/src/agent-tools-call.ts
16
17
  const MEOWCALLER_COMMAND = "meowcaller";
17
18
  const SESSION_DATABASE = "wa-voip.db";
@@ -19,7 +20,7 @@ const MAX_AUDIO_DURATION_MS = 6e4;
19
20
  const MIN_CALL_WINDOW_MS = 115e3;
20
21
  const MAX_CALL_WINDOW_MS = 175e3;
21
22
  const MAX_MESSAGE_LENGTH = 4e3;
22
- const MAX_COMMAND_OUTPUT_BYTES = 64 * 1024;
23
+ const MAX_COMMAND_OUTPUT_BYTES = 65536;
23
24
  const MEOWCALLER_ANSWER_TIMEOUT = "45s";
24
25
  const MEOWCALLER_MAX_DURATION = "65s";
25
26
  const activeCallAccounts = /* @__PURE__ */ new Set();
@@ -222,4 +223,10 @@ function registerWhatsAppCallTool(api) {
222
223
  api.registerTool((context) => createWhatsAppCallTool(api, context), { name: "whatsapp_call" });
223
224
  }
224
225
  //#endregion
225
- export { registerWhatsAppCallTool };
226
+ //#region extensions/whatsapp/agent-tools-api.ts
227
+ function registerWhatsAppAgentTools(api) {
228
+ registerWhatsAppCallTool(api);
229
+ registerWhatsAppLoginTool(api);
230
+ }
231
+ //#endregion
232
+ export { registerWhatsAppAgentTools };
@@ -8,7 +8,8 @@ const QR_DATA_URL_MAX_LENGTH = 16384;
8
8
  function readLoginStringPreservingWhitespace(value) {
9
9
  return hasNonEmptyString(value) ? value : void 0;
10
10
  }
11
- function createWhatsAppLoginTool() {
11
+ function createWhatsAppLoginTool(context) {
12
+ if (context.senderIsOwner !== true) return null;
12
13
  return {
13
14
  label: "WhatsApp Login",
14
15
  name: "whatsapp_login",
@@ -23,7 +24,10 @@ function createWhatsAppLoginTool() {
23
24
  pattern: "^data:image/png;base64,.+$"
24
25
  }))
25
26
  }),
26
- execute: async (_toolCallId, args) => {
27
+ execute: async (_toolCallId, args, signal) => {
28
+ const beforeCredentialPersistence = async () => {
29
+ if (!signal || signal.aborted) throw new Error("WhatsApp login authority is no longer active.");
30
+ };
27
31
  const renderQrReply = (params) => {
28
32
  return {
29
33
  content: [{
@@ -64,9 +68,11 @@ function createWhatsAppLoginTool() {
64
68
  details: { connected: result.connected }
65
69
  };
66
70
  }
71
+ await beforeCredentialPersistence();
67
72
  const result = await startWebLoginWithQr({
68
73
  accountId,
69
74
  timeoutMs,
75
+ beforeCredentialPersistence,
70
76
  force: typeof args.force === "boolean" ? args.force : false
71
77
  });
72
78
  if (!result.qrDataUrl) return {
@@ -84,5 +90,8 @@ function createWhatsAppLoginTool() {
84
90
  }
85
91
  };
86
92
  }
93
+ function registerWhatsAppLoginTool(api) {
94
+ api.registerTool((context) => createWhatsAppLoginTool(context), { name: "whatsapp_login" });
95
+ }
87
96
  //#endregion
88
- export { createWhatsAppLoginTool as t };
97
+ export { registerWhatsAppLoginTool as n, createWhatsAppLoginTool as t };
package/dist/api.js CHANGED
@@ -1,18 +1,18 @@
1
- import { a as resolveWhatsAppAccount, i as listWhatsAppAuthDirs, n as hasAnyWhatsAppAuth, o as resolveWhatsAppAuthDir, r as listEnabledWhatsAppAccounts, s as resolveWhatsAppMediaMaxBytes, t as DEFAULT_WHATSAPP_MEDIA_MAX_MB } from "./accounts-BX2fZUyR.js";
1
+ import { a as resolveWhatsAppAccount, i as listWhatsAppAuthDirs, n as hasAnyWhatsAppAuth, o as resolveWhatsAppAuthDir, r as listEnabledWhatsAppAccounts, s as resolveWhatsAppMediaMaxBytes, t as DEFAULT_WHATSAPP_MEDIA_MAX_MB } from "./accounts-CeKQbu_s.js";
2
2
  import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-CB5SOWjc.js";
3
3
  import { a as normalizeWhatsAppAllowFromEntries, c as normalizeWhatsAppTarget, i as looksLikeWhatsAppTargetId, r as isWhatsAppUserTarget, s as normalizeWhatsAppMessagingTarget, t as isWhatsAppGroupJid } from "./normalize-target-CugRyONv.js";
4
4
  import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-1GqbT1uX.js";
5
- import { c as toWhatsappJid, i as markdownToWhatsApp, l as toWhatsappJidWithLid, n as isSelfChatMode, r as jidToE164, s as resolveJidToE164, t as assertWebChannel } from "./targets-runtime-TMk0lGuy.js";
6
- import { n as resolveUserPath, t as normalizeE164 } from "./text-runtime-CaKLhowd.js";
7
- import { n as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS, t as whatsappPlugin } from "./channel-DRMYRfZ8.js";
8
- import { a as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupToolPolicy } from "./shared-wg42NKFB.js";
5
+ import { c as toWhatsappJid, i as markdownToWhatsApp, l as toWhatsappJidWithLid, n as isSelfChatMode, r as jidToE164, s as resolveJidToE164, t as assertWebChannel } from "./targets-runtime-RBjx3pg_.js";
6
+ import { n as resolveUserPath, t as normalizeE164 } from "./text-runtime-DyfmcATV.js";
7
+ import { n as WHATSAPP_LEGACY_OUTBOUND_SEND_DEP_KEYS, t as whatsappPlugin } from "./channel-DxMmDjqK.js";
8
+ import { a as resolveWhatsAppGroupRequireMention, o as resolveWhatsAppGroupToolPolicy } from "./shared-DDjonGys.js";
9
9
  import { t as whatsappCommandPolicy } from "./command-policy-BIOSHySD.js";
10
- import { t as whatsappSetupPlugin } from "./channel.setup-DhBBhbQv.js";
11
- import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-HU41RHGI.js";
12
- import { a as waitForWaConnection, o as DEFAULT_WHATSAPP_SOCKET_TIMING, r as createWaSocket, s as createWhatsAppSocketOperationTimeoutAdapter } from "./socket-close-2T0_jZTN.js";
10
+ import { t as whatsappSetupPlugin } from "./channel.setup-aOFLSQyw.js";
11
+ import { t as DEFAULT_WEB_MEDIA_BYTES } from "./constants-C7m81BNe.js";
12
+ import { a as waitForWaConnection, o as DEFAULT_WHATSAPP_SOCKET_TIMING, r as createWaSocket, s as createWhatsAppSocketOperationTimeoutAdapter } from "./socket-close-CpkkJZCU.js";
13
13
  import { n as getStatusCode, t as formatError } from "./session-errors-JuazczrA.js";
14
- import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-P7_3U73Z.js";
15
- import { _ as resolveInboundMediaMimetype, c as extractContextInfo, m as findMessageSection, o as describeReplyContext, p as extractText, t as createWebSendApi, u as extractLocationData } from "./send-api-obOSm2cC.js";
14
+ import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-LgxYJLWY.js";
15
+ import { _ as resolveInboundMediaMimetype, c as extractContextInfo, m as findMessageSection, o as describeReplyContext, p as extractText, t as createWebSendApi, u as extractLocationData } from "./send-api-kFcuhSiY.js";
16
16
  import { asBoolean, isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
17
17
  import { formatLocationText } from "openclaw/plugin-sdk/channel-inbound";
18
18
  //#region extensions/whatsapp/src/qa-driver.runtime.ts
@@ -1,10 +1,10 @@
1
- import "./accounts-BX2fZUyR.js";
1
+ import "./accounts-CeKQbu_s.js";
2
2
  import { r as resolveDefaultWhatsAppAccountId } from "./account-ids-CB5SOWjc.js";
3
3
  import { s as normalizeWhatsAppMessagingTarget } from "./normalize-target-CugRyONv.js";
4
- import { i as sendTypingWhatsApp, t as sendMessageWhatsApp } from "./send-CwvTU4RI.js";
4
+ import { i as sendTypingWhatsApp, t as sendMessageWhatsApp } from "./send-DiPjiygK.js";
5
5
  import { i as getWhatsAppRuntime } from "./runtime-BLlToOi6.js";
6
6
  import "./normalize-C7Hkc_vE.js";
7
- import { i as unregisterWhatsAppApprovalReactionTarget, r as registerWhatsAppApprovalReactionTarget } from "./approval-reactions-Jyr1JaAK.js";
7
+ import { i as unregisterWhatsAppApprovalReactionTarget, r as registerWhatsAppApprovalReactionTarget } from "./approval-reactions-DGDA6hQ7.js";
8
8
  import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
9
9
  import { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
10
10
  import { buildApprovalReactionPendingContent } from "openclaw/plugin-sdk/approval-reaction-runtime";
@@ -1,7 +1,7 @@
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 { n as getOptionalWhatsAppRuntime } from "./runtime-BLlToOi6.js";
4
- import { c as getWhatsAppApprovalApprovers, l as whatsappApprovalAuth } from "./group-session-key-DmFc_Cqi.js";
4
+ import { c as getWhatsAppApprovalApprovers, l as whatsappApprovalAuth } from "./group-session-key-KUguLmSZ.js";
5
5
  import { isApprovalNotFoundError } from "openclaw/plugin-sdk/error-runtime";
6
6
  import { createLazyRuntimeSurface } from "openclaw/plugin-sdk/lazy-runtime";
7
7
  import { approvalReactionDecisionSetsMatch, buildApprovalReactionDeliveredBindingMarker, createApprovalReactionTargetStore, listApprovalReactionBindings, readApprovalReactionDecisionList, readApprovalReactionDeliveredBinding, readApprovalReactionPresentationBinding, resolveTypedApprovalReactionTarget } from "openclaw/plugin-sdk/approval-reaction-runtime";
@@ -18,15 +18,16 @@ var approval_reactions_exports = /* @__PURE__ */ __exportAll({
18
18
  });
19
19
  const PERSISTENT_NAMESPACE = "whatsapp.approval-reactions";
20
20
  const PERSISTENT_MAX_ENTRIES = 1e3;
21
- const DEFAULT_REACTION_TARGET_TTL_MS = 1440 * 60 * 1e3;
21
+ const DEFAULT_REACTION_TARGET_TTL_MS = 864e5;
22
22
  const DELIVERY_BINDING_CHANNEL_DATA_KEY = "whatsappApprovalReactionBindingV1";
23
23
  const loadResolveApprovalOverGateway = createLazyRuntimeSurface(() => import("openclaw/plugin-sdk/approval-gateway-runtime"), (runtime) => runtime.resolveApprovalOverGateway);
24
+ const reportPersistentApprovalReactionError = createPluginStateErrorReporter(getOptionalWhatsAppRuntime, "whatsapp", "approval-reaction-state", "WhatsApp persistent approval reaction state failed");
24
25
  const whatsappApprovalReactionTargets = createApprovalReactionTargetStore({
25
26
  namespace: PERSISTENT_NAMESPACE,
26
27
  maxEntries: PERSISTENT_MAX_ENTRIES,
27
28
  defaultTtlMs: DEFAULT_REACTION_TARGET_TTL_MS,
28
29
  openStore: (storeParams) => getOptionalWhatsAppRuntime()?.state.openKeyedStore(storeParams),
29
- logPersistentError: createPluginStateErrorReporter(getOptionalWhatsAppRuntime, "whatsapp", "approval-reaction-state", "WhatsApp persistent approval reaction state failed"),
30
+ logPersistentError: reportPersistentApprovalReactionError,
30
31
  readPersistedTarget
31
32
  });
32
33
  function buildReactionTargetKey(params) {
@@ -88,7 +89,8 @@ function visibleApprovalBindingMatches(text, binding) {
88
89
  "allow-always",
89
90
  "deny"
90
91
  ] });
91
- const decisions = readApprovalReactionDecisionList(decisionLines.map((line) => knownBindings.find((entry) => `${entry.emoji} ${entry.label}` === line)?.decision));
92
+ const visibleDecisions = decisionLines.map((line) => knownBindings.find((entry) => `${entry.emoji} ${entry.label}` === line)?.decision);
93
+ const decisions = readApprovalReactionDecisionList(visibleDecisions);
92
94
  if (!decisions) return false;
93
95
  return approvalReactionDecisionSetsMatch(binding.allowedDecisions, decisions);
94
96
  }
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
2
  import { a as readWebCredsJsonRaw, c as resolveWebCredsPath, i as isWhatsAppBaileysAuthFileName, l as statWebCredsFileSync, o as readWebCredsJsonRawSync, r as hasWebCredsSync, s as resolveWebCredsBackupPath, t as assertWebCredsPathRegularFileOrMissing } from "./creds-files-W6B3EMZ8.js";
3
- import { r as jidToE164 } from "./targets-runtime-TMk0lGuy.js";
4
- import { n as resolveUserPath, t as normalizeE164 } from "./text-runtime-CaKLhowd.js";
3
+ import { r as jidToE164 } from "./targets-runtime-RBjx3pg_.js";
4
+ import { n as resolveUserPath, t as normalizeE164 } from "./text-runtime-DyfmcATV.js";
5
5
  import path from "node:path";
6
6
  import { resolveOAuthDir as resolveOAuthDir$1 } from "openclaw/plugin-sdk/state-paths";
7
7
  import { replaceFileAtomic } from "openclaw/plugin-sdk/security-runtime";
@@ -240,7 +240,9 @@ async function restoreCredsFromBackupIfNeeded(authDir, options) {
240
240
  return false;
241
241
  }
242
242
  async function webAuthExists(authDir = resolveDefaultWebAuthDir()) {
243
- const raw = await readWebCredsJsonRaw(resolveWebCredsPath(resolveUserPath(authDir)));
243
+ const resolvedAuthDir = resolveUserPath(authDir);
244
+ const credsPath = resolveWebCredsPath(resolvedAuthDir);
245
+ const raw = await readWebCredsJsonRaw(credsPath);
244
246
  if (!raw) return false;
245
247
  try {
246
248
  JSON.parse(raw);
@@ -1,30 +1,28 @@
1
- import { a as resolveWhatsAppAccount } from "./accounts-BX2fZUyR.js";
1
+ import { a as resolveWhatsAppAccount } from "./accounts-CeKQbu_s.js";
2
2
  import { r as resolveDefaultWhatsAppAccountId, t as listAccountIds } from "./account-ids-CB5SOWjc.js";
3
3
  import { c as normalizeWhatsAppTarget, i as looksLikeWhatsAppTargetId, n as isWhatsAppNewsletterJid, o as normalizeWhatsAppAllowFromEntry, s as normalizeWhatsAppMessagingTarget, t as isWhatsAppGroupJid } from "./normalize-target-CugRyONv.js";
4
4
  import { t as resolveWhatsAppOutboundTarget } from "./resolve-outbound-target-1GqbT1uX.js";
5
- import { c as normalizeWhatsAppPayloadTextPreservingIndentation, i as sendTypingWhatsApp, n as sendPollWhatsApp, o as normalizeWhatsAppOutboundPayload, s as normalizeWhatsAppPayloadText, t as sendMessageWhatsApp, v as resolveWhatsAppReactionLevel } from "./send-CwvTU4RI.js";
5
+ import { c as normalizeWhatsAppPayloadTextPreservingIndentation, i as sendTypingWhatsApp, n as sendPollWhatsApp, o as normalizeWhatsAppOutboundPayload, s as normalizeWhatsAppPayloadText, t as sendMessageWhatsApp, v as resolveWhatsAppReactionLevel } from "./send-DiPjiygK.js";
6
6
  import { i as getWhatsAppRuntime } from "./runtime-BLlToOi6.js";
7
7
  import "./normalize-C7Hkc_vE.js";
8
- import { c as toWhatsappJid } from "./targets-runtime-TMk0lGuy.js";
9
- import "./text-runtime-CaKLhowd.js";
10
- import { t as createWhatsAppLoginTool } from "./agent-tools-login-BjRpD-JQ.js";
11
- import { c as getWhatsAppApprovalApprovers, l as whatsappApprovalAuth, s as lookupInboundMessageMetaForTarget, t as resolveWhatsAppGroupSessionKey } from "./group-session-key-DmFc_Cqi.js";
12
- import { a as resolveWhatsAppGroupRequireMention, c as loadWhatsAppChannelRuntime, i as whatsappSetupContract, l as readWhatsAppAccountLinkState, n as whatsappSetupWizardProxy, o as resolveWhatsAppGroupToolPolicy, s as formatWhatsAppConfigAllowFromEntries, t as createWhatsAppPluginBase } from "./shared-wg42NKFB.js";
8
+ import { c as toWhatsappJid } from "./targets-runtime-RBjx3pg_.js";
9
+ import "./text-runtime-DyfmcATV.js";
10
+ import { c as getWhatsAppApprovalApprovers, l as whatsappApprovalAuth, s as lookupInboundMessageMetaForTarget, t as resolveWhatsAppGroupSessionKey } from "./group-session-key-KUguLmSZ.js";
11
+ import { a as resolveWhatsAppGroupRequireMention, c as loadWhatsAppChannelRuntime, i as whatsappSetupContract, l as readWhatsAppAccountLinkState, n as whatsappSetupWizardProxy, o as resolveWhatsAppGroupToolPolicy, s as formatWhatsAppConfigAllowFromEntries, t as createWhatsAppPluginBase } from "./shared-DDjonGys.js";
13
12
  import { t as whatsappCommandPolicy } from "./command-policy-BIOSHySD.js";
14
- import { f as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-CtpBqH5S.js";
13
+ import { f as readWebAuthExistsForDecision, n as WHATSAPP_AUTH_UNSTABLE_CODE } from "./auth-store-DTj1H9pv.js";
15
14
  import { createActionGate as createActionGate$1 } from "openclaw/plugin-sdk/channel-actions";
16
15
  import { normalizeOptionalAccountId } from "openclaw/plugin-sdk/account-core";
17
16
  import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
18
17
  import { collectIssuesForEnabledAccounts, createComputedAccountStatusAdapter, createDefaultChannelRuntimeState, isRecord as isRecord$1, readAccountStatusSnapshot } from "openclaw/plugin-sdk/status-helpers";
18
+ import { createMessageReceiptFromOutboundResults, defineChannelMessageAdapter, resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
19
19
  import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
20
20
  import { buildChannelOutboundSessionRoute } from "openclaw/plugin-sdk/core";
21
- import { chunkText } from "openclaw/plugin-sdk/reply-chunking";
22
- import { createMessageReceiptFromOutboundResults, defineChannelMessageAdapter, resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-outbound";
23
21
  import { sendTextMediaPayload } from "openclaw/plugin-sdk/reply-payload";
24
22
  import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1 } from "openclaw/plugin-sdk/account-id";
23
+ import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
25
24
  import { buildDmGroupAccountAllowlistAdapter } from "openclaw/plugin-sdk/allowlist-config-edit";
26
25
  import { createChatChannelPlugin } from "openclaw/plugin-sdk/channel-core";
27
- import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
28
26
  import { createApproverRestrictedNativeApprovalCapabilityFromForwardingRoutes } from "openclaw/plugin-sdk/approval-delivery-runtime";
29
27
  import { createLazyChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
30
28
  import { buildApprovalReactionPromptPayloadForRequest } from "openclaw/plugin-sdk/approval-reaction-runtime";
@@ -80,7 +78,7 @@ const whatsappApproval = createApproverRestrictedNativeApprovalCapabilityFromFor
80
78
  approvalKind,
81
79
  request
82
80
  }),
83
- load: async () => (await import("./approval-handler.runtime-CkMMvUjk.js")).whatsappApprovalNativeRuntime
81
+ load: async () => (await import("./approval-handler.runtime-DeyPb57-.js")).whatsappApprovalNativeRuntime
84
82
  })
85
83
  });
86
84
  function buildWhatsAppPendingPayload(params, approvalKind) {
@@ -150,7 +148,7 @@ function resolveQuoteLookupAccountId(cfg, accountId) {
150
148
  if (explicitAccountId) return explicitAccountId;
151
149
  return resolveDefaultWhatsAppAccountId(cfg ?? {});
152
150
  }
153
- function createWhatsAppOutboundBase({ chunker, sendMessageWhatsApp, sendPollWhatsApp, shouldLogVerbose, resolveTarget, normalizeText = normalizeWhatsAppPayloadText, skipEmptyText = true }) {
151
+ function createWhatsAppOutboundBase({ sendMessageWhatsApp, sendPollWhatsApp, shouldLogVerbose, resolveTarget, normalizeText = normalizeWhatsAppPayloadText, skipEmptyText = true }) {
154
152
  const resolveQuotedMessageKey = (params) => {
155
153
  const replyToId = params.replyToId?.trim();
156
154
  if (!replyToId) return;
@@ -168,8 +166,6 @@ function createWhatsAppOutboundBase({ chunker, sendMessageWhatsApp, sendPollWhat
168
166
  };
169
167
  const outbound = {
170
168
  deliveryMode: "gateway",
171
- chunker,
172
- chunkerMode: "text",
173
169
  textChunkLimit: 4e3,
174
170
  sanitizeText: ({ text }) => normalizeText(text),
175
171
  deliveryCapabilities: { durableFinal: {
@@ -181,7 +177,7 @@ function createWhatsAppOutboundBase({ chunker, sendMessageWhatsApp, sendPollWhat
181
177
  resolveTarget,
182
178
  ...createAttachedChannelResultAdapter({
183
179
  channel: "whatsapp",
184
- sendText: async ({ cfg, to, text, accountId, deps, gifPlayback, replyToId, onDeliveryResult }) => {
180
+ sendText: async ({ cfg, to, text, accountId, deps, gifPlayback, replyToId, replyToIdSource, replyToMode, formatting, onPlatformSendDispatch, onDeliveryResult }) => {
185
181
  const normalizedText = normalizeText(text);
186
182
  if (skipEmptyText && !normalizedText) return { messageId: "" };
187
183
  const lookupAccountId = resolveQuoteLookupAccountId(cfg, accountId);
@@ -195,13 +191,17 @@ function createWhatsAppOutboundBase({ chunker, sendMessageWhatsApp, sendPollWhat
195
191
  cfg,
196
192
  accountId: accountId ?? void 0,
197
193
  gifPlayback,
194
+ replyToIdSource,
195
+ replyToMode,
196
+ formatting,
197
+ onPlatformSendDispatch,
198
198
  ...quotedMessageKey ? { quotedMessageKey } : {},
199
199
  ...onDeliveryResult ? { onDeliveryResult: async (result) => {
200
200
  await onDeliveryResult(attachChannelToResult("whatsapp", result));
201
201
  } } : {}
202
202
  });
203
203
  },
204
- sendMedia: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, audioAsVoice, accountId, deps, gifPlayback, forceDocument, replyToId, onDeliveryResult }) => {
204
+ sendMedia: async ({ cfg, to, text, mediaUrl, mediaAccess, mediaLocalRoots, mediaReadFile, audioAsVoice, accountId, deps, gifPlayback, forceDocument, replyToId, replyToIdSource, replyToMode, formatting, onPlatformSendDispatch, onDeliveryResult }) => {
205
205
  const lookupAccountId = resolveQuoteLookupAccountId(cfg, accountId);
206
206
  const quotedMessageKey = resolveQuotedMessageKey({
207
207
  accountId: lookupAccountId,
@@ -219,6 +219,10 @@ function createWhatsAppOutboundBase({ chunker, sendMessageWhatsApp, sendPollWhat
219
219
  accountId: accountId ?? void 0,
220
220
  gifPlayback,
221
221
  forceDocument,
222
+ replyToIdSource,
223
+ replyToMode,
224
+ formatting,
225
+ onPlatformSendDispatch,
222
226
  ...quotedMessageKey ? { quotedMessageKey } : {},
223
227
  ...onDeliveryResult ? { onDeliveryResult: async (result) => {
224
228
  await onDeliveryResult(attachChannelToResult("whatsapp", result));
@@ -260,8 +264,8 @@ function createWhatsAppOutboundBase({ chunker, sendMessageWhatsApp, sendPollWhat
260
264
  }
261
265
  //#endregion
262
266
  //#region extensions/whatsapp/src/channel-outbound.ts
263
- const loadWhatsAppApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-Jyr1JaAK.js").then((n) => n.t));
264
- const loadWhatsAppQuestionReactionsModule = createLazyRuntimeModule(() => import("./question-reactions-D3eAeB0i.js").then((n) => n.n));
267
+ const loadWhatsAppApprovalReactionsModule = createLazyRuntimeModule(() => import("./approval-reactions-DGDA6hQ7.js").then((n) => n.t));
268
+ const loadWhatsAppQuestionReactionsModule = createLazyRuntimeModule(() => import("./question-reactions-B9D6MHXZ.js").then((n) => n.n));
265
269
  function normalizeWhatsAppChannelPayloadText(text) {
266
270
  return normalizeWhatsAppPayloadTextPreservingIndentation(text);
267
271
  }
@@ -286,7 +290,6 @@ async function registerDeliveredWhatsAppApprovalPayload(params) {
286
290
  }
287
291
  const whatsappChannelOutbound = {
288
292
  ...createWhatsAppOutboundBase({
289
- chunker: chunkText,
290
293
  sendMessageWhatsApp: async (to, text, options) => await sendMessageWhatsApp(to, text, {
291
294
  ...options,
292
295
  preserveLeadingWhitespace: true
@@ -418,7 +421,7 @@ const WHATSAPP_ACCOUNT_STATUS_FIELDS = [
418
421
  "lastError",
419
422
  "healthState"
420
423
  ];
421
- const RECENT_DISCONNECT_WARNING_WINDOW_MS = 900 * 1e3;
424
+ const RECENT_DISCONNECT_WARNING_WINDOW_MS = 9e5;
422
425
  function readLastDisconnect(value) {
423
426
  if (typeof value === "string") {
424
427
  const error = normalizeOptionalString(value);
@@ -525,8 +528,8 @@ function collectWhatsAppStatusIssues(accounts) {
525
528
  }
526
529
  //#endregion
527
530
  //#region extensions/whatsapp/src/channel.ts
528
- const loadWhatsAppDirectoryConfig = createLazyRuntimeModule(() => import("./directory-config-P7_3U73Z.js").then((n) => n.t));
529
- const loadWhatsAppChannelReactAction = createLazyRuntimeModule(() => import("./channel-react-action-CstrR0CT.js"));
531
+ const loadWhatsAppDirectoryConfig = createLazyRuntimeModule(() => import("./directory-config-LgxYJLWY.js").then((n) => n.t));
532
+ const loadWhatsAppChannelReactAction = createLazyRuntimeModule(() => import("./channel-react-action-BUp7Wbfr.js"));
530
533
  function resolveWhatsAppTargetInfo(raw) {
531
534
  const normalized = normalizeWhatsAppTarget(raw);
532
535
  if (!normalized) return null;
@@ -563,7 +566,6 @@ const whatsappPlugin = createChatChannelPlugin({
563
566
  isConfigured: (account) => Boolean(account.authDir),
564
567
  isLinked: async (account) => await readWhatsAppAccountLinkState(account.authDir)
565
568
  }),
566
- agentTools: () => [createWhatsAppLoginTool()],
567
569
  allowlist: buildDmGroupAccountAllowlistAdapter({
568
570
  channelId: "whatsapp",
569
571
  resolveAccount: resolveWhatsAppAccount,
@@ -1,2 +1,2 @@
1
- import { t as WhatsAppChannelConfigSchema } from "./config-schema-BQP5YCeK.js";
1
+ import { t as WhatsAppChannelConfigSchema } from "./config-schema-BYA6e_Ii.js";
2
2
  export { WhatsAppChannelConfigSchema };
@@ -1,2 +1,2 @@
1
- import { t as whatsappPlugin } from "./channel-DRMYRfZ8.js";
1
+ import { t as whatsappPlugin } from "./channel-DxMmDjqK.js";
2
2
  export { whatsappPlugin };
@@ -1,7 +1,7 @@
1
- import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-BX2fZUyR.js";
1
+ import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-CeKQbu_s.js";
2
2
  import { c as normalizeWhatsAppTarget, t as isWhatsAppGroupJid } from "./normalize-target-CugRyONv.js";
3
- import { r as resolveAuthorizedWhatsAppOutboundTarget, t as handleWhatsAppAction } from "./action-runtime-pM-ExU0l.js";
4
- import { a as sendWhatsAppUploadFile } from "./send-CwvTU4RI.js";
3
+ import { r as resolveAuthorizedWhatsAppOutboundTarget, t as handleWhatsAppAction } from "./action-runtime-Bw0loEdy.js";
4
+ import { a as sendWhatsAppUploadFile } from "./send-DiPjiygK.js";
5
5
  import "./normalize-C7Hkc_vE.js";
6
6
  import { jsonResult, readStringOrNumberParam, readStringParam as readStringParam$1, resolveReactionMessageId } from "openclaw/plugin-sdk/channel-actions";
7
7
  import { canonicalizeBase64, estimateBase64DecodedBytes } from "openclaw/plugin-sdk/media-runtime";
@@ -1,9 +1,9 @@
1
1
  import { startWebLoginWithQr as startWebLoginWithQr$1, waitForWebLogin as waitForWebLogin$1 } from "./login-qr-runtime.js";
2
- import { c as logoutWeb$1, d as readWebAuthExistsBestEffort$1, f as readWebAuthExistsForDecision$1, g as readWebSelfId$1, h as readWebAuthState$1, m as readWebAuthSnapshotBestEffort$1, o as getWebAuthAgeMs$1, p as readWebAuthSnapshot$1, s as logWebSelfId$1, x as webAuthExists$1 } from "./auth-store-CtpBqH5S.js";
2
+ import { c as logoutWeb$1, d as readWebAuthExistsBestEffort$1, f as readWebAuthExistsForDecision$1, g as readWebSelfId$1, h as readWebAuthState$1, m as readWebAuthSnapshotBestEffort$1, o as getWebAuthAgeMs$1, p as readWebAuthSnapshot$1, s as logWebSelfId$1, x as webAuthExists$1 } from "./auth-store-DTj1H9pv.js";
3
3
  import { t as getActiveWebListener$1 } from "./active-listener-BEjWsCNM.js";
4
- import { t as monitorWebChannel$1 } from "./monitor-IzwQKizW.js";
5
- import { t as loginWeb$1 } from "./login-BkpKpndm.js";
6
- import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-Cwn3zyxK.js";
4
+ import { t as monitorWebChannel$1 } from "./monitor-CTsyo-HE.js";
5
+ import { t as loginWeb$1 } from "./login-Bk_jiXKD.js";
6
+ import { whatsappSetupWizard as whatsappSetupWizard$1 } from "./setup-surface-Dm3T6S8t.js";
7
7
  //#region extensions/whatsapp/src/channel.runtime.ts
8
8
  function getActiveWebListener(...args) {
9
9
  return getActiveWebListener$1(...args);
@@ -1,4 +1,4 @@
1
- import { a as resolveWhatsAppGroupRequireMention, i as whatsappSetupContract, l as readWhatsAppAccountLinkState, n as whatsappSetupWizardProxy, o as resolveWhatsAppGroupToolPolicy, t as createWhatsAppPluginBase } from "./shared-wg42NKFB.js";
1
+ import { a as resolveWhatsAppGroupRequireMention, i as whatsappSetupContract, l as readWhatsAppAccountLinkState, n as whatsappSetupWizardProxy, o as resolveWhatsAppGroupToolPolicy, t as createWhatsAppPluginBase } from "./shared-DDjonGys.js";
2
2
  //#region extensions/whatsapp/src/channel.setup.ts
3
3
  const whatsappSetupPlugin = { ...createWhatsAppPluginBase({
4
4
  groups: {
@@ -1,9 +1,8 @@
1
1
  import { createChannelConfigUiHints } from "openclaw/plugin-sdk/channel-core";
2
2
  import { buildChannelConfigSchema } from "openclaw/plugin-sdk/channel-config-schema";
3
3
  import { WhatsAppConfigSchema } from "openclaw/plugin-sdk/bundled-channel-config-schema";
4
- //#endregion
5
- //#region extensions/whatsapp/src/config-schema.ts
6
- const WhatsAppChannelConfigSchema = buildChannelConfigSchema(WhatsAppConfigSchema, { uiHints: {
4
+ //#region extensions/whatsapp/src/config-ui-hints.ts
5
+ const whatsAppChannelConfigUiHints = {
7
6
  "": {
8
7
  label: "WhatsApp",
9
8
  help: "WhatsApp channel provider configuration for access policy and direct-message routing safety."
@@ -45,6 +44,9 @@ const WhatsAppChannelConfigSchema = buildChannelConfigSchema(WhatsAppConfigSchem
45
44
  policyTargetDescription: "WhatsApp conversation IDs such as 123@g.us"
46
45
  }
47
46
  })
48
- } });
47
+ };
48
+ //#endregion
49
+ //#region extensions/whatsapp/src/config-schema.ts
50
+ const WhatsAppChannelConfigSchema = buildChannelConfigSchema(WhatsAppConfigSchema, { uiHints: whatsAppChannelConfigUiHints });
49
51
  //#endregion
50
52
  export { WhatsAppChannelConfigSchema as t };
@@ -1,7 +1,7 @@
1
1
  import { r as getWhatsAppChannelRuntime } from "./runtime-BLlToOi6.js";
2
2
  import { n as WHATSAPP_CONNECTION_OWNER_PENDING_CAPABILITY, t as WHATSAPP_CONNECTION_CONTROLLER_CAPABILITY } from "./connection-controller-runtime-context-DG0tuYuw.js";
3
- import { M as waitForCredsSaveQueueWithTimeout, c as logoutWeb, f as readWebAuthExistsForDecision, k as resolveComparableIdentity, r as WhatsAppAuthUnstableError } from "./auth-store-CtpBqH5S.js";
4
- import { a as waitForWaConnection, m as acquireWhatsAppGatewayConnectionOwner, o as DEFAULT_WHATSAPP_SOCKET_TIMING, r as createWaSocket, t as closeWhatsAppSocketAndWait } from "./socket-close-2T0_jZTN.js";
3
+ import { M as waitForCredsSaveQueueWithTimeout, c as logoutWeb, f as readWebAuthExistsForDecision, k as resolveComparableIdentity, r as WhatsAppAuthUnstableError } from "./auth-store-DTj1H9pv.js";
4
+ import { a as waitForWaConnection, m as acquireWhatsAppGatewayConnectionOwner, o as DEFAULT_WHATSAPP_SOCKET_TIMING, r as createWaSocket, t as closeWhatsAppSocketAndWait } from "./socket-close-CpkkJZCU.js";
5
5
  import { n as getStatusCode, t as formatError } from "./session-errors-JuazczrA.js";
6
6
  import { computeBackoff, info, sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
7
7
  import { registerChannelRuntimeContext } from "openclaw/plugin-sdk/channel-runtime-context";
@@ -1,4 +1,4 @@
1
1
  //#region extensions/whatsapp/src/auto-reply/constants.ts
2
- const DEFAULT_WEB_MEDIA_BYTES = 5 * 1024 * 1024;
2
+ const DEFAULT_WEB_MEDIA_BYTES = 5242880;
3
3
  //#endregion
4
4
  export { DEFAULT_WEB_MEDIA_BYTES as t };
@@ -1,11 +1,11 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { c as resolveMergedWhatsAppAccountConfig, o as resolveWhatsAppAuthDir } from "./accounts-BX2fZUyR.js";
2
+ import { c as resolveMergedWhatsAppAccountConfig, o as resolveWhatsAppAuthDir } from "./accounts-CeKQbu_s.js";
3
3
  import { c as normalizeWhatsAppTarget, t as isWhatsAppGroupJid } from "./normalize-target-CugRyONv.js";
4
4
  import { i as hasPendingWhatsAppConnectionOwner, r as getWhatsAppConnectionController } from "./connection-controller-runtime-context-DG0tuYuw.js";
5
5
  import "./normalize-C7Hkc_vE.js";
6
- import { M as waitForCredsSaveQueueWithTimeout, f as readWebAuthExistsForDecision } from "./auth-store-CtpBqH5S.js";
6
+ import { M as waitForCredsSaveQueueWithTimeout, f as readWebAuthExistsForDecision } from "./auth-store-DTj1H9pv.js";
7
7
  import { n as resolveWebAccountId } from "./active-listener-BEjWsCNM.js";
8
- import { a as waitForWaConnection, h as acquireWhatsAppStandaloneConnectionOwner, n as createWaDirectorySocket, p as WhatsAppConnectionOwnerBusyError, t as closeWhatsAppSocketAndWait } from "./socket-close-2T0_jZTN.js";
8
+ import { a as waitForWaConnection, h as acquireWhatsAppStandaloneConnectionOwner, n as createWaDirectorySocket, p as WhatsAppConnectionOwnerBusyError, t as closeWhatsAppSocketAndWait } from "./socket-close-CpkkJZCU.js";
9
9
  import { listResolvedDirectoryGroupEntriesFromMapKeys, listResolvedDirectoryUserEntriesFromAllowFrom } from "openclaw/plugin-sdk/directory-config-runtime";
10
10
  //#region extensions/whatsapp/src/directory-config.ts
11
11
  var directory_config_exports = /* @__PURE__ */ __exportAll({
@@ -1,4 +1,4 @@
1
- import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-P7_3U73Z.js";
1
+ import { n as listWhatsAppDirectoryGroupsFromConfig, r as listWhatsAppDirectoryPeersFromConfig } from "./directory-config-LgxYJLWY.js";
2
2
  //#region extensions/whatsapp/directory-contract-api.ts
3
3
  const whatsappDirectoryContractPlugin = {
4
4
  id: "whatsapp",
@@ -1,8 +1,8 @@
1
- import { a as resolveWhatsAppAccount } from "./accounts-BX2fZUyR.js";
1
+ import { a as resolveWhatsAppAccount } from "./accounts-CeKQbu_s.js";
2
2
  import { c as normalizeWhatsAppTarget } from "./normalize-target-CugRyONv.js";
3
3
  import "./normalize-C7Hkc_vE.js";
4
- import { r as jidToE164 } from "./targets-runtime-TMk0lGuy.js";
5
- import "./text-runtime-CaKLhowd.js";
4
+ import { r as jidToE164 } from "./targets-runtime-RBjx3pg_.js";
5
+ import "./text-runtime-DyfmcATV.js";
6
6
  import { formatMediaPlaceholderText } from "openclaw/plugin-sdk/channel-inbound";
7
7
  import { createChannelApprovalAuth } from "openclaw/plugin-sdk/approval-auth-runtime";
8
8
  import { isHostedLidUser, isHostedPnUser, isLidUser, isPnUser } from "baileys";
@@ -32,7 +32,7 @@ const getWhatsAppApprovalApprovers = whatsappApproval.resolveApprovers;
32
32
  const whatsappApprovalAuth = whatsappApproval.approvalAuth;
33
33
  //#endregion
34
34
  //#region extensions/whatsapp/src/quoted-message.ts
35
- const CACHE_TTL_MS = 600 * 1e3;
35
+ const CACHE_TTL_MS = 6e5;
36
36
  const MAX_ENTRIES = 500;
37
37
  const cache = /* @__PURE__ */ new Map();
38
38
  function makeCacheKey(accountId, remoteJid, messageId) {
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { defineBundledChannelEntry, loadBundledEntryExportSync } from "openclaw/plugin-sdk/channel-entry-contract";
2
2
  //#region extensions/whatsapp/index.ts
3
- function registerWhatsAppCallTool(api) {
3
+ function registerWhatsAppAgentTools(api) {
4
4
  loadBundledEntryExportSync(import.meta.url, {
5
- specifier: "./call-tool-api.js",
6
- exportName: "registerWhatsAppCallTool"
5
+ specifier: "./agent-tools-api.js",
6
+ exportName: "registerWhatsAppAgentTools"
7
7
  })(api);
8
8
  }
9
9
  var whatsapp_default = defineBundledChannelEntry({
@@ -19,7 +19,7 @@ var whatsapp_default = defineBundledChannelEntry({
19
19
  specifier: "./runtime-setter-api.js",
20
20
  exportName: "setWhatsAppRuntime"
21
21
  },
22
- registerFull: registerWhatsAppCallTool
22
+ registerFull: registerWhatsAppAgentTools
23
23
  });
24
24
  //#endregion
25
25
  export { whatsapp_default as default };
@@ -1,5 +1,5 @@
1
- import { t as createWhatsAppLoginTool } from "./agent-tools-login-BjRpD-JQ.js";
2
- import { c as logoutWeb, g as readWebSelfId, l as pickWebChannel, o as getWebAuthAgeMs, s as logWebSelfId, t as WA_WEB_AUTH_DIR, x as webAuthExists, y as resolveDefaultWebAuthDir } from "./auth-store-CtpBqH5S.js";
1
+ import { t as createWhatsAppLoginTool } from "./agent-tools-login-B-2qZPzc.js";
2
+ import { c as logoutWeb, g as readWebSelfId, l as pickWebChannel, o as getWebAuthAgeMs, s as logWebSelfId, t as WA_WEB_AUTH_DIR, x as webAuthExists, y as resolveDefaultWebAuthDir } from "./auth-store-DTj1H9pv.js";
3
3
  import { t as getActiveWebListener } from "./active-listener-BEjWsCNM.js";
4
4
  import { n as getStatusCode, t as formatError } from "./session-errors-JuazczrA.js";
5
5
  export { WA_WEB_AUTH_DIR, createWhatsAppLoginTool, formatError, getActiveWebListener, getStatusCode, getWebAuthAgeMs, logWebSelfId, logoutWeb, pickWebChannel, readWebSelfId, resolveDefaultWebAuthDir, webAuthExists };
@@ -1,8 +1,8 @@
1
1
  import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
- import { a as resolveWhatsAppAccount } from "./accounts-BX2fZUyR.js";
3
- import { b as restoreCredsFromBackupIfNeeded } from "./auth-store-CtpBqH5S.js";
4
- import { f as renderQrTerminal, r as createWaSocket, u as resolveWhatsAppSocketTiming } from "./socket-close-2T0_jZTN.js";
5
- import { a as closeWaSocketSoon, o as waitForWhatsAppLoginResult } from "./connection-controller-CIYuBJrs.js";
2
+ import { a as resolveWhatsAppAccount } from "./accounts-CeKQbu_s.js";
3
+ import { b as restoreCredsFromBackupIfNeeded } from "./auth-store-DTj1H9pv.js";
4
+ import { f as renderQrTerminal, r as createWaSocket, u as resolveWhatsAppSocketTiming } from "./socket-close-CpkkJZCU.js";
5
+ import { a as closeWaSocketSoon, o as waitForWhatsAppLoginResult } from "./connection-controller-BvkxsbWi.js";
6
6
  import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
7
7
  import { logInfo } from "openclaw/plugin-sdk/logging-core";
8
8
  import { danger, defaultRuntime, success } from "openclaw/plugin-sdk/runtime-env";
@@ -12,8 +12,9 @@ var login_exports = /* @__PURE__ */ __exportAll({ loginWeb: () => loginWeb });
12
12
  const QR_LINK_INSTRUCTION = "Open the WhatsApp app, go to Linked Devices, then scan this QR:";
13
13
  const CLEAR_TERMINAL = "\x1B[2J\x1B[H";
14
14
  async function loginWeb(verbose, waitForConnection, runtime = defaultRuntime, accountId, options) {
15
+ const cfg = getRuntimeConfig();
15
16
  const account = resolveWhatsAppAccount({
16
- cfg: getRuntimeConfig(),
17
+ cfg,
17
18
  accountId
18
19
  });
19
20
  const socketTiming = resolveWhatsAppSocketTiming();