@openclaw/whatsapp 2026.7.1-beta.1 → 2026.7.1-beta.4

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 (516) hide show
  1. package/dist/{access-control-88UPniDc.js → access-control-DYE5dXna.js} +5 -3
  2. package/dist/{accounts-DgViSyJx.js → accounts-4YgwroRU.js} +1 -1
  3. package/dist/{action-runtime-HPX_j5T4.js → action-runtime-DPahAqxV.js} +2 -2
  4. package/dist/action-runtime-api.js +1 -1
  5. package/dist/action-runtime.runtime.js +1 -1
  6. package/dist/{active-listener-CFwkn3ho.js → active-listener-B4SDebQ6.js} +1 -1
  7. package/dist/api.js +16 -12
  8. package/dist/{approval-handler.runtime-CSpqzpr5.js → approval-handler.runtime-DNWS4aYQ.js} +1 -1
  9. package/dist/auth-presence.js +1 -1
  10. package/dist/{auth-store-ECx4h57q.js → auth-store-Db-wfApd.js} +23 -13
  11. package/dist/call-tool-api.js +233 -0
  12. package/dist/{channel-BAj2xDFM.js → channel-BWp7h1uY.js} +45 -19
  13. package/dist/channel-config-api.js +1 -1
  14. package/dist/channel-plugin-api.js +1 -1
  15. package/dist/{channel-react-action-Dfn3giuP.js → channel-react-action-CKJHL_Wf.js} +4 -11
  16. package/dist/{channel.runtime-D_0MiKk3.js → channel.runtime-CAssfx9p.js} +5 -5
  17. package/dist/{channel.setup-3tEq3gHA.js → channel.setup-CURc5rEt.js} +2 -2
  18. package/dist/{config-schema-CROZuhT-.js → config-schema-mBX2nmn1.js} +4 -0
  19. package/dist/{connection-controller-u-tfAFhJ.js → connection-controller-DkbrFSIn.js} +6 -5
  20. package/dist/connection-controller-registry-TSX_udJp.js +22 -0
  21. package/dist/contract-api.js +1 -1
  22. package/dist/{quoted-message-CpA_ujXK.js → group-session-key-BhC1RQOE.js} +31 -2
  23. package/dist/{identity-CmsTmkKR.js → identity-Dqft3mFA.js} +2 -1
  24. package/dist/index.js +9 -2
  25. package/dist/light-runtime-api.js +3 -3
  26. package/dist/{login-8lHwLmXj.js → login-C48y0jlx.js} +14 -7
  27. package/dist/{login-qr-BEZZqrTb.js → login-qr-BjId7dll.js} +7 -7
  28. package/dist/login-qr-runtime.js +2 -5
  29. package/dist/{monitor-DnsIesIx.js → monitor-DD8bXohk.js} +262 -171
  30. package/dist/runtime-api.js +9 -9
  31. package/dist/{send-BVzLSkaY.js → send-C5CpFcBG.js} +29 -13
  32. package/dist/{send-api-45J-BzEp.js → send-api-DLlXl8CH.js} +6 -5
  33. package/dist/{session-WU4SVP8f.js → session-DriaHt7V.js} +3 -3
  34. package/dist/{session-errors-CbsoQqoy.js → session-errors-BAj9D2La.js} +1 -22
  35. package/dist/{setup-core-BLI8hThs.js → setup-core-DH-DFPLY.js} +4 -4
  36. package/dist/{setup-finalize-BrZsNK4V.js → setup-finalize-c8dl34sO.js} +3 -3
  37. package/dist/setup-plugin-api.js +1 -1
  38. package/dist/{setup-surface-DaVQrr0L.js → setup-surface-DlWb0Z09.js} +3 -3
  39. package/dist/{socket-timing-DvMNkIge.js → socket-timing-DhbVFjah.js} +17 -5
  40. package/dist/{text-runtime-C88QkuU9.js → targets-runtime-C-GiVn6Y.js} +2 -3
  41. package/dist/text-runtime-DdX6-mC_.js +4 -0
  42. package/node_modules/@cacheable/memory/README.md +177 -0
  43. package/node_modules/@cacheable/memory/dist/index.cjs +867 -820
  44. package/node_modules/@cacheable/memory/dist/index.d.cts +382 -280
  45. package/node_modules/@cacheable/memory/dist/index.d.mts +412 -0
  46. package/node_modules/@cacheable/memory/dist/index.mjs +841 -0
  47. package/node_modules/@cacheable/memory/package.json +9 -9
  48. package/node_modules/@cacheable/utils/README.md +342 -8
  49. package/node_modules/@cacheable/utils/dist/index.cjs +1322 -619
  50. package/node_modules/@cacheable/utils/dist/index.d.cts +769 -173
  51. package/node_modules/@cacheable/utils/dist/index.d.mts +903 -0
  52. package/node_modules/@cacheable/utils/dist/index.mjs +1355 -0
  53. package/node_modules/@cacheable/utils/package.json +8 -8
  54. package/node_modules/@types/node/README.md +1 -1
  55. package/node_modules/@types/node/assert/strict.d.ts +10 -1
  56. package/node_modules/@types/node/assert.d.ts +144 -17
  57. package/node_modules/@types/node/async_hooks.d.ts +9 -9
  58. package/node_modules/@types/node/buffer.d.ts +64 -30
  59. package/node_modules/@types/node/child_process.d.ts +17 -21
  60. package/node_modules/@types/node/cluster.d.ts +13 -13
  61. package/node_modules/@types/node/console.d.ts +1 -1
  62. package/node_modules/@types/node/crypto.d.ts +471 -575
  63. package/node_modules/@types/node/diagnostics_channel.d.ts +274 -32
  64. package/node_modules/@types/node/dns.d.ts +15 -15
  65. package/node_modules/@types/node/events.d.ts +3 -3
  66. package/node_modules/@types/node/ffi.d.ts +486 -0
  67. package/node_modules/@types/node/fs/promises.d.ts +7 -4
  68. package/node_modules/@types/node/fs.d.ts +24 -18
  69. package/node_modules/@types/node/globals.d.ts +4 -4
  70. package/node_modules/@types/node/http.d.ts +30 -5
  71. package/node_modules/@types/node/http2.d.ts +5 -1
  72. package/node_modules/@types/node/index.d.ts +1 -3
  73. package/node_modules/@types/node/inspector.d.ts +1 -1
  74. package/node_modules/@types/node/module.d.ts +16 -45
  75. package/node_modules/@types/node/net.d.ts +1 -1
  76. package/node_modules/@types/node/os.d.ts +2 -2
  77. package/node_modules/@types/node/package.json +4 -4
  78. package/node_modules/@types/node/perf_hooks.d.ts +1 -9
  79. package/node_modules/@types/node/process.d.ts +25 -12
  80. package/node_modules/@types/node/quic.d.ts +92 -11
  81. package/node_modules/@types/node/readline.d.ts +12 -11
  82. package/node_modules/@types/node/repl.d.ts +10 -10
  83. package/node_modules/@types/node/sqlite.d.ts +56 -1
  84. package/node_modules/@types/node/stream/iter.d.ts +150 -0
  85. package/node_modules/@types/node/stream/promises.d.ts +2 -2
  86. package/node_modules/@types/node/stream/web.d.ts +1 -1
  87. package/node_modules/@types/node/stream.d.ts +37 -5
  88. package/node_modules/@types/node/test/reporters.d.ts +1 -1
  89. package/node_modules/@types/node/test.d.ts +120 -10
  90. package/node_modules/@types/node/tls.d.ts +1 -1
  91. package/node_modules/@types/node/ts5.6/index.d.ts +2 -4
  92. package/node_modules/@types/node/ts5.7/index.d.ts +1 -3
  93. package/node_modules/@types/node/url.d.ts +3 -3
  94. package/node_modules/@types/node/util/types.d.ts +1 -1
  95. package/node_modules/@types/node/util.d.ts +22 -22
  96. package/node_modules/@types/node/v8.d.ts +85 -3
  97. package/node_modules/@types/node/vm.d.ts +9 -9
  98. package/node_modules/@types/node/web-globals/domexception.d.ts +15 -0
  99. package/node_modules/@types/node/worker_threads.d.ts +10 -12
  100. package/node_modules/@types/node/zlib.d.ts +3 -3
  101. package/node_modules/cacheable/README.md +309 -30
  102. package/node_modules/cacheable/dist/index.cjs +1307 -1153
  103. package/node_modules/cacheable/dist/index.d.cts +741 -469
  104. package/node_modules/cacheable/dist/index.d.mts +766 -0
  105. package/node_modules/cacheable/dist/index.mjs +1210 -0
  106. package/node_modules/cacheable/package.json +10 -10
  107. package/node_modules/content-type/README.md +32 -57
  108. package/node_modules/content-type/dist/index.d.ts +26 -0
  109. package/node_modules/content-type/dist/index.js +170 -0
  110. package/node_modules/content-type/dist/index.js.map +1 -0
  111. package/node_modules/content-type/package.json +35 -25
  112. package/node_modules/media-typer/README.md +19 -33
  113. package/node_modules/media-typer/dist/index.d.ts +29 -0
  114. package/node_modules/media-typer/dist/index.js +64 -0
  115. package/node_modules/media-typer/dist/index.js.map +1 -0
  116. package/node_modules/media-typer/package.json +37 -22
  117. package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.js +2 -2
  118. package/node_modules/music-metadata/lib/mp4/AtomToken.js +65 -13
  119. package/node_modules/music-metadata/lib/wav/WaveChunk.d.ts +10 -0
  120. package/node_modules/music-metadata/lib/wav/WaveChunk.js +13 -3
  121. package/node_modules/music-metadata/lib/wav/WaveParser.d.ts +1 -0
  122. package/node_modules/music-metadata/lib/wav/WaveParser.js +6 -5
  123. package/node_modules/music-metadata/package.json +5 -5
  124. package/node_modules/typebox/build/compile/validator.d.mts +2 -7
  125. package/node_modules/typebox/build/compile/validator.mjs +6 -36
  126. package/node_modules/typebox/build/error/errors.d.mts +1 -7
  127. package/node_modules/typebox/build/format/_idna.mjs +36 -6
  128. package/node_modules/typebox/build/format/_puny.mjs +4 -1
  129. package/node_modules/typebox/build/format/uuid.d.mts +2 -2
  130. package/node_modules/typebox/build/format/uuid.mjs +3 -3
  131. package/node_modules/typebox/build/guard/emit.d.mts +0 -4
  132. package/node_modules/typebox/build/guard/emit.mjs +0 -8
  133. package/node_modules/typebox/build/guard/guard.d.mts +4 -8
  134. package/node_modules/typebox/build/guard/guard.mjs +5 -13
  135. package/node_modules/typebox/build/schema/engine/boolean.d.mts +3 -3
  136. package/node_modules/typebox/build/schema/engine/boolean.mjs +4 -4
  137. package/node_modules/typebox/build/schema/engine/index.d.mts +0 -1
  138. package/node_modules/typebox/build/schema/engine/index.mjs +0 -1
  139. package/node_modules/typebox/build/schema/engine/schema.mjs +5 -10
  140. package/node_modules/typebox/build/schema/engine/type.mjs +14 -18
  141. package/node_modules/typebox/build/schema/types/dependencies.mjs +1 -1
  142. package/node_modules/typebox/build/schema/types/index.d.mts +0 -1
  143. package/node_modules/typebox/build/schema/types/index.mjs +0 -1
  144. package/node_modules/typebox/build/schema/types/schema.d.mts +1 -1
  145. package/node_modules/typebox/build/schema/types/schema.mjs +2 -2
  146. package/node_modules/typebox/build/system/locale/ar_001.mjs +0 -1
  147. package/node_modules/typebox/build/system/locale/bn_BD.mjs +0 -1
  148. package/node_modules/typebox/build/system/locale/cs_CZ.mjs +0 -1
  149. package/node_modules/typebox/build/system/locale/de_DE.mjs +0 -1
  150. package/node_modules/typebox/build/system/locale/el_GR.mjs +0 -1
  151. package/node_modules/typebox/build/system/locale/en_US.mjs +0 -1
  152. package/node_modules/typebox/build/system/locale/es_419.mjs +0 -1
  153. package/node_modules/typebox/build/system/locale/es_AR.mjs +0 -1
  154. package/node_modules/typebox/build/system/locale/es_ES.mjs +0 -1
  155. package/node_modules/typebox/build/system/locale/es_MX.mjs +0 -1
  156. package/node_modules/typebox/build/system/locale/fa_IR.mjs +0 -1
  157. package/node_modules/typebox/build/system/locale/fil_PH.mjs +0 -1
  158. package/node_modules/typebox/build/system/locale/fr_CA.mjs +0 -1
  159. package/node_modules/typebox/build/system/locale/fr_FR.mjs +0 -1
  160. package/node_modules/typebox/build/system/locale/ha_NG.mjs +0 -1
  161. package/node_modules/typebox/build/system/locale/hi_IN.mjs +0 -1
  162. package/node_modules/typebox/build/system/locale/hu_HU.mjs +0 -1
  163. package/node_modules/typebox/build/system/locale/id_ID.mjs +0 -1
  164. package/node_modules/typebox/build/system/locale/it_IT.mjs +0 -1
  165. package/node_modules/typebox/build/system/locale/ja_JP.mjs +0 -1
  166. package/node_modules/typebox/build/system/locale/ko_KR.mjs +0 -1
  167. package/node_modules/typebox/build/system/locale/ms_MY.mjs +0 -1
  168. package/node_modules/typebox/build/system/locale/nl_NL.mjs +0 -1
  169. package/node_modules/typebox/build/system/locale/pl_PL.mjs +0 -1
  170. package/node_modules/typebox/build/system/locale/pt_BR.mjs +0 -1
  171. package/node_modules/typebox/build/system/locale/pt_PT.mjs +0 -1
  172. package/node_modules/typebox/build/system/locale/ro_RO.mjs +0 -1
  173. package/node_modules/typebox/build/system/locale/ru_RU.mjs +0 -1
  174. package/node_modules/typebox/build/system/locale/sv_SE.mjs +0 -1
  175. package/node_modules/typebox/build/system/locale/sw_TZ.mjs +0 -1
  176. package/node_modules/typebox/build/system/locale/th_TH.mjs +0 -1
  177. package/node_modules/typebox/build/system/locale/tr_TR.mjs +0 -1
  178. package/node_modules/typebox/build/system/locale/uk_UA.mjs +0 -1
  179. package/node_modules/typebox/build/system/locale/ur_PK.mjs +0 -1
  180. package/node_modules/typebox/build/system/locale/vi_VN.mjs +0 -1
  181. package/node_modules/typebox/build/system/locale/yo_NG.mjs +0 -1
  182. package/node_modules/typebox/build/system/locale/zh_Hans.mjs +0 -1
  183. package/node_modules/typebox/build/system/locale/zh_Hant.mjs +0 -1
  184. package/node_modules/typebox/build/system/memory/clone.d.mts +2 -3
  185. package/node_modules/typebox/build/system/memory/clone.mjs +73 -26
  186. package/node_modules/typebox/build/system/settings/settings.d.mts +15 -0
  187. package/node_modules/typebox/build/system/settings/settings.mjs +3 -1
  188. package/node_modules/typebox/build/type/action/_add_immutable.d.mts +11 -0
  189. package/node_modules/typebox/build/type/action/_add_immutable.mjs +11 -0
  190. package/node_modules/typebox/build/type/action/_add_optional.d.mts +11 -0
  191. package/node_modules/typebox/build/type/action/_add_optional.mjs +11 -0
  192. package/node_modules/typebox/build/type/action/_add_readonly.d.mts +11 -0
  193. package/node_modules/typebox/build/type/action/_add_readonly.mjs +11 -0
  194. package/node_modules/typebox/build/type/action/_remove_immutable.d.mts +11 -0
  195. package/node_modules/typebox/build/type/action/_remove_immutable.mjs +11 -0
  196. package/node_modules/typebox/build/type/action/_remove_optional.d.mts +11 -0
  197. package/node_modules/typebox/build/type/action/_remove_optional.mjs +11 -0
  198. package/node_modules/typebox/build/type/action/_remove_readonly.d.mts +11 -0
  199. package/node_modules/typebox/build/type/action/_remove_readonly.mjs +11 -0
  200. package/node_modules/typebox/build/type/action/conditional.d.mts +2 -3
  201. package/node_modules/typebox/build/type/action/conditional.mjs +2 -1
  202. package/node_modules/typebox/build/type/action/index.d.mts +7 -4
  203. package/node_modules/typebox/build/type/action/index.mjs +7 -4
  204. package/node_modules/typebox/build/type/action/mapped.d.mts +2 -3
  205. package/node_modules/typebox/build/type/action/mapped.mjs +2 -1
  206. package/node_modules/typebox/build/type/action/module.d.mts +8 -7
  207. package/node_modules/typebox/build/type/action/module.mjs +7 -6
  208. package/node_modules/typebox/build/type/action/readonly_object.d.mts +0 -5
  209. package/node_modules/typebox/build/type/action/readonly_object.mjs +0 -5
  210. package/node_modules/typebox/build/type/action/with.d.mts +11 -0
  211. package/node_modules/typebox/build/type/action/with.mjs +11 -0
  212. package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +1 -1
  213. package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +1 -3
  214. package/node_modules/typebox/build/type/engine/call/instantiate.mjs +3 -2
  215. package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +2 -2
  216. package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +3 -4
  217. package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +2 -1
  218. package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +2 -3
  219. package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +3 -6
  220. package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +6 -9
  221. package/node_modules/typebox/build/type/engine/cyclic/check.mjs +10 -16
  222. package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +1 -4
  223. package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +9 -15
  224. package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +1 -4
  225. package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +8 -14
  226. package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +2 -5
  227. package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +3 -2
  228. package/node_modules/typebox/build/type/engine/enum/index.d.mts +0 -1
  229. package/node_modules/typebox/build/type/engine/enum/index.mjs +0 -1
  230. package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +1 -2
  231. package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +2 -6
  232. package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +10 -6
  233. package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +10 -6
  234. package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +2 -1
  235. package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +3 -3
  236. package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +17 -5
  237. package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +34 -8
  238. package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +5 -6
  239. package/node_modules/typebox/build/type/engine/exclude/operation.mjs +11 -12
  240. package/node_modules/typebox/build/type/engine/extract/operation.d.mts +5 -6
  241. package/node_modules/typebox/build/type/engine/extract/operation.mjs +11 -12
  242. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
  243. package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
  244. package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
  245. package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
  246. package/node_modules/typebox/build/type/engine/index.d.mts +2 -2
  247. package/node_modules/typebox/build/type/engine/index.mjs +2 -2
  248. package/node_modules/typebox/build/type/engine/indexable/from_dependent.d.mts +5 -0
  249. package/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +8 -0
  250. package/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +3 -3
  251. package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +4 -4
  252. package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +2 -2
  253. package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +3 -3
  254. package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +3 -1
  255. package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +9 -6
  256. package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +2 -1
  257. package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +5 -2
  258. package/node_modules/typebox/build/type/engine/instantiate.d.mts +44 -31
  259. package/node_modules/typebox/build/type/engine/instantiate.mjs +82 -83
  260. package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +3 -6
  261. package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +2 -2
  262. package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +3 -3
  263. package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +2 -1
  264. package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +5 -1
  265. package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +4 -4
  266. package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +3 -3
  267. package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +5 -4
  268. package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +10 -5
  269. package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +7 -9
  270. package/node_modules/typebox/build/type/engine/module/instantiate.mjs +17 -15
  271. package/node_modules/typebox/build/type/engine/object/from_dependent.d.mts +5 -0
  272. package/node_modules/typebox/build/type/engine/object/from_dependent.mjs +8 -0
  273. package/node_modules/typebox/build/type/engine/object/from_type.d.mts +3 -1
  274. package/node_modules/typebox/build/type/engine/object/from_type.mjs +8 -5
  275. package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
  276. package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
  277. package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
  278. package/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
  279. package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
  280. package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +3 -4
  281. package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +2 -1
  282. package/node_modules/typebox/build/type/engine/partial/from_dependent.d.mts +5 -0
  283. package/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +8 -0
  284. package/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +1 -1
  285. package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +3 -2
  286. package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +2 -2
  287. package/node_modules/typebox/build/type/engine/partial/from_object.mjs +2 -2
  288. package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +3 -1
  289. package/node_modules/typebox/build/type/engine/partial/from_type.mjs +7 -4
  290. package/node_modules/typebox/build/type/engine/priority/index.d.mts +1 -0
  291. package/node_modules/typebox/build/type/engine/priority/index.mjs +1 -0
  292. package/node_modules/typebox/build/type/engine/priority/priority.d.mts +20 -0
  293. package/node_modules/typebox/build/type/engine/priority/priority.mjs +28 -0
  294. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
  295. package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
  296. package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
  297. package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
  298. package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +2 -2
  299. package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +2 -2
  300. package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
  301. package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +8 -0
  302. package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +1 -1
  303. package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +3 -2
  304. package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +2 -2
  305. package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +2 -2
  306. package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +2 -2
  307. package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +2 -2
  308. package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +3 -1
  309. package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +8 -5
  310. package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +2 -2
  311. package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +2 -2
  312. package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +2 -2
  313. package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +2 -2
  314. package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +3 -3
  315. package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +6 -6
  316. package/node_modules/typebox/build/type/engine/required/from_dependent.d.mts +5 -0
  317. package/node_modules/typebox/build/type/engine/required/from_dependent.mjs +8 -0
  318. package/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +1 -1
  319. package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +3 -2
  320. package/node_modules/typebox/build/type/engine/required/from_object.d.mts +2 -2
  321. package/node_modules/typebox/build/type/engine/required/from_object.mjs +2 -2
  322. package/node_modules/typebox/build/type/engine/required/from_type.d.mts +3 -1
  323. package/node_modules/typebox/build/type/engine/required/from_type.mjs +7 -4
  324. package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +3 -3
  325. package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +2 -2
  326. package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +6 -6
  327. package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +1 -1
  328. package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +1 -0
  329. package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +1 -4
  330. package/node_modules/typebox/build/type/engine/this/expand_this.mjs +7 -13
  331. package/node_modules/typebox/build/type/engine/with/instantiate.d.mts +8 -0
  332. package/node_modules/typebox/build/type/engine/{options → with}/instantiate.mjs +5 -5
  333. package/node_modules/typebox/build/type/extends/dependent.d.mts +6 -0
  334. package/node_modules/typebox/build/type/extends/dependent.mjs +6 -0
  335. package/node_modules/typebox/build/type/extends/enum.d.mts +4 -4
  336. package/node_modules/typebox/build/type/extends/enum.mjs +3 -2
  337. package/node_modules/typebox/build/type/extends/extends_left.d.mts +5 -7
  338. package/node_modules/typebox/build/type/extends/extends_left.mjs +24 -27
  339. package/node_modules/typebox/build/type/extends/extends_right.d.mts +7 -5
  340. package/node_modules/typebox/build/type/extends/extends_right.mjs +20 -15
  341. package/node_modules/typebox/build/type/extends/inference.mjs +1 -1
  342. package/node_modules/typebox/build/type/extends/object.d.mts +8 -1
  343. package/node_modules/typebox/build/type/extends/object.mjs +25 -3
  344. package/node_modules/typebox/build/type/extends/parameters.mjs +2 -2
  345. package/node_modules/typebox/build/type/extends/record.d.mts +13 -0
  346. package/node_modules/typebox/build/type/extends/record.mjs +23 -0
  347. package/node_modules/typebox/build/type/extends/template_literal.d.mts +3 -3
  348. package/node_modules/typebox/build/type/extends/template_literal.mjs +3 -3
  349. package/node_modules/typebox/build/type/extends/tuple.d.mts +3 -6
  350. package/node_modules/typebox/build/type/extends/tuple.mjs +6 -5
  351. package/node_modules/typebox/build/type/extends/union.mjs +2 -2
  352. package/node_modules/typebox/build/type/script/mapping.d.mts +84 -99
  353. package/node_modules/typebox/build/type/script/mapping.mjs +81 -85
  354. package/node_modules/typebox/build/type/script/parser.d.mts +40 -40
  355. package/node_modules/typebox/build/type/script/parser.mjs +22 -22
  356. package/node_modules/typebox/build/type/script/script.d.mts +3 -4
  357. package/node_modules/typebox/build/type/script/script.mjs +3 -2
  358. package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -1
  359. package/node_modules/typebox/build/type/script/token/internal/guard.mjs +1 -1
  360. package/node_modules/typebox/build/type/script/token/internal/take.mjs +1 -1
  361. package/node_modules/typebox/build/type/script/token/until.mjs +2 -2
  362. package/node_modules/typebox/build/type/types/_codec.d.mts +12 -12
  363. package/node_modules/typebox/build/type/types/_codec.mjs +0 -1
  364. package/node_modules/typebox/build/type/types/_immutable.d.mts +2 -9
  365. package/node_modules/typebox/build/type/types/_immutable.mjs +2 -10
  366. package/node_modules/typebox/build/type/types/_optional.d.mts +2 -9
  367. package/node_modules/typebox/build/type/types/_optional.mjs +2 -11
  368. package/node_modules/typebox/build/type/types/_readonly.d.mts +2 -9
  369. package/node_modules/typebox/build/type/types/_readonly.mjs +2 -10
  370. package/node_modules/typebox/build/type/types/_refine.d.mts +8 -10
  371. package/node_modules/typebox/build/type/types/_refine.mjs +1 -2
  372. package/node_modules/typebox/build/type/types/call.d.mts +3 -3
  373. package/node_modules/typebox/build/type/types/call.mjs +3 -2
  374. package/node_modules/typebox/build/type/types/deferred.d.mts +1 -0
  375. package/node_modules/typebox/build/type/types/deferred.mjs +1 -1
  376. package/node_modules/typebox/build/type/types/dependent.d.mts +17 -0
  377. package/node_modules/typebox/build/type/types/dependent.mjs +24 -0
  378. package/node_modules/typebox/build/type/types/enum.d.mts +3 -1
  379. package/node_modules/typebox/build/type/types/enum.mjs +5 -0
  380. package/node_modules/typebox/build/type/types/index.d.mts +1 -4
  381. package/node_modules/typebox/build/type/types/index.mjs +1 -4
  382. package/node_modules/typebox/build/type/types/number.d.mts +1 -1
  383. package/node_modules/typebox/build/type/types/number.mjs +1 -1
  384. package/node_modules/typebox/build/type/types/record.d.mts +13 -7
  385. package/node_modules/typebox/build/type/types/record.mjs +15 -9
  386. package/node_modules/typebox/build/type/types/static.d.mts +2 -5
  387. package/node_modules/typebox/build/typebox.d.mts +4 -8
  388. package/node_modules/typebox/build/typebox.mjs +4 -8
  389. package/node_modules/typebox/build/value/clean/clean.mjs +4 -2
  390. package/node_modules/typebox/build/value/clean/from_intersect.mjs +2 -2
  391. package/node_modules/typebox/build/value/clean/from_type.mjs +8 -10
  392. package/node_modules/typebox/build/value/clean/from_union.d.mts +1 -1
  393. package/node_modules/typebox/build/value/clean/from_union.mjs +1 -2
  394. package/node_modules/typebox/build/value/clone/clone.mjs +2 -73
  395. package/node_modules/typebox/build/value/codec/decode.mjs +4 -2
  396. package/node_modules/typebox/build/value/codec/encode.mjs +4 -2
  397. package/node_modules/typebox/build/value/codec/from_array.mjs +1 -4
  398. package/node_modules/typebox/build/value/codec/from_object.mjs +1 -4
  399. package/node_modules/typebox/build/value/codec/from_record.mjs +2 -7
  400. package/node_modules/typebox/build/value/codec/from_tuple.mjs +1 -4
  401. package/node_modules/typebox/build/value/codec/from_union.mjs +2 -3
  402. package/node_modules/typebox/build/value/convert/from_enum.mjs +3 -4
  403. package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +1 -1
  404. package/node_modules/typebox/build/value/convert/from_template_literal.mjs +2 -3
  405. package/node_modules/typebox/build/value/convert/from_type.mjs +19 -21
  406. package/node_modules/typebox/build/value/create/from_enum.mjs +2 -2
  407. package/node_modules/typebox/build/value/create/from_type.mjs +23 -31
  408. package/node_modules/typebox/build/value/default/from_object.mjs +1 -1
  409. package/node_modules/typebox/build/value/default/from_type.mjs +8 -10
  410. package/node_modules/typebox/build/value/index.d.mts +0 -1
  411. package/node_modules/typebox/build/value/index.mjs +0 -1
  412. package/node_modules/typebox/build/value/repair/from_enum.mjs +2 -3
  413. package/node_modules/typebox/build/value/repair/from_type.mjs +24 -22
  414. package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +6 -2
  415. package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +62 -26
  416. package/node_modules/typebox/build/value/value.d.mts +0 -1
  417. package/node_modules/typebox/build/value/value.mjs +0 -1
  418. package/node_modules/typebox/package.json +25 -25
  419. package/node_modules/typebox/readme.md +97 -80
  420. package/node_modules/undici-types/agent.d.ts +0 -2
  421. package/node_modules/undici-types/client.d.ts +25 -19
  422. package/node_modules/undici-types/dispatcher.d.ts +7 -33
  423. package/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
  424. package/node_modules/undici-types/fetch.d.ts +24 -4
  425. package/node_modules/undici-types/h2c-client.d.ts +6 -6
  426. package/node_modules/undici-types/handlers.d.ts +1 -2
  427. package/node_modules/undici-types/header.d.ts +5 -0
  428. package/node_modules/undici-types/index.d.ts +3 -1
  429. package/node_modules/undici-types/interceptors.d.ts +1 -1
  430. package/node_modules/undici-types/package.json +1 -1
  431. package/node_modules/undici-types/pool.d.ts +0 -2
  432. package/node_modules/undici-types/proxy-agent.d.ts +2 -2
  433. package/node_modules/undici-types/round-robin-pool.d.ts +0 -2
  434. package/node_modules/undici-types/snapshot-agent.d.ts +4 -0
  435. package/node_modules/undici-types/socks5-proxy-agent.d.ts +2 -2
  436. package/node_modules/undici-types/webidl.d.ts +0 -1
  437. package/npm-shrinkwrap.json +49 -41
  438. package/openclaw.plugin.json +12 -0
  439. package/package.json +5 -5
  440. package/node_modules/@cacheable/memory/dist/index.d.ts +0 -310
  441. package/node_modules/@cacheable/memory/dist/index.js +0 -807
  442. package/node_modules/@cacheable/utils/dist/index.d.ts +0 -307
  443. package/node_modules/@cacheable/utils/dist/index.js +0 -630
  444. package/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
  445. package/node_modules/cacheable/dist/index.d.ts +0 -494
  446. package/node_modules/cacheable/dist/index.js +0 -1141
  447. package/node_modules/content-type/HISTORY.md +0 -29
  448. package/node_modules/content-type/index.js +0 -225
  449. package/node_modules/media-typer/HISTORY.md +0 -50
  450. package/node_modules/media-typer/index.js +0 -143
  451. package/node_modules/typebox/build/schema/engine/_guard.d.mts +0 -6
  452. package/node_modules/typebox/build/schema/engine/_guard.mjs +0 -26
  453. package/node_modules/typebox/build/schema/types/_guard.d.mts +0 -10
  454. package/node_modules/typebox/build/schema/types/_guard.mjs +0 -16
  455. package/node_modules/typebox/build/type/action/_optional.d.mts +0 -19
  456. package/node_modules/typebox/build/type/action/_optional.mjs +0 -40
  457. package/node_modules/typebox/build/type/action/_readonly.d.mts +0 -19
  458. package/node_modules/typebox/build/type/action/_readonly.mjs +0 -40
  459. package/node_modules/typebox/build/type/action/awaited.d.mts +0 -15
  460. package/node_modules/typebox/build/type/action/awaited.mjs +0 -15
  461. package/node_modules/typebox/build/type/action/options.d.mts +0 -11
  462. package/node_modules/typebox/build/type/action/options.mjs +0 -11
  463. package/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +0 -11
  464. package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +0 -20
  465. package/node_modules/typebox/build/type/engine/enum/enum_to_union.d.mts +0 -14
  466. package/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +0 -24
  467. package/node_modules/typebox/build/type/engine/options/index.d.mts +0 -1
  468. package/node_modules/typebox/build/type/engine/options/index.mjs +0 -1
  469. package/node_modules/typebox/build/type/engine/options/instantiate.d.mts +0 -8
  470. package/node_modules/typebox/build/type/extends/async_iterator.d.mts +0 -7
  471. package/node_modules/typebox/build/type/extends/async_iterator.mjs +0 -9
  472. package/node_modules/typebox/build/type/extends/iterator.d.mts +0 -7
  473. package/node_modules/typebox/build/type/extends/iterator.mjs +0 -9
  474. package/node_modules/typebox/build/type/extends/promise.d.mts +0 -7
  475. package/node_modules/typebox/build/type/extends/promise.mjs +0 -9
  476. package/node_modules/typebox/build/type/types/async_iterator.d.mts +0 -20
  477. package/node_modules/typebox/build/type/types/async_iterator.mjs +0 -28
  478. package/node_modules/typebox/build/type/types/base.d.mts +0 -50
  479. package/node_modules/typebox/build/type/types/base.mjs +0 -84
  480. package/node_modules/typebox/build/type/types/iterator.d.mts +0 -20
  481. package/node_modules/typebox/build/type/types/iterator.mjs +0 -28
  482. package/node_modules/typebox/build/type/types/promise.d.mts +0 -21
  483. package/node_modules/typebox/build/type/types/promise.mjs +0 -29
  484. package/node_modules/typebox/build/value/clean/from_base.d.mts +0 -2
  485. package/node_modules/typebox/build/value/clean/from_base.mjs +0 -4
  486. package/node_modules/typebox/build/value/convert/from_base.d.mts +0 -2
  487. package/node_modules/typebox/build/value/convert/from_base.mjs +0 -4
  488. package/node_modules/typebox/build/value/create/from_async_iterator.d.mts +0 -2
  489. package/node_modules/typebox/build/value/create/from_async_iterator.mjs +0 -5
  490. package/node_modules/typebox/build/value/create/from_base.d.mts +0 -2
  491. package/node_modules/typebox/build/value/create/from_base.mjs +0 -4
  492. package/node_modules/typebox/build/value/create/from_iterator.d.mts +0 -2
  493. package/node_modules/typebox/build/value/create/from_iterator.mjs +0 -5
  494. package/node_modules/typebox/build/value/create/from_promise.d.mts +0 -2
  495. package/node_modules/typebox/build/value/create/from_promise.mjs +0 -5
  496. package/node_modules/typebox/build/value/default/from_base.d.mts +0 -2
  497. package/node_modules/typebox/build/value/default/from_base.mjs +0 -5
  498. package/node_modules/typebox/build/value/mutate/error.d.mts +0 -3
  499. package/node_modules/typebox/build/value/mutate/error.mjs +0 -6
  500. package/node_modules/typebox/build/value/mutate/from_array.d.mts +0 -2
  501. package/node_modules/typebox/build/value/mutate/from_array.mjs +0 -16
  502. package/node_modules/typebox/build/value/mutate/from_object.d.mts +0 -2
  503. package/node_modules/typebox/build/value/mutate/from_object.mjs +0 -40
  504. package/node_modules/typebox/build/value/mutate/from_unknown.d.mts +0 -2
  505. package/node_modules/typebox/build/value/mutate/from_unknown.mjs +0 -7
  506. package/node_modules/typebox/build/value/mutate/from_value.d.mts +0 -2
  507. package/node_modules/typebox/build/value/mutate/from_value.mjs +0 -12
  508. package/node_modules/typebox/build/value/mutate/index.d.mts +0 -1
  509. package/node_modules/typebox/build/value/mutate/index.mjs +0 -1
  510. package/node_modules/typebox/build/value/mutate/mutate.d.mts +0 -11
  511. package/node_modules/typebox/build/value/mutate/mutate.mjs +0 -41
  512. package/node_modules/typebox/build/value/repair/from_base.d.mts +0 -2
  513. package/node_modules/typebox/build/value/repair/from_base.mjs +0 -8
  514. package/dist/{approval-resolver-e1hAVRRy.js → approval-resolver-DF-lu8k5.js} +1 -1
  515. /package/node_modules/typebox/build/type/engine/{awaited → with}/index.d.mts +0 -0
  516. /package/node_modules/typebox/build/type/engine/{awaited → with}/index.mjs +0 -0
