@openclaw/discord 2026.8.1-beta.3 → 2026.8.1
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-D5xmUpnj.js → account-inspect-BDfKyuvL.js} +1 -1
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-DNl-oCEw.js → accounts-CfQ-vSyf.js} +5 -124
- package/dist/action-runtime-api.js +1 -1
- package/dist/{activities-api-KCBAmWxD.js → activities-api-Dl-TOyOX.js} +5 -4
- package/dist/activities-api.js +1 -1
- package/dist/api.js +16 -16
- package/dist/{approval-handler.runtime-B12RCYr8.js → approval-handler.runtime-q4Zqo44V.js} +28 -105
- package/dist/{audit-Yc7eZDd6.js → audit-DgrvFPGt.js} +5 -5
- package/dist/{channel-cXYzGc4L.js → channel-BsQUalPw.js} +18 -20
- package/dist/{channel-actions.runtime-CODTvo7c.js → channel-actions.runtime-UMGGIfSy.js} +59 -58
- 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-rPs4dsk_.js} +5 -5
- package/dist/{components-ezGKo_Yh.js → components-Dk35LTf_.js} +33 -29
- package/dist/{config-schema-DC5kDtQ5.js → config-schema-CxPqtVI1.js} +16 -10
- package/dist/{conversation-binding-route-D6rCQ5S0.js → conversation-binding-route-BjvX4e35.js} +1 -1
- package/dist/{directory-config-XyCfoqLg.js → directory-config-B7DY_pNG.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-Df0NbFJB.js → directory-live-DuAXKkan.js} +2 -2
- package/dist/doctor-contract-api.js +1 -1
- package/dist/{doctor-DYY31GrO.js → doctor-zQTtn6hm.js} +4 -4
- package/dist/{handle-action.guild-admin-6Tvvinsa.js → handle-action.guild-admin-DZewwLr1.js} +9 -5
- package/dist/index.js +1 -1
- package/dist/ingress-identity-CzZKcPK8.js +60 -0
- package/dist/{message-handler-B61q5MOF.js → message-handler-C5By3yl5.js} +5 -5
- package/dist/{message-handler.preflight-Bzg_Hawz.js → message-handler.preflight-DrszWuHw.js} +20 -84
- package/dist/{message-handler.process--4_712Ec.js → message-handler.process-DyFPDLCt.js} +60 -66
- package/dist/{message-utils-BXLLnFl6.js → message-text-Ca8M6TU8.js} +34 -32
- package/dist/{outbound-adapter-DxHTOqiN.js → outbound-adapter-Dif8p481.js} +58 -61
- package/dist/{outbound-components-B2PL0ooH.js → outbound-components-wjv7yyAj.js} +5 -4
- package/dist/outbound-session-route-Bn4uXaoE.js +665 -0
- package/dist/{owner-access-Bg41VzAf.js → owner-access-UlYi9t0M.js} +1 -1
- package/dist/{pluralkit-dUl4v1X3.js → pluralkit-9EuEN4UD.js} +1 -1
- package/dist/{probe-BTdtVRwU.js → probe-n6ZXxK8V.js} +1 -1
- package/dist/{probe.runtime-Dq5-PRKT.js → probe.runtime-CN4bdPfZ.js} +1 -1
- package/dist/{provider-DlK_ynqt.js → provider-LXiOcJrH.js} +443 -295
- package/dist/{provider-session.runtime-CvvphHvs.js → provider-session.runtime-DSNe7r2W.js} +3 -3
- package/dist/provider.runtime-DiInaDXO.js +2 -0
- package/dist/{realtime-session.runtime-ysbMG8v7.js → realtime-session.runtime-DOViOIjY.js} +106 -122
- package/dist/{resolve-allowlist-common-DIVXbD1P.js → resolve-allowlist-common-BLoYaxEG.js} +1 -1
- package/dist/{resolve-channels-CGeUoIqb.js → resolve-channels-D2yl_2CN.js} +4 -3
- package/dist/{resolve-users-BtKxLUZv.js → resolve-users-BLxfqajZ.js} +2 -2
- package/dist/{retry-DNsVTeTo.js → retry-DqHCW6PV.js} +220 -6
- package/dist/{runtime-D71_VFLr.js → runtime-BYamRVPN.js} +73 -56
- package/dist/{runtime-CQovMsH3.js → runtime-DrxVBTtp.js} +2 -2
- package/dist/runtime-api.js +16 -23
- package/dist/{sdk-runtime-37OU6_Yh.js → sdk-runtime-6tfgYDjY.js} +55 -86
- 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-UJHiAm4C.js} +78 -15
- package/dist/{send.components-ChK1wS7w.js → send.components-CrBJpGT_.js} +15 -22
- package/dist/{send.outbound-HIkgji_7.js → send.outbound-D7JYmfm9.js} +58 -69
- package/dist/{send.shared-B3fpaLWJ.js → send.shared-DZJ1akvQ.js} +36 -21
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-CaAaoksy.js → shared-Dii2HTn7.js} +31 -9
- package/dist/{subagent-hooks-CNT2ZJTJ.js → subagent-hooks-JyGrtQIl.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -6
- package/dist/{system-events-Nuwoq_au.js → system-events-BEmcj4xJ.js} +1 -1
- package/dist/{target-resolver-DIXShHaZ.js → target-resolver-V-IYae6s.js} +3 -3
- package/dist/targets-CQp53cGj.js +3 -0
- package/dist/{thread-bindings-VlymUnbz.js → thread-bindings-DvYP79fy.js} +3 -4
- package/dist/{thread-bindings.manager-CngsgErq.js → thread-bindings.manager-Clm77DBM.js} +8 -12
- package/dist/{threading-DU6pgeGm.js → threading-CXuu_7o9.js} +47 -25
- package/dist/{transcripts-source-DeIMNbRh.js → transcripts-source-BLEMH_yi.js} +9 -4
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-oLiS5Z13.js → typing-B9snnwMe.js} +1 -1
- package/dist/{voice-runtime-CjNFaynA.js → voice-runtime-DY6_o73o.js} +76 -66
- 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 +23 -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 +12 -4
- package/package.json +8 -8
- package/skills/discord/SKILL.md +1 -1
- 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/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,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-DqHCW6PV.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-Clm77DBM.js";
|
|
4
|
+
import { a as formatDiscordMediaText, f as resolveDiscordChannelInfo, n as resolveDiscordForwardedMessagesTextFromSnapshots, p as resolveDiscordMessageChannelId, t as resolveDiscordEmbedText } from "./message-text-Ca8M6TU8.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
|
|
@@ -99,20 +101,19 @@ function normalizeTitleContextField(raw, maxChars) {
|
|
|
99
101
|
//#endregion
|
|
100
102
|
//#region extensions/discord/src/monitor/threading.cache.ts
|
|
101
103
|
const DISCORD_THREAD_STARTER_CACHE_TTL_MS = 300 * 1e3;
|
|
104
|
+
const DISCORD_THREAD_STARTER_NEGATIVE_CACHE_TTL_MS = 30 * 1e3;
|
|
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
|
}
|
|
@@ -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-DqHCW6PV.js";
|
|
2
|
+
import { a as listEnabledDiscordAccounts, c as resolveDiscordAccount } from "./accounts-CfQ-vSyf.js";
|
|
3
|
+
import { n as resolveDiscordVoiceEnabled, r as authorizeDiscordVoiceIngress, t as resolveDiscordVoiceAccess } from "./owner-access-UlYi9t0M.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-BLEMH_yi.js";
|
|
2
2
|
//#region extensions/discord/transcripts-source-api.ts
|
|
3
3
|
function registerDiscordTranscriptSourceProvider(api) {
|
|
4
4
|
api.registerTranscriptSourceProvider(discordVoiceTranscriptsSourceProvider);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Rt as sendChannelTyping, on as __exportAll } from "./retry-DqHCW6PV.js";
|
|
2
2
|
import { c as raceWithTimeout } from "./timeouts-B9cy6RvQ.js";
|
|
3
3
|
//#region extensions/discord/src/monitor/typing.ts
|
|
4
4
|
var typing_exports = /* @__PURE__ */ __exportAll({ sendTyping: () => sendTyping });
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { k as parseDiscordTarget } from "./accounts-DNl-oCEw.js";
|
|
1
|
+
import { D as ReadyListener, L as isUnknownDiscordVoiceStateError, O as ResumedListener, Yt as getGuildVoiceState, _ as parseDiscordTarget, j as VoiceStateUpdateListener, y as discord_exports } from "./retry-DqHCW6PV.js";
|
|
3
2
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
4
3
|
import { a as normalizeDiscordSlug, h as resolveDiscordOwnerAccess, x as formatDiscordUserTag } from "./allow-list-BDMimASD.js";
|
|
5
|
-
import { a as formatMention } from "./send.outbound-
|
|
6
|
-
import { n as resolveDiscordVoiceEnabled, r as authorizeDiscordVoiceIngress, t as resolveDiscordVoiceAccess } from "./owner-access-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { a as formatMention } from "./send.outbound-D7JYmfm9.js";
|
|
5
|
+
import { n as resolveDiscordVoiceEnabled, r as authorizeDiscordVoiceIngress, t as resolveDiscordVoiceAccess } from "./owner-access-UlYi9t0M.js";
|
|
6
|
+
import { b as resolveFetchedDiscordThreadLikeChannelContext, m as buildDiscordGroupSystemPrompt } from "./provider-LXiOcJrH.js";
|
|
7
|
+
import { _ as decodeOpusStreamChunks, a as VOICE_CONNECT_READY_TIMEOUT_MS, b as maybeControlDiscordVoiceAgentRun, c as isVoiceChannel, d as resolveVoiceTimeoutMs, g as decodeOpusStream, h as createDiscordOpusPlaybackStream, i as PLAYBACK_READY_TIMEOUT_MS, l as logVoiceVerbose, n as CAPTURE_FINALIZE_GRACE_MS, o as VOICE_RECONNECT_GRACE_MS, s as isDiscordRealtimeVoiceMode, t as loadDiscordVoiceSdk, u as resolveDiscordVoiceMode, v as writeVoiceWavFile, x as formatVoiceLogPreview, y as formatVoiceIngressPrompt } from "./sdk-runtime-6tfgYDjY.js";
|
|
9
8
|
import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
10
9
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
11
10
|
import { formatErrorMessage } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
@@ -15,7 +14,7 @@ import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
|
15
14
|
import { escapeRegExp, truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
16
15
|
import { stripInlineDirectiveTagsForDisplay } from "openclaw/plugin-sdk/text-chunking";
|
|
17
16
|
import { unlinkIfExists } from "openclaw/plugin-sdk/media-runtime";
|
|
18
|
-
import {
|
|
17
|
+
import { resolveAgentDir } from "openclaw/plugin-sdk/agent-runtime";
|
|
19
18
|
import { enqueueRoutedSystemEvent } from "openclaw/plugin-sdk/system-event-runtime";
|
|
20
19
|
import { Readable } from "node:stream";
|
|
21
20
|
import { OpusError } from "libopus-wasm";
|
|
@@ -84,7 +83,7 @@ async function runDiscordVoiceAgentTurn(params) {
|
|
|
84
83
|
});
|
|
85
84
|
if (!context) return null;
|
|
86
85
|
const voiceModel = normalizeOptionalString(params.discordConfig.voice?.model);
|
|
87
|
-
const payloads = (await
|
|
86
|
+
const payloads = (await getDiscordRuntime().agent.runCommandFromIngress({
|
|
88
87
|
message: params.message,
|
|
89
88
|
sessionKey: params.entry.route.sessionKey,
|
|
90
89
|
agentId: params.entry.route.agentId,
|
|
@@ -1200,6 +1199,7 @@ async function processDiscordVoiceSegment(params) {
|
|
|
1200
1199
|
logVoiceVerbose(`transcription ok (${transcript.length} chars): guild ${entry.guildId} channel ${entry.channelId}`);
|
|
1201
1200
|
logVoiceVerbose(`transcript from ${ingress.speakerLabel} (${userId}) in guild ${entry.guildId} channel ${entry.channelId}: ${formatVoiceLogPreview(transcript)}`);
|
|
1202
1201
|
if (params.transcripts) {
|
|
1202
|
+
if (entry.sessionLifecycle.status === "stopped" || entry.transcripts !== params.transcripts) return;
|
|
1203
1203
|
await params.transcripts.onUtterance({
|
|
1204
1204
|
sessionId: params.transcripts.sessionId,
|
|
1205
1205
|
startedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -1281,16 +1281,24 @@ async function processDiscordVoiceSegment(params) {
|
|
|
1281
1281
|
}
|
|
1282
1282
|
params.enqueuePlayback(entry, async () => {
|
|
1283
1283
|
const voiceSdk = loadDiscordVoiceSdk();
|
|
1284
|
+
const playbackLifecycle = new AbortController();
|
|
1285
|
+
let playbackStarted = false;
|
|
1286
|
+
const cancelStoppedPlayback = () => (!playbackStarted || entry.sessionLifecycle.status === "stopped") && playbackLifecycle.abort();
|
|
1284
1287
|
try {
|
|
1285
1288
|
if (entry.sessionLifecycle.status === "stopped") return;
|
|
1289
|
+
entry.player.on(voiceSdk.AudioPlayerStatus.Idle, cancelStoppedPlayback);
|
|
1286
1290
|
const input = voiceReplyAudio.mode === "stream" ? Readable.fromWeb(voiceReplyAudio.audioStream) : voiceReplyAudio.audioPath;
|
|
1287
1291
|
logVoiceVerbose(`playback start: guild ${entry.guildId} channel ${entry.channelId} ${voiceReplyAudio.mode}`);
|
|
1288
1292
|
const resource = voiceSdk.createAudioResource(createDiscordOpusPlaybackStream(input), { inputType: voiceSdk.StreamType.Opus });
|
|
1289
1293
|
entry.player.play(resource);
|
|
1290
|
-
await voiceSdk.entersState(entry.player, voiceSdk.AudioPlayerStatus.Playing,
|
|
1291
|
-
|
|
1294
|
+
await voiceSdk.entersState(entry.player, voiceSdk.AudioPlayerStatus.Playing, AbortSignal.any([AbortSignal.timeout(PLAYBACK_READY_TIMEOUT_MS), playbackLifecycle.signal]));
|
|
1295
|
+
playbackStarted = true;
|
|
1296
|
+
await voiceSdk.entersState(entry.player, voiceSdk.AudioPlayerStatus.Idle, playbackLifecycle.signal);
|
|
1292
1297
|
logVoiceVerbose(`playback done: guild ${entry.guildId} channel ${entry.channelId}`);
|
|
1298
|
+
} catch (error) {
|
|
1299
|
+
if (entry.sessionLifecycle.status !== "stopped") throw error;
|
|
1293
1300
|
} finally {
|
|
1301
|
+
entry.player.off(voiceSdk.AudioPlayerStatus.Idle, cancelStoppedPlayback);
|
|
1294
1302
|
await releaseAudio?.();
|
|
1295
1303
|
}
|
|
1296
1304
|
});
|
|
@@ -1336,6 +1344,7 @@ var DiscordVoiceReceive = class {
|
|
|
1336
1344
|
}
|
|
1337
1345
|
logVoiceVerbose(`capture start: guild ${entry.guildId} channel ${entry.channelId} user ${userId}`);
|
|
1338
1346
|
const voiceSdk = loadDiscordVoiceSdk();
|
|
1347
|
+
const transcripts = entry.transcripts;
|
|
1339
1348
|
const voiceMode = resolveDiscordVoiceMode(this.params.discordConfig.voice);
|
|
1340
1349
|
const realtime = entry.realtimeLifecycle.status === "active" && isDiscordRealtimeVoiceMode(voiceMode) ? entry.realtimeLifecycle.instance : void 0;
|
|
1341
1350
|
if (entry.player.state.status === voiceSdk.AudioPlayerStatus.Playing && !realtime) {
|
|
@@ -1413,6 +1422,7 @@ var DiscordVoiceReceive = class {
|
|
|
1413
1422
|
logVoiceVerbose(`capture ready (${durationSeconds.toFixed(2)}s): guild ${entry.guildId} channel ${entry.channelId} user ${userId}`);
|
|
1414
1423
|
entry.processingQueue = entry.processingQueue.then(async () => {
|
|
1415
1424
|
if (!this.params.isEntryCurrent(entry)) return;
|
|
1425
|
+
if (entry.transcripts !== transcripts) return;
|
|
1416
1426
|
await this.processSegment({
|
|
1417
1427
|
entry,
|
|
1418
1428
|
wavPath,
|
|
@@ -1602,9 +1612,21 @@ var DiscordVoiceReceive = class {
|
|
|
1602
1612
|
//#endregion
|
|
1603
1613
|
//#region extensions/discord/src/voice/voice-session.ts
|
|
1604
1614
|
const logger$2 = createSubsystemLogger("discord/voice");
|
|
1615
|
+
const REALTIME_PLAYBACK_MAX_MISSED_FRAMES = 100;
|
|
1605
1616
|
function isVoiceSessionStopped(entry) {
|
|
1606
1617
|
return entry.sessionLifecycle.status === "stopped";
|
|
1607
1618
|
}
|
|
1619
|
+
function retireTranscripts(entry) {
|
|
1620
|
+
const transcripts = entry.transcripts;
|
|
1621
|
+
entry.transcripts = void 0;
|
|
1622
|
+
try {
|
|
1623
|
+
Promise.resolve(transcripts?.onStop?.()).catch((error) => {
|
|
1624
|
+
logger$2.warn(`discord voice: transcripts retirement failed: ${formatErrorMessage(error)}`);
|
|
1625
|
+
});
|
|
1626
|
+
} catch (error) {
|
|
1627
|
+
logger$2.warn(`discord voice: transcripts retirement failed: ${formatErrorMessage(error)}`);
|
|
1628
|
+
}
|
|
1629
|
+
}
|
|
1608
1630
|
function isVoiceConnectionDestroyed(connection, voiceSdk) {
|
|
1609
1631
|
return connection.state.status === voiceSdk.VoiceConnectionStatus.Destroyed;
|
|
1610
1632
|
}
|
|
@@ -1691,7 +1713,10 @@ var DiscordVoiceSessions = class {
|
|
|
1691
1713
|
if (existing && existing.channelId === channelId) {
|
|
1692
1714
|
existing.autoJoinWhenOccupied = options?.autoJoinWhenOccupied === true;
|
|
1693
1715
|
if (authority) existing.generation = authority.generation;
|
|
1694
|
-
if (options?.transcripts)
|
|
1716
|
+
if (options?.transcripts) {
|
|
1717
|
+
retireTranscripts(existing);
|
|
1718
|
+
existing.transcripts = options.transcripts;
|
|
1719
|
+
}
|
|
1695
1720
|
if (!options?.transcripts && isDiscordRealtimeVoiceMode(voiceMode) && existing.realtimeLifecycle.status !== "active" && existing.realtimeLifecycle.status !== "starting") {
|
|
1696
1721
|
const realtimeResult = await this.attachRealtimeSession(existing, voiceMode, {
|
|
1697
1722
|
requireLiveEntry: true,
|
|
@@ -1751,10 +1776,7 @@ var DiscordVoiceSessions = class {
|
|
|
1751
1776
|
logVoiceVerbose(`join: DAVE settings encryption=${daveEncryption === false ? "off" : "on"} tolerance=${decryptionFailureTolerance ?? "default"} connectTimeout=${connectReadyTimeoutMs}ms reconnectGrace=${reconnectGraceMs}ms`);
|
|
1752
1777
|
const voiceSdk = loadDiscordVoiceSdk();
|
|
1753
1778
|
const existingEntry = this.params.sessions.get(guildId);
|
|
1754
|
-
if (existingEntry)
|
|
1755
|
-
existingEntry.stop();
|
|
1756
|
-
this.params.sessions.delete(guildId);
|
|
1757
|
-
}
|
|
1779
|
+
if (existingEntry) existingEntry.stop();
|
|
1758
1780
|
const voiceConnectionGroup = resolveVoiceConnectionGroup(this.params.accountId);
|
|
1759
1781
|
const staleConnection = voiceSdk.getVoiceConnection(guildId, voiceConnectionGroup);
|
|
1760
1782
|
if (staleConnection) destroyVoiceConnectionSafely({
|
|
@@ -1849,24 +1871,23 @@ var DiscordVoiceSessions = class {
|
|
|
1849
1871
|
}
|
|
1850
1872
|
const { route, voiceRoute, agentSessionMode, agentSessionTarget } = routeInfo;
|
|
1851
1873
|
logger$2.info(`discord voice: joining guild=${guildId} channel=${channelId} mode=${voiceMode} agent=${route.agentId} voiceSession=${voiceRoute.sessionKey} supervisorSession=${route.sessionKey} agentSessionMode=${agentSessionMode}${agentSessionTarget ? ` agentSessionTarget=${agentSessionTarget}` : ""} voiceModel=${voiceConfig?.model ?? "route-default"} realtimeProvider=${voiceConfig?.realtime?.provider ?? "auto"} realtimeModel=${voiceConfig?.realtime?.model ?? "provider-default"} realtimeVoice=${voiceConfig?.realtime?.speakerVoice ?? voiceConfig?.realtime?.speakerVoiceId ?? "provider-default"}`);
|
|
1852
|
-
const player = voiceSdk.createAudioPlayer();
|
|
1874
|
+
const player = isDiscordRealtimeVoiceMode(voiceMode) ? voiceSdk.createAudioPlayer({ behaviors: { maxMissedFrames: REALTIME_PLAYBACK_MAX_MISSED_FRAMES } }) : voiceSdk.createAudioPlayer();
|
|
1853
1875
|
connection.subscribe(player);
|
|
1854
|
-
const
|
|
1855
|
-
if (this.params.sessions.get(guildId)?.connection === connection) this.params.sessions.delete(guildId);
|
|
1856
|
-
};
|
|
1857
|
-
const stopEntry = (entry, optionsLocal) => {
|
|
1876
|
+
const stopEntry = (optionsLocal) => {
|
|
1858
1877
|
if (entry.sessionLifecycle.status === "stopped") return;
|
|
1859
1878
|
entry.sessionLifecycle = {
|
|
1860
1879
|
status: "stopped",
|
|
1861
1880
|
reason: optionsLocal.reason
|
|
1862
1881
|
};
|
|
1882
|
+
retireTranscripts(entry);
|
|
1883
|
+
if (this.params.sessions.get(guildId) === entry) this.params.sessions.delete(guildId);
|
|
1863
1884
|
this.params.membership.deactivate(entry);
|
|
1864
|
-
|
|
1865
|
-
|
|
1885
|
+
connection.receiver.speaking.off("start", speakingHandler);
|
|
1886
|
+
connection.receiver.speaking.off("end", speakingEndHandler);
|
|
1866
1887
|
stopVoiceCaptureState(entry.capture);
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1888
|
+
connection.off(voiceSdk.VoiceConnectionStatus.Disconnected, disconnectedHandler);
|
|
1889
|
+
connection.off(voiceSdk.VoiceConnectionStatus.Destroyed, destroyedHandler);
|
|
1890
|
+
player.off("error", playerErrorHandler);
|
|
1870
1891
|
const realtimeLifecycle = entry.realtimeLifecycle;
|
|
1871
1892
|
if (realtimeLifecycle.status === "starting" || realtimeLifecycle.status === "active") realtimeLifecycle.instance.close();
|
|
1872
1893
|
entry.realtimeLifecycle = {
|
|
@@ -1874,7 +1895,7 @@ var DiscordVoiceSessions = class {
|
|
|
1874
1895
|
generation: realtimeLifecycle.generation,
|
|
1875
1896
|
reason: optionsLocal.reason
|
|
1876
1897
|
};
|
|
1877
|
-
player.stop();
|
|
1898
|
+
player.stop(true);
|
|
1878
1899
|
if (optionsLocal.destroyConnection) destroyVoiceConnectionSafely({
|
|
1879
1900
|
connection,
|
|
1880
1901
|
voiceSdk,
|
|
@@ -1906,41 +1927,12 @@ var DiscordVoiceSessions = class {
|
|
|
1906
1927
|
generation: 0
|
|
1907
1928
|
},
|
|
1908
1929
|
stop(reason) {
|
|
1909
|
-
|
|
1910
|
-
stopEntry(entry, {
|
|
1930
|
+
stopEntry({
|
|
1911
1931
|
destroyConnection: true,
|
|
1912
1932
|
reason: reason ?? `stop guild ${guildId} channel ${channelId}`
|
|
1913
1933
|
});
|
|
1914
1934
|
}
|
|
1915
1935
|
};
|
|
1916
|
-
if (!options?.transcripts && isDiscordRealtimeVoiceMode(voiceMode)) {
|
|
1917
|
-
const realtimeResult = await this.attachRealtimeSession(entry, voiceMode, { isCurrent: authority?.isCurrent });
|
|
1918
|
-
if (!realtimeResult.ok) {
|
|
1919
|
-
destroyVoiceConnectionSafely({
|
|
1920
|
-
connection,
|
|
1921
|
-
voiceSdk,
|
|
1922
|
-
reason: `realtime setup failed guild ${guildId} channel ${channelId}`
|
|
1923
|
-
});
|
|
1924
|
-
return {
|
|
1925
|
-
ok: false,
|
|
1926
|
-
message: realtimeResult.message,
|
|
1927
|
-
guildId,
|
|
1928
|
-
channelId
|
|
1929
|
-
};
|
|
1930
|
-
}
|
|
1931
|
-
}
|
|
1932
|
-
if (this.params.destroyed() || authority && !authority.isCurrent()) {
|
|
1933
|
-
stopEntry(entry, {
|
|
1934
|
-
destroyConnection: true,
|
|
1935
|
-
reason: `${this.params.destroyed() ? "manager stopped" : "join cancelled"} during setup guild ${guildId} channel ${channelId}`
|
|
1936
|
-
});
|
|
1937
|
-
return {
|
|
1938
|
-
ok: false,
|
|
1939
|
-
message: this.params.destroyed() ? "Discord voice manager is stopped." : "Discord voice join was cancelled.",
|
|
1940
|
-
guildId,
|
|
1941
|
-
channelId
|
|
1942
|
-
};
|
|
1943
|
-
}
|
|
1944
1936
|
const speakingHandler = (userId) => {
|
|
1945
1937
|
this.params.receive.handleSpeakingStart(entry, userId).catch((err) => {
|
|
1946
1938
|
logger$2.warn(`discord voice: capture failed: ${formatErrorMessage(err)}`);
|
|
@@ -1957,8 +1949,7 @@ var DiscordVoiceSessions = class {
|
|
|
1957
1949
|
logVoiceVerbose(`disconnected: recovery started guild ${guildId} channel ${channelId}`);
|
|
1958
1950
|
} catch (err) {
|
|
1959
1951
|
logger$2.warn(`discord voice: disconnect recovery failed: guild ${guildId} channel ${channelId} timeout=${reconnectGraceMs}ms error=${formatErrorMessage(err)}; destroying connection`);
|
|
1960
|
-
|
|
1961
|
-
stopEntry(entry, {
|
|
1952
|
+
stopEntry({
|
|
1962
1953
|
destroyConnection: true,
|
|
1963
1954
|
reason: `disconnect recovery failed guild ${guildId} channel ${channelId}`
|
|
1964
1955
|
});
|
|
@@ -1966,8 +1957,7 @@ var DiscordVoiceSessions = class {
|
|
|
1966
1957
|
})();
|
|
1967
1958
|
};
|
|
1968
1959
|
const destroyedHandler = () => {
|
|
1969
|
-
|
|
1970
|
-
stopEntry(entry, {
|
|
1960
|
+
stopEntry({
|
|
1971
1961
|
destroyConnection: false,
|
|
1972
1962
|
reason: `destroyed guild ${guildId} channel ${channelId}`
|
|
1973
1963
|
});
|
|
@@ -1975,12 +1965,33 @@ var DiscordVoiceSessions = class {
|
|
|
1975
1965
|
const playerErrorHandler = (err) => {
|
|
1976
1966
|
logger$2.warn(`discord voice: playback error: ${formatErrorMessage(err)}`);
|
|
1977
1967
|
};
|
|
1978
|
-
this.params.receive.enableDaveReceivePassthrough(entry, "post-join warmup", 30);
|
|
1979
|
-
connection.receiver.speaking.on("start", speakingHandler);
|
|
1980
|
-
connection.receiver.speaking.on("end", speakingEndHandler);
|
|
1981
1968
|
connection.on(voiceSdk.VoiceConnectionStatus.Disconnected, disconnectedHandler);
|
|
1982
1969
|
connection.on(voiceSdk.VoiceConnectionStatus.Destroyed, destroyedHandler);
|
|
1983
1970
|
player.on("error", playerErrorHandler);
|
|
1971
|
+
if (!options?.transcripts && isDiscordRealtimeVoiceMode(voiceMode)) {
|
|
1972
|
+
const realtimeResult = await this.attachRealtimeSession(entry, voiceMode, { isCurrent: authority?.isCurrent });
|
|
1973
|
+
if (!realtimeResult.ok) {
|
|
1974
|
+
entry.stop(`realtime setup failed guild ${guildId} channel ${channelId}`);
|
|
1975
|
+
return {
|
|
1976
|
+
ok: false,
|
|
1977
|
+
message: realtimeResult.message,
|
|
1978
|
+
guildId,
|
|
1979
|
+
channelId
|
|
1980
|
+
};
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
if (isVoiceSessionStopped(entry) || this.params.destroyed() || authority && !authority.isCurrent()) {
|
|
1984
|
+
entry.stop(`${this.params.destroyed() ? "manager stopped" : "join cancelled"} during setup guild ${guildId} channel ${channelId}`);
|
|
1985
|
+
return {
|
|
1986
|
+
ok: false,
|
|
1987
|
+
message: this.params.destroyed() ? "Discord voice manager is stopped." : "Discord voice join was cancelled.",
|
|
1988
|
+
guildId,
|
|
1989
|
+
channelId
|
|
1990
|
+
};
|
|
1991
|
+
}
|
|
1992
|
+
this.params.receive.enableDaveReceivePassthrough(entry, "post-join warmup", 30);
|
|
1993
|
+
connection.receiver.speaking.on("start", speakingHandler);
|
|
1994
|
+
connection.receiver.speaking.on("end", speakingEndHandler);
|
|
1984
1995
|
this.params.sessions.set(guildId, entry);
|
|
1985
1996
|
this.params.membership.activate(entry, this.params.botUserId());
|
|
1986
1997
|
logger$2.info(`discord voice: joined guild=${guildId} channel=${channelId} mode=${voiceMode} agent=${route.agentId} voiceSession=${voiceRoute.sessionKey} supervisorSession=${route.sessionKey} voiceModel=${voiceConfig?.model ?? "route-default"}`);
|
|
@@ -2011,7 +2022,7 @@ var DiscordVoiceSessions = class {
|
|
|
2011
2022
|
channelId: entry.channelId
|
|
2012
2023
|
};
|
|
2013
2024
|
if (entry.realtimeLifecycle.status === "active" || entry.realtimeLifecycle.status === "starting") {
|
|
2014
|
-
entry
|
|
2025
|
+
retireTranscripts(entry);
|
|
2015
2026
|
return {
|
|
2016
2027
|
ok: true,
|
|
2017
2028
|
message: `Stopped transcripts for ${formatMention({ channelId: entry.channelId })}.`,
|
|
@@ -2021,7 +2032,6 @@ var DiscordVoiceSessions = class {
|
|
|
2021
2032
|
}
|
|
2022
2033
|
}
|
|
2023
2034
|
entry.stop();
|
|
2024
|
-
this.params.sessions.delete(guildId);
|
|
2025
2035
|
if (!entry.receiveRecovery.decryptRecoveryInFlight) this.params.receive.deleteRecoveryAttempt(guildId);
|
|
2026
2036
|
if (!options?.preserveFollowState) this.params.onLeaveFollowState(guildId);
|
|
2027
2037
|
logVoiceVerbose(`leave: disconnected from guild ${guildId} channel ${entry.channelId}`);
|
|
@@ -2042,7 +2052,7 @@ var DiscordVoiceSessions = class {
|
|
|
2042
2052
|
ok: false,
|
|
2043
2053
|
message: "Discord realtime voice session stopped before startup completed."
|
|
2044
2054
|
};
|
|
2045
|
-
const { DiscordRealtimeVoiceSession } = await import("./realtime-session.runtime-
|
|
2055
|
+
const { DiscordRealtimeVoiceSession } = await import("./realtime-session.runtime-DOViOIjY.js");
|
|
2046
2056
|
const realtime = new DiscordRealtimeVoiceSession({
|
|
2047
2057
|
accountId: this.params.accountId,
|
|
2048
2058
|
bootstrapContextInstructions,
|
|
@@ -41,23 +41,23 @@ For timestamp UUIDs, namespace UUIDs, and other options read on ...
|
|
|
41
41
|
|
|
42
42
|
## API Summary
|
|
43
43
|
|
|
44
|
-
| | |
|
|
45
|
-
| --- | --- |
|
|
46
|
-
| [`uuid.NIL`](#uuidnil) | The nil UUID string (all zeros) |
|
|
47
|
-
| [`uuid.MAX`](#uuidmax) | The max UUID string (all ones) |
|
|
48
|
-
| [`uuid.parse()`](#uuidparsestr) | Convert UUID string to array of bytes |
|
|
49
|
-
| [`uuid.stringify()`](#uuidstringifyarr-offset) | Convert array of bytes to UUID string |
|
|
50
|
-
| [`uuid.v1()`](#uuidv1options-buffer-offset) |
|
|
51
|
-
| [`uuid.v1ToV6()`](#uuidv1tov6uuid) |
|
|
52
|
-
| [`uuid.v3()`](#uuidv3name-namespace-buffer-offset) |
|
|
53
|
-
| [`uuid.v4()`](#uuidv4options-buffer-offset) |
|
|
54
|
-
| [`uuid.v5()`](#uuidv5name-namespace-buffer-offset) |
|
|
55
|
-
| [`uuid.v6()`](#uuidv6options-buffer-offset) |
|
|
56
|
-
| [`uuid.v6ToV1()`](#uuidv6tov1uuid) |
|
|
57
|
-
| [`uuid.v7()`](#uuidv7options-buffer-offset) |
|
|
58
|
-
| ~~[`uuid.v8()`](#uuidv8)~~ | "Intentionally left blank" |
|
|
59
|
-
| [`uuid.validate()`](#uuidvalidatestr) | Test a string to see if it is a valid UUID |
|
|
60
|
-
| [`uuid.version()`](#uuidversionstr) | Detect RFC version of a UUID |
|
|
44
|
+
| | |
|
|
45
|
+
| --- | --- |
|
|
46
|
+
| [`uuid.NIL`](#uuidnil) | The nil UUID string (all zeros) |
|
|
47
|
+
| [`uuid.MAX`](#uuidmax) | The max UUID string (all ones) |
|
|
48
|
+
| [`uuid.parse()`](#uuidparsestr) | Convert UUID string to array of bytes |
|
|
49
|
+
| [`uuid.stringify()`](#uuidstringifyarr-offset) | Convert array of bytes to UUID string |
|
|
50
|
+
| [`uuid.v1()`](#uuidv1options-buffer-offset) | Generate a version 1 (timestamp) UUID |
|
|
51
|
+
| [`uuid.v1ToV6()`](#uuidv1tov6uuid) | Convert a version 1 UUID to version 6 |
|
|
52
|
+
| [`uuid.v3()`](#uuidv3name-namespace-buffer-offset) | Generate a version 3 (namespace w/ MD5) UUID |
|
|
53
|
+
| [`uuid.v4()`](#uuidv4options-buffer-offset) | Generate a version 4 (random) UUID |
|
|
54
|
+
| [`uuid.v5()`](#uuidv5name-namespace-buffer-offset) | Generate a version 5 (namespace w/ SHA-1) UUID |
|
|
55
|
+
| [`uuid.v6()`](#uuidv6options-buffer-offset) | Generate a version 6 (timestamp, reordered) UUID |
|
|
56
|
+
| [`uuid.v6ToV1()`](#uuidv6tov1uuid) | Convert a version 6 UUID to version 1 |
|
|
57
|
+
| [`uuid.v7()`](#uuidv7options-buffer-offset) | Generate a version 7 (Unix Epoch time-based) UUID |
|
|
58
|
+
| ~~[`uuid.v8()`](#uuidv8)~~ | "Intentionally left blank" |
|
|
59
|
+
| [`uuid.validate()`](#uuidvalidatestr) | Test a string to see if it is a valid UUID |
|
|
60
|
+
| [`uuid.version()`](#uuidversionstr) | Detect RFC version of a UUID |
|
|
61
61
|
|
|
62
62
|
## API
|
|
63
63
|
|
|
@@ -357,7 +357,7 @@ Example:
|
|
|
357
357
|
```javascript
|
|
358
358
|
import { v7 as uuidv7 } from 'uuid';
|
|
359
359
|
|
|
360
|
-
uuidv7(); // ⇨ '01941f29-7c00-
|
|
360
|
+
uuidv7(); // ⇨ '01941f29-7c00-73e4-a310-744d2167fc5b'
|
|
361
361
|
```
|
|
362
362
|
|
|
363
363
|
### ~~uuid.v8()~~
|
|
@@ -464,7 +464,7 @@ Prior to `uuid@11`, it was possible for `options` state to interfere with the in
|
|
|
464
464
|
|
|
465
465
|
**Browsers**: `uuid` [builds are tested](/uuidjs/uuid/blob/main/wdio.conf.js) against the latest version of desktop Chrome, Safari, Firefox, and Edge. Mobile versions of these same browsers are expected to work but aren't currently tested.
|
|
466
466
|
|
|
467
|
-
**Node**: `uuid` [builds are tested](https://github.com/uuidjs/uuid/blob/main/.github/workflows/ci.yml#
|
|
467
|
+
**Node**: `uuid` [builds are tested](https://github.com/uuidjs/uuid/blob/main/.github/workflows/ci.yml#L31) against node ([LTS releases](https://github.com/nodejs/Release)), plus one prior. E.g. At the time of this writing `node@20` is the "maintenance" release and `node@24` is the "current" release, so `uuid` supports `node@20`-`node@24`.
|
|
468
468
|
|
|
469
469
|
**Typescript**: TS versions released within the past two years are supported. [source](https://github.com/microsoft/TypeScript/issues/49088#issuecomment-2468723715)
|
|
470
470
|
|
|
@@ -61,14 +61,18 @@ function v1Bytes(rnds, msecs, nsecs, clockseq, node, buf, offset = 0) {
|
|
|
61
61
|
msecs ??= Date.now();
|
|
62
62
|
nsecs ??= 0;
|
|
63
63
|
clockseq ??= ((rnds[8] << 8) | rnds[9]) & 0x3fff;
|
|
64
|
-
node
|
|
64
|
+
if (node == null) {
|
|
65
|
+
node = rnds.slice(10, 16);
|
|
66
|
+
node[0] |= 0x01;
|
|
67
|
+
}
|
|
65
68
|
msecs += 12219292800000;
|
|
66
|
-
const
|
|
69
|
+
const t = (msecs & 0xfffffff) * 10000 + nsecs;
|
|
70
|
+
const tl = t >>> 0;
|
|
67
71
|
buf[offset++] = (tl >>> 24) & 0xff;
|
|
68
72
|
buf[offset++] = (tl >>> 16) & 0xff;
|
|
69
73
|
buf[offset++] = (tl >>> 8) & 0xff;
|
|
70
74
|
buf[offset++] = tl & 0xff;
|
|
71
|
-
const tmh = ((msecs /
|
|
75
|
+
const tmh = (((msecs / 0x10000000) | 0) * 625 + ((t / 0x100000000) | 0)) & 0xfffffff;
|
|
72
76
|
buf[offset++] = (tmh >>> 8) & 0xff;
|
|
73
77
|
buf[offset++] = tmh & 0xff;
|
|
74
78
|
buf[offset++] = ((tmh >>> 24) & 0xf) | 0x10;
|
|
@@ -18,7 +18,7 @@ export function updateV7State(state, now, rnds) {
|
|
|
18
18
|
state.msecs ??= -Infinity;
|
|
19
19
|
state.seq ??= 0;
|
|
20
20
|
if (now > state.msecs) {
|
|
21
|
-
state.seq = (rnds
|
|
21
|
+
state.seq = v7Sequence(rnds);
|
|
22
22
|
state.msecs = now;
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
@@ -43,7 +43,7 @@ function v7Bytes(rnds, msecs, seq, buf, offset = 0) {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
msecs ??= Date.now();
|
|
46
|
-
seq ??= (
|
|
46
|
+
seq ??= v7Sequence(rnds);
|
|
47
47
|
buf[offset++] = (msecs / 0x10000000000) & 0xff;
|
|
48
48
|
buf[offset++] = (msecs / 0x100000000) & 0xff;
|
|
49
49
|
buf[offset++] = (msecs / 0x1000000) & 0xff;
|
|
@@ -62,4 +62,7 @@ function v7Bytes(rnds, msecs, seq, buf, offset = 0) {
|
|
|
62
62
|
buf[offset++] = rnds[15];
|
|
63
63
|
return buf;
|
|
64
64
|
}
|
|
65
|
+
function v7Sequence(rnds) {
|
|
66
|
+
return ((rnds[6] & 0x7f) << 24) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9];
|
|
67
|
+
}
|
|
65
68
|
export default v7;
|
|
@@ -61,14 +61,18 @@ function v1Bytes(rnds, msecs, nsecs, clockseq, node, buf, offset = 0) {
|
|
|
61
61
|
msecs ??= Date.now();
|
|
62
62
|
nsecs ??= 0;
|
|
63
63
|
clockseq ??= ((rnds[8] << 8) | rnds[9]) & 0x3fff;
|
|
64
|
-
node
|
|
64
|
+
if (node == null) {
|
|
65
|
+
node = rnds.slice(10, 16);
|
|
66
|
+
node[0] |= 0x01;
|
|
67
|
+
}
|
|
65
68
|
msecs += 12219292800000;
|
|
66
|
-
const
|
|
69
|
+
const t = (msecs & 0xfffffff) * 10000 + nsecs;
|
|
70
|
+
const tl = t >>> 0;
|
|
67
71
|
buf[offset++] = (tl >>> 24) & 0xff;
|
|
68
72
|
buf[offset++] = (tl >>> 16) & 0xff;
|
|
69
73
|
buf[offset++] = (tl >>> 8) & 0xff;
|
|
70
74
|
buf[offset++] = tl & 0xff;
|
|
71
|
-
const tmh = ((msecs /
|
|
75
|
+
const tmh = (((msecs / 0x10000000) | 0) * 625 + ((t / 0x100000000) | 0)) & 0xfffffff;
|
|
72
76
|
buf[offset++] = (tmh >>> 8) & 0xff;
|
|
73
77
|
buf[offset++] = tmh & 0xff;
|
|
74
78
|
buf[offset++] = ((tmh >>> 24) & 0xf) | 0x10;
|
|
@@ -18,7 +18,7 @@ export function updateV7State(state, now, rnds) {
|
|
|
18
18
|
state.msecs ??= -Infinity;
|
|
19
19
|
state.seq ??= 0;
|
|
20
20
|
if (now > state.msecs) {
|
|
21
|
-
state.seq = (rnds
|
|
21
|
+
state.seq = v7Sequence(rnds);
|
|
22
22
|
state.msecs = now;
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
@@ -43,7 +43,7 @@ function v7Bytes(rnds, msecs, seq, buf, offset = 0) {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
msecs ??= Date.now();
|
|
46
|
-
seq ??= (
|
|
46
|
+
seq ??= v7Sequence(rnds);
|
|
47
47
|
buf[offset++] = (msecs / 0x10000000000) & 0xff;
|
|
48
48
|
buf[offset++] = (msecs / 0x100000000) & 0xff;
|
|
49
49
|
buf[offset++] = (msecs / 0x1000000) & 0xff;
|
|
@@ -62,4 +62,7 @@ function v7Bytes(rnds, msecs, seq, buf, offset = 0) {
|
|
|
62
62
|
buf[offset++] = rnds[15];
|
|
63
63
|
return buf;
|
|
64
64
|
}
|
|
65
|
+
function v7Sequence(rnds) {
|
|
66
|
+
return ((rnds[6] & 0x7f) << 24) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9];
|
|
67
|
+
}
|
|
65
68
|
export default v7;
|