@openclaw/whatsapp 2026.7.1-beta.2 → 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.
- package/dist/{access-control-88UPniDc.js → access-control-DYE5dXna.js} +5 -3
- package/dist/{accounts-DgViSyJx.js → accounts-4YgwroRU.js} +1 -1
- package/dist/{action-runtime-hqza0J8B.js → action-runtime-DPahAqxV.js} +2 -2
- package/dist/action-runtime-api.js +1 -1
- package/dist/action-runtime.runtime.js +1 -1
- package/dist/{active-listener-CFwkn3ho.js → active-listener-B4SDebQ6.js} +1 -1
- package/dist/api.js +14 -13
- package/dist/{approval-handler.runtime-9_SV7vhc.js → approval-handler.runtime-DNWS4aYQ.js} +1 -1
- package/dist/auth-presence.js +1 -1
- package/dist/{auth-store-ECx4h57q.js → auth-store-Db-wfApd.js} +23 -13
- package/dist/call-tool-api.js +233 -0
- package/dist/{channel-fcXxWXic.js → channel-BWp7h1uY.js} +44 -18
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel-react-action-Dgy9uUMl.js → channel-react-action-CKJHL_Wf.js} +3 -3
- package/dist/{channel.runtime-B4ThooGF.js → channel.runtime-CAssfx9p.js} +5 -5
- package/dist/{channel.setup-C_WEdyJR.js → channel.setup-CURc5rEt.js} +2 -2
- package/dist/{config-schema-CROZuhT-.js → config-schema-mBX2nmn1.js} +4 -0
- package/dist/{connection-controller-u-tfAFhJ.js → connection-controller-DkbrFSIn.js} +6 -5
- package/dist/connection-controller-registry-TSX_udJp.js +22 -0
- package/dist/contract-api.js +1 -1
- package/dist/{quoted-message-CpA_ujXK.js → group-session-key-BhC1RQOE.js} +31 -2
- package/dist/{identity-CmsTmkKR.js → identity-Dqft3mFA.js} +2 -1
- package/dist/index.js +9 -2
- package/dist/light-runtime-api.js +3 -3
- package/dist/{login-8lHwLmXj.js → login-C48y0jlx.js} +14 -7
- package/dist/{login-qr-BEZZqrTb.js → login-qr-BjId7dll.js} +7 -7
- package/dist/login-qr-runtime.js +1 -1
- package/dist/{monitor-BqkJ4MpT.js → monitor-DD8bXohk.js} +249 -160
- package/dist/runtime-api.js +9 -9
- package/dist/{send-i8Xk5mBQ.js → send-C5CpFcBG.js} +27 -9
- package/dist/{send-api-DndiBJhN.js → send-api-DLlXl8CH.js} +6 -5
- package/dist/{session-WU4SVP8f.js → session-DriaHt7V.js} +3 -3
- package/dist/{session-errors-CbsoQqoy.js → session-errors-BAj9D2La.js} +1 -22
- package/dist/{setup-core-KjSBbWX4.js → setup-core-DH-DFPLY.js} +4 -4
- package/dist/{setup-finalize-WedNP30s.js → setup-finalize-c8dl34sO.js} +3 -3
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-IOdkbWsQ.js → setup-surface-DlWb0Z09.js} +3 -3
- package/dist/{socket-timing-DvMNkIge.js → socket-timing-DhbVFjah.js} +17 -5
- package/dist/{text-runtime-C88QkuU9.js → targets-runtime-C-GiVn6Y.js} +2 -3
- package/dist/text-runtime-DdX6-mC_.js +4 -0
- package/node_modules/@cacheable/memory/README.md +177 -0
- package/node_modules/@cacheable/memory/dist/index.cjs +867 -820
- package/node_modules/@cacheable/memory/dist/index.d.cts +382 -280
- package/node_modules/@cacheable/memory/dist/index.d.mts +412 -0
- package/node_modules/@cacheable/memory/dist/index.mjs +841 -0
- package/node_modules/@cacheable/memory/package.json +9 -9
- package/node_modules/@cacheable/utils/README.md +342 -8
- package/node_modules/@cacheable/utils/dist/index.cjs +1322 -619
- package/node_modules/@cacheable/utils/dist/index.d.cts +769 -173
- package/node_modules/@cacheable/utils/dist/index.d.mts +903 -0
- package/node_modules/@cacheable/utils/dist/index.mjs +1355 -0
- package/node_modules/@cacheable/utils/package.json +8 -8
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/assert/strict.d.ts +10 -1
- package/node_modules/@types/node/assert.d.ts +144 -17
- package/node_modules/@types/node/async_hooks.d.ts +9 -9
- package/node_modules/@types/node/buffer.d.ts +64 -30
- package/node_modules/@types/node/child_process.d.ts +17 -21
- package/node_modules/@types/node/cluster.d.ts +13 -13
- package/node_modules/@types/node/console.d.ts +1 -1
- package/node_modules/@types/node/crypto.d.ts +471 -575
- package/node_modules/@types/node/diagnostics_channel.d.ts +274 -32
- package/node_modules/@types/node/dns.d.ts +15 -15
- package/node_modules/@types/node/events.d.ts +3 -3
- package/node_modules/@types/node/ffi.d.ts +486 -0
- package/node_modules/@types/node/fs/promises.d.ts +7 -4
- package/node_modules/@types/node/fs.d.ts +24 -18
- package/node_modules/@types/node/globals.d.ts +4 -4
- package/node_modules/@types/node/http.d.ts +30 -5
- package/node_modules/@types/node/http2.d.ts +5 -1
- package/node_modules/@types/node/index.d.ts +1 -3
- package/node_modules/@types/node/inspector.d.ts +1 -1
- package/node_modules/@types/node/module.d.ts +16 -45
- package/node_modules/@types/node/net.d.ts +1 -1
- package/node_modules/@types/node/os.d.ts +2 -2
- package/node_modules/@types/node/package.json +4 -4
- package/node_modules/@types/node/perf_hooks.d.ts +1 -9
- package/node_modules/@types/node/process.d.ts +25 -12
- package/node_modules/@types/node/quic.d.ts +92 -11
- package/node_modules/@types/node/readline.d.ts +12 -11
- package/node_modules/@types/node/repl.d.ts +10 -10
- package/node_modules/@types/node/sqlite.d.ts +56 -1
- package/node_modules/@types/node/stream/iter.d.ts +150 -0
- package/node_modules/@types/node/stream/promises.d.ts +2 -2
- package/node_modules/@types/node/stream/web.d.ts +1 -1
- package/node_modules/@types/node/stream.d.ts +37 -5
- package/node_modules/@types/node/test/reporters.d.ts +1 -1
- package/node_modules/@types/node/test.d.ts +120 -10
- package/node_modules/@types/node/tls.d.ts +1 -1
- package/node_modules/@types/node/ts5.6/index.d.ts +2 -4
- package/node_modules/@types/node/ts5.7/index.d.ts +1 -3
- package/node_modules/@types/node/url.d.ts +3 -3
- package/node_modules/@types/node/util/types.d.ts +1 -1
- package/node_modules/@types/node/util.d.ts +22 -22
- package/node_modules/@types/node/v8.d.ts +85 -3
- package/node_modules/@types/node/vm.d.ts +9 -9
- package/node_modules/@types/node/web-globals/domexception.d.ts +15 -0
- package/node_modules/@types/node/worker_threads.d.ts +10 -12
- package/node_modules/@types/node/zlib.d.ts +3 -3
- package/node_modules/cacheable/README.md +309 -30
- package/node_modules/cacheable/dist/index.cjs +1307 -1153
- package/node_modules/cacheable/dist/index.d.cts +741 -469
- package/node_modules/cacheable/dist/index.d.mts +766 -0
- package/node_modules/cacheable/dist/index.mjs +1210 -0
- package/node_modules/cacheable/package.json +10 -10
- package/node_modules/content-type/README.md +32 -57
- package/node_modules/content-type/dist/index.d.ts +26 -0
- package/node_modules/content-type/dist/index.js +170 -0
- package/node_modules/content-type/dist/index.js.map +1 -0
- package/node_modules/content-type/package.json +35 -25
- package/node_modules/media-typer/README.md +19 -33
- package/node_modules/media-typer/dist/index.d.ts +29 -0
- package/node_modules/media-typer/dist/index.js +64 -0
- package/node_modules/media-typer/dist/index.js.map +1 -0
- package/node_modules/media-typer/package.json +37 -22
- package/node_modules/music-metadata/lib/id3v1/ID3v1Parser.js +2 -2
- package/node_modules/music-metadata/lib/mp4/AtomToken.js +65 -13
- package/node_modules/music-metadata/lib/wav/WaveChunk.d.ts +10 -0
- package/node_modules/music-metadata/lib/wav/WaveChunk.js +13 -3
- package/node_modules/music-metadata/lib/wav/WaveParser.d.ts +1 -0
- package/node_modules/music-metadata/lib/wav/WaveParser.js +6 -5
- package/node_modules/music-metadata/package.json +5 -5
- package/node_modules/typebox/build/compile/validator.d.mts +2 -7
- package/node_modules/typebox/build/compile/validator.mjs +6 -36
- package/node_modules/typebox/build/error/errors.d.mts +1 -7
- package/node_modules/typebox/build/format/_idna.mjs +36 -6
- package/node_modules/typebox/build/format/_puny.mjs +4 -1
- package/node_modules/typebox/build/format/uuid.d.mts +2 -2
- package/node_modules/typebox/build/format/uuid.mjs +3 -3
- package/node_modules/typebox/build/guard/emit.d.mts +0 -4
- package/node_modules/typebox/build/guard/emit.mjs +0 -8
- package/node_modules/typebox/build/guard/guard.d.mts +4 -8
- package/node_modules/typebox/build/guard/guard.mjs +5 -13
- package/node_modules/typebox/build/schema/engine/boolean.d.mts +3 -3
- package/node_modules/typebox/build/schema/engine/boolean.mjs +4 -4
- package/node_modules/typebox/build/schema/engine/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/engine/index.mjs +0 -1
- package/node_modules/typebox/build/schema/engine/schema.mjs +5 -10
- package/node_modules/typebox/build/schema/engine/type.mjs +14 -18
- package/node_modules/typebox/build/schema/types/dependencies.mjs +1 -1
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -1
- package/node_modules/typebox/build/schema/types/index.mjs +0 -1
- package/node_modules/typebox/build/schema/types/schema.d.mts +1 -1
- package/node_modules/typebox/build/schema/types/schema.mjs +2 -2
- package/node_modules/typebox/build/system/locale/ar_001.mjs +0 -1
- package/node_modules/typebox/build/system/locale/bn_BD.mjs +0 -1
- package/node_modules/typebox/build/system/locale/cs_CZ.mjs +0 -1
- package/node_modules/typebox/build/system/locale/de_DE.mjs +0 -1
- package/node_modules/typebox/build/system/locale/el_GR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/en_US.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_419.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_AR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_ES.mjs +0 -1
- package/node_modules/typebox/build/system/locale/es_MX.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fa_IR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fil_PH.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fr_CA.mjs +0 -1
- package/node_modules/typebox/build/system/locale/fr_FR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ha_NG.mjs +0 -1
- package/node_modules/typebox/build/system/locale/hi_IN.mjs +0 -1
- package/node_modules/typebox/build/system/locale/hu_HU.mjs +0 -1
- package/node_modules/typebox/build/system/locale/id_ID.mjs +0 -1
- package/node_modules/typebox/build/system/locale/it_IT.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ja_JP.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ko_KR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ms_MY.mjs +0 -1
- package/node_modules/typebox/build/system/locale/nl_NL.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pl_PL.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pt_BR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/pt_PT.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ro_RO.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ru_RU.mjs +0 -1
- package/node_modules/typebox/build/system/locale/sv_SE.mjs +0 -1
- package/node_modules/typebox/build/system/locale/sw_TZ.mjs +0 -1
- package/node_modules/typebox/build/system/locale/th_TH.mjs +0 -1
- package/node_modules/typebox/build/system/locale/tr_TR.mjs +0 -1
- package/node_modules/typebox/build/system/locale/uk_UA.mjs +0 -1
- package/node_modules/typebox/build/system/locale/ur_PK.mjs +0 -1
- package/node_modules/typebox/build/system/locale/vi_VN.mjs +0 -1
- package/node_modules/typebox/build/system/locale/yo_NG.mjs +0 -1
- package/node_modules/typebox/build/system/locale/zh_Hans.mjs +0 -1
- package/node_modules/typebox/build/system/locale/zh_Hant.mjs +0 -1
- package/node_modules/typebox/build/system/memory/clone.d.mts +2 -3
- package/node_modules/typebox/build/system/memory/clone.mjs +73 -26
- package/node_modules/typebox/build/system/settings/settings.d.mts +15 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +3 -1
- package/node_modules/typebox/build/type/action/_add_immutable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_immutable.mjs +11 -0
- package/node_modules/typebox/build/type/action/_add_optional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_optional.mjs +11 -0
- package/node_modules/typebox/build/type/action/_add_readonly.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_add_readonly.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_immutable.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_immutable.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_optional.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_optional.mjs +11 -0
- package/node_modules/typebox/build/type/action/_remove_readonly.d.mts +11 -0
- package/node_modules/typebox/build/type/action/_remove_readonly.mjs +11 -0
- package/node_modules/typebox/build/type/action/conditional.d.mts +2 -3
- package/node_modules/typebox/build/type/action/conditional.mjs +2 -1
- package/node_modules/typebox/build/type/action/index.d.mts +7 -4
- package/node_modules/typebox/build/type/action/index.mjs +7 -4
- package/node_modules/typebox/build/type/action/mapped.d.mts +2 -3
- package/node_modules/typebox/build/type/action/mapped.mjs +2 -1
- package/node_modules/typebox/build/type/action/module.d.mts +8 -7
- package/node_modules/typebox/build/type/action/module.mjs +7 -6
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +0 -5
- package/node_modules/typebox/build/type/action/readonly_object.mjs +0 -5
- package/node_modules/typebox/build/type/action/with.d.mts +11 -0
- package/node_modules/typebox/build/type/action/with.mjs +11 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +1 -1
- package/node_modules/typebox/build/type/engine/call/instantiate.d.mts +1 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +3 -2
- package/node_modules/typebox/build/type/engine/call/resolve_arguments.mjs +2 -2
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.d.mts +3 -4
- package/node_modules/typebox/build/type/engine/constructor_parameters/instantiate.mjs +2 -1
- package/node_modules/typebox/build/type/engine/cyclic/candidates.d.mts +2 -3
- package/node_modules/typebox/build/type/engine/cyclic/candidates.mjs +3 -6
- package/node_modules/typebox/build/type/engine/cyclic/check.d.mts +6 -9
- package/node_modules/typebox/build/type/engine/cyclic/check.mjs +10 -16
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/cyclic/dependencies.mjs +9 -15
- package/node_modules/typebox/build/type/engine/cyclic/extends.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/cyclic/extends.mjs +8 -14
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.d.mts +2 -5
- package/node_modules/typebox/build/type/engine/cyclic/instantiate.mjs +3 -2
- package/node_modules/typebox/build/type/engine/enum/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/enum/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +1 -2
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +2 -6
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +10 -6
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +10 -6
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +3 -3
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +17 -5
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +34 -8
- package/node_modules/typebox/build/type/engine/exclude/operation.d.mts +5 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +11 -12
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +5 -6
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +11 -12
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/immutable/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/index.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/index.mjs +2 -2
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/indexable/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/indexable/from_enum.d.mts +3 -3
- package/node_modules/typebox/build/type/engine/indexable/from_enum.mjs +4 -4
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/indexable/from_template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/engine/indexable/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/indexable/from_type.mjs +9 -6
- package/node_modules/typebox/build/type/engine/indexed/instantiate.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/indexed/instantiate.mjs +5 -2
- package/node_modules/typebox/build/type/engine/instantiate.d.mts +44 -31
- package/node_modules/typebox/build/type/engine/instantiate.mjs +82 -83
- package/node_modules/typebox/build/type/engine/interface/instantiate.d.mts +3 -6
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/intrinsics/from_template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/engine/keyof/instantiate.d.mts +2 -1
- package/node_modules/typebox/build/type/engine/keyof/instantiate.mjs +5 -1
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/mapped/mapped_operation.mjs +3 -3
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.d.mts +5 -4
- package/node_modules/typebox/build/type/engine/mapped/mapped_variants.mjs +10 -5
- package/node_modules/typebox/build/type/engine/module/instantiate.d.mts +7 -9
- package/node_modules/typebox/build/type/engine/module/instantiate.mjs +17 -15
- package/node_modules/typebox/build/type/engine/object/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/object/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/object/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/object/from_type.mjs +8 -5
- package/node_modules/typebox/build/type/engine/object/from_union.mjs +2 -2
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/optional/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/parameters/instantiate.d.mts +3 -4
- package/node_modules/typebox/build/type/engine/parameters/instantiate.mjs +2 -1
- package/node_modules/typebox/build/type/engine/partial/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/partial/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/partial/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/partial/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/partial/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/partial/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/partial/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/partial/from_type.mjs +7 -4
- package/node_modules/typebox/build/type/engine/priority/index.d.mts +1 -0
- package/node_modules/typebox/build/type/engine/priority/index.mjs +1 -0
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +20 -0
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +28 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_add.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.d.mts +10 -0
- package/node_modules/typebox/build/type/engine/readonly/instantiate_remove.mjs +14 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_array.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_tuple.mjs +2 -2
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/readonly_object/from_type.mjs +8 -5
- package/node_modules/typebox/build/type/engine/record/from_key_enum.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_enum.mjs +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/record/from_key_template_literal.mjs +2 -2
- package/node_modules/typebox/build/type/engine/ref/instantiate.d.mts +3 -3
- package/node_modules/typebox/build/type/engine/ref/instantiate.mjs +6 -6
- package/node_modules/typebox/build/type/engine/required/from_dependent.d.mts +5 -0
- package/node_modules/typebox/build/type/engine/required/from_dependent.mjs +8 -0
- package/node_modules/typebox/build/type/engine/required/from_intersect.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/required/from_intersect.mjs +3 -2
- package/node_modules/typebox/build/type/engine/required/from_object.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/required/from_object.mjs +2 -2
- package/node_modules/typebox/build/type/engine/required/from_type.d.mts +3 -1
- package/node_modules/typebox/build/type/engine/required/from_type.mjs +7 -4
- package/node_modules/typebox/build/type/engine/template_literal/decode.mjs +3 -3
- package/node_modules/typebox/build/type/engine/template_literal/encode.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/template_literal/encode.mjs +6 -6
- package/node_modules/typebox/build/type/engine/template_literal/is_finite.mjs +1 -1
- package/node_modules/typebox/build/type/engine/template_literal/is_pattern.mjs +1 -0
- package/node_modules/typebox/build/type/engine/this/expand_this.d.mts +1 -4
- package/node_modules/typebox/build/type/engine/this/expand_this.mjs +7 -13
- package/node_modules/typebox/build/type/engine/with/instantiate.d.mts +8 -0
- package/node_modules/typebox/build/type/engine/{options → with}/instantiate.mjs +5 -5
- package/node_modules/typebox/build/type/extends/dependent.d.mts +6 -0
- package/node_modules/typebox/build/type/extends/dependent.mjs +6 -0
- package/node_modules/typebox/build/type/extends/enum.d.mts +4 -4
- package/node_modules/typebox/build/type/extends/enum.mjs +3 -2
- package/node_modules/typebox/build/type/extends/extends_left.d.mts +5 -7
- package/node_modules/typebox/build/type/extends/extends_left.mjs +24 -27
- package/node_modules/typebox/build/type/extends/extends_right.d.mts +7 -5
- package/node_modules/typebox/build/type/extends/extends_right.mjs +20 -15
- package/node_modules/typebox/build/type/extends/inference.mjs +1 -1
- package/node_modules/typebox/build/type/extends/object.d.mts +8 -1
- package/node_modules/typebox/build/type/extends/object.mjs +25 -3
- package/node_modules/typebox/build/type/extends/parameters.mjs +2 -2
- package/node_modules/typebox/build/type/extends/record.d.mts +13 -0
- package/node_modules/typebox/build/type/extends/record.mjs +23 -0
- package/node_modules/typebox/build/type/extends/template_literal.d.mts +3 -3
- package/node_modules/typebox/build/type/extends/template_literal.mjs +3 -3
- package/node_modules/typebox/build/type/extends/tuple.d.mts +3 -6
- package/node_modules/typebox/build/type/extends/tuple.mjs +6 -5
- package/node_modules/typebox/build/type/extends/union.mjs +2 -2
- package/node_modules/typebox/build/type/script/mapping.d.mts +84 -99
- package/node_modules/typebox/build/type/script/mapping.mjs +81 -85
- package/node_modules/typebox/build/type/script/parser.d.mts +40 -40
- package/node_modules/typebox/build/type/script/parser.mjs +22 -22
- package/node_modules/typebox/build/type/script/script.d.mts +3 -4
- package/node_modules/typebox/build/type/script/script.mjs +3 -2
- package/node_modules/typebox/build/type/script/token/internal/guard.d.mts +1 -1
- package/node_modules/typebox/build/type/script/token/internal/guard.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/internal/take.mjs +1 -1
- package/node_modules/typebox/build/type/script/token/until.mjs +2 -2
- package/node_modules/typebox/build/type/types/_codec.d.mts +12 -12
- package/node_modules/typebox/build/type/types/_codec.mjs +0 -1
- package/node_modules/typebox/build/type/types/_immutable.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_immutable.mjs +2 -10
- package/node_modules/typebox/build/type/types/_optional.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_optional.mjs +2 -11
- package/node_modules/typebox/build/type/types/_readonly.d.mts +2 -9
- package/node_modules/typebox/build/type/types/_readonly.mjs +2 -10
- package/node_modules/typebox/build/type/types/_refine.d.mts +8 -10
- package/node_modules/typebox/build/type/types/_refine.mjs +1 -2
- package/node_modules/typebox/build/type/types/call.d.mts +3 -3
- package/node_modules/typebox/build/type/types/call.mjs +3 -2
- package/node_modules/typebox/build/type/types/deferred.d.mts +1 -0
- package/node_modules/typebox/build/type/types/deferred.mjs +1 -1
- package/node_modules/typebox/build/type/types/dependent.d.mts +17 -0
- package/node_modules/typebox/build/type/types/dependent.mjs +24 -0
- package/node_modules/typebox/build/type/types/enum.d.mts +3 -1
- package/node_modules/typebox/build/type/types/enum.mjs +5 -0
- package/node_modules/typebox/build/type/types/index.d.mts +1 -4
- package/node_modules/typebox/build/type/types/index.mjs +1 -4
- package/node_modules/typebox/build/type/types/number.d.mts +1 -1
- package/node_modules/typebox/build/type/types/number.mjs +1 -1
- package/node_modules/typebox/build/type/types/record.d.mts +13 -7
- package/node_modules/typebox/build/type/types/record.mjs +15 -9
- package/node_modules/typebox/build/type/types/static.d.mts +2 -5
- package/node_modules/typebox/build/typebox.d.mts +4 -8
- package/node_modules/typebox/build/typebox.mjs +4 -8
- package/node_modules/typebox/build/value/clean/clean.mjs +4 -2
- package/node_modules/typebox/build/value/clean/from_intersect.mjs +2 -2
- package/node_modules/typebox/build/value/clean/from_type.mjs +8 -10
- package/node_modules/typebox/build/value/clean/from_union.d.mts +1 -1
- package/node_modules/typebox/build/value/clean/from_union.mjs +1 -2
- package/node_modules/typebox/build/value/clone/clone.mjs +2 -73
- package/node_modules/typebox/build/value/codec/decode.mjs +4 -2
- package/node_modules/typebox/build/value/codec/encode.mjs +4 -2
- package/node_modules/typebox/build/value/codec/from_array.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_object.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_record.mjs +2 -7
- package/node_modules/typebox/build/value/codec/from_tuple.mjs +1 -4
- package/node_modules/typebox/build/value/codec/from_union.mjs +2 -3
- package/node_modules/typebox/build/value/convert/from_enum.mjs +3 -4
- package/node_modules/typebox/build/value/convert/from_template_literal.d.mts +1 -1
- package/node_modules/typebox/build/value/convert/from_template_literal.mjs +2 -3
- package/node_modules/typebox/build/value/convert/from_type.mjs +19 -21
- package/node_modules/typebox/build/value/create/from_enum.mjs +2 -2
- package/node_modules/typebox/build/value/create/from_type.mjs +23 -31
- package/node_modules/typebox/build/value/default/from_object.mjs +1 -1
- package/node_modules/typebox/build/value/default/from_type.mjs +8 -10
- package/node_modules/typebox/build/value/index.d.mts +0 -1
- package/node_modules/typebox/build/value/index.mjs +0 -1
- package/node_modules/typebox/build/value/repair/from_enum.mjs +2 -3
- package/node_modules/typebox/build/value/repair/from_type.mjs +24 -22
- package/node_modules/typebox/build/value/shared/union_priority_sort.d.mts +6 -2
- package/node_modules/typebox/build/value/shared/union_priority_sort.mjs +62 -26
- package/node_modules/typebox/build/value/value.d.mts +0 -1
- package/node_modules/typebox/build/value/value.mjs +0 -1
- package/node_modules/typebox/package.json +25 -25
- package/node_modules/typebox/readme.md +97 -80
- package/node_modules/undici-types/agent.d.ts +0 -2
- package/node_modules/undici-types/client.d.ts +25 -19
- package/node_modules/undici-types/dispatcher.d.ts +7 -33
- package/node_modules/undici-types/dispatcher1-wrapper.d.ts +7 -0
- package/node_modules/undici-types/fetch.d.ts +24 -4
- package/node_modules/undici-types/h2c-client.d.ts +6 -6
- package/node_modules/undici-types/handlers.d.ts +1 -2
- package/node_modules/undici-types/header.d.ts +5 -0
- package/node_modules/undici-types/index.d.ts +3 -1
- package/node_modules/undici-types/interceptors.d.ts +1 -1
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/pool.d.ts +0 -2
- package/node_modules/undici-types/proxy-agent.d.ts +2 -2
- package/node_modules/undici-types/round-robin-pool.d.ts +0 -2
- package/node_modules/undici-types/snapshot-agent.d.ts +4 -0
- package/node_modules/undici-types/socks5-proxy-agent.d.ts +2 -2
- package/node_modules/undici-types/webidl.d.ts +0 -1
- package/npm-shrinkwrap.json +49 -41
- package/openclaw.plugin.json +12 -0
- package/package.json +5 -5
- package/node_modules/@cacheable/memory/dist/index.d.ts +0 -310
- package/node_modules/@cacheable/memory/dist/index.js +0 -807
- package/node_modules/@cacheable/utils/dist/index.d.ts +0 -307
- package/node_modules/@cacheable/utils/dist/index.js +0 -630
- package/node_modules/@types/node/compatibility/iterators.d.ts +0 -21
- package/node_modules/cacheable/dist/index.d.ts +0 -494
- package/node_modules/cacheable/dist/index.js +0 -1141
- package/node_modules/content-type/HISTORY.md +0 -29
- package/node_modules/content-type/index.js +0 -225
- package/node_modules/media-typer/HISTORY.md +0 -50
- package/node_modules/media-typer/index.js +0 -143
- package/node_modules/typebox/build/schema/engine/_guard.d.mts +0 -6
- package/node_modules/typebox/build/schema/engine/_guard.mjs +0 -26
- package/node_modules/typebox/build/schema/types/_guard.d.mts +0 -10
- package/node_modules/typebox/build/schema/types/_guard.mjs +0 -16
- package/node_modules/typebox/build/type/action/_optional.d.mts +0 -19
- package/node_modules/typebox/build/type/action/_optional.mjs +0 -40
- package/node_modules/typebox/build/type/action/_readonly.d.mts +0 -19
- package/node_modules/typebox/build/type/action/_readonly.mjs +0 -40
- package/node_modules/typebox/build/type/action/awaited.d.mts +0 -15
- package/node_modules/typebox/build/type/action/awaited.mjs +0 -15
- package/node_modules/typebox/build/type/action/options.d.mts +0 -11
- package/node_modules/typebox/build/type/action/options.mjs +0 -11
- package/node_modules/typebox/build/type/engine/awaited/instantiate.d.mts +0 -11
- package/node_modules/typebox/build/type/engine/awaited/instantiate.mjs +0 -20
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.d.mts +0 -14
- package/node_modules/typebox/build/type/engine/enum/enum_to_union.mjs +0 -24
- package/node_modules/typebox/build/type/engine/options/index.d.mts +0 -1
- package/node_modules/typebox/build/type/engine/options/index.mjs +0 -1
- package/node_modules/typebox/build/type/engine/options/instantiate.d.mts +0 -8
- package/node_modules/typebox/build/type/extends/async_iterator.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/async_iterator.mjs +0 -9
- package/node_modules/typebox/build/type/extends/iterator.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/iterator.mjs +0 -9
- package/node_modules/typebox/build/type/extends/promise.d.mts +0 -7
- package/node_modules/typebox/build/type/extends/promise.mjs +0 -9
- package/node_modules/typebox/build/type/types/async_iterator.d.mts +0 -20
- package/node_modules/typebox/build/type/types/async_iterator.mjs +0 -28
- package/node_modules/typebox/build/type/types/base.d.mts +0 -50
- package/node_modules/typebox/build/type/types/base.mjs +0 -84
- package/node_modules/typebox/build/type/types/iterator.d.mts +0 -20
- package/node_modules/typebox/build/type/types/iterator.mjs +0 -28
- package/node_modules/typebox/build/type/types/promise.d.mts +0 -21
- package/node_modules/typebox/build/type/types/promise.mjs +0 -29
- package/node_modules/typebox/build/value/clean/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/clean/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/convert/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/convert/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/create/from_async_iterator.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_async_iterator.mjs +0 -5
- package/node_modules/typebox/build/value/create/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_base.mjs +0 -4
- package/node_modules/typebox/build/value/create/from_iterator.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_iterator.mjs +0 -5
- package/node_modules/typebox/build/value/create/from_promise.d.mts +0 -2
- package/node_modules/typebox/build/value/create/from_promise.mjs +0 -5
- package/node_modules/typebox/build/value/default/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/default/from_base.mjs +0 -5
- package/node_modules/typebox/build/value/mutate/error.d.mts +0 -3
- package/node_modules/typebox/build/value/mutate/error.mjs +0 -6
- package/node_modules/typebox/build/value/mutate/from_array.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_array.mjs +0 -16
- package/node_modules/typebox/build/value/mutate/from_object.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_object.mjs +0 -40
- package/node_modules/typebox/build/value/mutate/from_unknown.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_unknown.mjs +0 -7
- package/node_modules/typebox/build/value/mutate/from_value.d.mts +0 -2
- package/node_modules/typebox/build/value/mutate/from_value.mjs +0 -12
- package/node_modules/typebox/build/value/mutate/index.d.mts +0 -1
- package/node_modules/typebox/build/value/mutate/index.mjs +0 -1
- package/node_modules/typebox/build/value/mutate/mutate.d.mts +0 -11
- package/node_modules/typebox/build/value/mutate/mutate.mjs +0 -41
- package/node_modules/typebox/build/value/repair/from_base.d.mts +0 -2
- package/node_modules/typebox/build/value/repair/from_base.mjs +0 -8
- package/dist/{approval-resolver-e1hAVRRy.js → approval-resolver-DF-lu8k5.js} +1 -1
- /package/node_modules/typebox/build/type/engine/{awaited → with}/index.d.mts +0 -0
- /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-
|
|
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-
|
|
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 {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { n as
|
|
8
|
-
import {
|
|
9
|
-
import { a as
|
|
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-
|
|
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-
|
|
13
|
-
import { r as waitForWaConnection, t as createWaSocket } from "./session-
|
|
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-
|
|
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";
|
|
@@ -29,10 +31,10 @@ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
|
29
31
|
import { LocalMediaAccessError, getDefaultLocalRoots, loadWebMedia as loadWebMedia$1, loadWebMediaRaw, optimizeImageToJpeg, optimizeImageToPng } from "openclaw/plugin-sdk/web-media";
|
|
30
32
|
import { chunkMarkdownTextWithMode } from "openclaw/plugin-sdk/reply-chunking";
|
|
31
33
|
import { isReasoningReplyPayload, resolveSendableOutboundReplyParts, sendMediaWithLeadingCaption } from "openclaw/plugin-sdk/reply-payload";
|
|
32
|
-
import { DEFAULT_ACCOUNT_ID as DEFAULT_ACCOUNT_ID$1, DEFAULT_MAIN_KEY, buildAgentMainSessionKey, buildAgentSessionKey, buildGroupHistoryKey, deriveLastRoutePolicy, normalizeAccountId as normalizeAccountId$1, normalizeAgentId, resolveAgentRoute, resolveInboundLastRouteSessionKey
|
|
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";
|
|
33
35
|
import { recordInboundSession } from "openclaw/plugin-sdk/conversation-runtime";
|
|
34
36
|
import { getSessionEntry, patchSessionEntry, resolveStorePath, resolveStorePath as resolveStorePath$1, updateLastRoute } from "openclaw/plugin-sdk/session-store-runtime";
|
|
35
|
-
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";
|
|
36
38
|
import { saveMediaStream } from "openclaw/plugin-sdk/media-store";
|
|
37
39
|
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
|
|
38
40
|
import { createHash } from "node:crypto";
|
|
@@ -45,6 +47,7 @@ import { drainPendingDeliveries } from "openclaw/plugin-sdk/delivery-queue-runti
|
|
|
45
47
|
import { DEFAULT_GROUP_HISTORY_LIMIT, buildHistoryContextFromEntries, buildInboundHistoryFromEntries, createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
|
|
46
48
|
import { enqueueSystemEvent } from "openclaw/plugin-sdk/system-event-runtime";
|
|
47
49
|
import { createClaimableDedupe } from "openclaw/plugin-sdk/persistent-dedupe";
|
|
50
|
+
import { collectErrorGraphCandidates, formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
48
51
|
import { getRuntimeConfig as getRuntimeConfig$1, getRuntimeConfigSourceSnapshot } from "openclaw/plugin-sdk/runtime-config-snapshot";
|
|
49
52
|
import { resolveChannelContextVisibilityMode } from "openclaw/plugin-sdk/context-visibility-runtime";
|
|
50
53
|
import { buildMentionRegexes, implicitMentionKindWhen, normalizeMentionText, resolveInboundMentionDecision } from "openclaw/plugin-sdk/channel-mention-gating";
|
|
@@ -55,6 +58,94 @@ import { normalizeGroupActivation, parseActivationCommand } from "openclaw/plugi
|
|
|
55
58
|
import { createInternalHookEvent, deriveInboundMessageHookContext, fireAndForgetBoundedHook, toInternalMessageReceivedContext, toPluginMessageContext, toPluginMessageReceivedEvent, triggerInternalHook } from "openclaw/plugin-sdk/hook-runtime";
|
|
56
59
|
import { getGlobalHookRunner } from "openclaw/plugin-sdk/plugin-runtime";
|
|
57
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
|
|
58
149
|
//#region extensions/whatsapp/src/inbound/message-aliases.ts
|
|
59
150
|
function normalizeQuoteSender(sender) {
|
|
60
151
|
if (!sender?.displayName && !sender?.jid && !sender?.e164) return;
|
|
@@ -379,94 +470,6 @@ function normalizeWebInboundMessage(msg) {
|
|
|
379
470
|
return normalizeLegacyFlatWebInboundMessage(msg);
|
|
380
471
|
}
|
|
381
472
|
//#endregion
|
|
382
|
-
//#region extensions/whatsapp/src/inbound/dedupe.ts
|
|
383
|
-
const RECENT_WEB_MESSAGE_TTL_MS = 20 * 6e4;
|
|
384
|
-
const RECENT_WEB_MESSAGE_MAX = 5e3;
|
|
385
|
-
const RECENT_OUTBOUND_MESSAGE_TTL_MS = 20 * 6e4;
|
|
386
|
-
const RECENT_OUTBOUND_MESSAGE_MAX = 5e3;
|
|
387
|
-
const claimableInboundMessages = createClaimableDedupe({
|
|
388
|
-
ttlMs: RECENT_WEB_MESSAGE_TTL_MS,
|
|
389
|
-
memoryMaxSize: RECENT_WEB_MESSAGE_MAX
|
|
390
|
-
});
|
|
391
|
-
const recentOutboundMessages = createRecentMessageCache({
|
|
392
|
-
ttlMs: RECENT_OUTBOUND_MESSAGE_TTL_MS,
|
|
393
|
-
maxSize: RECENT_OUTBOUND_MESSAGE_MAX
|
|
394
|
-
});
|
|
395
|
-
function createRecentMessageCache(options) {
|
|
396
|
-
const ttlMs = Math.max(0, options.ttlMs);
|
|
397
|
-
const maxSize = Math.max(0, Math.floor(options.maxSize));
|
|
398
|
-
const cache = /* @__PURE__ */ new Map();
|
|
399
|
-
const prune = (now) => {
|
|
400
|
-
if (ttlMs > 0) {
|
|
401
|
-
const cutoff = now - ttlMs;
|
|
402
|
-
for (const [key, timestamp] of cache) if (timestamp < cutoff) cache.delete(key);
|
|
403
|
-
}
|
|
404
|
-
while (cache.size > maxSize) {
|
|
405
|
-
const oldest = cache.keys().next().value;
|
|
406
|
-
if (!oldest) break;
|
|
407
|
-
cache.delete(oldest);
|
|
408
|
-
}
|
|
409
|
-
};
|
|
410
|
-
const peek = (key, now = Date.now()) => {
|
|
411
|
-
if (!key) return false;
|
|
412
|
-
const timestamp = cache.get(key);
|
|
413
|
-
if (timestamp === void 0) return false;
|
|
414
|
-
if (ttlMs > 0 && now - timestamp >= ttlMs) {
|
|
415
|
-
cache.delete(key);
|
|
416
|
-
return false;
|
|
417
|
-
}
|
|
418
|
-
return true;
|
|
419
|
-
};
|
|
420
|
-
return {
|
|
421
|
-
check: (key, now = Date.now()) => {
|
|
422
|
-
if (!key) return false;
|
|
423
|
-
const existed = peek(key, now);
|
|
424
|
-
cache.delete(key);
|
|
425
|
-
cache.set(key, now);
|
|
426
|
-
prune(now);
|
|
427
|
-
return existed;
|
|
428
|
-
},
|
|
429
|
-
peek,
|
|
430
|
-
clear: () => cache.clear()
|
|
431
|
-
};
|
|
432
|
-
}
|
|
433
|
-
var WhatsAppRetryableInboundError = class extends Error {
|
|
434
|
-
constructor(message, options) {
|
|
435
|
-
super(message, options);
|
|
436
|
-
this.name = "WhatsAppRetryableInboundError";
|
|
437
|
-
}
|
|
438
|
-
};
|
|
439
|
-
function buildMessageKey(params) {
|
|
440
|
-
const accountId = params.accountId.trim();
|
|
441
|
-
const remoteJid = params.remoteJid.trim();
|
|
442
|
-
const messageId = params.messageId.trim();
|
|
443
|
-
if (!accountId || !remoteJid || !messageId || messageId === "unknown") return null;
|
|
444
|
-
return `${accountId}:${remoteJid}:${messageId}`;
|
|
445
|
-
}
|
|
446
|
-
function resetWebInboundDedupe() {
|
|
447
|
-
claimableInboundMessages.clearMemory();
|
|
448
|
-
recentOutboundMessages.clear();
|
|
449
|
-
}
|
|
450
|
-
async function claimRecentInboundMessageDelivery(key) {
|
|
451
|
-
return (await claimableInboundMessages.claim(key)).kind;
|
|
452
|
-
}
|
|
453
|
-
async function commitRecentInboundMessage(key) {
|
|
454
|
-
await claimableInboundMessages.commit(key);
|
|
455
|
-
}
|
|
456
|
-
function releaseRecentInboundMessage(key, error) {
|
|
457
|
-
claimableInboundMessages.release(key, { error });
|
|
458
|
-
}
|
|
459
|
-
function rememberRecentOutboundMessage(params) {
|
|
460
|
-
const key = buildMessageKey(params);
|
|
461
|
-
if (!key) return;
|
|
462
|
-
recentOutboundMessages.check(key);
|
|
463
|
-
}
|
|
464
|
-
function isRecentOutboundMessage(params) {
|
|
465
|
-
const key = buildMessageKey(params);
|
|
466
|
-
if (!key) return false;
|
|
467
|
-
return recentOutboundMessages.peek(key);
|
|
468
|
-
}
|
|
469
|
-
//#endregion
|
|
470
473
|
//#region extensions/whatsapp/src/inbound/durable-receive.ts
|
|
471
474
|
const WHATSAPP_DURABLE_INBOUND_PENDING_MAX_ENTRIES = 450;
|
|
472
475
|
const WHATSAPP_DURABLE_INBOUND_COMPLETED_MAX_ENTRIES = 450;
|
|
@@ -538,23 +541,17 @@ async function downloadInboundMedia(msg, sock, maxBytes = 50 * 1024 * 1024) {
|
|
|
538
541
|
const mimetype = resolveInboundMediaMimetype(message);
|
|
539
542
|
const fileName = message.documentMessage?.fileName ?? void 0;
|
|
540
543
|
if (!message.imageMessage && !message.videoMessage && !message.documentMessage && !message.audioMessage && !message.stickerMessage) return;
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
};
|
|
553
|
-
} catch (err) {
|
|
554
|
-
if (err instanceof WhatsAppInboundMediaLimitExceededError) throw err;
|
|
555
|
-
logVerbose(`downloadMediaMessage failed: ${String(err)}`);
|
|
556
|
-
return;
|
|
557
|
-
}
|
|
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
|
+
};
|
|
558
555
|
}
|
|
559
556
|
async function downloadQuotedInboundMedia(msg, sock, maxBytes = 50 * 1024 * 1024) {
|
|
560
557
|
const contextInfo = extractContextInfo(unwrapMessage(msg.message));
|
|
@@ -578,6 +575,12 @@ const RECONNECT_IN_PROGRESS_ERROR = "no active socket - reconnection in progress
|
|
|
578
575
|
const GROUP_META_TTL_MS = 300 * 1e3;
|
|
579
576
|
const BAILEYS_MESSAGE_TTL_MS = 600 * 1e3;
|
|
580
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
|
+
}
|
|
581
584
|
function resolveGroupMetadataExpiresAt(nowRaw = Date.now()) {
|
|
582
585
|
const now = asDateTimestampMs(nowRaw);
|
|
583
586
|
return now === void 0 ? void 0 : resolveExpiresAtMsFromDurationMs(GROUP_META_TTL_MS, { nowMs: now });
|
|
@@ -645,6 +648,18 @@ function logWhatsAppVerbose(enabled, message) {
|
|
|
645
648
|
function isGroupJid(jid) {
|
|
646
649
|
return (typeof isJidGroup === "function" ? isJidGroup(jid) : jid.endsWith("@g.us")) === true;
|
|
647
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
|
+
}
|
|
648
663
|
function recordAcceptedInboundActivity(accountId) {
|
|
649
664
|
recordChannelActivity({
|
|
650
665
|
channel: "whatsapp",
|
|
@@ -728,9 +743,10 @@ async function attachWebInboxToSocket(options) {
|
|
|
728
743
|
const dedupeKeys = uniqueStrings(entries.map((entry) => entry.dedupeKey).filter(isNonEmptyString));
|
|
729
744
|
const durableEntries = entries.filter((entry) => isNonEmptyString(entry.durableId));
|
|
730
745
|
const readReceiptEntries = entries.filter((entry) => Boolean(entry.readReceipt));
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
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) })));
|
|
734
750
|
return;
|
|
735
751
|
}
|
|
736
752
|
await Promise.all([...dedupeKeys.map((dedupeKey) => commitRecentInboundMessage(dedupeKey)), ...durableEntries.map((entry) => durableInboundJournal.complete(entry.durableId, entry.readReceipt ? { metadata: { readReceipt: entry.readReceipt } } : void 0))]);
|
|
@@ -760,6 +776,7 @@ async function attachWebInboxToSocket(options) {
|
|
|
760
776
|
const mentioned = /* @__PURE__ */ new Set();
|
|
761
777
|
for (const entry of orderedEntries) for (const jid of entry.group?.mentions?.jids ?? []) mentioned.add(jid);
|
|
762
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");
|
|
763
780
|
const combinedMentions = mentioned.size > 0 ? {
|
|
764
781
|
...last.group?.mentions,
|
|
765
782
|
jids: Array.from(mentioned)
|
|
@@ -772,7 +789,8 @@ async function attachWebInboxToSocket(options) {
|
|
|
772
789
|
...last,
|
|
773
790
|
payload: {
|
|
774
791
|
...last.payload,
|
|
775
|
-
body: combinedBody
|
|
792
|
+
body: combinedBody,
|
|
793
|
+
commandBody: combinedCommandBody
|
|
776
794
|
},
|
|
777
795
|
group: combinedGroup,
|
|
778
796
|
event: {
|
|
@@ -824,18 +842,71 @@ async function attachWebInboxToSocket(options) {
|
|
|
824
842
|
remoteJid,
|
|
825
843
|
messageId
|
|
826
844
|
});
|
|
827
|
-
|
|
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
|
+
});
|
|
828
851
|
};
|
|
829
852
|
const trackLateAcceptedSend = (jid, promise) => {
|
|
830
853
|
promise.then((result) => {
|
|
831
854
|
rememberOutboundMessage(jid, result);
|
|
832
855
|
}, () => {});
|
|
833
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
|
+
};
|
|
834
904
|
const sendTrackedMessage = async (jid, content, sendOptions) => {
|
|
835
905
|
let lastErr = /* @__PURE__ */ new Error(RECONNECT_IN_PROGRESS_ERROR);
|
|
836
906
|
for (let attempt = 1;; attempt++) {
|
|
837
907
|
const currentSock = getCurrentSock();
|
|
838
908
|
if (currentSock) try {
|
|
909
|
+
await assertCanSendToJid(jid, currentSock, { useVerifiedReady: true });
|
|
839
910
|
const result = await createWhatsAppSocketOperationTimeoutAdapter(currentSock, sendOperationTimeoutMs, { onSendMessageTimeout: ({ jid: timedOutJid, promise }) => {
|
|
840
911
|
trackLateAcceptedSend(timedOutJid, promise);
|
|
841
912
|
} }).sendMessage(jid, content, sendOptions);
|
|
@@ -1047,7 +1118,9 @@ async function attachWebInboxToSocket(options) {
|
|
|
1047
1118
|
if (upsertType !== "append") return false;
|
|
1048
1119
|
const APPEND_RECENT_GRACE_MS = 6e4;
|
|
1049
1120
|
const msgTsSeconds = parseWhatsAppTimestampSeconds(msg.messageTimestamp);
|
|
1050
|
-
|
|
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);
|
|
1051
1124
|
};
|
|
1052
1125
|
const processDurableInboundMessage = async (msg, upsertType, receiveOrder, stored) => {
|
|
1053
1126
|
const inbound = await normalizeInboundMessage(msg);
|
|
@@ -1117,12 +1190,14 @@ async function attachWebInboxToSocket(options) {
|
|
|
1117
1190
|
const locationText = location ? formatLocationText(location) : void 0;
|
|
1118
1191
|
const contactContext = extractContactContext(msg.message ?? void 0);
|
|
1119
1192
|
const externalAdReplyContext = extractExternalAdReplyContext(msg.message ?? void 0);
|
|
1193
|
+
const mediaPlaceholder = extractMediaPlaceholder(msg.message ?? void 0);
|
|
1120
1194
|
let body = extractText(msg.message ?? void 0);
|
|
1121
1195
|
if (locationText) body = [body, locationText].filter(Boolean).join("\n").trim();
|
|
1122
1196
|
if (!body) {
|
|
1123
|
-
body =
|
|
1197
|
+
body = mediaPlaceholder;
|
|
1124
1198
|
if (!body) return null;
|
|
1125
1199
|
}
|
|
1200
|
+
const commandBody = body;
|
|
1126
1201
|
const replyContext = describeReplyContext(msg.message);
|
|
1127
1202
|
let mediaPath;
|
|
1128
1203
|
let mediaType;
|
|
@@ -1136,12 +1211,26 @@ async function attachWebInboxToSocket(options) {
|
|
|
1136
1211
|
};
|
|
1137
1212
|
try {
|
|
1138
1213
|
await saveInboundMedia(await downloadInboundMedia(msg, sock, maxBytes));
|
|
1139
|
-
if (!mediaPath && replyContext) await saveInboundMedia(await downloadQuotedInboundMedia(msg, sock, maxBytes));
|
|
1140
1214
|
} catch (err) {
|
|
1141
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
|
+
});
|
|
1142
1230
|
}
|
|
1143
1231
|
return {
|
|
1144
1232
|
body,
|
|
1233
|
+
commandBody,
|
|
1145
1234
|
location: location ?? void 0,
|
|
1146
1235
|
contactContext,
|
|
1147
1236
|
externalAdReplyContext,
|
|
@@ -1154,8 +1243,10 @@ async function attachWebInboxToSocket(options) {
|
|
|
1154
1243
|
const enqueueInboundMessage = async (msg, inbound, enriched, durable) => {
|
|
1155
1244
|
const chatJid = inbound.remoteJid;
|
|
1156
1245
|
const sendComposing = async () => {
|
|
1157
|
-
|
|
1246
|
+
const currentSock = getCurrentSock();
|
|
1247
|
+
if (!currentSock) return;
|
|
1158
1248
|
try {
|
|
1249
|
+
await assertCanSendToJid(chatJid, currentSock);
|
|
1159
1250
|
await sendApiSocketOperations.sendPresenceUpdate("composing", chatJid);
|
|
1160
1251
|
} catch (err) {
|
|
1161
1252
|
logWhatsAppVerbose(options.verbose, `Presence update failed: ${String(err)}`);
|
|
@@ -1166,7 +1257,8 @@ async function attachWebInboxToSocket(options) {
|
|
|
1166
1257
|
return normalizeWhatsAppSendResult(await sendTrackedMessage(chatJid, addWhatsAppOutboundMentionsToContent({ text: resolved.text }, resolved.mentionedJids), optionsResult), "text");
|
|
1167
1258
|
};
|
|
1168
1259
|
const sendMedia = async (payload, optionsValue) => {
|
|
1169
|
-
|
|
1260
|
+
const previewPayload = await addWhatsAppImagePreviewFields(payload);
|
|
1261
|
+
return normalizeWhatsAppSendResult(await sendTrackedMessage(chatJid, await applyOutboundMentionsToContent(chatJid, previewPayload), optionsValue), "media");
|
|
1170
1262
|
};
|
|
1171
1263
|
const timestamp = inbound.messageTimestampMs;
|
|
1172
1264
|
const mentionedJids = extractMentionedJids(msg.message);
|
|
@@ -1210,6 +1302,7 @@ async function attachWebInboxToSocket(options) {
|
|
|
1210
1302
|
},
|
|
1211
1303
|
payload: {
|
|
1212
1304
|
body: enriched.body,
|
|
1305
|
+
commandBody: enriched.commandBody,
|
|
1213
1306
|
location: enriched.location ?? void 0,
|
|
1214
1307
|
untrustedStructuredContext: untrustedStructuredContext.length > 0 ? untrustedStructuredContext : void 0,
|
|
1215
1308
|
media
|
|
@@ -1340,6 +1433,7 @@ async function attachWebInboxToSocket(options) {
|
|
|
1340
1433
|
};
|
|
1341
1434
|
const handleConnectionUpdate = (update) => {
|
|
1342
1435
|
try {
|
|
1436
|
+
if ("reachoutTimeLock" in update) rememberReachoutTimeLock(update.reachoutTimeLock);
|
|
1343
1437
|
if (update.connection === "close") {
|
|
1344
1438
|
if (options.socketRef?.current === sock) options.socketRef.current = null;
|
|
1345
1439
|
const status = getStatusCode(update.lastDisconnect?.error);
|
|
@@ -1452,6 +1546,7 @@ async function attachWebInboxToSocket(options) {
|
|
|
1452
1546
|
error: "closed"
|
|
1453
1547
|
});
|
|
1454
1548
|
},
|
|
1549
|
+
assertSendReady: assertCanSendTo,
|
|
1455
1550
|
sendComposingTo: sendApi.sendComposingTo,
|
|
1456
1551
|
sendMessage: sendApi.sendMessage,
|
|
1457
1552
|
sendPoll: sendApi.sendPoll,
|
|
@@ -1597,6 +1692,7 @@ function createWebChannelStatusController(statusSink) {
|
|
|
1597
1692
|
}
|
|
1598
1693
|
status.lastError = null;
|
|
1599
1694
|
status.healthState = "healthy";
|
|
1695
|
+
status.terminalDisconnect = void 0;
|
|
1600
1696
|
emit();
|
|
1601
1697
|
},
|
|
1602
1698
|
noteInbound(at = Date.now()) {
|
|
@@ -1648,6 +1744,7 @@ function createWebChannelStatusController(statusSink) {
|
|
|
1648
1744
|
status.running = false;
|
|
1649
1745
|
status.connected = false;
|
|
1650
1746
|
status.lastEventAt = at;
|
|
1747
|
+
status.terminalDisconnect = status.healthState === "logged-out" || status.healthState === "conflict";
|
|
1651
1748
|
if (!isTerminalHealthState(status.healthState)) status.healthState = "stopped";
|
|
1652
1749
|
emit();
|
|
1653
1750
|
}
|
|
@@ -1697,28 +1794,6 @@ function formatWhatsAppInboundListeningLog(account) {
|
|
|
1697
1794
|
return `Listening for WhatsApp inbound messages (DM + ${explicitGroupCount} configured ${explicitGroupCount === 1 ? "group" : "groups"}).`;
|
|
1698
1795
|
}
|
|
1699
1796
|
//#endregion
|
|
1700
|
-
//#region extensions/whatsapp/src/group-session-key.ts
|
|
1701
|
-
function resolveWhatsAppGroupAccountThreadId(accountId) {
|
|
1702
|
-
return `whatsapp-account-${normalizeAccountId$1(accountId)}`;
|
|
1703
|
-
}
|
|
1704
|
-
function resolveWhatsAppLegacyGroupSessionKey(params) {
|
|
1705
|
-
const accountId = normalizeAccountId$1(params.accountId);
|
|
1706
|
-
if (!accountId || accountId === DEFAULT_ACCOUNT_ID$1 || !params.sessionKey.includes(":group:")) return null;
|
|
1707
|
-
const suffix = `:thread:${resolveWhatsAppGroupAccountThreadId(accountId)}`;
|
|
1708
|
-
return params.sessionKey.endsWith(suffix) ? params.sessionKey.slice(0, -suffix.length) : null;
|
|
1709
|
-
}
|
|
1710
|
-
function resolveWhatsAppGroupSessionRoute(route) {
|
|
1711
|
-
if (route.accountId === DEFAULT_ACCOUNT_ID$1 || !route.sessionKey.includes(":group:")) return route;
|
|
1712
|
-
const scopedSession = resolveThreadSessionKeys({
|
|
1713
|
-
baseSessionKey: route.sessionKey,
|
|
1714
|
-
threadId: resolveWhatsAppGroupAccountThreadId(route.accountId)
|
|
1715
|
-
});
|
|
1716
|
-
return {
|
|
1717
|
-
...route,
|
|
1718
|
-
sessionKey: scopedSession.sessionKey
|
|
1719
|
-
};
|
|
1720
|
-
}
|
|
1721
|
-
//#endregion
|
|
1722
1797
|
//#region extensions/whatsapp/src/auto-reply/monitor/ack-emoji.ts
|
|
1723
1798
|
const DEFAULT_WHATSAPP_ACK_REACTION = "👀";
|
|
1724
1799
|
function resolveWhatsAppAckEmoji(params) {
|
|
@@ -2057,7 +2132,13 @@ async function applyGroupGating(params) {
|
|
|
2057
2132
|
...params.msg.payload,
|
|
2058
2133
|
body: params.mentionText
|
|
2059
2134
|
}
|
|
2060
|
-
} :
|
|
2135
|
+
} : {
|
|
2136
|
+
...params.msg,
|
|
2137
|
+
payload: {
|
|
2138
|
+
...params.msg.payload,
|
|
2139
|
+
body: params.msg.payload.commandBody ?? params.msg.payload.body
|
|
2140
|
+
}
|
|
2141
|
+
};
|
|
2061
2142
|
const commandBody = stripMentionsForCommand(mentionMsg.payload.body, mentionConfig.mentionRegexes, self.e164);
|
|
2062
2143
|
const activationCommand = parseActivationCommand(commandBody);
|
|
2063
2144
|
const owner = isOwnerSender(baseMentionConfig, params.msg, params.authDir);
|
|
@@ -2261,9 +2342,10 @@ async function deliverWebReply(params) {
|
|
|
2261
2342
|
if (result) sendResults.push(result);
|
|
2262
2343
|
};
|
|
2263
2344
|
const finishDelivery = () => {
|
|
2345
|
+
const receipt = createWhatsAppReplyDeliveryReceipt(sendResults);
|
|
2264
2346
|
return {
|
|
2265
2347
|
results: sendResults,
|
|
2266
|
-
receipt
|
|
2348
|
+
receipt,
|
|
2267
2349
|
providerAccepted: sendResults.some((result) => result.providerAccepted)
|
|
2268
2350
|
};
|
|
2269
2351
|
};
|
|
@@ -3251,13 +3333,14 @@ async function processMessage(params) {
|
|
|
3251
3333
|
whatsappInboundLog.info(`Inbound message ${fromDisplay} -> ${params.msg.platform.recipientJid} (${conversationKind}${kindLabel}, ${combinedBody.length} chars)`);
|
|
3252
3334
|
if (shouldLogVerbose$1()) whatsappInboundLog.debug(`Inbound body: ${elide(combinedBody, 400)}`);
|
|
3253
3335
|
const sender = getSenderIdentity(params.msg);
|
|
3336
|
+
const commandBody = params.msg.payload.commandBody ?? params.msg.payload.body;
|
|
3254
3337
|
const dmRouteTarget = resolveWhatsAppDmRouteTarget({
|
|
3255
3338
|
msg: params.msg,
|
|
3256
3339
|
senderE164: sender.e164 ?? void 0,
|
|
3257
3340
|
normalizeE164
|
|
3258
3341
|
});
|
|
3259
|
-
const shouldCheckCommandAuth = shouldComputeCommandAuthorized(
|
|
3260
|
-
const isTextCommand = isControlCommandMessage$1(
|
|
3342
|
+
const shouldCheckCommandAuth = shouldComputeCommandAuthorized(commandBody, params.cfg);
|
|
3343
|
+
const isTextCommand = isControlCommandMessage$1(commandBody, params.cfg);
|
|
3261
3344
|
const commandAuthorized = shouldCheckCommandAuth ? await resolveWhatsAppCommandAuthorized({
|
|
3262
3345
|
cfg: params.cfg,
|
|
3263
3346
|
msg: params.msg,
|
|
@@ -3268,12 +3351,12 @@ async function processMessage(params) {
|
|
|
3268
3351
|
kind: "text-slash",
|
|
3269
3352
|
source: "text",
|
|
3270
3353
|
authorized: Boolean(commandAuthorized),
|
|
3271
|
-
body:
|
|
3354
|
+
body: commandBody
|
|
3272
3355
|
} : {
|
|
3273
3356
|
kind: "normal",
|
|
3274
3357
|
source: "message",
|
|
3275
3358
|
authorized: false,
|
|
3276
|
-
body:
|
|
3359
|
+
body: commandBody
|
|
3277
3360
|
};
|
|
3278
3361
|
const { onModelSelected, ...replyPipeline } = createChannelMessageReplyPipeline({
|
|
3279
3362
|
cfg: params.cfg,
|
|
@@ -3298,14 +3381,14 @@ async function processMessage(params) {
|
|
|
3298
3381
|
const ctxPayload = await buildWhatsAppInboundContext({
|
|
3299
3382
|
bodyForAgent: msgForAgent.payload.body,
|
|
3300
3383
|
combinedBody,
|
|
3301
|
-
commandBody
|
|
3384
|
+
commandBody,
|
|
3302
3385
|
commandAuthorized,
|
|
3303
3386
|
commandTurn,
|
|
3304
3387
|
groupHistory: visibleGroupHistory,
|
|
3305
3388
|
groupMemberRoster: params.groupMemberNames.get(params.groupHistoryKey),
|
|
3306
3389
|
groupSystemPrompt: conversationSystemPrompt,
|
|
3307
3390
|
msg: params.msg,
|
|
3308
|
-
rawBody:
|
|
3391
|
+
rawBody: commandBody,
|
|
3309
3392
|
route: params.route,
|
|
3310
3393
|
sender: {
|
|
3311
3394
|
id: getPrimaryIdentityId(sender) ?? void 0,
|
|
@@ -3811,6 +3894,7 @@ async function monitorWebChannel(verbose, listenerFactory = attachWebInboxToSock
|
|
|
3811
3894
|
process.once("SIGINT", handleSigint);
|
|
3812
3895
|
const transportTimeoutMs = tuning.transportTimeoutMs ?? DEFAULT_TRANSPORT_TIMEOUT_MS;
|
|
3813
3896
|
const messageTimeoutMs = tuning.messageTimeoutMs ?? 1800 * 1e3;
|
|
3897
|
+
const reconnectCatchUpWindowMs = Math.min(Math.max(messageTimeoutMs, 6e4), WHATSAPP_INBOUND_DEDUPE_TTL_MS);
|
|
3814
3898
|
const watchdogCheckMs = tuning.watchdogCheckMs ?? 60 * 1e3;
|
|
3815
3899
|
const controller = new WhatsAppConnectionController({
|
|
3816
3900
|
accountId: account.accountId,
|
|
@@ -3847,7 +3931,7 @@ async function monitorWebChannel(verbose, listenerFactory = attachWebInboxToSock
|
|
|
3847
3931
|
if (normalized.payload.media?.path || normalized.payload.media?.type) return false;
|
|
3848
3932
|
if (normalized.payload.location) return false;
|
|
3849
3933
|
if (normalized.quote?.id || normalized.quote?.body) return false;
|
|
3850
|
-
return !isControlCommandMessage(normalized.payload.body, cfg);
|
|
3934
|
+
return !isControlCommandMessage(normalized.payload.commandBody ?? normalized.payload.body, cfg);
|
|
3851
3935
|
};
|
|
3852
3936
|
let connection;
|
|
3853
3937
|
try {
|
|
@@ -3886,6 +3970,11 @@ async function monitorWebChannel(verbose, listenerFactory = attachWebInboxToSock
|
|
|
3886
3970
|
sendReadReceipts: account.sendReadReceipts,
|
|
3887
3971
|
socketTiming,
|
|
3888
3972
|
debounceMs: inboundDebounceMs,
|
|
3973
|
+
appendReplyWindow: connectionLocal.openedAfterRecentInbound ? {
|
|
3974
|
+
afterMs: connectionLocal.startedAt - reconnectCatchUpWindowMs,
|
|
3975
|
+
untilMs: connectionLocal.startedAt + reconnectCatchUpWindowMs,
|
|
3976
|
+
maxAgeMs: reconnectCatchUpWindowMs
|
|
3977
|
+
} : void 0,
|
|
3889
3978
|
shouldDebounce,
|
|
3890
3979
|
socketRef: controller.socketRef,
|
|
3891
3980
|
shouldRetryDisconnect: () => !sigintStop && controller.shouldRetryDisconnect(),
|