@@ -1,18 +1,20 @@
1
- import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-DgViSyJx.js";
2
- import { a as normalizeWhatsAppOutboundPayload, c as prepareWhatsAppOutboundMedia, d as maybeResolveWhatsAppApprovalReaction, g as resolveWhatsAppReactionLevel, l as sendWhatsAppOutboundWithRetry, r as sendReactionWhatsApp, s as normalizeWhatsAppPayloadTextPreservingIndentation } from "./send-BVzLSkaY.js";
1
+ import { a as resolveWhatsAppAccount, s as resolveWhatsAppMediaMaxBytes } from "./accounts-4YgwroRU.js";
2
+ import { a as normalizeWhatsAppOutboundPayload, c as prepareWhatsAppOutboundMedia, d as maybeResolveWhatsAppApprovalReaction, g as resolveWhatsAppReactionLevel, l as sendWhatsAppOutboundWithRetry, r as sendReactionWhatsApp, s as normalizeWhatsAppPayloadTextPreservingIndentation } from "./send-C5CpFcBG.js";
3
3
  import { n as getWhatsAppRuntime } from "./runtime-BfAdAEYT.js";
4
- import { n as getStatusCode, r as getRegisteredWhatsAppConnectionController, t as formatError } from "./session-errors-CbsoQqoy.js";
5
- import { a as resolveWhatsAppSocketTiming, i as resolveWhatsAppSocketOperationTimeoutMs, n as createWhatsAppSocketOperationTimeoutAdapter, o as withWhatsAppSocketOperationTimeout, r as isWhatsAppSocketOperationTimeoutError } from "./socket-timing-DvMNkIge.js";
6
- import { d as markdownToWhatsApp, f as resolveEquivalentWhatsAppDirectChatJids, l as isSelfChatMode, n as normalizeE164, p as resolveJidToE164, t as convertMarkdownTables$1, u as jidToE164 } from "./text-runtime-C88QkuU9.js";
7
- import { n as cacheInboundMessageMeta, r as lookupInboundMessageMeta, t as buildQuotedMessageOptions } from "./quoted-message-CpA_ujXK.js";
8
- import { g as readWebSelfId, o as getWebAuthAgeMs, r as WhatsAppAuthUnstableError, v as readWebSelfIdentityForDecision } from "./auth-store-ECx4h57q.js";
9
- import { a as getSelfIdentity, c as resolveComparableIdentity, i as getReplyContext, n as getMentionIdentities, o as getSenderIdentity, r as getPrimaryIdentityId, s as identitiesOverlap, t as getComparableIdentityValues } from "./identity-CmsTmkKR.js";
4
+ import { t as getRegisteredWhatsAppConnectionController } from "./connection-controller-registry-TSX_udJp.js";
5
+ import { n as getStatusCode, t as formatError } from "./session-errors-BAj9D2La.js";
6
+ import { a as resolveWhatsAppSocketTiming, i as resolveWhatsAppSocketOperationTimeoutMs, n as createWhatsAppSocketOperationTimeoutAdapter, o as withWhatsAppSocketOperationTimeout, r as isWhatsAppSocketOperationTimeoutError } from "./socket-timing-DhbVFjah.js";
7
+ import { a as resolveEquivalentWhatsAppDirectChatJids, c as toWhatsappJidWithLid, i as markdownToWhatsApp, n as isSelfChatMode, o as resolveJidToE164, r as jidToE164, s as toWhatsappJid } from "./targets-runtime-C-GiVn6Y.js";
8
+ import { n as normalizeE164, t as convertMarkdownTables$1 } from "./text-runtime-DdX6-mC_.js";
9
+ import { a as cacheInboundMessageMeta, i as buildQuotedMessageOptions, n as resolveWhatsAppGroupSessionRoute, o as lookupInboundMessageMeta, r as resolveWhatsAppLegacyGroupSessionKey } from "./group-session-key-BhC1RQOE.js";
10
+ import { g as readWebSelfId, o as getWebAuthAgeMs, r as WhatsAppAuthUnstableError, v as readWebSelfIdentityForDecision } from "./auth-store-Db-wfApd.js";
11
+ import { a as getSelfIdentity, c as resolveComparableIdentity, i as getReplyContext, n as getMentionIdentities, o as getSenderIdentity, r as getPrimaryIdentityId, s as identitiesOverlap, t as getComparableIdentityValues } from "./identity-Dqft3mFA.js";
10
12
  import { n as resolveWhatsAppGroupsConfigPath } from "./group-config-path-BGyzT9Lg.js";
