@openclaw/discord 2026.8.1-beta.3 → 2026.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account-inspect-BY-ve3yH.js +45 -0
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-DNl-oCEw.js → accounts-CwJQoLjM.js} +87 -162
- package/dist/action-runtime-api.js +1 -1
- package/dist/{activities-api-KCBAmWxD.js → activities-api-CkKcHUB6.js} +14 -12
- package/dist/activities-api.js +1 -1
- package/dist/{allow-list-BDMimASD.js → allow-list-C2JuH-R0.js} +10 -6
- package/dist/{api-DNVbJyEy.js → api-BfmEP6wp.js} +6 -5
- package/dist/api.js +18 -18
- package/dist/{approval-handler.runtime-B12RCYr8.js → approval-handler.runtime-DZM6Kt1Z.js} +30 -106
- package/dist/{audit-Yc7eZDd6.js → audit-DIbQA4VT.js} +8 -7
- package/dist/{channel-cXYzGc4L.js → channel-CarzU3bg.js} +25 -25
- package/dist/{channel-actions.runtime-CODTvo7c.js → channel-actions.runtime-B2wMqeVK.js} +60 -57
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/channel-type-CVLZyGYS.js +7 -0
- package/dist/{channel.setup-CSiwnMgs.js → channel.setup-z_ewMVa9.js} +18 -18
- package/dist/{components-ezGKo_Yh.js → components-gvRA0oaI.js} +33 -29
- package/dist/{config-schema-DC5kDtQ5.js → config-schema-B797-Spt.js} +21 -14
- package/dist/{conversation-binding-route-D6rCQ5S0.js → conversation-binding-route-DPpBRpYI.js} +1 -1
- package/dist/{directory-config-XyCfoqLg.js → directory-config-AA8wQx0D.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-Df0NbFJB.js → directory-live-D_kFz_Fj.js} +4 -4
- package/dist/{doctor-DYY31GrO.js → doctor-QQTOkBfW.js} +5 -5
- package/dist/{doctor-contract-DsWvKIXF.js → doctor-contract-Co5vRCZ6.js} +9 -6
- package/dist/doctor-contract-api.js +4 -3
- package/dist/{handle-action.guild-admin-6Tvvinsa.js → handle-action.guild-admin-Cc88ZGon.js} +9 -5
- package/dist/index.js +1 -1
- package/dist/ingress-identity-BCzfPPYM.js +60 -0
- package/dist/{message-handler-B61q5MOF.js → message-handler-CAeEpqWo.js} +14 -10
- package/dist/{message-handler.preflight-Bzg_Hawz.js → message-handler.preflight-CoKoE3dY.js} +32 -91
- package/dist/{message-handler.process--4_712Ec.js → message-handler.process-cdIJ_fDT.js} +99 -123
- package/dist/{message-utils-BXLLnFl6.js → message-text-C0K4-fkg.js} +41 -34
- package/dist/{outbound-adapter-DxHTOqiN.js → outbound-adapter-Ch0At5Ra.js} +85 -78
- package/dist/{outbound-components-B2PL0ooH.js → outbound-components-Bnt_7x7r.js} +5 -4
- package/dist/outbound-session-route-CzzerX2K.js +668 -0
- package/dist/{owner-access-Bg41VzAf.js → owner-access-yc1sX7Gx.js} +7 -6
- package/dist/{pluralkit-dUl4v1X3.js → pluralkit-B3cUVI7i.js} +2 -2
- package/dist/{probe-BTdtVRwU.js → probe-3ovFAp3b.js} +3 -3
- package/dist/{probe.runtime-Dq5-PRKT.js → probe.runtime-BckHn3cJ.js} +1 -1
- package/dist/{provider-DlK_ynqt.js → provider-CjI8BSzS.js} +511 -342
- package/dist/{provider-session.runtime-CvvphHvs.js → provider-session.runtime-DdKRMcE9.js} +3 -3
- package/dist/provider.runtime-Bo1WbLLr.js +2 -0
- package/dist/{realtime-session.runtime-ysbMG8v7.js → realtime-session.runtime-37IC-p5K.js} +110 -126
- package/dist/{resolve-allowlist-common-DIVXbD1P.js → resolve-allowlist-common-BJ5UZNNT.js} +3 -3
- package/dist/{resolve-channels-CGeUoIqb.js → resolve-channels-BexR2eUn.js} +6 -5
- package/dist/{resolve-users-BtKxLUZv.js → resolve-users-BtXBCH5W.js} +5 -4
- package/dist/{retry-after-DdLPmPoa.js → retry-after-BrLjLUJi.js} +2 -1
- package/dist/{retry-DNsVTeTo.js → retry-t5RcEsPk.js} +237 -15
- package/dist/{runtime-CQovMsH3.js → runtime-BNlDfLwS.js} +2 -2
- package/dist/{runtime-D71_VFLr.js → runtime-DydyfxST.js} +182 -131
- package/dist/runtime-api.js +19 -26
- package/dist/{secret-config-contract-B3i6WxV5.js → secret-config-contract-DFu9hfU8.js} +14 -6
- package/dist/secret-contract-api.js +1 -1
- package/dist/{security-audit-BfJhAXZp.js → security-audit-DKfK-iPY.js} +10 -11
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/{security-audit.runtime-BVKF9VtY.js → security-audit.runtime-sKZyKgpx.js} +1 -1
- package/dist/{send-rQIffSYu.js → send-mTKSBdmZ.js} +149 -58
- package/dist/{send.components-ChK1wS7w.js → send.components-nsPnc7kK.js} +29 -30
- package/dist/{send.outbound-HIkgji_7.js → send.outbound-CaOs9Zy1.js} +87 -84
- package/dist/{send.shared-B3fpaLWJ.js → send.shared-BJHt0Vyf.js} +55 -33
- package/dist/{sender-identity-BJtfyise.js → sender-identity-Dt0imZyY.js} +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-CaAaoksy.js → shared-BNesVA4P.js} +43 -18
- package/dist/{subagent-hooks-CNT2ZJTJ.js → subagent-hooks-IeZVPLGj.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -6
- package/dist/{system-events-Nuwoq_au.js → system-events-Be5EJI3b.js} +2 -2
- package/dist/{target-resolver-DIXShHaZ.js → target-resolver-C0MnwEki.js} +6 -5
- package/dist/targets-DQSye1Rv.js +3 -0
- package/dist/{thread-bindings-VlymUnbz.js → thread-bindings-wECUSIIG.js} +6 -6
- package/dist/{thread-bindings.manager-CngsgErq.js → thread-bindings.manager-B-3UHCc1.js} +31 -32
- package/dist/{thread-bindings.session-updates-CJb-BpPL.js → thread-bindings.session-updates-CC7HoQvt.js} +2 -1
- package/dist/{threading-DU6pgeGm.js → threading-te5ADPQI.js} +51 -27
- package/dist/{timeouts-B9cy6RvQ.js → timeouts-D86uWLt_.js} +1 -1
- package/dist/{transcripts-source-DeIMNbRh.js → transcripts-source-DkUhR7YK.js} +9 -4
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-oLiS5Z13.js → typing-DAwJF5VT.js} +2 -2
- package/dist/{voice-runtime-CjNFaynA.js → voice-runtime-COyYYTDD.js} +418 -74
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/README.md +1 -1
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/conforms.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/package.json +3 -3
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubArray.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubObject.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubString.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/README.md +19 -19
- package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist/v1.js +7 -3
- package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist/v7.js +5 -2
- package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist-node/v1.js +7 -3
- package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/dist-node/v7.js +5 -2
- package/node_modules/@discord/embedded-app-sdk/node_modules/uuid/package.json +4 -3
- package/node_modules/@discordjs/voice/node_modules/@types/node/README.md +1 -1
- package/node_modules/@discordjs/voice/node_modules/@types/node/child_process.d.ts +0 -1
- package/node_modules/@discordjs/voice/node_modules/@types/node/crypto.d.ts +6 -6
- package/node_modules/@discordjs/voice/node_modules/@types/node/dns/promises.d.ts +5 -5
- package/node_modules/@discordjs/voice/node_modules/@types/node/dns.d.ts +5 -5
- package/node_modules/@discordjs/voice/node_modules/@types/node/fs.d.ts +7 -0
- package/node_modules/@discordjs/voice/node_modules/@types/node/http.d.ts +30 -0
- package/node_modules/@discordjs/voice/node_modules/@types/node/http2.d.ts +4 -4
- package/node_modules/@discordjs/voice/node_modules/@types/node/os.d.ts +30 -30
- package/node_modules/@discordjs/voice/node_modules/@types/node/package.json +2 -2
- package/node_modules/@discordjs/voice/node_modules/@types/node/perf_hooks.d.ts +2 -1
- package/node_modules/@discordjs/voice/node_modules/@types/node/process.d.ts +42 -43
- package/node_modules/@discordjs/voice/node_modules/@types/node/quic.d.ts +1049 -84
- package/node_modules/@discordjs/voice/node_modules/@types/node/sqlite.d.ts +14 -1
- package/node_modules/@discordjs/voice/node_modules/@types/node/stream/iter.d.ts +3 -2
- package/node_modules/@discordjs/voice/node_modules/@types/node/test.d.ts +61 -0
- package/node_modules/@discordjs/voice/node_modules/@types/node/v8.d.ts +20 -23
- package/node_modules/discord-api-types/CHANGELOG.md +8 -0
- package/node_modules/discord-api-types/package.json +4 -4
- package/node_modules/discord-api-types/payloads/v10/channel.d.ts +2 -2
- package/node_modules/discord-api-types/payloads/v10/channel.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/gateway.d.ts +4 -0
- package/node_modules/discord-api-types/payloads/v10/gateway.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/gateway.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/message.d.ts +4 -1
- package/node_modules/discord-api-types/payloads/v10/message.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/message.js +1 -0
- package/node_modules/discord-api-types/payloads/v10/message.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/channel.d.ts +2 -2
- package/node_modules/discord-api-types/payloads/v9/channel.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/gateway.d.ts +4 -0
- package/node_modules/discord-api-types/payloads/v9/gateway.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/gateway.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/message.d.ts +4 -1
- package/node_modules/discord-api-types/payloads/v9/message.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/message.js +1 -0
- package/node_modules/discord-api-types/payloads/v9/message.js.map +1 -1
- package/node_modules/typebox/build/format/date.d.mts +1 -1
- package/node_modules/typebox/build/format/date.mjs +1 -1
- package/node_modules/typebox/build/format/date_time.d.mts +2 -2
- package/node_modules/typebox/build/format/date_time.mjs +3 -3
- package/node_modules/typebox/build/format/email.d.mts +1 -1
- package/node_modules/typebox/build/format/email.mjs +2 -2
- package/node_modules/typebox/build/format/hostname.mjs +2 -10
- package/node_modules/typebox/build/format/idn_email.d.mts +1 -1
- package/node_modules/typebox/build/format/idn_email.mjs +3 -3
- package/node_modules/typebox/build/format/idn_hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idn_hostname.mjs +3 -11
- package/node_modules/typebox/build/format/idna/format/bidi.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/bidi.mjs +98 -0
- package/node_modules/typebox/build/format/idna/format/puny.d.mts +3 -0
- package/node_modules/typebox/build/format/idna/format/puny.mjs +144 -0
- package/node_modules/typebox/build/format/idna/hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/hostname.mjs +16 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +41 -0
- package/node_modules/typebox/build/format/idna/index.d.mts +2 -0
- package/node_modules/typebox/build/format/idna/index.mjs +2 -0
- package/node_modules/typebox/build/format/idna/label/ascii.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/ascii.mjs +9 -0
- package/node_modules/typebox/build/format/idna/label/puny.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/puny.mjs +28 -0
- package/node_modules/typebox/build/format/idna/label/unicode.d.mts +1 -0
- package/node_modules/typebox/build/format/idna/label/unicode.mjs +106 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.d.mts +30 -0
- package/node_modules/typebox/build/format/idna/pattern/pattern.mjs +70 -0
- package/node_modules/typebox/build/format/ipv4.d.mts +0 -1
- package/node_modules/typebox/build/format/ipv4.mjs +2 -32
- package/node_modules/typebox/build/format/ipv6.mjs +2 -61
- package/node_modules/typebox/build/format/iri.d.mts +2 -2
- package/node_modules/typebox/build/format/iri.mjs +26 -8
- package/node_modules/typebox/build/format/iri_reference.d.mts +2 -2
- package/node_modules/typebox/build/format/iri_reference.mjs +9 -55
- package/node_modules/typebox/build/format/regex.d.mts +1 -2
- package/node_modules/typebox/build/format/regex.mjs +2 -6
- package/node_modules/typebox/build/format/time.d.mts +2 -2
- package/node_modules/typebox/build/format/time.mjs +19 -14
- package/node_modules/typebox/build/format/uri.d.mts +1 -1
- package/node_modules/typebox/build/format/uri.mjs +3 -130
- package/node_modules/typebox/build/format/uri_reference.d.mts +1 -1
- package/node_modules/typebox/build/format/uri_reference.mjs +2 -3
- package/node_modules/typebox/build/format/uri_template.d.mts +2 -3
- package/node_modules/typebox/build/format/uri_template.mjs +4 -5
- package/node_modules/typebox/build/format/url.d.mts +3 -3
- package/node_modules/typebox/build/format/url.mjs +4 -5
- package/node_modules/typebox/build/guard/emit.d.mts +3 -1
- package/node_modules/typebox/build/guard/emit.mjs +12 -5
- package/node_modules/typebox/build/guard/guard.d.mts +8 -2
- package/node_modules/typebox/build/guard/guard.mjs +25 -4
- package/node_modules/typebox/build/guard/string.d.mts +2 -2
- package/node_modules/typebox/build/guard/string.mjs +7 -7
- package/node_modules/typebox/build/schema/engine/_context.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/_functions.mjs +1 -2
- package/node_modules/typebox/build/schema/engine/_regexp.d.mts +2 -0
- package/node_modules/typebox/build/schema/engine/_regexp.mjs +4 -0
- package/node_modules/typebox/build/schema/engine/_stack.mjs +12 -13
- package/node_modules/typebox/build/schema/engine/additionalItems.mjs +17 -7
- package/node_modules/typebox/build/schema/engine/additionalProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/contains.mjs +18 -6
- package/node_modules/typebox/build/schema/engine/enum.mjs +1 -1
- package/node_modules/typebox/build/schema/engine/items.mjs +26 -6
- package/node_modules/typebox/build/schema/engine/maxContains.mjs +3 -3
- package/node_modules/typebox/build/schema/engine/minContains.mjs +14 -4
- package/node_modules/typebox/build/schema/engine/not.mjs +4 -2
- package/node_modules/typebox/build/schema/engine/oneOf.mjs +7 -6
- package/node_modules/typebox/build/schema/engine/pattern.mjs +3 -2
- package/node_modules/typebox/build/schema/engine/patternProperties.mjs +4 -3
- package/node_modules/typebox/build/schema/engine/ref.mjs +1 -7
- package/node_modules/typebox/build/schema/engine/schema.mjs +13 -4
- package/node_modules/typebox/build/schema/engine/type.mjs +1 -1
- package/node_modules/typebox/build/schema/resolve/resolve.d.mts +4 -1
- package/node_modules/typebox/build/schema/resolve/resolve.mjs +202 -1
- package/node_modules/typebox/build/schema/static/propertyNames.d.mts +5 -0
- package/node_modules/typebox/build/schema/static/propertyNames.mjs +3 -0
- package/node_modules/typebox/build/schema/static/schema.d.mts +3 -0
- package/node_modules/typebox/build/schema/types/index.d.mts +0 -2
- package/node_modules/typebox/build/schema/types/index.mjs +0 -2
- package/node_modules/typebox/build/system/memory/clone.mjs +14 -11
- package/node_modules/typebox/build/system/memory/discard.mjs +6 -5
- package/node_modules/typebox/build/system/settings/settings.d.mts +9 -0
- package/node_modules/typebox/build/system/settings/settings.mjs +2 -0
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.d.mts +6 -1
- package/node_modules/typebox/build/type/engine/call/distribute_arguments.mjs +16 -3
- package/node_modules/typebox/build/type/engine/call/instantiate.mjs +34 -4
- package/node_modules/typebox/build/type/engine/evaluate/broaden.d.mts +5 -5
- package/node_modules/typebox/build/type/engine/evaluate/broaden.mjs +20 -26
- package/node_modules/typebox/build/type/engine/evaluate/compare.d.mts +6 -10
- package/node_modules/typebox/build/type/engine/evaluate/compare.mjs +9 -13
- package/node_modules/typebox/build/type/engine/evaluate/composite.d.mts +7 -4
- package/node_modules/typebox/build/type/engine/evaluate/composite.mjs +12 -19
- package/node_modules/typebox/build/type/engine/evaluate/distribute.d.mts +4 -20
- package/node_modules/typebox/build/type/engine/evaluate/distribute.mjs +8 -20
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.d.mts +4 -4
- package/node_modules/typebox/build/type/engine/evaluate/evaluate.mjs +11 -8
- package/node_modules/typebox/build/type/engine/evaluate/flatten.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/evaluate/flatten.mjs +3 -4
- package/node_modules/typebox/build/type/engine/evaluate/narrow.d.mts +17 -2
- package/node_modules/typebox/build/type/engine/evaluate/narrow.mjs +26 -6
- package/node_modules/typebox/build/type/engine/exclude/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/extract/operation.d.mts +1 -1
- package/node_modules/typebox/build/type/engine/extract/operation.mjs +3 -4
- package/node_modules/typebox/build/type/engine/priority/priority.d.mts +2 -2
- package/node_modules/typebox/build/type/engine/priority/priority.mjs +3 -4
- package/node_modules/typebox/build/type/script/mapping.d.mts +32 -29
- package/node_modules/typebox/build/type/script/mapping.mjs +18 -25
- package/node_modules/typebox/build/type/script/parser.d.mts +19 -25
- package/node_modules/typebox/build/type/script/parser.mjs +27 -23
- package/node_modules/typebox/build/value/errors/errors.d.mts +2 -2
- package/node_modules/typebox/build/value/errors/errors.mjs +1 -1
- package/node_modules/typebox/package.json +27 -27
- package/node_modules/typebox/readme.md +79 -82
- package/node_modules/undici/docs/docs/api/Client.md +21 -8
- package/node_modules/undici/lib/api/readable.js +33 -43
- package/node_modules/undici/lib/core/connect.js +16 -2
- package/node_modules/undici/lib/core/symbols.js +1 -0
- package/node_modules/undici/lib/dispatcher/client-h1.js +3 -3
- package/node_modules/undici/lib/dispatcher/client-h2.js +179 -10
- package/node_modules/undici/lib/dispatcher/client.js +74 -29
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +28 -6
- package/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +15 -1
- package/node_modules/undici/lib/handler/retry-handler.js +7 -2
- package/node_modules/undici/lib/interceptor/cache.js +5 -2
- package/node_modules/undici/lib/interceptor/deduplicate.js +1 -1
- package/node_modules/undici/lib/mock/mock-utils.js +213 -24
- package/node_modules/undici/lib/util/cache.js +2 -4
- package/node_modules/undici/lib/web/websocket/websocket.js +22 -0
- package/node_modules/undici/package.json +1 -1
- package/node_modules/undici/types/client.d.ts +40 -0
- package/node_modules/ws/lib/permessage-deflate.js +3 -1
- package/node_modules/ws/package.json +1 -1
- package/openclaw.plugin.json +14 -6
- package/package.json +8 -8
- package/skills/discord/SKILL.md +1 -1
- package/dist/account-inspect-D5xmUpnj.js +0 -89
- package/dist/approval-message-safety-XGFPbDoI.js +0 -226
- package/dist/audit-core-BCX8UeFH.js +0 -105
- package/dist/channel-actions-Dr2QI8Bf.js +0 -212
- package/dist/inbound-event-delivery-De2qxTrP.js +0 -39
- package/dist/provider.runtime-CzKGRiAF.js +0 -2
- package/dist/runtime-api.actions.js +0 -3
- package/dist/runtime-api.lookup.js +0 -7
- package/dist/runtime-api.monitor-CzeTYF32.js +0 -6
- package/dist/runtime-api.monitor.js +0 -9
- package/dist/runtime-api.send.js +0 -7
- package/dist/runtime-api.threads.js +0 -5
- package/dist/sdk-runtime-37OU6_Yh.js +0 -369
- package/dist/send.reactions-gmJ6yFPo.js +0 -78
- package/dist/send.receipt-Cnhoautb.js +0 -76
- package/dist/subagent-progress-FPLqBY1s.js +0 -110
- package/dist/targets-B2pf49zc.js +0 -3
- package/node_modules/typebox/build/format/_idna.d.mts +0 -2
- package/node_modules/typebox/build/format/_idna.mjs +0 -246
- package/node_modules/typebox/build/format/_puny.d.mts +0 -1
- package/node_modules/typebox/build/format/_puny.mjs +0 -77
- package/node_modules/typebox/build/schema/resolve/ref.d.mts +0 -3
- package/node_modules/typebox/build/schema/resolve/ref.mjs +0 -146
- package/node_modules/typebox/build/schema/types/contentEncoding.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentEncoding.mjs +0 -13
- package/node_modules/typebox/build/schema/types/contentMediaType.d.mts +0 -9
- package/node_modules/typebox/build/schema/types/contentMediaType.mjs +0 -13
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
1
|
+
import { At as getChannel, on as __exportAll, v as resolveDiscordChannelId, vt as createChannelWebhook } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { P as createDiscordRestClient } from "./send.shared-BJHt0Vyf.js";
|
|
3
|
+
import { t as sendMessageDiscord } from "./send.outbound-CaOs9Zy1.js";
|
|
4
|
+
import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.js";
|
|
5
|
+
import { c as sendWebhookMessageDiscord, u as createThreadDiscord } from "./send-mTKSBdmZ.js";
|
|
6
6
|
import { A as toReusableWebhookKey, C as resolveThreadBindingMaxAgeExpiresAt, D as shouldDefaultPersist, E as setBindingRecord, S as resolveThreadBindingInactivityExpiresAt, T as saveBindingsToDisk, _ as rememberThreadBindingToken, b as resolveBindingRecordKey, c as ensureBindingsLoaded, f as normalizeTargetKind, g as rememberReusableWebhook, h as refreshUnboundThreadWebhookIdentity, i as REUSABLE_WEBHOOKS_BY_ACCOUNT_CHANNEL, l as forgetThreadBindingToken, m as normalizeThreadId, n as MANAGERS_BY_ACCOUNT_ID, p as normalizeThreadBindingDurationMs, r as PERSIST_BY_ACCOUNT_ID, s as THREAD_BINDING_TOUCH_PERSIST_MIN_INTERVAL_MS, t as BINDINGS_BY_THREAD_ID, u as getThreadBindingToken, v as removeBindingRecord, w as resolveThreadBindingMaxAgeMs$1, x as resolveThreadBindingIdleTimeoutMs$1, y as resolveBindingIdsForSession } from "./thread-bindings.state-D8OMdk4O.js";
|
|
7
|
-
import { ChannelType } from "discord-api-types/v10";
|
|
8
7
|
import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
9
8
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
10
9
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -13,7 +12,7 @@ import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
|
13
12
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
14
13
|
import { SYSTEM_MARK } from "openclaw/plugin-sdk/text-chunking";
|
|
15
14
|
import { formatThreadBindingDurationLabel, registerSessionBindingAdapter, resolveThreadBindingConversationIdFromBindingId, resolveThreadBindingFarewellText, resolveThreadBindingIntroText, resolveThreadBindingThreadName, unregisterSessionBindingAdapter } from "openclaw/plugin-sdk/conversation-runtime";
|
|
16
|
-
import {
|
|
15
|
+
import { resolveSessionAgentIdStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
17
16
|
//#region extensions/discord/src/monitor/thread-bindings.persona.ts
|
|
18
17
|
const THREAD_BINDING_PERSONA_MAX_CHARS = 80;
|
|
19
18
|
function normalizePersonaLabel(value) {
|
|
@@ -21,7 +20,8 @@ function normalizePersonaLabel(value) {
|
|
|
21
20
|
return value.replace(/\s+/g, " ").trim() || void 0;
|
|
22
21
|
}
|
|
23
22
|
function resolveThreadBindingPersona(params) {
|
|
24
|
-
|
|
23
|
+
const base = normalizePersonaLabel(params.label) || normalizePersonaLabel(params.agentId) || "agent";
|
|
24
|
+
return truncateUtf16Safe(`${SYSTEM_MARK} ${base}`, THREAD_BINDING_PERSONA_MAX_CHARS);
|
|
25
25
|
}
|
|
26
26
|
function resolveThreadBindingPersonaFromRecord(record) {
|
|
27
27
|
return resolveThreadBindingPersona({
|
|
@@ -93,7 +93,7 @@ function resolveDiscordChannelInfoSafe(channel) {
|
|
|
93
93
|
//#endregion
|
|
94
94
|
//#region extensions/discord/src/monitor/thread-bindings.types.ts
|
|
95
95
|
const THREAD_BINDINGS_SWEEP_INTERVAL_MS = 12e4;
|
|
96
|
-
const DEFAULT_THREAD_BINDING_IDLE_TIMEOUT_MS =
|
|
96
|
+
const DEFAULT_THREAD_BINDING_IDLE_TIMEOUT_MS = 864e5;
|
|
97
97
|
//#endregion
|
|
98
98
|
//#region extensions/discord/src/monitor/thread-bindings.discord-api.ts
|
|
99
99
|
function buildThreadTarget(threadId) {
|
|
@@ -107,9 +107,6 @@ function isThreadArchived(raw) {
|
|
|
107
107
|
if (asRecord.threadMetadata?.archived === true) return true;
|
|
108
108
|
return false;
|
|
109
109
|
}
|
|
110
|
-
function isThreadChannelType(type) {
|
|
111
|
-
return type === ChannelType.PublicThread || type === ChannelType.PrivateThread || type === ChannelType.AnnouncementThread;
|
|
112
|
-
}
|
|
113
110
|
function normalizeDiscordBindingChannelId(raw) {
|
|
114
111
|
const trimmed = normalizeOptionalString(raw) ?? "";
|
|
115
112
|
if (!trimmed) return null;
|
|
@@ -227,7 +224,7 @@ async function resolveChannelIdForBinding(params) {
|
|
|
227
224
|
const channelId = normalizeOptionalString(resolveDiscordChannelIdSafe(channel)) ?? "";
|
|
228
225
|
const type = channelInfo.type;
|
|
229
226
|
const parentId = normalizeOptionalString(channelInfo.parentId) ?? "";
|
|
230
|
-
if (parentId &&
|
|
227
|
+
if (parentId && isDiscordThreadChannelType(type)) return parentId;
|
|
231
228
|
return channelId || null;
|
|
232
229
|
} catch (err) {
|
|
233
230
|
logVerbose(`discord thread binding channel resolve failed for ${lookupThreadId}: ${summarizeDiscordError(err)}`);
|
|
@@ -236,11 +233,12 @@ async function resolveChannelIdForBinding(params) {
|
|
|
236
233
|
}
|
|
237
234
|
async function createThreadForBinding(params) {
|
|
238
235
|
try {
|
|
239
|
-
|
|
236
|
+
const created = await createThreadDiscord(params.channelId, { name: params.threadName }, {
|
|
240
237
|
cfg: params.cfg,
|
|
241
238
|
accountId: params.accountId,
|
|
242
239
|
token: params.token
|
|
243
|
-
})
|
|
240
|
+
});
|
|
241
|
+
return (normalizeOptionalString(created?.id) ?? "") || null;
|
|
244
242
|
} catch (err) {
|
|
245
243
|
logVerbose(`discord thread binding auto-thread create failed for ${params.channelId}: ${summarizeDiscordError(err)}`);
|
|
246
244
|
return null;
|
|
@@ -404,12 +402,6 @@ var thread_bindings_manager_exports = /* @__PURE__ */ __exportAll({
|
|
|
404
402
|
createThreadBindingManager: () => createThreadBindingManager,
|
|
405
403
|
getThreadBindingManager: () => getThreadBindingManager
|
|
406
404
|
});
|
|
407
|
-
function registerManager(manager) {
|
|
408
|
-
MANAGERS_BY_ACCOUNT_ID.set(manager.accountId, manager);
|
|
409
|
-
}
|
|
410
|
-
function unregisterManager(accountId, manager) {
|
|
411
|
-
if (MANAGERS_BY_ACCOUNT_ID.get(accountId) === manager) MANAGERS_BY_ACCOUNT_ID.delete(accountId);
|
|
412
|
-
}
|
|
413
405
|
function createNoopManager(accountIdRaw) {
|
|
414
406
|
return {
|
|
415
407
|
accountId: normalizeAccountId(accountIdRaw),
|
|
@@ -451,13 +443,14 @@ function createThreadBindingManager(params) {
|
|
|
451
443
|
const maxAgeMs = normalizeThreadBindingDurationMs(params.maxAgeMs, 0);
|
|
452
444
|
const resolveCurrentCfg = () => getRuntimeConfigSnapshot() ?? params.cfg;
|
|
453
445
|
const resolveCurrentToken = () => getThreadBindingToken(accountId) ?? params.token;
|
|
446
|
+
const getCurrentBinding = (threadId) => MANAGERS_BY_ACCOUNT_ID.get(accountId) === manager ? manager.getByThreadId(threadId) : void 0;
|
|
454
447
|
let sweepTimer = null;
|
|
455
448
|
const runSweepOnce = async () => {
|
|
456
449
|
const bindings = manager.listBindings();
|
|
457
450
|
if (bindings.length === 0) return;
|
|
458
451
|
let rest = null;
|
|
459
452
|
for (const snapshotBinding of bindings) {
|
|
460
|
-
const binding =
|
|
453
|
+
const binding = getCurrentBinding(snapshotBinding.threadId);
|
|
461
454
|
if (!binding) continue;
|
|
462
455
|
const now = Date.now();
|
|
463
456
|
const inactivityExpiresAt = resolveThreadBindingInactivityExpiresAt({
|
|
@@ -500,8 +493,9 @@ function createThreadBindingManager(params) {
|
|
|
500
493
|
}
|
|
501
494
|
if (isDirectConversationBindingId(binding.threadId)) continue;
|
|
502
495
|
if (!rest) try {
|
|
496
|
+
const cfg = resolveCurrentCfg();
|
|
503
497
|
rest = createDiscordRestClient({
|
|
504
|
-
cfg
|
|
498
|
+
cfg,
|
|
505
499
|
accountId,
|
|
506
500
|
token: resolveCurrentToken()
|
|
507
501
|
}).rest;
|
|
@@ -510,6 +504,7 @@ function createThreadBindingManager(params) {
|
|
|
510
504
|
}
|
|
511
505
|
try {
|
|
512
506
|
const channel = await getChannel(rest, binding.threadId);
|
|
507
|
+
if (getCurrentBinding(binding.threadId) !== binding) continue;
|
|
513
508
|
if (!channel || typeof channel !== "object") {
|
|
514
509
|
logVerbose(`discord thread binding sweep probe returned invalid payload for ${binding.threadId}`);
|
|
515
510
|
continue;
|
|
@@ -520,6 +515,7 @@ function createThreadBindingManager(params) {
|
|
|
520
515
|
sendFarewell: true
|
|
521
516
|
});
|
|
522
517
|
} catch (err) {
|
|
518
|
+
if (getCurrentBinding(binding.threadId) !== binding) continue;
|
|
523
519
|
if (isDiscordThreadGoneError(err)) {
|
|
524
520
|
logVerbose(`discord thread binding sweep removing stale binding ${binding.threadId}: ${summarizeDiscordError(err)}`);
|
|
525
521
|
manager.unbindThread({
|
|
@@ -608,6 +604,7 @@ function createThreadBindingManager(params) {
|
|
|
608
604
|
const targetSessionKey = normalizeOptionalString(bindParams.targetSessionKey) ?? "";
|
|
609
605
|
if (!targetSessionKey) return null;
|
|
610
606
|
const targetKind = normalizeTargetKind(bindParams.targetKind, targetSessionKey);
|
|
607
|
+
const previous = existingValue?.targetSessionKey === targetSessionKey && existingValue.targetKind === targetKind ? existingValue : void 0;
|
|
611
608
|
let webhookId = normalizeOptionalString(bindParams.webhookId) ?? normalizeOptionalString(existingValue?.webhookId) ?? "";
|
|
612
609
|
let webhookToken = normalizeOptionalString(bindParams.webhookToken) ?? normalizeOptionalString(existingValue?.webhookToken) ?? "";
|
|
613
610
|
if (!directConversationBinding && (!webhookId || !webhookToken)) {
|
|
@@ -635,22 +632,22 @@ function createThreadBindingManager(params) {
|
|
|
635
632
|
threadId,
|
|
636
633
|
targetKind,
|
|
637
634
|
targetSessionKey,
|
|
638
|
-
agentId: normalizeOptionalString(bindParams.agentId) ?? normalizeOptionalString(
|
|
635
|
+
agentId: normalizeOptionalString(bindParams.agentId) ?? normalizeOptionalString(previous?.agentId) ?? resolveSessionAgentIdStrict({
|
|
639
636
|
config: cfg,
|
|
640
637
|
sessionKey: targetSessionKey
|
|
641
638
|
}),
|
|
642
|
-
label: normalizeOptionalString(bindParams.label) ?? normalizeOptionalString(
|
|
639
|
+
label: normalizeOptionalString(bindParams.label) ?? normalizeOptionalString(previous?.label),
|
|
643
640
|
webhookId: webhookId || void 0,
|
|
644
641
|
webhookToken: webhookToken || void 0,
|
|
645
|
-
boundBy: normalizeOptionalString(bindParams.boundBy) ?? normalizeOptionalString(
|
|
642
|
+
boundBy: normalizeOptionalString(bindParams.boundBy) ?? normalizeOptionalString(previous?.boundBy) ?? "system",
|
|
646
643
|
boundAt: now,
|
|
647
644
|
lastActivityAt: now,
|
|
648
645
|
idleTimeoutMs: typeof existingValue?.idleTimeoutMs === "number" ? existingValue.idleTimeoutMs : idleTimeoutMs,
|
|
649
646
|
maxAgeMs: typeof existingValue?.maxAgeMs === "number" ? existingValue.maxAgeMs : maxAgeMs,
|
|
650
|
-
metadata:
|
|
651
|
-
...
|
|
647
|
+
metadata: {
|
|
648
|
+
...previous?.metadata,
|
|
652
649
|
...bindParams.metadata
|
|
653
|
-
}
|
|
650
|
+
}
|
|
654
651
|
};
|
|
655
652
|
setBindingRecord(record);
|
|
656
653
|
if (persist) saveBindingsToDisk();
|
|
@@ -723,13 +720,15 @@ function createThreadBindingManager(params) {
|
|
|
723
720
|
clearInterval(sweepTimer);
|
|
724
721
|
sweepTimer = null;
|
|
725
722
|
}
|
|
726
|
-
|
|
723
|
+
if (MANAGERS_BY_ACCOUNT_ID.get(accountId) === manager) {
|
|
724
|
+
MANAGERS_BY_ACCOUNT_ID.delete(accountId);
|
|
725
|
+
forgetThreadBindingToken(accountId);
|
|
726
|
+
}
|
|
727
727
|
unregisterSessionBindingAdapter({
|
|
728
728
|
channel: "discord",
|
|
729
729
|
accountId,
|
|
730
730
|
adapter: sessionBindingAdapter
|
|
731
731
|
});
|
|
732
|
-
forgetThreadBindingToken(accountId);
|
|
733
732
|
}
|
|
734
733
|
};
|
|
735
734
|
if (params.enableSweeper !== false) {
|
|
@@ -749,7 +748,7 @@ function createThreadBindingManager(params) {
|
|
|
749
748
|
resolveCurrentToken
|
|
750
749
|
});
|
|
751
750
|
registerSessionBindingAdapter(sessionBindingAdapter);
|
|
752
|
-
|
|
751
|
+
MANAGERS_BY_ACCOUNT_ID.set(accountId, manager);
|
|
753
752
|
return manager;
|
|
754
753
|
}
|
|
755
754
|
function createNoopThreadBindingManager(accountId) {
|
|
@@ -9,9 +9,10 @@ function resolveBindingIdsForTargetSession(params) {
|
|
|
9
9
|
ensureBindingsLoaded();
|
|
10
10
|
const targetSessionKey = params.targetSessionKey.trim();
|
|
11
11
|
if (!targetSessionKey) return [];
|
|
12
|
+
const accountId = params.accountId ? normalizeAccountId(params.accountId) : void 0;
|
|
12
13
|
return resolveBindingIdsForSession({
|
|
13
14
|
targetSessionKey,
|
|
14
|
-
accountId
|
|
15
|
+
accountId,
|
|
15
16
|
targetKind: params.targetKind
|
|
16
17
|
});
|
|
17
18
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { F as DiscordError, Ot as editChannel, Tt as createThread, jt as getChannelMessage, on as __exportAll, y as discord_exports } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.js";
|
|
3
|
+
import { d as resolveDiscordChannelParentSafe, l as resolveDiscordChannelNameSafe, s as resolveDiscordChannelIdSafe, u as resolveDiscordChannelParentIdSafe } from "./thread-bindings.manager-B-3UHCc1.js";
|
|
4
|
+
import { a as formatDiscordMediaText, h as resolveDiscordMessageChannelId, m as resolveDiscordChannelInfo, n as resolveDiscordForwardedMessagesTextFromSnapshots, t as resolveDiscordEmbedText } from "./message-text-C0K4-fkg.js";
|
|
4
5
|
import { buildAgentSessionKey } from "openclaw/plugin-sdk/routing";
|
|
5
6
|
import { normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
7
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
7
8
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
8
9
|
import { createReplyReferencePlanner } from "openclaw/plugin-sdk/reply-reference";
|
|
10
|
+
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
9
11
|
import { resolveChannelModelOverride } from "openclaw/plugin-sdk/model-session-runtime";
|
|
10
12
|
import { generateConversationLabel } from "openclaw/plugin-sdk/reply-dispatch-runtime";
|
|
11
13
|
//#region extensions/discord/src/monitor/thread-title.ts
|
|
@@ -98,21 +100,20 @@ function normalizeTitleContextField(raw, maxChars) {
|
|
|
98
100
|
}
|
|
99
101
|
//#endregion
|
|
100
102
|
//#region extensions/discord/src/monitor/threading.cache.ts
|
|
101
|
-
const DISCORD_THREAD_STARTER_CACHE_TTL_MS =
|
|
103
|
+
const DISCORD_THREAD_STARTER_CACHE_TTL_MS = 3e5;
|
|
104
|
+
const DISCORD_THREAD_STARTER_NEGATIVE_CACHE_TTL_MS = 3e4;
|
|
102
105
|
const DISCORD_THREAD_STARTER_CACHE_MAX = 500;
|
|
103
106
|
const DISCORD_THREAD_STARTER_CACHE = /* @__PURE__ */ new Map();
|
|
104
107
|
function getCachedThreadStarter(key, now) {
|
|
105
108
|
const entry = DISCORD_THREAD_STARTER_CACHE.get(key);
|
|
106
109
|
if (!entry) return;
|
|
107
|
-
|
|
110
|
+
const ttlMs = entry.value.kind === "miss" ? DISCORD_THREAD_STARTER_NEGATIVE_CACHE_TTL_MS : DISCORD_THREAD_STARTER_CACHE_TTL_MS;
|
|
111
|
+
if (now < entry.updatedAt || now - entry.updatedAt >= ttlMs) {
|
|
108
112
|
DISCORD_THREAD_STARTER_CACHE.delete(key);
|
|
109
113
|
return;
|
|
110
114
|
}
|
|
111
115
|
DISCORD_THREAD_STARTER_CACHE.delete(key);
|
|
112
|
-
DISCORD_THREAD_STARTER_CACHE.set(key,
|
|
113
|
-
...entry,
|
|
114
|
-
updatedAt: now
|
|
115
|
-
});
|
|
116
|
+
DISCORD_THREAD_STARTER_CACHE.set(key, entry);
|
|
116
117
|
return entry.value;
|
|
117
118
|
}
|
|
118
119
|
function setCachedThreadStarter(key, value, now) {
|
|
@@ -121,26 +122,20 @@ function setCachedThreadStarter(key, value, now) {
|
|
|
121
122
|
value,
|
|
122
123
|
updatedAt: now
|
|
123
124
|
});
|
|
124
|
-
|
|
125
|
-
const iter = DISCORD_THREAD_STARTER_CACHE.keys().next();
|
|
126
|
-
if (iter.done) break;
|
|
127
|
-
DISCORD_THREAD_STARTER_CACHE.delete(iter.value);
|
|
128
|
-
}
|
|
125
|
+
pruneMapToMaxSize(DISCORD_THREAD_STARTER_CACHE, DISCORD_THREAD_STARTER_CACHE_MAX);
|
|
129
126
|
}
|
|
130
127
|
//#endregion
|
|
131
128
|
//#region extensions/discord/src/monitor/threading.starter.ts
|
|
132
|
-
function isDiscordThreadType(type) {
|
|
133
|
-
return type === discord_exports.ChannelType.PublicThread || type === discord_exports.ChannelType.PrivateThread || type === discord_exports.ChannelType.AnnouncementThread;
|
|
134
|
-
}
|
|
135
129
|
function isDiscordForumParentType(parentType) {
|
|
136
130
|
return parentType === discord_exports.ChannelType.GuildForum || parentType === discord_exports.ChannelType.GuildMedia;
|
|
137
131
|
}
|
|
132
|
+
const IN_FLIGHT_DISCORD_THREAD_STARTERS = /* @__PURE__ */ new Map();
|
|
138
133
|
function resolveDiscordThreadChannel(params) {
|
|
139
134
|
if (!params.isGuildMessage) return null;
|
|
140
135
|
const { message, channelInfo } = params;
|
|
141
136
|
const channel = "channel" in message ? message.channel : void 0;
|
|
142
137
|
if (channel && typeof channel === "object" && "isThread" in channel && typeof channel.isThread === "function" && channel.isThread()) return channel;
|
|
143
|
-
if (!
|
|
138
|
+
if (!isDiscordThreadChannelType(channelInfo?.type)) return null;
|
|
144
139
|
const messageChannelId = params.messageChannelId || resolveDiscordMessageChannelId({ message });
|
|
145
140
|
if (!messageChannelId) return null;
|
|
146
141
|
return {
|
|
@@ -168,29 +163,56 @@ async function resolveDiscordThreadParentInfo(params) {
|
|
|
168
163
|
};
|
|
169
164
|
}
|
|
170
165
|
async function resolveDiscordThreadStarter(params) {
|
|
171
|
-
const
|
|
166
|
+
const messageChannelId = resolveDiscordThreadStarterMessageChannelId(params);
|
|
167
|
+
if (!messageChannelId) return null;
|
|
168
|
+
const cacheKey = `${params.accountId}:${params.channel.id}:${messageChannelId}`;
|
|
172
169
|
const cached = getCachedThreadStarter(cacheKey, Date.now());
|
|
173
|
-
if (cached) return cached;
|
|
170
|
+
if (cached) return cached.kind === "hit" ? cached.starter : null;
|
|
171
|
+
const inFlight = IN_FLIGHT_DISCORD_THREAD_STARTERS.get(cacheKey);
|
|
172
|
+
if (inFlight) return inFlight;
|
|
173
|
+
const pending = resolveDiscordThreadStarterUncached(params, cacheKey, messageChannelId);
|
|
174
|
+
IN_FLIGHT_DISCORD_THREAD_STARTERS.set(cacheKey, pending);
|
|
175
|
+
try {
|
|
176
|
+
return await pending;
|
|
177
|
+
} finally {
|
|
178
|
+
if (IN_FLIGHT_DISCORD_THREAD_STARTERS.get(cacheKey) === pending) IN_FLIGHT_DISCORD_THREAD_STARTERS.delete(cacheKey);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
async function resolveDiscordThreadStarterUncached(params, cacheKey, messageChannelId) {
|
|
182
|
+
const cacheMiss = () => {
|
|
183
|
+
setCachedThreadStarter(cacheKey, { kind: "miss" }, Date.now());
|
|
184
|
+
};
|
|
174
185
|
try {
|
|
175
|
-
const messageChannelId = resolveDiscordThreadStarterMessageChannelId(params);
|
|
176
|
-
if (!messageChannelId) return null;
|
|
177
186
|
const starter = await fetchDiscordThreadStarterMessage({
|
|
178
187
|
client: params.client,
|
|
179
188
|
messageChannelId,
|
|
180
189
|
threadId: params.channel.id
|
|
181
190
|
});
|
|
182
|
-
if (!starter)
|
|
191
|
+
if (!starter) {
|
|
192
|
+
cacheMiss();
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
183
195
|
const payload = buildDiscordThreadStarterPayload({
|
|
184
196
|
starter,
|
|
185
197
|
resolveTimestampMs: params.resolveTimestampMs
|
|
186
198
|
});
|
|
187
|
-
if (!payload)
|
|
188
|
-
|
|
199
|
+
if (!payload) {
|
|
200
|
+
cacheMiss();
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
setCachedThreadStarter(cacheKey, {
|
|
204
|
+
kind: "hit",
|
|
205
|
+
starter: payload
|
|
206
|
+
}, Date.now());
|
|
189
207
|
return payload;
|
|
190
|
-
} catch {
|
|
208
|
+
} catch (error) {
|
|
209
|
+
if (isDiscordThreadStarterNegativeCacheError(error)) cacheMiss();
|
|
191
210
|
return null;
|
|
192
211
|
}
|
|
193
212
|
}
|
|
213
|
+
function isDiscordThreadStarterNegativeCacheError(error) {
|
|
214
|
+
return error instanceof DiscordError && (error.status === 403 || error.status === 404);
|
|
215
|
+
}
|
|
194
216
|
function resolveDiscordThreadStarterMessageChannelId(params) {
|
|
195
217
|
return isDiscordForumParentType(params.parentType) ? params.channel.id : params.parentId;
|
|
196
218
|
}
|
|
@@ -244,7 +266,9 @@ function resolveDiscordReplyTarget(opts) {
|
|
|
244
266
|
return opts.hasReplied ? void 0 : replyToId;
|
|
245
267
|
}
|
|
246
268
|
function sanitizeDiscordThreadName(rawName, fallbackId) {
|
|
247
|
-
|
|
269
|
+
const baseSource = rawName.replace(/<@!?\d+>/g, "").replace(/<@&\d+>/g, "").replace(/<#\d+>/g, "").replace(/\s+/g, " ").trim() || `Thread ${fallbackId}`;
|
|
270
|
+
const base = truncateUtf16Safe(baseSource, 80);
|
|
271
|
+
return truncateUtf16Safe(base, 100) || `Thread ${fallbackId}`;
|
|
248
272
|
}
|
|
249
273
|
function resolveDiscordReplyDeliveryPlan(params) {
|
|
250
274
|
const originalReplyTarget = params.replyTarget;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
2
2
|
//#region extensions/discord/src/monitor/timeouts.ts
|
|
3
3
|
const DISCORD_DEFAULT_LISTENER_TIMEOUT_MS = 12e4;
|
|
4
|
-
const DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS =
|
|
4
|
+
const DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS = 18e5;
|
|
5
5
|
const DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS = 6e4;
|
|
6
6
|
const DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS = 12e4;
|
|
7
7
|
/** @deprecated Discord listener timeouts are compatibility-only. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as listEnabledDiscordAccounts, c as resolveDiscordAccount } from "./accounts-
|
|
3
|
-
import { n as resolveDiscordVoiceEnabled, r as authorizeDiscordVoiceIngress, t as resolveDiscordVoiceAccess } from "./owner-access-
|
|
1
|
+
import { on as __exportAll } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { a as listEnabledDiscordAccounts, c as resolveDiscordAccount } from "./accounts-CwJQoLjM.js";
|
|
3
|
+
import { n as resolveDiscordVoiceEnabled, r as authorizeDiscordVoiceIngress, t as resolveDiscordVoiceAccess } from "./owner-access-yc1sX7Gx.js";
|
|
4
4
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
5
5
|
import { summarizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
@@ -205,7 +205,12 @@ const discordVoiceTranscriptsSourceProvider = {
|
|
|
205
205
|
channelId
|
|
206
206
|
}, { transcripts: {
|
|
207
207
|
sessionId: request.session.sessionId,
|
|
208
|
-
onUtterance: request.onUtterance
|
|
208
|
+
onUtterance: request.onUtterance,
|
|
209
|
+
onStop: () => request.onStatus?.({
|
|
210
|
+
sessionId: request.session.sessionId,
|
|
211
|
+
active: false,
|
|
212
|
+
source: request.session.source
|
|
213
|
+
})
|
|
209
214
|
} });
|
|
210
215
|
if (!joined.ok) return {
|
|
211
216
|
ok: false,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-
|
|
1
|
+
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-DkUhR7YK.js";
|
|
2
2
|
//#region extensions/discord/transcripts-source-api.ts
|
|
3
3
|
function registerDiscordTranscriptSourceProvider(api) {
|
|
4
4
|
api.registerTranscriptSourceProvider(discordVoiceTranscriptsSourceProvider);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as raceWithTimeout } from "./timeouts-
|
|
1
|
+
import { Rt as sendChannelTyping, on as __exportAll } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { c as raceWithTimeout } from "./timeouts-D86uWLt_.js";
|
|
3
3
|
//#region extensions/discord/src/monitor/typing.ts
|
|
4
4
|
var typing_exports = /* @__PURE__ */ __exportAll({ sendTyping: () => sendTyping });
|
|
5
5
|
const DISCORD_TYPING_START_TIMEOUT_MS = 5e3;
|