11
- import { c as requireWhatsAppInboundAdmission, i as resolveWhatsAppInboundPolicy, l as resolveWhatsAppGroupConversationId, o as buildDeprecatedFlatWhatsAppInboundAdmission, r as resolveWhatsAppCommandAuthorized, s as requireAdmittedWhatsAppInboundMessage, t as checkInboundAccessControl } from "./access-control-88UPniDc.js";
12
- import { _ as extractLocationData, a as mayContainWhatsAppOutboundMention, b as extractText, c as DisconnectReason, d as normalizeMessageContent, f as resolveInboundMediaMimetype, g as extractExternalAdReplyContext, h as extractContextInfo, i as addWhatsAppOutboundMentionsToContent, l as downloadMediaMessage, m as extractContactContext, n as listWhatsAppSendResultMessageIds, o as resolveWhatsAppOutboundMentions, p as describeReplyContext, r as normalizeWhatsAppSendResult, s as addWhatsAppImagePreviewFields, t as createWebSendApi, u as isJidGroup, v as extractMediaPlaceholder, x as hasInboundUserContent, y as extractMentionedJids } from "./send-api-45J-BzEp.js";
13
- import { r as waitForWaConnection, t as createWaSocket } from "./session-WU4SVP8f.js";
13
+ import { c as requireWhatsAppInboundAdmission, i as resolveWhatsAppInboundPolicy, l as resolveWhatsAppGroupConversationId, o as buildDeprecatedFlatWhatsAppInboundAdmission, r as resolveWhatsAppCommandAuthorized, s as requireAdmittedWhatsAppInboundMessage, t as checkInboundAccessControl } from "./access-control-DYE5dXna.js";
14
+ import { _ as extractLocationData, a as mayContainWhatsAppOutboundMention, b as extractText, c as DisconnectReason, d as normalizeMessageContent, f as resolveInboundMediaMimetype, g as extractExternalAdReplyContext, h as extractContextInfo, i as addWhatsAppOutboundMentionsToContent, l as downloadMediaMessage, m as extractContactContext, n as listWhatsAppSendResultMessageIds, o as resolveWhatsAppOutboundMentions, p as describeReplyContext, r as normalizeWhatsAppSendResult, s as addWhatsAppImagePreviewFields, t as createWebSendApi, u as isJidGroup, v as extractMediaPlaceholder, x as hasInboundUserContent, y as extractMentionedJids } from "./send-api-DLlXl8CH.js";
15
+ import { r as waitForWaConnection, t as createWaSocket } from "./session-DriaHt7V.js";
14
16
  import { t as BufferJSON } from "./session.runtime-CyooSQvj.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-u-tfAFhJ.js";
17
+ 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-DkbrFSIn.js";
16
18
  import { resolveAccountEntry } from "openclaw/plugin-sdk/account-core";
17
19
  import { normalizeLowercaseStringOrEmpty, normalizeStringEntries, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
18
20
  import { createChannelMessageReplyPipeline, createDurableInboundReceiveJournalFromQueue, createMessageReceiptFromOutboundResults, deliverInboundReplyWithMessageSendContext, resolveChannelMessageSourceReplyDeliveryMode } from "openclaw/plugin-sdk/channel-outbound";
@@ -22,16 +24,17 @@ import { formatCliCommand } from "openclaw/plugin-sdk/cli-runtime";
22
24
  import { getChildLogger } from "openclaw/plugin-sdk/logging-core";
23
25
  import { resolveMarkdownTableMode as resolveMarkdownTableMode$1 } from "openclaw/plugin-sdk/markdown-table-runtime";
24
26
  import { createSubsystemLogger, defaultRuntime, formatDurationPrecise, getChildLogger as getChildLogger$1, logVerbose, logVerbose as logVerbose$1, registerUnhandledRejectionHandler, shouldLogVerbose, shouldLogVerbose as shouldLogVerbose$1, warn } from "openclaw/plugin-sdk/runtime-env";
27
+ import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
25
28
  import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/media-runtime";
26
29
  import { asDateTimestampMs, parseStrictFiniteNumber, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
27
30
  import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
28
31
  import { LocalMediaAccessError, getDefaultLocalRoots, loadWebMedia as loadWebMedia$1, loadWebMediaRaw, optimizeImageToJpeg, optimizeImageToPng } from "openclaw/plugin-sdk/web-media";
29
32
  import { chunkMarkdownTextWithMode } from "openclaw/plugin-sdk/reply-chunking";
30
33
  import { isReasoningReplyPayload, resolveSendableOutboundReplyParts, sendMediaWithLeadingCaption } from "openclaw/plugin-sdk/reply-payload";
31
- import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, DEFAULT_MAIN_KEY, buildAgentMainSessionKey, buildAgentSessionKey, buildGroupHistoryKey, deriveLastRoutePolicy, normalizeAccountId as normalizeAccountId$1, normalizeAgentId, resolveAgentRoute, resolveInboundLastRouteSessionKey, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
34
+ import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, DEFAULT_MAIN_KEY, buildAgentMainSessionKey, buildAgentSessionKey, buildGroupHistoryKey, deriveLastRoutePolicy, normalizeAccountId as normalizeAccountId$1, normalizeAgentId, resolveAgentRoute, resolveInboundLastRouteSessionKey } from "openclaw/plugin-sdk/routing";
32
35
  import { recordInboundSession } from "openclaw/plugin-sdk/conversation-runtime";
33
36
  import { getSessionEntry, patchSessionEntry, resolveStorePath, resolveStorePath as resolveStorePath$1, updateLastRoute } from "openclaw/plugin-sdk/session-store-runtime";
34
- import { buildChannelInboundEventContext, filterChannelInboundQuoteContext, formatInboundEnvelope, formatInboundEnvelope as formatInboundEnvelope$1, formatLocationText, hasVisibleInboundReplyDispatch, resolveInboundSessionEnvelopeContext, runChannelInboundEvent, toInboundMediaFacts, toLocationContext } from "openclaw/plugin-sdk/channel-inbound";
37
+ import { buildChannelInboundEventContext, filterChannelInboundQuoteContext, formatInboundEnvelope, formatInboundEnvelope as formatInboundEnvelope$1, formatInboundMediaUnavailableText, formatLocationText, hasVisibleInboundReplyDispatch, resolveInboundSessionEnvelopeContext, runChannelInboundEvent, toInboundMediaFacts, toLocationContext } from "openclaw/plugin-sdk/channel-inbound";
35
38
  import { saveMediaStream } from "openclaw/plugin-sdk/media-store";
36
39
  import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
37
40
  import { createHash } from "node:crypto";
@@ -44,6 +47,7 @@ import { drainPendingDeliveries } from "openclaw/plugin-sdk/delivery-queue-runti
44
47
  import { DEFAULT_GROUP_HISTORY_LIMIT, buildHistoryContextFromEntries, buildInboundHistoryFromEntries, createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
45
48
  import { enqueueSystemEvent } from "openclaw/plugin-sdk/system-event-runtime";
46
49
  import { createClaimableDedupe } from "openclaw/plugin-sdk/persistent-dedupe";
50
+ import { collectErrorGraphCandidates, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
47
51
  import { getRuntimeConfig as getRuntimeConfig$1, getRuntimeConfigSourceSnapshot } from "openclaw/plugin-sdk/runtime-config-snapshot";
48
52
  import { resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context-visibility-runtime";
49
53
  import { buildMentionRegexes, implicitMentionKindWhen, normalizeMentionText, resolveInboundMentionDecision } from "openclaw/plugin-sdk/channel-mention-gating";
@@ -54,6 +58,94 @@ import { normalizeGroupActivation, parseActivationCommand } from "openclaw/plugi
54
58
  import { createInternalHookEvent, deriveInboundMessageHookContext, fireAndForgetBoundedHook, toInternalMessageReceivedContext, toPluginMessageContext, toPluginMessageReceivedEvent, triggerInternalHook } from "openclaw/plugin-sdk/hook-runtime";
55
59
  import { getGlobalHookRunner } from "openclaw/plugin-sdk/plugin-runtime";
56
60
  import { resolveBatchedReplyThreadingPolicy } from "openclaw/plugin-sdk/reply-reference";
61
+ //#region extensions/whatsapp/src/inbound/dedupe.ts
62
+ const WHATSAPP_INBOUND_DEDUPE_TTL_MS = 20 * 6e4;
63
+ const RECENT_WEB_MESSAGE_MAX = 5e3;
64
+ const RECENT_OUTBOUND_MESSAGE_TTL_MS = 20 * 6e4;
65
+ const RECENT_OUTBOUND_MESSAGE_MAX = 5e3;
66
+ const claimableInboundMessages = createClaimableDedupe({
67
+ ttlMs: WHATSAPP_INBOUND_DEDUPE_TTL_MS,
68
+ memoryMaxSize: RECENT_WEB_MESSAGE_MAX
69
+ });
70
+ const recentOutboundMessages = createRecentMessageCache({
71
+ ttlMs: RECENT_OUTBOUND_MESSAGE_TTL_MS,
72
+ maxSize: RECENT_OUTBOUND_MESSAGE_MAX
73
+ });
74
+ function createRecentMessageCache(options) {
75
+ const ttlMs = Math.max(0, options.ttlMs);
76
+ const maxSize = Math.max(0, Math.floor(options.maxSize));
77
+ const cache = /* @__PURE__ */ new Map();
78
+ const prune = (now) => {
79
+ if (ttlMs > 0) {
80
+ const cutoff = now - ttlMs;
81
+ for (const [key, timestamp] of cache) if (timestamp < cutoff) cache.delete(key);
82
+ }
83
+ while (cache.size > maxSize) {
84
+ const oldest = cache.keys().next().value;
85
+ if (!oldest) break;
86
+ cache.delete(oldest);
87
+ }
88
+ };
89
+ const peek = (key, now = Date.now()) => {
90
+ if (!key) return false;
91
+ const timestamp = cache.get(key);
92
+ if (timestamp === void 0) return false;
93
+ if (ttlMs > 0 && now - timestamp >= ttlMs) {
94
+ cache.delete(key);
95
+ return false;
96
+ }
97
+ return true;
98
+ };
99
+ return {
100
+ check: (key, now = Date.now()) => {
101
+ if (!key) return false;
102
+ const existed = peek(key, now);
103
+ cache.delete(key);
104
+ cache.set(key, now);
105
+ prune(now);
106
+ return existed;
107
+ },
108
+ peek,
109
+ clear: () => cache.clear()
110
+ };
111
+ }
112
+ var WhatsAppRetryableInboundError = class extends Error {
113
+ constructor(message, options) {
114
+ super(message, options);
115
+ this.name = "WhatsAppRetryableInboundError";
116
+ }
117
+ };
118
+ function buildMessageKey(params) {
119
+ const accountId = params.accountId.trim();
120
+ const remoteJid = params.remoteJid.trim();
121
+ const messageId = params.messageId.trim();
122
+ if (!accountId || !remoteJid || !messageId || messageId === "unknown") return null;
123
+ return `${accountId}:${remoteJid}:${messageId}`;
124
+ }
125
+ function resetWebInboundDedupe() {
126
+ claimableInboundMessages.clearMemory();
127
+ recentOutboundMessages.clear();
128
+ }
129
+ async function claimRecentInboundMessageDelivery(key) {
130
+ return (await claimableInboundMessages.claim(key)).kind;
131
+ }
132
+ async function commitRecentInboundMessage(key) {
133
+ await claimableInboundMessages.commit(key);
134
+ }
135
+ function releaseRecentInboundMessage(key, error) {
136
+ claimableInboundMessages.release(key, { error });
137
+ }
138
+ function rememberRecentOutboundMessage(params) {
139
+ const key = buildMessageKey(params);
140
+ if (!key) return;
141
+ recentOutboundMessages.check(key);
142
+ }
143
+ function isRecentOutboundMessage(params) {
144
+ const key = buildMessageKey(params);
145
+ if (!key) return false;
146
+ return recentOutboundMessages.peek(key);
147
+ }
148
+ //#endregion
57
149
  //#region extensions/whatsapp/src/inbound/message-aliases.ts
58
150
  function normalizeQuoteSender(sender) {
59
151
  if (!sender?.displayName && !sender?.jid && !sender?.e164) return;
@@ -378,94 +470,6 @@ function normalizeWebInboundMessage(msg) {
378
470
  return normalizeLegacyFlatWebInboundMessage(msg);
379
471
  }
380
472
  //#endregion
381
- //#region extensions/whatsapp/src/inbound/dedupe.ts
382
- const RECENT_WEB_MESSAGE_TTL_MS = 20 * 6e4;
383
- const RECENT_WEB_MESSAGE_MAX = 5e3;
384
- const RECENT_OUTBOUND_MESSAGE_TTL_MS = 20 * 6e4;
385
- const RECENT_OUTBOUND_MESSAGE_MAX = 5e3;
386
- const claimableInboundMessages = createClaimableDedupe({
387
- ttlMs: RECENT_WEB_MESSAGE_TTL_MS,
388
- memoryMaxSize: RECENT_WEB_MESSAGE_MAX
389
- });
390
- const recentOutboundMessages = createRecentMessageCache({
391
- ttlMs: RECENT_OUTBOUND_MESSAGE_TTL_MS,
392
- maxSize: RECENT_OUTBOUND_MESSAGE_MAX
393
- });
394
- function createRecentMessageCache(options) {
395
- const ttlMs = Math.max(0, options.ttlMs);
396
- const maxSize = Math.max(0, Math.floor(options.maxSize));
397
- const cache = /* @__PURE__ */ new Map();
398
- const prune = (now) => {
399
- if (ttlMs > 0) {
400
- const cutoff = now - ttlMs;
401
- for (const [key, timestamp] of cache) if (timestamp < cutoff) cache.delete(key);
402
- }
403
- while (cache.size > maxSize) {
404
- const oldest = cache.keys().next().value;
405
- if (!oldest) break;
406
- cache.delete(oldest);
407
- }
408
- };
409
- const peek = (key, now = Date.now()) => {
410
- if (!key) return false;
411
- const timestamp = cache.get(key);
412
- if (timestamp === void 0) return false;
413
- if (ttlMs > 0 && now - timestamp >= ttlMs) {
414
- cache.delete(key);
415
- return false;
416
- }
417
- return true;
418
- };
419
- return {
420
- check: (key, now = Date.now()) => {
421
- if (!key) return false;
422
- const existed = peek(key, now);
423
- cache.delete(key);
424
- cache.set(key, now);
425
- prune(now);
426
- return existed;
427
- },
428
- peek,
429
- clear: () => cache.clear()
430
- };
431
- }
432
- var WhatsAppRetryableInboundError = class extends Error {
433
- constructor(message, options) {
434
- super(message, options);
435
- this.name = "WhatsAppRetryableInboundError";
436
- }
437
- };
438
- function buildMessageKey(params) {
439
- const accountId = params.accountId.trim();
440
- const remoteJid = params.remoteJid.trim();
441
- const messageId = params.messageId.trim();
442
- if (!accountId || !remoteJid || !messageId || messageId === "unknown") return null;
443
- return `${accountId}:${remoteJid}:${messageId}`;
444
- }
445
- function resetWebInboundDedupe() {
446
- claimableInboundMessages.clearMemory();
447
- recentOutboundMessages.clear();
448
- }
449
- async function claimRecentInboundMessageDelivery(key) {
450
- return (await claimableInboundMessages.claim(key)).kind;
451
- }
452
- async function commitRecentInboundMessage(key) {
453
- await claimableInboundMessages.commit(key);
454
- }
455
- function releaseRecentInboundMessage(key, error) {
456
- claimableInboundMessages.release(key, { error });
457
- }
458
- function rememberRecentOutboundMessage(params) {
459
- const key = buildMessageKey(params);
460
- if (!key) return;
461
- recentOutboundMessages.check(key);
462
- }
463
- function isRecentOutboundMessage(params) {
464
- const key = buildMessageKey(params);
465
- if (!key) return false;
466
- return recentOutboundMessages.peek(key);
467
- }
468
- //#endregion
469
473
  //#region extensions/whatsapp/src/inbound/durable-receive.ts
470
474
  const WHATSAPP_DURABLE_INBOUND_PENDING_MAX_ENTRIES = 450;
471
475
  const WHATSAPP_DURABLE_INBOUND_COMPLETED_MAX_ENTRIES = 450;
@@ -537,23 +541,17 @@ async function downloadInboundMedia(msg, sock, maxBytes = 50 * 1024 * 1024) {
537
541
  const mimetype = resolveInboundMediaMimetype(message);
538
542
  const fileName = message.documentMessage?.fileName ?? void 0;
539
543
  if (!message.imageMessage && !message.videoMessage && !message.documentMessage && !message.audioMessage && !message.stickerMessage) return;
540
- try {
541
- return {
542
- saved: await saveMediaStream(await downloadMediaMessage(msg, "stream", {}, {
543
- reuploadRequest: sock.updateMediaMessage,
544
- logger: sock.logger
545
- }), mimetype, "inbound", maxBytes, fileName).catch((err) => {
546
- if (err instanceof Error && /Media exceeds/i.test(err.message)) throw new WhatsAppInboundMediaLimitExceededError(maxBytes);
547
- throw err;
548
- }),
549
- mimetype,
550
- fileName
551
- };
552
- } catch (err) {
553
- if (err instanceof WhatsAppInboundMediaLimitExceededError) throw err;
554
- logVerbose(`downloadMediaMessage failed: ${String(err)}`);
555
- return;
556
- }
544
+ return {
545
+ saved: await saveMediaStream(await downloadMediaMessage(msg, "stream", {}, {
546
+ reuploadRequest: sock.updateMediaMessage,
547
+ logger: sock.logger
548
+ }), mimetype, "inbound", maxBytes, fileName).catch((err) => {
549
+ if (err instanceof Error && /Media exceeds/i.test(err.message)) throw new WhatsAppInboundMediaLimitExceededError(maxBytes);
550
+ throw err;
551
+ }),
552
+ mimetype,
553
+ fileName
554
+ };
557
555
  }
558
556
  async function downloadQuotedInboundMedia(msg, sock, maxBytes = 50 * 1024 * 1024) {
559
557
  const contextInfo = extractContextInfo(unwrapMessage(msg.message));
@@ -577,6 +575,12 @@ const RECONNECT_IN_PROGRESS_ERROR = "no active socket - reconnection in progress
577
575
  const GROUP_META_TTL_MS = 300 * 1e3;
578
576
  const BAILEYS_MESSAGE_TTL_MS = 600 * 1e3;
579
577
  const INBOUND_CLOSE_DRAIN_TIMEOUT_MS = 5e3;
578
+ const REPLY_SESSION_INIT_CONFLICT_MESSAGE_RE = /reply session initialization conflicted for \S+/u;
579
+ function resolveRetryableWhatsAppInboundError(error) {
580
+ if (error instanceof WhatsAppRetryableInboundError) return error;
581
+ if (!collectErrorGraphCandidates(error, (current) => [current.cause, current.error]).some((candidate) => REPLY_SESSION_INIT_CONFLICT_MESSAGE_RE.test(formatErrorMessage(candidate)))) return null;
582
+ return new WhatsAppRetryableInboundError(formatErrorMessage(error), { cause: error });
583
+ }
580
584
  function resolveGroupMetadataExpiresAt(nowRaw = Date.now()) {
581
585
  const now = asDateTimestampMs(nowRaw);
582
586
  return now === void 0 ? void 0 : resolveExpiresAtMsFromDurationMs(GROUP_META_TTL_MS, { nowMs: now });
@@ -644,6 +648,18 @@ function logWhatsAppVerbose(enabled, message) {
644
648
  function isGroupJid(jid) {
645
649
  return (typeof isJidGroup === "function" ? isJidGroup(jid) : jid.endsWith("@g.us")) === true;
646
650
  }
651
+ function isDirectUserJid(jid) {
652
+ return /^(\d+)(?::\d+)?@(s\.whatsapp\.net|c\.us|lid|hosted|hosted\.lid)$/i.test(jid.trim());
653
+ }
654
+ function getActiveReachoutTimelock(state) {
655
+ if (state?.isActive !== true) return;
656
+ const endsAt = state.timeEnforcementEnds?.getTime();
657
+ return endsAt === void 0 || !Number.isFinite(endsAt) || endsAt > Date.now() ? state : void 0;
658
+ }
659
+ function formatReachoutTimelockError(state) {
660
+ const details = [state.enforcementType ? `type=${state.enforcementType}` : void 0, state.timeEnforcementEnds instanceof Date && Number.isFinite(state.timeEnforcementEnds.getTime()) ? `until=${state.timeEnforcementEnds.toISOString()}` : void 0].filter(Boolean);
661
+ return `WhatsApp reachout timelock is active; direct messages are temporarily blocked${details.length ? ` (${details.join(", ")})` : ""}`;
662
+ }
647
663
  function recordAcceptedInboundActivity(accountId) {
648
664
  recordChannelActivity({
649
665
  channel: "whatsapp",
@@ -727,9 +743,10 @@ async function attachWebInboxToSocket(options) {
727
743
  const dedupeKeys = uniqueStrings(entries.map((entry) => entry.dedupeKey).filter(isNonEmptyString));
728
744
  const durableEntries = entries.filter((entry) => isNonEmptyString(entry.durableId));
729
745
  const readReceiptEntries = entries.filter((entry) => Boolean(entry.readReceipt));
730
- if (error instanceof WhatsAppRetryableInboundError) {
731
- dedupeKeys.forEach((dedupeKey) => releaseRecentInboundMessage(dedupeKey, error));
732
- await Promise.all(durableEntries.map((entry) => durableInboundJournal.release(entry.durableId, { lastError: formatError(error) })));
746
+ const retryableError = resolveRetryableWhatsAppInboundError(error);
747
+ if (retryableError) {
748
+ dedupeKeys.forEach((dedupeKey) => releaseRecentInboundMessage(dedupeKey, retryableError));
749
+ await Promise.all(durableEntries.map((entry) => durableInboundJournal.release(entry.durableId, { lastError: formatError(retryableError) })));
733
750
  return;
734
751
  }
735
752
  await Promise.all([...dedupeKeys.map((dedupeKey) => commitRecentInboundMessage(dedupeKey)), ...durableEntries.map((entry) => durableInboundJournal.complete(entry.durableId, entry.readReceipt ? { metadata: { readReceipt: entry.readReceipt } } : void 0))]);
@@ -759,6 +776,7 @@ async function attachWebInboxToSocket(options) {
759
776
  const mentioned = /* @__PURE__ */ new Set();
760
777
  for (const entry of orderedEntries) for (const jid of entry.group?.mentions?.jids ?? []) mentioned.add(jid);
761
778
  const combinedBody = orderedEntries.map((entry) => entry.payload.body).filter(Boolean).join("\n");
779
+ const combinedCommandBody = orderedEntries.map((entry) => entry.payload.commandBody ?? entry.payload.body).filter(Boolean).join("\n");
762
780
  const combinedMentions = mentioned.size > 0 ? {
763
781
  ...last.group?.mentions,
764
782
  jids: Array.from(mentioned)
@@ -771,7 +789,8 @@ async function attachWebInboxToSocket(options) {
771
789
  ...last,
772
790
  payload: {
773
791
  ...last.payload,
774
- body: combinedBody
792
+ body: combinedBody,
793
+ commandBody: combinedCommandBody
775
794
  },
776
795
  group: combinedGroup,
777
796
  event: {
@@ -823,18 +842,71 @@ async function attachWebInboxToSocket(options) {
823
842
  remoteJid,
824
843
  messageId
825
844
  });
826
- rememberBaileysMessage(remoteJid, messageId, typeof result === "object" && result && "message" in result ? result.message : void 0);
845
+ const message = typeof result === "object" && result && "message" in result ? result.message : void 0;
846
+ rememberBaileysMessage(remoteJid, messageId, message);
847
+ cacheInboundMessageMeta(options.accountId, remoteJid, messageId, {
848
+ fromMe: true,
849
+ body: extractText(message ?? void 0)
850
+ });
827
851
  };
828
852
  const trackLateAcceptedSend = (jid, promise) => {
829
853
  promise.then((result) => {
830
854
  rememberOutboundMessage(jid, result);
831
855
  }, () => {});
832
856
  };
857
+ let reachoutTimeLock;
858
+ let reachoutTimeLockFetch;
859
+ let reachoutTimeLockVersion = 0;
860
+ let verifiedSendReady;
861
+ const rememberReachoutTimeLock = (state) => {
862
+ reachoutTimeLock = state;
863
+ reachoutTimeLockVersion += 1;
864
+ verifiedSendReady = void 0;
865
+ };
866
+ const fetchReachoutTimeLock = async (currentSock) => {
867
+ if (typeof currentSock.fetchAccountReachoutTimelock !== "function") return;
868
+ if (!reachoutTimeLockFetch) reachoutTimeLockFetch = currentSock.fetchAccountReachoutTimelock().then((state) => {
869
+ rememberReachoutTimeLock(state);
870
+ return state;
871
+ }).catch((err) => {
872
+ logWhatsAppVerbose(options.verbose, `Failed fetching WhatsApp reachout timelock before send: ${formatError(err)}`);
873
+ }).finally(() => {
874
+ reachoutTimeLockFetch = void 0;
875
+ });
876
+ return await reachoutTimeLockFetch;
877
+ };
878
+ const rememberVerifiedSendReady = (jid, currentSock) => {
879
+ verifiedSendReady = {
880
+ jid,
881
+ sock: currentSock,
882
+ reachoutTimeLockVersion
883
+ };
884
+ };
885
+ const consumeVerifiedSendReady = (jid, currentSock) => {
886
+ if (verifiedSendReady?.jid !== jid || verifiedSendReady.sock !== currentSock || verifiedSendReady.reachoutTimeLockVersion !== reachoutTimeLockVersion) return false;
887
+ verifiedSendReady = void 0;
888
+ return true;
889
+ };
890
+ const assertCanSendToJid = async (jid, currentSock, readinessOptions) => {
891
+ if (!isDirectUserJid(jid)) return;
892
+ if (readinessOptions?.useVerifiedReady && consumeVerifiedSendReady(jid, currentSock)) return;
893
+ const state = getActiveReachoutTimelock(reachoutTimeLock) ?? await fetchReachoutTimeLock(currentSock);
894
+ const activeState = getActiveReachoutTimelock(state);
895
+ if (activeState) throw new Error(formatReachoutTimelockError(activeState));
896
+ if (readinessOptions?.rememberReady && state) rememberVerifiedSendReady(jid, currentSock);
897
+ };
898
+ const assertCanSendTo = async (to) => {
899
+ const currentSock = getCurrentSock();
900
+ if (!currentSock) throw new Error(RECONNECT_IN_PROGRESS_ERROR);
901
+ const jid = options.authDir ? toWhatsappJidWithLid(to, { authDir: options.authDir }) : toWhatsappJid(to);
902
+ await assertCanSendToJid(jid, currentSock, { rememberReady: true });
903
+ };
833
904
  const sendTrackedMessage = async (jid, content, sendOptions) => {
834
905
  let lastErr = /* @__PURE__ */ new Error(RECONNECT_IN_PROGRESS_ERROR);
835
906
  for (let attempt = 1;; attempt++) {
836
907
  const currentSock = getCurrentSock();
837
908
  if (currentSock) try {
909
+ await assertCanSendToJid(jid, currentSock, { useVerifiedReady: true });
838
910
  const result = await createWhatsAppSocketOperationTimeoutAdapter(currentSock, sendOperationTimeoutMs, { onSendMessageTimeout: ({ jid: timedOutJid, promise }) => {
839
911
  trackLateAcceptedSend(timedOutJid, promise);
840
912
  } }).sendMessage(jid, content, sendOptions);
@@ -1046,7 +1118,9 @@ async function attachWebInboxToSocket(options) {
1046
1118
  if (upsertType !== "append") return false;
1047
1119
  const APPEND_RECENT_GRACE_MS = 6e4;
1048
1120
  const msgTsSeconds = parseWhatsAppTimestampSeconds(msg.messageTimestamp);
1049
- return (msgTsSeconds !== void 0 ? msgTsSeconds * 1e3 : 0) < connectedAtMs - APPEND_RECENT_GRACE_MS;
1121
+ const msgTsMs = msgTsSeconds !== void 0 ? msgTsSeconds * 1e3 : 0;
1122
+ const nowMs = Date.now();
1123
+ return msgTsMs < (options.appendReplyWindow && nowMs <= options.appendReplyWindow.untilMs ? Math.max(options.appendReplyWindow.afterMs, nowMs - options.appendReplyWindow.maxAgeMs) : connectedAtMs - APPEND_RECENT_GRACE_MS);
1050
1124
  };
1051
1125
  const processDurableInboundMessage = async (msg, upsertType, receiveOrder, stored) => {
1052
1126
  const inbound = await normalizeInboundMessage(msg);
@@ -1116,12 +1190,14 @@ async function attachWebInboxToSocket(options) {
1116
1190
  const locationText = location ? formatLocationText(location) : void 0;
1117
1191
  const contactContext = extractContactContext(msg.message ?? void 0);
1118
1192
  const externalAdReplyContext = extractExternalAdReplyContext(msg.message ?? void 0);
1193
+ const mediaPlaceholder = extractMediaPlaceholder(msg.message ?? void 0);
1119
1194
  let body = extractText(msg.message ?? void 0);
1120
1195
  if (locationText) body = [body, locationText].filter(Boolean).join("\n").trim();
1121
1196
  if (!body) {
1122
- body = extractMediaPlaceholder(msg.message ?? void 0);
1197
+ body = mediaPlaceholder;
1123
1198
  if (!body) return null;
1124
1199
  }
1200
+ const commandBody = body;
1125
1201
  const replyContext = describeReplyContext(msg.message);
1126
1202
  let mediaPath;
1127
1203
  let mediaType;
@@ -1135,12 +1211,26 @@ async function attachWebInboxToSocket(options) {
1135
1211
  };
1136
1212
  try {
1137
1213
  await saveInboundMedia(await downloadInboundMedia(msg, sock, maxBytes));
1138
- if (!mediaPath && replyContext) await saveInboundMedia(await downloadQuotedInboundMedia(msg, sock, maxBytes));
1139
1214
  } catch (err) {
1140
1215
  logWhatsAppVerbose(options.verbose, `Inbound media download failed: ${String(err)}`);
1216
+ body = formatInboundMediaUnavailableText({
1217
+ body,
1218
+ mediaPlaceholder,
1219
+ notice: "[whatsapp attachment unavailable]"
1220
+ });
1221
+ }
1222
+ if (!mediaPath && replyContext) try {
1223
+ await saveInboundMedia(await downloadQuotedInboundMedia(msg, sock, maxBytes));
1224
+ } catch (err) {
1225
+ logWhatsAppVerbose(options.verbose, `Quoted media download failed: ${String(err)}`);
1226
+ body = formatInboundMediaUnavailableText({
1227
+ body,
1228
+ notice: "[whatsapp quoted attachment unavailable]"
1229
+ });
1141
1230
  }
1142
1231
  return {
1143
1232
  body,
1233
+ commandBody,
1144
1234
  location: location ?? void 0,
1145
1235
  contactContext,
1146
1236
  externalAdReplyContext,
@@ -1153,8 +1243,10 @@ async function attachWebInboxToSocket(options) {
1153
1243
  const enqueueInboundMessage = async (msg, inbound, enriched, durable) => {
1154
1244
  const chatJid = inbound.remoteJid;
1155
1245
  const sendComposing = async () => {
1156
- if (!getCurrentSock()) return;
1246
+ const currentSock = getCurrentSock();
1247
+ if (!currentSock) return;
1157
1248
  try {
1249
+ await assertCanSendToJid(chatJid, currentSock);
1158
1250
  await sendApiSocketOperations.sendPresenceUpdate("composing", chatJid);
1159
1251
  } catch (err) {
1160
1252
  logWhatsAppVerbose(options.verbose, `Presence update failed: ${String(err)}`);
@@ -1165,7 +1257,8 @@ async function attachWebInboxToSocket(options) {
1165
1257
  return normalizeWhatsAppSendResult(await sendTrackedMessage(chatJid, addWhatsAppOutboundMentionsToContent({ text: resolved.text }, resolved.mentionedJids), optionsResult), "text");
1166
1258
  };
1167
1259
  const sendMedia = async (payload, optionsValue) => {
1168
- return normalizeWhatsAppSendResult(await sendTrackedMessage(chatJid, await applyOutboundMentionsToContent(chatJid, await addWhatsAppImagePreviewFields(payload)), optionsValue), "media");
1260
+ const previewPayload = await addWhatsAppImagePreviewFields(payload);
1261
+ return normalizeWhatsAppSendResult(await sendTrackedMessage(chatJid, await applyOutboundMentionsToContent(chatJid, previewPayload), optionsValue), "media");
1169
1262
  };
1170
1263
  const timestamp = inbound.messageTimestampMs;
1171
1264
  const mentionedJids = extractMentionedJids(msg.message);
@@ -1209,6 +1302,7 @@ async function attachWebInboxToSocket(options) {
1209
1302
  },
1210
1303
  payload: {
1211
1304
  body: enriched.body,
1305
+ commandBody: enriched.commandBody,
1212
1306
  location: enriched.location ?? void 0,
1213
1307
  untrustedStructuredContext: untrustedStructuredContext.length > 0 ? untrustedStructuredContext : void 0,
1214
1308
  media
@@ -1339,6 +1433,7 @@ async function attachWebInboxToSocket(options) {
1339
1433
  };
1340
1434
  const handleConnectionUpdate = (update) => {
1341
1435
  try {
1436
+ if ("reachoutTimeLock" in update) rememberReachoutTimeLock(update.reachoutTimeLock);
1342
1437
  if (update.connection === "close") {
1343
1438
  if (options.socketRef?.current === sock) options.socketRef.current = null;
1344
1439
  const status = getStatusCode(update.lastDisconnect?.error);
@@ -1451,6 +1546,7 @@ async function attachWebInboxToSocket(options) {
1451
1546
  error: "closed"
1452
1547
  });
1453
1548
  },
1549
+ assertSendReady: assertCanSendTo,
1454
1550
  sendComposingTo: sendApi.sendComposingTo,
1455
1551
  sendMessage: sendApi.sendMessage,
1456
1552
  sendPoll: sendApi.sendPoll,
@@ -1596,6 +1692,7 @@ function createWebChannelStatusController(statusSink) {
1596
1692
  }
1597
1693
  status.lastError = null;
1598
1694
  status.healthState = "healthy";
1695
+ status.terminalDisconnect = void 0;
1599
1696
  emit();
1600
1697
  },
1601
1698
  noteInbound(at = Date.now()) {
@@ -1647,6 +1744,7 @@ function createWebChannelStatusController(statusSink) {
1647
1744
  status.running = false;
1648
1745
  status.connected = false;
1649
1746
  status.lastEventAt = at;
1747
+ status.terminalDisconnect = status.healthState === "logged-out" || status.healthState === "conflict";
1650
1748
  if (!isTerminalHealthState(status.healthState)) status.healthState = "stopped";
1651
1749
  emit();
1652
1750
  }
@@ -1696,28 +1794,6 @@ function formatWhatsAppInboundListeningLog(account) {
1696
1794
  return `Listening for WhatsApp inbound messages (DM + ${explicitGroupCount} configured ${explicitGroupCount === 1 ? "group" : "groups"}).`;
1697
1795
  }
1698
1796
  //#endregion
1699
- //#region extensions/whatsapp/src/group-session-key.ts
1700
- function resolveWhatsAppGroupAccountThreadId(accountId) {
1701
- return `whatsapp-account-${normalizeAccountId$1(accountId)}`;
1702
- }
1703
- function resolveWhatsAppLegacyGroupSessionKey(params) {
1704
- const accountId = normalizeAccountId$1(params.accountId);
1705
- if (!accountId || accountId === DEFAULT_ACCOUNT_ID$1 || !params.sessionKey.includes(":group:")) return null;
1706
- const suffix = `:thread:${resolveWhatsAppGroupAccountThreadId(accountId)}`;
1707
- return params.sessionKey.endsWith(suffix) ? params.sessionKey.slice(0, -suffix.length) : null;
1708
- }
1709
- function resolveWhatsAppGroupSessionRoute(route) {
1710
- if (route.accountId === DEFAULT_ACCOUNT_ID$1 || !route.sessionKey.includes(":group:")) return route;
1711
- const scopedSession = resolveThreadSessionKeys({
1712
- baseSessionKey: route.sessionKey,
1713
- threadId: resolveWhatsAppGroupAccountThreadId(route.accountId)
1714
- });
1715
- return {
1716
- ...route,
1717
- sessionKey: scopedSession.sessionKey
1718
- };
1719
- }
1720
- //#endregion
1721
1797
  //#region extensions/whatsapp/src/auto-reply/monitor/ack-emoji.ts
1722
1798
  const DEFAULT_WHATSAPP_ACK_REACTION = "👀";
1723
1799
  function resolveWhatsAppAckEmoji(params) {
@@ -1807,7 +1883,7 @@ async function maybeSendAckReaction(params) {
1807
1883
  isGroup,
1808
1884
  directEnabled,
1809
1885
  groupMode,
1810
- wasMentioned: params.msg.wasMentioned === true,
1886
+ wasMentioned: (params.msg.groupMention?.wasMentioned ?? params.msg.wasMentioned) === true,
1811
1887
  groupActivated: activation === "always"
1812
1888
  });
1813
1889
  if (!shouldSendReaction()) return null;
@@ -2056,7 +2132,13 @@ async function applyGroupGating(params) {
2056
2132
  ...params.msg.payload,
2057
2133
  body: params.mentionText
2058
2134
  }
2059
- } : params.msg;
2135
+ } : {
2136
+ ...params.msg,
2137
+ payload: {
2138
+ ...params.msg.payload,
2139
+ body: params.msg.payload.commandBody ?? params.msg.payload.body
2140
+ }
2141
+ };
2060
2142
  const commandBody = stripMentionsForCommand(mentionMsg.payload.body, mentionConfig.mentionRegexes, self.e164);
2061
2143
  const activationCommand = parseActivationCommand(commandBody);
2062
2144
  const owner = isOwnerSender(baseMentionConfig, params.msg, params.authDir);
@@ -2092,7 +2174,10 @@ async function applyGroupGating(params) {
2092
2174
  }
2093
2175
  });
2094
2176
  const effectiveWasMentioned = mentionDecision.effectiveWasMentioned || shouldBypassMention;
2095
- params.msg.wasMentioned = effectiveWasMentioned;
2177
+ params.msg.groupMention = {
2178
+ wasMentioned: effectiveWasMentioned,
2179
+ requireMention
2180
+ };
2096
2181
  if (!shouldBypassMention && requireMention && mentionDecision.shouldSkip) {
2097
2182
  if (params.deferMissingMention === true) {
2098
2183
  params.logVerbose(`Deferring group mention skip until audio preflight completes in ${conversationId}`);
@@ -2257,9 +2342,10 @@ async function deliverWebReply(params) {
2257
2342
  if (result) sendResults.push(result);
2258
2343
  };
2259
2344
  const finishDelivery = () => {
2345
+ const receipt = createWhatsAppReplyDeliveryReceipt(sendResults);
2260
2346
  return {
2261
2347
  results: sendResults,
2262
- receipt: createWhatsAppReplyDeliveryReceipt(sendResults),
2348
+ receipt,
2263
2349
  providerAccepted: sendResults.some((result) => result.providerAccepted)
2264
2350
  };
2265
2351
  };
@@ -2556,6 +2642,7 @@ async function buildWhatsAppInboundContext(params) {
2556
2642
  const admission = requireWhatsAppInboundAdmission(params.msg);
2557
2643
  const conversationId = admission.conversation.id;
2558
2644
  const conversationKind = admission.conversation.kind;
2645
+ const wasMentioned = params.msg.groupMention?.wasMentioned ?? params.msg.wasMentioned;
2559
2646
  const inboundHistory = conversationKind === "group" ? buildInboundHistoryFromEntries({
2560
2647
  entries: (params.groupHistory ?? []).map((entry) => ({
2561
2648
  sender: entry.sender,
@@ -2612,9 +2699,10 @@ async function buildWhatsAppInboundContext(params) {
2612
2699
  commandBody: params.commandBody ?? params.msg.payload.body
2613
2700
  },
2614
2701
  access: {
2615
- ...params.msg.wasMentioned !== void 0 ? { mentions: {
2702
+ ...wasMentioned !== void 0 ? { mentions: {
2616
2703
  canDetectMention: conversationKind === "group",
2617
- wasMentioned: params.msg.wasMentioned
2704
+ wasMentioned,
2705
+ requireMention: params.msg.groupMention?.requireMention
2618
2706
  } } : {},
2619
2707
  commands: { authorized: params.commandAuthorized }
2620
2708
  },
@@ -2885,7 +2973,7 @@ async function dispatchWhatsAppBufferedReply(params) {
2885
2973
  }
2886
2974
  },
2887
2975
  replyOptions: {
2888
- suppressTyping: sourceRepliesAreToolOnly && conversationKind === "group" && !params.msg.wasMentioned,
2976
+ suppressTyping: sourceRepliesAreToolOnly && conversationKind === "group" && !(params.msg.groupMention?.wasMentioned ?? params.msg.wasMentioned),
2889
2977
  disableBlockStreaming,
2890
2978
  ...sourceReplyDeliveryMode ? { sourceReplyDeliveryMode } : {},
2891
2979
  onModelSelected: params.onModelSelected,
@@ -3035,7 +3123,7 @@ async function createWhatsAppStatusReactionController(params) {
3035
3123
  isGroup,
3036
3124
  directEnabled,
3037
3125
  groupMode,
3038
- wasMentioned: params.msg.wasMentioned === true,
3126
+ wasMentioned: (params.msg.groupMention?.wasMentioned ?? params.msg.wasMentioned) === true,
3039
3127
  groupActivated: activation === "always"
3040
3128
  })) return null;
3041
3129
  const sender = getSenderIdentity(params.msg);
@@ -3245,13 +3333,14 @@ async function processMessage(params) {
3245
3333
  whatsappInboundLog.info(`Inbound message ${fromDisplay} -> ${params.msg.platform.recipientJid} (${conversationKind}${kindLabel}, ${combinedBody.length} chars)`);
3246
3334
  if (shouldLogVerbose$1()) whatsappInboundLog.debug(`Inbound body: ${elide(combinedBody, 400)}`);
3247
3335
  const sender = getSenderIdentity(params.msg);
3336
+ const commandBody = params.msg.payload.commandBody ?? params.msg.payload.body;
3248
3337
  const dmRouteTarget = resolveWhatsAppDmRouteTarget({
3249
3338
  msg: params.msg,
3250
3339
  senderE164: sender.e164 ?? void 0,
3251
3340
  normalizeE164
3252
3341
  });
3253
- const shouldCheckCommandAuth = shouldComputeCommandAuthorized(params.msg.payload.body, params.cfg);
3254
- const isTextCommand = isControlCommandMessage$1(params.msg.payload.body, params.cfg);
3342
+ const shouldCheckCommandAuth = shouldComputeCommandAuthorized(commandBody, params.cfg);
3343
+ const isTextCommand = isControlCommandMessage$1(commandBody, params.cfg);
3255
3344
  const commandAuthorized = shouldCheckCommandAuth ? await resolveWhatsAppCommandAuthorized({
3256
3345
  cfg: params.cfg,
3257
3346
  msg: params.msg,
@@ -3262,12 +3351,12 @@ async function processMessage(params) {
3262
3351
  kind: "text-slash",
3263
3352
  source: "text",
3264
3353
  authorized: Boolean(commandAuthorized),
3265
- body: params.msg.payload.body
3354
+ body: commandBody
3266
3355
  } : {
3267
3356
  kind: "normal",
3268
3357
  source: "message",
3269
3358
  authorized: false,
3270
- body: params.msg.payload.body
3359
+ body: commandBody
3271
3360
  };
3272
3361
  const { onModelSelected, ...replyPipeline } = createChannelMessageReplyPipeline({
3273
3362
  cfg: params.cfg,
@@ -3292,14 +3381,14 @@ async function processMessage(params) {
3292
3381
  const ctxPayload = await buildWhatsAppInboundContext({
3293
3382
  bodyForAgent: msgForAgent.payload.body,
3294
3383
  combinedBody,
3295
- commandBody: params.msg.payload.body,
3384
+ commandBody,
3296
3385
  commandAuthorized,
3297
3386
  commandTurn,
3298
3387
  groupHistory: visibleGroupHistory,
3299
3388
  groupMemberRoster: params.groupMemberNames.get(params.groupHistoryKey),
3300
3389
  groupSystemPrompt: conversationSystemPrompt,
3301
3390
  msg: params.msg,
3302
- rawBody: params.msg.payload.body,
3391
+ rawBody: commandBody,
3303
3392
  route: params.route,
3304
3393
  sender: {
3305
3394
  id: getPrimaryIdentityId(sender) ?? void 0,
@@ -3703,11 +3792,7 @@ function createWebOnMessageHandler(params) {
3703
3792
  function isNonRetryableWebCloseStatus(statusCode) {
3704
3793
  return statusCode === 440;
3705
3794
  }
3706
- let replyResolverRuntimePromise = null;
3707
- function loadReplyResolverRuntime() {
3708
- replyResolverRuntimePromise ??= import("./reply-resolver.runtime-Ded8D58Y.js");
3709
- return replyResolverRuntimePromise;
3710
- }
3795
+ const loadReplyResolverRuntime = createLazyRuntimeModule(() => import("./reply-resolver.runtime-Ded8D58Y.js"));
3711
3796
  function resolveWebMonitorConfigSnapshot(params) {
3712
3797
  const account = resolveWhatsAppAccount({
3713
3798
  cfg: params.cfg,
@@ -3809,6 +3894,7 @@ async function monitorWebChannel(verbose, listenerFactory = attachWebInboxToSock
3809
3894
  process.once("SIGINT", handleSigint);
3810
3895
  const transportTimeoutMs = tuning.transportTimeoutMs ?? DEFAULT_TRANSPORT_TIMEOUT_MS;
3811
3896
  const messageTimeoutMs = tuning.messageTimeoutMs ?? 1800 * 1e3;
3897
+ const reconnectCatchUpWindowMs = Math.min(Math.max(messageTimeoutMs, 6e4), WHATSAPP_INBOUND_DEDUPE_TTL_MS);
3812
3898
  const watchdogCheckMs = tuning.watchdogCheckMs ?? 60 * 1e3;
3813
3899
  const controller = new WhatsAppConnectionController({
3814
3900
  accountId: account.accountId,
@@ -3845,7 +3931,7 @@ async function monitorWebChannel(verbose, listenerFactory = attachWebInboxToSock
3845
3931
  if (normalized.payload.media?.path || normalized.payload.media?.type) return false;
3846
3932
  if (normalized.payload.location) return false;
3847
3933
  if (normalized.quote?.id || normalized.quote?.body) return false;
3848
- return !isControlCommandMessage(normalized.payload.body, cfg);
3934
+ return !isControlCommandMessage(normalized.payload.commandBody ?? normalized.payload.body, cfg);
3849
3935
  };
3850
3936
  let connection;
3851
3937
  try {
@@ -3884,6 +3970,11 @@ async function monitorWebChannel(verbose, listenerFactory = attachWebInboxToSock
3884
3970
  sendReadReceipts: account.sendReadReceipts,
3885
3971
  socketTiming,
3886
3972
  debounceMs: inboundDebounceMs,
3973
+ appendReplyWindow: connectionLocal.openedAfterRecentInbound ? {
3974
+ afterMs: connectionLocal.startedAt - reconnectCatchUpWindowMs,
3975
+ untilMs: connectionLocal.startedAt + reconnectCatchUpWindowMs,
3976
+ maxAgeMs: reconnectCatchUpWindowMs
3977
+ } : void 0,
3887
3978
  shouldDebounce,
3888
3979
  socketRef: controller.socketRef,
3889
3980
  shouldRetryDisconnect: () => !sigintStop && controller.shouldRetryDisconnect(),