@openclaw/discord 2026.10.2 → 2026.10.5-beta.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/.setup/account-inspect-8cCu6uPG.mjs +31 -0
- package/dist/.setup/{accounts-HE9-mj1L.mjs → accounts-ljrzXBJi.mjs} +47 -45
- package/dist/.setup/{allow-list-vxkG9_JD.mjs → allow-list-B_ToXtew.mjs} +34 -101
- package/dist/.setup/{api-DlNUkDqj.mjs → api-CtmE1OUN.mjs} +25 -31
- package/dist/.setup/{approval-handler.runtime-DmnEa54W.mjs → approval-handler.runtime-D7FoZSn0.mjs} +30 -53
- package/dist/.setup/{approval-message-updates-B0jdSqOj.mjs → approval-message-updates-CIGByUcE.mjs} +2 -2
- package/dist/.setup/{audit-BpikUwN_.mjs → audit-zSawfbsN.mjs} +5 -8
- package/dist/.setup/{channel-Dr-AUnGt.mjs → channel-DI7DMzu0.mjs} +136 -215
- package/dist/.setup/{channel-access-BRp3Y-rF.mjs → channel-access-DasWY_OV.mjs} +6 -7
- package/dist/.setup/{channel.setup-BmNvkidb.mjs → channel.setup-DdFVN1mr.mjs} +35 -64
- package/dist/.setup/{components-DLJR0xU-.mjs → components-HN9052L1.mjs} +123 -146
- package/dist/.setup/{config-schema-BQWfnSCx.mjs → config-schema-_uBILpQf.mjs} +7 -3
- package/dist/.setup/{conversation-binding-route-DicJC1Lj.mjs → conversation-binding-route-DTjCBx-O.mjs} +1 -1
- package/dist/.setup/{directory-config-gqsdcplU.mjs → directory-config-3iVub-3m.mjs} +1 -1
- package/dist/.setup/{directory-live-Bipr0eUJ.mjs → directory-live-DLygQVtW.mjs} +18 -22
- package/dist/.setup/{discord-9gysrhzp.mjs → discord-BGqgx-yd.mjs} +686 -854
- package/dist/.setup/{doctor-B2bskDcF.mjs → doctor-DSrNJ7m2.mjs} +36 -47
- package/dist/.setup/{doctor-contract-Bg3NPAMw.mjs → doctor-contract-Bwv8EuQ_.mjs} +7 -16
- package/dist/.setup/{handle-action-UmkjXBfo.mjs → handle-action-CXH1h1tq.mjs} +25 -38
- package/dist/.setup/{handle-action.guild-admin-CB4sc9VV.mjs → handle-action.guild-admin-CHKW6PIs.mjs} +25 -31
- package/dist/.setup/{live-policy-config-VxexfRKo.mjs → live-policy-config-BPoB3eQi.mjs} +1 -1
- package/dist/.setup/{message-handler-BK69A-NB.mjs → message-handler-Ii_etru1.mjs} +9 -14
- package/dist/.setup/{message-handler.preflight-DFpsh90H.mjs → message-handler.preflight-C7YuSRl_.mjs} +79 -128
- package/dist/.setup/{message-handler.preflight-pluralkit-BXGGVmpe.mjs → message-handler.preflight-pluralkit-C3iAG--b.mjs} +6 -6
- package/dist/.setup/{message-handler.process-TKoqcqIP.mjs → message-handler.process-ClgWYH6o.mjs} +234 -206
- package/dist/.setup/{outbound-adapter-D4wRAb5S.mjs → outbound-adapter-D8OOIuKn.mjs} +73 -112
- package/dist/.setup/{outbound-session-route-BvBH4LC6.mjs → outbound-session-route-B0Hpwn3Q.mjs} +57 -115
- package/dist/.setup/output-activity-uBpMSX75.mjs +11 -0
- package/dist/.setup/{pluralkit-a6_NLfH9.mjs → pluralkit-B64dfq_j.mjs} +3 -1
- package/dist/.setup/{preflight-audio-DHGIHEpv.mjs → preflight-audio-wWgsZG5F.mjs} +1 -5
- package/dist/.setup/{presence-cache-Dg3_dADn.mjs → presence-cache-DCeTsL73.mjs} +3 -6
- package/dist/.setup/{probe-BwSKpnZf.mjs → probe-D3P1x4aN.mjs} +10 -18
- package/dist/.setup/{provider-YP8gN9_o.mjs → provider-D9EzOfG8.mjs} +2990 -3903
- package/dist/.setup/{provider-session.runtime-D1gkPxHT.mjs → provider-session.runtime-CsnRvddI.mjs} +5 -5
- package/dist/.setup/provider.runtime-BQVcM7Pg.mjs +2 -0
- package/dist/.setup/{realtime-session.runtime-BKUQBy1u.mjs → realtime-session.runtime-CxGBk8H-.mjs} +69 -98
- package/dist/.setup/{receive-recovery-DgkX7Qvi.mjs → receive-recovery-eVmK2_hl.mjs} +2 -12
- package/dist/.setup/resolve-allowlist-common-DNSsUQRF.mjs +66 -0
- package/dist/.setup/resolve-channels-UdT38DzU.mjs +173 -0
- package/dist/.setup/{resolve-users-DNrwvunm.mjs → resolve-users-DnCsrXZ_.mjs} +12 -41
- package/dist/.setup/{runtime-CESTexGn.mjs → runtime-CRTkKU1G.mjs} +202 -313
- package/dist/.setup/{runtime-DPcmPST9.mjs → runtime-DPm3gZXk.mjs} +2 -2
- package/dist/.setup/{secret-config-contract-uOE2J7yM.mjs → secret-config-contract-CIsH7R3B.mjs} +9 -18
- package/dist/.setup/{security-audit-D42cp5N7.mjs → security-audit-BFT84Uny.mjs} +1 -2
- package/dist/.setup/security-contract-DNyyjTZZ.mjs +19 -0
- package/dist/.setup/{send-CJk3VP5q.mjs → send-DbILKgcm.mjs} +184 -241
- package/dist/.setup/{send.components-dPljuV24.mjs → send.components-FxOS3CeP.mjs} +47 -63
- package/dist/.setup/{send.outbound-rOboMO_6.mjs → send.outbound-_jx4Xpd3.mjs} +178 -202
- package/dist/.setup/{send.receipt-DVOg2Oaw.mjs → send.receipt-BAlzXd8e.mjs} +33 -109
- package/dist/.setup/{send.shared-C4CN24D9.mjs → send.shared-CjQ4jbMA.mjs} +97 -153
- package/dist/.setup/{sender-identity-AHpUNr72.mjs → sender-identity-BNBvGt1l.mjs} +1 -1
- package/dist/.setup/setup-plugin-api-xfOFmxHP.mjs +3 -0
- package/dist/.setup/{shared-BoBnM5kM.mjs → shared-CestGDpq.mjs} +30 -20
- package/dist/.setup/{subagent-hooks-HH8Uy9cx.mjs → subagent-hooks-CME7dSGf.mjs} +5 -10
- package/dist/.setup/{system-events-Cwxaww8i.mjs → system-events-BwwSDCw4.mjs} +2 -2
- package/dist/.setup/target-parsing-C-HyNxcE.mjs +48 -0
- package/dist/.setup/{target-resolver-CSFoPQ12.mjs → target-resolver-Bse8fuTi.mjs} +11 -27
- package/dist/.setup/targets-DZJjkzwv.mjs +3 -0
- package/dist/.setup/{thread-bindings-DjQCkmsd.mjs → thread-bindings-0hPTSK14.mjs} +61 -52
- package/dist/.setup/{thread-bindings.manager-D2-GYZ5s.mjs → thread-bindings.manager-CdNa6UIs.mjs} +138 -211
- package/dist/.setup/{thread-bindings.session-updates-Bu_CGr_O.mjs → thread-bindings.session-updates-DGSljVf6.mjs} +60 -99
- package/dist/.setup/threading-BKe3E3tp.mjs +246 -0
- package/dist/.setup/{timeouts-pun7VJ02.mjs → timeouts-CuNARfyw.mjs} +10 -18
- package/dist/.setup/{transcripts-source-CaZQnGRH.mjs → transcripts-source-0qQYVu2H.mjs} +50 -368
- package/dist/.setup/{voice-runtime-DDymtIw8.mjs → voice-runtime-QlZJ4sHv.mjs} +166 -322
- package/dist/account-inspect-api.js +1 -1
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +77 -120
- package/dist/api.js +19 -18
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/doctor-contract-api.js +1 -1
- package/dist/runtime-api.js +21 -20
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/src/voice/audio-worker.runtime.js +38 -57
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/crypto.d.ts +2 -2
- package/node_modules/@types/node/dgram.d.ts +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/zlib.d.ts +6 -0
- package/node_modules/@types/ws/README.md +1 -1
- package/node_modules/@types/ws/index.d.mts +4 -0
- package/node_modules/@types/ws/index.d.ts +4 -0
- package/node_modules/@types/ws/package.json +3 -3
- package/node_modules/discord-api-types/_generated_/rest/v10/interfaces.d.ts +21 -0
- package/node_modules/discord-api-types/_generated_/rest/v10/interfaces.d.ts.map +1 -1
- package/node_modules/discord-api-types/_generated_/rest/v9/interfaces.d.ts +21 -0
- package/node_modules/discord-api-types/_generated_/rest/v9/interfaces.d.ts.map +1 -1
- package/node_modules/discord-api-types/globals.d.ts +6 -0
- package/node_modules/discord-api-types/globals.d.ts.map +1 -1
- package/node_modules/discord-api-types/globals.js +6 -0
- package/node_modules/discord-api-types/globals.js.map +1 -1
- package/node_modules/discord-api-types/package.json +3 -3
- package/node_modules/discord-api-types/payloads/index.mjs +1 -0
- package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.d.ts +207 -0
- package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.d.ts.map +1 -0
- package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.js +25 -0
- package/node_modules/discord-api-types/payloads/v10/applicationIdentityProfile.js.map +1 -0
- package/node_modules/discord-api-types/payloads/v10/autoModeration.d.ts +1 -1
- package/node_modules/discord-api-types/payloads/v10/autoModeration.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/guild.d.ts +27 -23
- package/node_modules/discord-api-types/payloads/v10/guild.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/guild.js +26 -22
- package/node_modules/discord-api-types/payloads/v10/guild.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/index.d.ts +1 -0
- package/node_modules/discord-api-types/payloads/v10/index.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/index.js +1 -0
- package/node_modules/discord-api-types/payloads/v10/index.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v10/index.mjs +1 -0
- package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.d.ts +207 -0
- package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.d.ts.map +1 -0
- package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.js +25 -0
- package/node_modules/discord-api-types/payloads/v9/applicationIdentityProfile.js.map +1 -0
- package/node_modules/discord-api-types/payloads/v9/autoModeration.d.ts +1 -1
- package/node_modules/discord-api-types/payloads/v9/autoModeration.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/guild.d.ts +27 -23
- package/node_modules/discord-api-types/payloads/v9/guild.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/guild.js +26 -22
- package/node_modules/discord-api-types/payloads/v9/guild.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/index.d.ts +1 -0
- package/node_modules/discord-api-types/payloads/v9/index.d.ts.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/index.js +1 -0
- package/node_modules/discord-api-types/payloads/v9/index.js.map +1 -1
- package/node_modules/discord-api-types/payloads/v9/index.mjs +1 -0
- package/node_modules/discord-api-types/rest/common.d.ts +2 -0
- package/node_modules/discord-api-types/rest/common.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/common.js +2 -0
- package/node_modules/discord-api-types/rest/common.js.map +1 -1
- package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.d.ts +70 -0
- package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.d.ts.map +1 -0
- package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.js +3 -0
- package/node_modules/discord-api-types/rest/v10/applicationIdentityProfile.js.map +1 -0
- package/node_modules/discord-api-types/rest/v10/index.d.ts +1 -0
- package/node_modules/discord-api-types/rest/v10/index.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/index.js +29 -0
- package/node_modules/discord-api-types/rest/v10/index.js.map +1 -1
- package/node_modules/discord-api-types/rest/v10/interactions.d.ts +4 -2
- package/node_modules/discord-api-types/rest/v10/interactions.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v10/user.d.ts +2 -2
- package/node_modules/discord-api-types/rest/v10/user.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.d.ts +70 -0
- package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.d.ts.map +1 -0
- package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.js +3 -0
- package/node_modules/discord-api-types/rest/v9/applicationIdentityProfile.js.map +1 -0
- package/node_modules/discord-api-types/rest/v9/index.d.ts +1 -0
- package/node_modules/discord-api-types/rest/v9/index.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/index.js +29 -0
- package/node_modules/discord-api-types/rest/v9/index.js.map +1 -1
- package/node_modules/discord-api-types/rest/v9/interactions.d.ts +4 -2
- package/node_modules/discord-api-types/rest/v9/interactions.d.ts.map +1 -1
- package/node_modules/discord-api-types/rest/v9/user.d.ts +2 -2
- package/node_modules/discord-api-types/rest/v9/user.d.ts.map +1 -1
- package/node_modules/discord-api-types/v10.mjs +1 -0
- package/node_modules/discord-api-types/v9.mjs +1 -0
- package/node_modules/micromark/dev/lib/compile.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/compile.js +14 -4
- package/node_modules/micromark/dev/lib/create-tokenizer.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/create-tokenizer.js +7 -6
- package/node_modules/micromark/dev/lib/initialize/document.js +25 -21
- package/node_modules/micromark/dev/lib/initialize/text.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/initialize/text.js +10 -6
- package/node_modules/micromark/dev/lib/preprocess.d.ts.map +1 -1
- package/node_modules/micromark/dev/lib/preprocess.js +19 -21
- package/node_modules/micromark/lib/compile.d.ts.map +1 -1
- package/node_modules/micromark/lib/compile.js +37 -29
- package/node_modules/micromark/lib/create-tokenizer.d.ts.map +1 -1
- package/node_modules/micromark/lib/create-tokenizer.js +37 -35
- package/node_modules/micromark/lib/initialize/document.js +21 -13
- package/node_modules/micromark/lib/initialize/text.d.ts.map +1 -1
- package/node_modules/micromark/lib/initialize/text.js +7 -3
- package/node_modules/micromark/lib/preprocess.d.ts.map +1 -1
- package/node_modules/micromark/lib/preprocess.js +16 -19
- package/node_modules/micromark/package.json +2 -15
- package/node_modules/micromark-core-commonmark/dev/lib/attention.js +18 -24
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/code-fenced.js +1 -43
- package/node_modules/micromark-core-commonmark/dev/lib/code-indented.js +19 -43
- package/node_modules/micromark-core-commonmark/dev/lib/heading-atx.js +2 -6
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/html-flow.js +2 -53
- package/node_modules/micromark-core-commonmark/dev/lib/label-end.js +14 -12
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-image.js +14 -5
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/label-start-link.js +14 -5
- package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/dev/lib/partial-non-lazy-continuation.js +67 -0
- package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/dev/lib/setext-underline.js +8 -5
- package/node_modules/micromark-core-commonmark/lib/attention.js +14 -24
- package/node_modules/micromark-core-commonmark/lib/code-fenced.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/code-fenced.js +1 -39
- package/node_modules/micromark-core-commonmark/lib/code-indented.js +11 -29
- package/node_modules/micromark-core-commonmark/lib/heading-atx.js +2 -6
- package/node_modules/micromark-core-commonmark/lib/html-flow.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/html-flow.js +2 -51
- package/node_modules/micromark-core-commonmark/lib/label-end.js +11 -10
- package/node_modules/micromark-core-commonmark/lib/label-start-image.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/label-start-image.js +11 -3
- package/node_modules/micromark-core-commonmark/lib/label-start-link.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/label-start-link.js +11 -3
- package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts +4 -0
- package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.d.ts.map +1 -0
- package/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js +61 -0
- package/node_modules/micromark-core-commonmark/lib/setext-underline.d.ts.map +1 -1
- package/node_modules/micromark-core-commonmark/lib/setext-underline.js +7 -5
- package/node_modules/micromark-core-commonmark/package.json +4 -16
- package/node_modules/micromark-factory-space/dev/index.d.ts +24 -1
- package/node_modules/micromark-factory-space/dev/index.d.ts.map +1 -1
- package/node_modules/micromark-factory-space/dev/index.js +58 -3
- package/node_modules/micromark-factory-space/index.d.ts +24 -1
- package/node_modules/micromark-factory-space/index.d.ts.map +1 -1
- package/node_modules/micromark-factory-space/index.js +55 -3
- package/node_modules/micromark-factory-space/package.json +1 -10
- package/node_modules/micromark-factory-space/readme.md +25 -25
- package/node_modules/micromark-util-edit-map/dev/index.d.ts +78 -0
- package/node_modules/micromark-util-edit-map/dev/index.d.ts.map +1 -0
- package/node_modules/micromark-util-edit-map/dev/index.js +237 -0
- package/node_modules/micromark-util-edit-map/index.d.ts +78 -0
- package/node_modules/micromark-util-edit-map/index.d.ts.map +1 -0
- package/node_modules/micromark-util-edit-map/index.js +225 -0
- package/node_modules/micromark-util-edit-map/license +22 -0
- package/node_modules/micromark-util-edit-map/package.json +48 -0
- package/node_modules/micromark-util-edit-map/readme.md +234 -0
- package/node_modules/micromark-util-types/index.d.ts +6 -3
- package/node_modules/micromark-util-types/package.json +2 -36
- package/node_modules/ws/lib/websocket.js +17 -3
- package/node_modules/ws/package.json +1 -1
- package/openclaw.plugin.json +3 -6
- package/package.json +7 -12
- package/dist/.setup/account-inspect-DsER5ILV.mjs +0 -45
- package/dist/.setup/provider.runtime-CZ51OIgD.mjs +0 -2
- package/dist/.setup/resolve-allowlist-common-BUyU3C-T.mjs +0 -27
- package/dist/.setup/resolve-channels-DA6QlhZN.mjs +0 -246
- package/dist/.setup/security-contract-DSHk7I2w.mjs +0 -26
- package/dist/.setup/setup-plugin-api-BVlCz3fm.mjs +0 -3
- package/dist/.setup/targets-bqXQENmX.mjs +0 -3
- package/dist/control-ui/2afbdab1d3aa65a789d8a3eba666f4b1ec5df07073538fe30d6cf32093a1fb2d/index.js +0 -1
package/dist/.setup/{provider-session.runtime-D1gkPxHT.mjs → provider-session.runtime-CsnRvddI.mjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as createNoopThreadBindingManager, t as createThreadBindingManager } from "./thread-bindings.manager-
|
|
2
|
-
import { c as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-
|
|
3
|
-
import { t as createDiscordMessageHandler } from "./message-handler-
|
|
1
|
+
import { i as createNoopThreadBindingManager, t as createThreadBindingManager } from "./thread-bindings.manager-CdNa6UIs.mjs";
|
|
2
|
+
import { c as reconcileAcpThreadBindingsOnStartup } from "./thread-bindings-0hPTSK14.mjs";
|
|
3
|
+
import { t as createDiscordMessageHandler } from "./message-handler-Ii_etru1.mjs";
|
|
4
4
|
import { resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled } from "openclaw/plugin-sdk/conversation-runtime";
|
|
5
|
-
import { getAcpSessionManager, isAcpRuntimeError } from "openclaw/plugin-sdk/acp-runtime";
|
|
6
|
-
export { createDiscordMessageHandler, createNoopThreadBindingManager, createThreadBindingManager, getAcpSessionManager, isAcpRuntimeError, reconcileAcpThreadBindingsOnStartup, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled };
|
|
5
|
+
import { getAcpSessionManager, isAcpRuntimeError, rethrowIncognitoSessionError } from "openclaw/plugin-sdk/acp-runtime";
|
|
6
|
+
export { createDiscordMessageHandler, createNoopThreadBindingManager, createThreadBindingManager, getAcpSessionManager, isAcpRuntimeError, reconcileAcpThreadBindingsOnStartup, resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled, rethrowIncognitoSessionError };
|
package/dist/.setup/{realtime-session.runtime-BKUQBy1u.mjs → realtime-session.runtime-CxGBk8H-.mjs}
RENAMED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { _ as restoreDiscordAudioError, b as setDiscordAudioOutputStatus, g as releaseDiscordAudioInput, h as getDiscordAudioOutputStatus, l as createDiscordPcmToRealtimeConverter, m as admitDiscordAudioInput, p as DiscordAudioOutputStatus } from "./receive-recovery-eVmK2_hl.mjs";
|
|
2
|
+
import { t as resolveDiscordOutputAudioDelta } from "./output-activity-uBpMSX75.mjs";
|
|
3
|
+
import { n as discordRealtimeVoiceSecretOwnerId } from "./secret-config-contract-CIsH7R3B.mjs";
|
|
4
|
+
import { y as logVoiceVerbose } from "./provider-D9EzOfG8.mjs";
|
|
5
|
+
import { a as logDiscordVoiceAgentControlResult, c as formatVoiceLogPreview, i as handleDiscordVoiceAgentControlToolCall, l as shouldLogRealtimeVerboseEvent, n as DiscordRealtimeRecording, o as maybeControlDiscordVoiceAgentRun, r as formatVoiceIngressPrompt, s as formatRealtimeInfoLog } from "./voice-runtime-QlZJ4sHv.mjs";
|
|
5
6
|
import { MessageChannel } from "node:worker_threads";
|
|
6
|
-
import { formatErrorMessage, readErrorName, toErrorObject } from "openclaw/plugin-sdk/error-runtime";
|
|
7
|
+
import { formatErrorMessage, readErrorName, toErrorObject, toStringifiedError } from "openclaw/plugin-sdk/error-runtime";
|
|
7
8
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
8
9
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
9
10
|
import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -395,7 +396,7 @@ var DiscordRealtimeConsults = class {
|
|
|
395
396
|
logger$3.info(`discord voice: realtime consult requested call=${callId} voiceSession=${this.params.entry.voiceSessionKey} supervisorSession=${this.params.entry.route.sessionKey} agent=${this.params.entry.route.agentId} question=${formatVoiceLogPreview(consultMessage)}`);
|
|
396
397
|
const nativeConsult = this.params.harness.forcedConsults.recordNativeConsult(event.args, callId);
|
|
397
398
|
if (nativeConsult.kind === "already_delivered" && this.params.harness.forcedConsults.isCancelled(nativeConsult.handle)) {
|
|
398
|
-
await this.
|
|
399
|
+
await this.submitAgentProxyConsultResult(callId, session, CANCELLED_CONSULT_RESULT);
|
|
399
400
|
return;
|
|
400
401
|
}
|
|
401
402
|
const pendingConsult = nativeConsult.kind === "pending" ? nativeConsult.handle : void 0;
|
|
@@ -413,8 +414,6 @@ var DiscordRealtimeConsults = class {
|
|
|
413
414
|
}
|
|
414
415
|
if (await this.submitRecentAgentProxyConsultResult(callId, recentConsult, session)) return;
|
|
415
416
|
}
|
|
416
|
-
}
|
|
417
|
-
if (!context) {
|
|
418
417
|
context = this.params.turns.consumePendingSpeakerContext();
|
|
419
418
|
if (context) {
|
|
420
419
|
recent = this.params.harness.forcedConsults.prepare(consultMessage, {
|
|
@@ -471,7 +470,6 @@ var DiscordRealtimeConsults = class {
|
|
|
471
470
|
return;
|
|
472
471
|
}
|
|
473
472
|
logger$3.warn(`discord voice: realtime active-run control failed; falling back to normal transcript handling: ${formatErrorMessage(error)}`);
|
|
474
|
-
control = void 0;
|
|
475
473
|
}
|
|
476
474
|
if (this.params.stopped() || providerEpoch !== this.params.providerEpoch()) return;
|
|
477
475
|
if (control?.handled) {
|
|
@@ -612,13 +610,6 @@ var DiscordRealtimeConsults = class {
|
|
|
612
610
|
if (state) state.promise = tracked;
|
|
613
611
|
return tracked;
|
|
614
612
|
}
|
|
615
|
-
async submitTerminalRealtimeToolResult(callId, session, result) {
|
|
616
|
-
if (session.bridge.supportsToolResultSuppression === false) {
|
|
617
|
-
await session.submitToolResult(callId, result);
|
|
618
|
-
return;
|
|
619
|
-
}
|
|
620
|
-
await session.submitToolResult(callId, result, { suppressResponse: true });
|
|
621
|
-
}
|
|
622
613
|
async submitRecentAgentProxyConsultResult(callId, recent, session) {
|
|
623
614
|
const state = recent.context;
|
|
624
615
|
if (!state) return false;
|
|
@@ -655,12 +646,13 @@ var DiscordRealtimeConsults = class {
|
|
|
655
646
|
if (deliveries?.size === 0) this.providerDeliveries.delete(state);
|
|
656
647
|
}
|
|
657
648
|
async submitAgentProxyConsultResult(callId, session, result, alreadyDelivered = false) {
|
|
658
|
-
|
|
659
|
-
|
|
649
|
+
const terminal = "status" in result || alreadyDelivered;
|
|
650
|
+
const payload = "status" in result ? CANCELLED_CONSULT_RESULT : alreadyDelivered ? {
|
|
660
651
|
status: "already_delivered",
|
|
661
652
|
message: "OpenClaw already delivered this answer to Discord voice. Do not repeat it."
|
|
662
|
-
}
|
|
663
|
-
|
|
653
|
+
} : result;
|
|
654
|
+
if (terminal && session.bridge.supportsToolResultSuppression !== false) await session.submitToolResult(callId, payload, { suppressResponse: true });
|
|
655
|
+
else await session.submitToolResult(callId, payload);
|
|
664
656
|
}
|
|
665
657
|
deliverDetachedResult(state) {
|
|
666
658
|
const result = state.result;
|
|
@@ -688,13 +680,9 @@ var DiscordRealtimeConsults = class {
|
|
|
688
680
|
//#region extensions/discord/src/voice/realtime-output.ts
|
|
689
681
|
/** Main retains provider item identity; physical output state belongs to the worker. */
|
|
690
682
|
var DiscordRealtimeOutput = class {
|
|
691
|
-
get activity() {
|
|
692
|
-
if (Atomics.load(this.clock, 2) !== 0n && !this.activityTracker.snapshot().playbackStarted) this.activityTracker.markPlaybackStarted();
|
|
693
|
-
return this.activityTracker;
|
|
694
|
-
}
|
|
695
683
|
constructor(params) {
|
|
696
684
|
this.params = params;
|
|
697
|
-
this.
|
|
685
|
+
this.activity = createRealtimeVoiceOutputActivityTracker();
|
|
698
686
|
this.clock = new BigInt64Array(new SharedArrayBuffer(24));
|
|
699
687
|
this.marks = /* @__PURE__ */ new Map();
|
|
700
688
|
this.nextMark = 0;
|
|
@@ -746,6 +734,9 @@ var DiscordRealtimeOutput = class {
|
|
|
746
734
|
playedBytes() {
|
|
747
735
|
return Number(Atomics.load(this.clock, 0));
|
|
748
736
|
}
|
|
737
|
+
hasStarted() {
|
|
738
|
+
return Atomics.load(this.clock, 2) !== 0n || this.activity.snapshot().playbackStarted;
|
|
739
|
+
}
|
|
749
740
|
pendingBytes() {
|
|
750
741
|
return this.closed ? 0 : Math.max(0, this.activity.snapshot().sourceAudioBytes * 4 - this.playedBytes());
|
|
751
742
|
}
|
|
@@ -781,8 +772,8 @@ var DiscordRealtimeOutput = class {
|
|
|
781
772
|
return true;
|
|
782
773
|
}
|
|
783
774
|
const previous = this.activity.snapshot();
|
|
784
|
-
const
|
|
785
|
-
const audioMs =
|
|
775
|
+
const delta = resolveDiscordOutputAudioDelta(previous, audio.length);
|
|
776
|
+
const { audioMs } = delta;
|
|
786
777
|
if (item) {
|
|
787
778
|
const last = this.spans.at(-1);
|
|
788
779
|
if (last?.item === item && last.endMs === previous.audioMs) last.endMs += audioMs;
|
|
@@ -792,11 +783,7 @@ var DiscordRealtimeOutput = class {
|
|
|
792
783
|
endMs: previous.audioMs + audioMs
|
|
793
784
|
});
|
|
794
785
|
}
|
|
795
|
-
this.activity.markAudio(
|
|
796
|
-
audioMs,
|
|
797
|
-
sourceAudioBytes: audio.length,
|
|
798
|
-
sinkAudioBytes: sinkBytes - previous.sinkAudioBytes
|
|
799
|
-
});
|
|
786
|
+
this.activity.markAudio(delta);
|
|
800
787
|
this.params.player.audio.send({
|
|
801
788
|
type: "output-audio",
|
|
802
789
|
id: this.id,
|
|
@@ -939,7 +926,6 @@ var DiscordRealtimePlayback = class {
|
|
|
939
926
|
this.retainedSpeechClosed = true;
|
|
940
927
|
this.speechSuccessor = void 0;
|
|
941
928
|
this.queuedExactSpeechMessages = [];
|
|
942
|
-
this.retireExactSpeech();
|
|
943
929
|
}
|
|
944
930
|
this.clearOutputAudio("session-close");
|
|
945
931
|
this.directOutput?.close();
|
|
@@ -1177,7 +1163,7 @@ var DiscordRealtimePlayback = class {
|
|
|
1177
1163
|
this.exactSpeechState = { status: "idle" };
|
|
1178
1164
|
if (speech.status !== "active") return;
|
|
1179
1165
|
const directStarted = speech.direct && Atomics.exchange(speech.direct.clock, 2, 0n) === -speech.direct.epoch;
|
|
1180
|
-
if (preserveUnplayed && !directStarted && !speech.output?.
|
|
1166
|
+
if (preserveUnplayed && !directStarted && !speech.output?.hasStarted()) this.queuedExactSpeechMessages.unshift(speech.message);
|
|
1181
1167
|
}
|
|
1182
1168
|
outputAudioMs() {
|
|
1183
1169
|
return this.directOutput ? Math.floor(Number(Atomics.load(this.directOutput.clock, 1)) / 48) : Math.floor(this.params.harness.outputActivity.snapshot().audioMs);
|
|
@@ -1193,7 +1179,6 @@ var DiscordRealtimePlayback = class {
|
|
|
1193
1179
|
this.speechSuccessor = void 0;
|
|
1194
1180
|
this.params.stopTerminally();
|
|
1195
1181
|
this.queuedExactSpeechMessages = [];
|
|
1196
|
-
this.retireExactSpeech();
|
|
1197
1182
|
this.clearOutputAudio(reason);
|
|
1198
1183
|
this.params.onTerminalError(error);
|
|
1199
1184
|
}
|
|
@@ -1364,11 +1349,14 @@ var DiscordRealtimeSpeakerSession = class {
|
|
|
1364
1349
|
status: "inactive",
|
|
1365
1350
|
generation: 0
|
|
1366
1351
|
};
|
|
1367
|
-
this.
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1352
|
+
this.policy = {
|
|
1353
|
+
toolPolicy: "safe-read-only",
|
|
1354
|
+
consultToolsAllow: void 0,
|
|
1355
|
+
consultPolicy: "auto",
|
|
1356
|
+
wakeNamePolicy: "never",
|
|
1357
|
+
wakeNames: [],
|
|
1358
|
+
handlesAgentConsult: false
|
|
1359
|
+
};
|
|
1372
1360
|
this.providerGenerationObserved = false;
|
|
1373
1361
|
this.providerContinuityEpoch = 0;
|
|
1374
1362
|
this.captures = /* @__PURE__ */ new Set();
|
|
@@ -1406,64 +1394,54 @@ var DiscordRealtimeSpeakerSession = class {
|
|
|
1406
1394
|
}
|
|
1407
1395
|
});
|
|
1408
1396
|
for (const item of params.conversationHistory ?? []) this.harness.recordTranscript(item.role, item.text);
|
|
1409
|
-
|
|
1397
|
+
const context = {
|
|
1398
|
+
...params,
|
|
1410
1399
|
bridge: () => this.bridge,
|
|
1400
|
+
harness: this.harness,
|
|
1401
|
+
providerEpoch: () => this.providerContinuityEpoch,
|
|
1402
|
+
providerId: () => this.realtimeProviderId,
|
|
1403
|
+
realtimeConfig: () => this.realtimeConfig,
|
|
1404
|
+
stopped: () => this.isStopped(),
|
|
1405
|
+
wakeNamePolicy: () => this.policy.wakeNamePolicy
|
|
1406
|
+
};
|
|
1407
|
+
this.playback = new DiscordRealtimePlayback({
|
|
1408
|
+
...context,
|
|
1411
1409
|
bridgeReady: () => this.isReady(),
|
|
1412
1410
|
buildSpeakExactMessage: (text) => buildRealtimeVoiceSpeakExactMessage({
|
|
1413
1411
|
text,
|
|
1414
1412
|
surfaceLabel: "the Discord voice channel"
|
|
1415
1413
|
}),
|
|
1416
|
-
entry: this.params.entry,
|
|
1417
|
-
player: this.params.player,
|
|
1418
|
-
harness: this.harness,
|
|
1419
1414
|
markProviderGenerationObserved: () => this.markProviderGenerationObserved(),
|
|
1420
|
-
mode: this.params.mode,
|
|
1421
|
-
onTerminalError: this.params.onTerminalError,
|
|
1422
|
-
providerId: () => this.realtimeProviderId,
|
|
1423
|
-
realtimeConfig: () => this.realtimeConfig,
|
|
1424
1415
|
stopTerminally: () => {
|
|
1425
1416
|
this.lifecycle.status = "stopped";
|
|
1426
1417
|
this.consults.close();
|
|
1427
1418
|
},
|
|
1428
|
-
stopped: () => this.isStopped(),
|
|
1429
1419
|
wakeNameRequired: () => this.isWakeNameRequired()
|
|
1430
1420
|
});
|
|
1431
1421
|
this.turns = new DiscordRealtimeTurns({
|
|
1432
|
-
|
|
1433
|
-
entry: this.params.entry,
|
|
1422
|
+
...context,
|
|
1434
1423
|
getHumanParticipantCount: () => this.humanParticipantCount(),
|
|
1435
1424
|
interruptRoomPlayback: () => {
|
|
1436
1425
|
if (!this.playback.isBargeInEnabled() || !this.params.player.isActive()) return false;
|
|
1437
1426
|
return this.params.player.handleBargeIn("active-speaker-audio");
|
|
1438
1427
|
},
|
|
1439
|
-
onAcceptedTranscript: (text,
|
|
1428
|
+
onAcceptedTranscript: (text, speakerContext, providerEpoch) => this.consults.handleAcceptedTranscript(text, speakerContext, providerEpoch),
|
|
1440
1429
|
playback: this.playback,
|
|
1441
|
-
providerEpoch: () => this.providerContinuityEpoch,
|
|
1442
|
-
providerId: () => this.realtimeProviderId,
|
|
1443
|
-
realtimeConfig: () => this.realtimeConfig,
|
|
1444
1430
|
recordInputAudio: (audio) => this.harness.recordInputAudio(audio),
|
|
1445
|
-
|
|
1446
|
-
wakeNamePolicy: () => this.wakeNamePolicy,
|
|
1447
|
-
wakeNames: () => this.wakeNames
|
|
1431
|
+
wakeNames: () => this.policy.wakeNames
|
|
1448
1432
|
});
|
|
1449
1433
|
this.consults = new DiscordRealtimeConsults({
|
|
1450
|
-
|
|
1451
|
-
consultPolicy: () => this.consultPolicy,
|
|
1452
|
-
consultToolPolicy: () => this.
|
|
1453
|
-
consultToolsAllow: () => this.consultToolsAllow,
|
|
1434
|
+
...context,
|
|
1435
|
+
consultPolicy: () => this.policy.consultPolicy,
|
|
1436
|
+
consultToolPolicy: () => this.policy.toolPolicy,
|
|
1437
|
+
consultToolsAllow: () => this.policy.consultToolsAllow,
|
|
1454
1438
|
debounceMs: () => this.realtimeConfig?.debounceMs,
|
|
1455
|
-
|
|
1456
|
-
harness: this.harness,
|
|
1457
|
-
isAgentProxy: () => this.params.mode === "agent-proxy" && !this.handlesAgentConsult,
|
|
1439
|
+
isAgentProxy: () => this.params.mode === "agent-proxy" && !this.policy.handlesAgentConsult,
|
|
1458
1440
|
isWakeNameRequired: () => this.isWakeNameRequired(),
|
|
1459
1441
|
playback: this.playback,
|
|
1460
|
-
providerEpoch: () => this.providerContinuityEpoch,
|
|
1461
1442
|
runAgentTurn: (turn) => this.trackOperation(() => this.params.runAgentTurn(turn)),
|
|
1462
|
-
resolveSpeakerContext: this.params.resolveSpeakerContext,
|
|
1463
|
-
stopped: () => this.isStopped(),
|
|
1464
1443
|
turns: this.turns,
|
|
1465
|
-
usesRealtimeAgentHandoff: () => this.params.mode === "bidi" || this.
|
|
1466
|
-
wakeNamePolicy: () => this.wakeNamePolicy
|
|
1444
|
+
usesRealtimeAgentHandoff: () => this.params.mode === "bidi" || this.policy.toolPolicy !== "none"
|
|
1467
1445
|
});
|
|
1468
1446
|
}
|
|
1469
1447
|
async connect() {
|
|
@@ -1485,13 +1463,8 @@ var DiscordRealtimeSpeakerSession = class {
|
|
|
1485
1463
|
this.realtimeProviderId = resolved.provider.id;
|
|
1486
1464
|
this.selection = selection;
|
|
1487
1465
|
const capabilities = resolved.capabilities;
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
this.consultToolPolicy = toolPolicy;
|
|
1491
|
-
this.consultToolsAllow = consultToolsAllow;
|
|
1492
|
-
this.consultPolicy = consultPolicy;
|
|
1493
|
-
this.wakeNamePolicy = wakeNamePolicy;
|
|
1494
|
-
this.wakeNames = wakeNames;
|
|
1466
|
+
this.policy = sessionPolicy;
|
|
1467
|
+
const { toolPolicy, consultPolicy, autoRespondToAudio } = sessionPolicy;
|
|
1495
1468
|
const usesRealtimeAgentHandoff = this.params.mode === "bidi" || toolPolicy !== "none";
|
|
1496
1469
|
const onReady = () => {
|
|
1497
1470
|
this.markProviderGenerationObserved();
|
|
@@ -1508,7 +1481,7 @@ var DiscordRealtimeSpeakerSession = class {
|
|
|
1508
1481
|
autoRespondToAudio,
|
|
1509
1482
|
interruptResponseOnInputAudio,
|
|
1510
1483
|
markStrategy: "transport",
|
|
1511
|
-
...this.handlesAgentConsult ? { runAgentConsult: (request) => this.trackOperation(() => this.consults.runAgentConsult(request)) } : {},
|
|
1484
|
+
...this.policy.handlesAgentConsult ? { runAgentConsult: (request) => this.trackOperation(() => this.consults.runAgentConsult(request)) } : {},
|
|
1512
1485
|
tools: usesRealtimeAgentHandoff ? resolveRealtimeVoiceAgentConsultTools(toolPolicy, toolPolicy !== "none" ? [REALTIME_VOICE_AGENT_CONTROL_TOOL] : []) : [],
|
|
1513
1486
|
audioSink: {
|
|
1514
1487
|
isOpen: () => !this.isStopped() && this.outputEnabled,
|
|
@@ -1540,7 +1513,7 @@ var DiscordRealtimeSpeakerSession = class {
|
|
|
1540
1513
|
return;
|
|
1541
1514
|
}
|
|
1542
1515
|
if (text.trim()) this.recording.transcript(text.trim());
|
|
1543
|
-
if (this.handlesAgentConsult) return;
|
|
1516
|
+
if (this.policy.handlesAgentConsult) return;
|
|
1544
1517
|
this.trackOperation(() => this.turns.handleFinalUserTranscript(text)).catch((error) => this.logRealtimeError(formatErrorMessage$1(error)));
|
|
1545
1518
|
},
|
|
1546
1519
|
onToolCall: (event, session) => {
|
|
@@ -1574,7 +1547,7 @@ var DiscordRealtimeSpeakerSession = class {
|
|
|
1574
1547
|
return;
|
|
1575
1548
|
}
|
|
1576
1549
|
const humanParticipantCount = this.humanParticipantCount();
|
|
1577
|
-
logger$1.info(`discord voice: realtime bridge starting mode=${this.params.mode} provider=${resolved.provider.id} model=${resolvedModel ?? "default"} voice=${resolvedVoice ?? "default"} consultPolicy=${consultPolicy} toolPolicy=${toolPolicy} autoRespond=${autoRespondToAudio} wakeNamePolicy=${this.wakeNamePolicy} requireWakeName=${this.isWakeNameRequired(humanParticipantCount)} humanParticipants=${humanParticipantCount} wakeNames=${this.wakeNames.join(",") || "none"} interruptResponse=${interruptResponseOnInputAudio} bargeIn=${bargeIn} minBargeInAudioEndMs=${minBargeInAudioEndMs}`);
|
|
1550
|
+
logger$1.info(`discord voice: realtime bridge starting mode=${this.params.mode} provider=${resolved.provider.id} model=${resolvedModel ?? "default"} voice=${resolvedVoice ?? "default"} consultPolicy=${consultPolicy} toolPolicy=${toolPolicy} autoRespond=${autoRespondToAudio} wakeNamePolicy=${this.policy.wakeNamePolicy} requireWakeName=${this.isWakeNameRequired(humanParticipantCount)} humanParticipants=${humanParticipantCount} wakeNames=${this.policy.wakeNames.join(",") || "none"} interruptResponse=${interruptResponseOnInputAudio} bargeIn=${bargeIn} minBargeInAudioEndMs=${minBargeInAudioEndMs}`);
|
|
1578
1551
|
this.attachOutputAudioPort();
|
|
1579
1552
|
await this.bridge.connect();
|
|
1580
1553
|
if (!this.markLifecycleReady(lifecycleGeneration)) {
|
|
@@ -1650,7 +1623,7 @@ var DiscordRealtimeSpeakerSession = class {
|
|
|
1650
1623
|
recordingInput?.exclude();
|
|
1651
1624
|
throw error;
|
|
1652
1625
|
} finally {
|
|
1653
|
-
recordingInput?.
|
|
1626
|
+
recordingInput?.seal("audio");
|
|
1654
1627
|
}
|
|
1655
1628
|
}
|
|
1656
1629
|
};
|
|
@@ -1703,7 +1676,7 @@ var DiscordRealtimeSpeakerSession = class {
|
|
|
1703
1676
|
}
|
|
1704
1677
|
attachOutputAudioPort() {
|
|
1705
1678
|
const provider = this.bridge?.bridge;
|
|
1706
|
-
if (this.wakeNamePolicy === "never" && provider?.outputAudioMode === "continuous" && provider.setAudioOutputPort) provider.setAudioOutputPort(this.playback.createOutputAudioPort(this.outputEnabled));
|
|
1679
|
+
if (this.policy.wakeNamePolicy === "never" && provider?.outputAudioMode === "continuous" && provider.setAudioOutputPort) provider.setAudioOutputPort(this.playback.createOutputAudioPort(this.outputEnabled));
|
|
1707
1680
|
}
|
|
1708
1681
|
hasActiveInput() {
|
|
1709
1682
|
return this.captures.size > 0;
|
|
@@ -1755,7 +1728,7 @@ var DiscordRealtimeSpeakerSession = class {
|
|
|
1755
1728
|
return this.params.getHumanParticipantCount?.() ?? 0;
|
|
1756
1729
|
}
|
|
1757
1730
|
isWakeNameRequired(humanParticipantCount = this.humanParticipantCount()) {
|
|
1758
|
-
return isRealtimeVoiceWakeNameRequired(this.wakeNamePolicy, humanParticipantCount);
|
|
1731
|
+
return isRealtimeVoiceWakeNameRequired(this.policy.wakeNamePolicy, humanParticipantCount);
|
|
1759
1732
|
}
|
|
1760
1733
|
handleBridgeEvent(event) {
|
|
1761
1734
|
if (!(event.direction === "client" && event.type === "session.continuity.reset") && !event.type.endsWith("audio.delta") && event.type !== "output_audio.rtp") this.markProviderGenerationObserved();
|
|
@@ -1764,10 +1737,8 @@ var DiscordRealtimeSpeakerSession = class {
|
|
|
1764
1737
|
if (event.direction === "server" && event.type === "response.created") this.playback.beginResponse();
|
|
1765
1738
|
if (event.direction === "server" && event.type === "input_audio_buffer.speech_started") this.turns.resetPartialWakeNameTracking();
|
|
1766
1739
|
if (shouldLogRealtimeVerboseEvent(event)) logVoiceVerbose(`realtime ${event.direction}:${event.type}${detail}`);
|
|
1767
|
-
const
|
|
1768
|
-
if (
|
|
1769
|
-
const lifecycleLog = formatRealtimeLifecycleLog(event);
|
|
1770
|
-
if (lifecycleLog) logger$1.info(lifecycleLog);
|
|
1740
|
+
const info = formatRealtimeInfoLog(event);
|
|
1741
|
+
if (info) logger$1.info(info);
|
|
1771
1742
|
}
|
|
1772
1743
|
markProviderGenerationObserved() {
|
|
1773
1744
|
this.lastActivityAt = Date.now();
|
|
@@ -1923,7 +1894,7 @@ var DiscordRealtimeVoiceSession = class {
|
|
|
1923
1894
|
handleSpeakerFailure(session, error) {
|
|
1924
1895
|
if (this.closed) return;
|
|
1925
1896
|
if (this.warmSession === session) {
|
|
1926
|
-
this.params.onTerminalError(
|
|
1897
|
+
this.params.onTerminalError(toStringifiedError(error));
|
|
1927
1898
|
return;
|
|
1928
1899
|
}
|
|
1929
1900
|
for (const speaker of this.sessions) {
|
|
@@ -2060,18 +2031,18 @@ var DiscordRealtimeVoiceSession = class {
|
|
|
2060
2031
|
}
|
|
2061
2032
|
}
|
|
2062
2033
|
async connectCandidate(session, signal) {
|
|
2063
|
-
signal
|
|
2064
|
-
|
|
2034
|
+
signal.throwIfAborted();
|
|
2035
|
+
const cancelled = createDeferred();
|
|
2036
|
+
const abort = () => {
|
|
2037
|
+
this.closeSpeaker(session);
|
|
2038
|
+
cancelled.reject(toErrorObject(signal.reason, "Discord voice change cancelled"));
|
|
2039
|
+
};
|
|
2065
2040
|
try {
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
reject(toErrorObject(signal?.reason, "Discord voice change cancelled"));
|
|
2070
|
-
};
|
|
2071
|
-
signal?.addEventListener("abort", abort, { once: true });
|
|
2072
|
-
})]);
|
|
2041
|
+
const connecting = session.connect();
|
|
2042
|
+
signal.addEventListener("abort", abort, { once: true });
|
|
2043
|
+
await Promise.race([connecting, cancelled.promise]);
|
|
2073
2044
|
} finally {
|
|
2074
|
-
|
|
2045
|
+
signal.removeEventListener("abort", abort);
|
|
2075
2046
|
}
|
|
2076
2047
|
}
|
|
2077
2048
|
releaseIdleSpeakers() {
|
|
@@ -111,9 +111,6 @@ function buildWavBuffer(chunks) {
|
|
|
111
111
|
for (const chunk of chunks) offset += chunk.copy(wav, offset);
|
|
112
112
|
return wav;
|
|
113
113
|
}
|
|
114
|
-
function createDiscordOpusEncodeStream() {
|
|
115
|
-
return new DiscordOpusEncodeStream();
|
|
116
|
-
}
|
|
117
114
|
function createDiscordOpusPlaybackStream(input) {
|
|
118
115
|
const inputSource = typeof input === "string" ? input : "pipe:0";
|
|
119
116
|
const ffmpeg = spawn(resolveFfmpegBin(), [
|
|
@@ -129,7 +126,7 @@ function createDiscordOpusPlaybackStream(input) {
|
|
|
129
126
|
],
|
|
130
127
|
windowsHide: true
|
|
131
128
|
});
|
|
132
|
-
const opusStream =
|
|
129
|
+
const opusStream = new DiscordOpusEncodeStream();
|
|
133
130
|
const stderr = Buffer.alloc(FFMPEG_ERROR_OUTPUT_BYTES);
|
|
134
131
|
let stderrBytes = 0;
|
|
135
132
|
let ffmpegClosed = false;
|
|
@@ -423,13 +420,6 @@ const DECRYPT_FAILURE_MARKER = "DecryptionFailed(";
|
|
|
423
420
|
const DAVE_PASSTHROUGH_DISABLED_MARKER = "UnencryptedWhenPassthroughDisabled";
|
|
424
421
|
const WASM_MEMORY_ACCESS_MARKER = "memory access out of bounds";
|
|
425
422
|
const OPUS_INVALID_PACKET_CODE = -4;
|
|
426
|
-
function createVoiceReceiveRecoveryState() {
|
|
427
|
-
return {
|
|
428
|
-
decryptFailureCount: 0,
|
|
429
|
-
lastDecryptFailureAt: 0,
|
|
430
|
-
decryptRecoveryInFlight: false
|
|
431
|
-
};
|
|
432
|
-
}
|
|
433
423
|
function isAbortLikeReceiveError(err) {
|
|
434
424
|
if (!err || typeof err !== "object") return false;
|
|
435
425
|
const name = "name" in err && typeof err.name === "string" ? err.name : "";
|
|
@@ -508,4 +498,4 @@ function enableDaveReceivePassthrough(params) {
|
|
|
508
498
|
}
|
|
509
499
|
}
|
|
510
500
|
//#endregion
|
|
511
|
-
export {
|
|
501
|
+
export { restoreDiscordAudioError as _, recoverDaveZeroTransition as a, setDiscordAudioOutputStatus as b, createDiscordOpusPlaybackStream as c, decodeOpusStreamChunks as d, writeVoiceWavFile as f, releaseDiscordAudioInput as g, getDiscordAudioOutputStatus as h, noteVoiceDecryptFailure as i, createDiscordPcmToRealtimeConverter as l, admitDiscordAudioInput as m, analyzeVoiceReceiveError as n, resetVoiceReceiveRecoveryState as o, DiscordAudioOutputStatus as p, enableDaveReceivePassthrough as r, DiscordOpusEncodeStream as s, DECRYPT_FAILURE_WINDOW_MS as t, createRealtimePcmToDiscordConverter as u, retireDiscordAudioOutput as v, serializeDiscordAudioError as y };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { h as normalizeDiscordToken } from "./accounts-ljrzXBJi.mjs";
|
|
2
|
+
import { o as normalizeDiscordSlug } from "./allow-list-B_ToXtew.mjs";
|
|
3
|
+
import { r as fetchDiscord } from "./api-CtmE1OUN.mjs";
|
|
4
|
+
//#region extensions/discord/src/guilds.ts
|
|
5
|
+
async function listGuilds(token, fetcher, options) {
|
|
6
|
+
return (await fetchDiscord("/users/@me/guilds", token, fetcher, options)).flatMap((guild) => typeof guild.id === "string" && typeof guild.name === "string" ? [{
|
|
7
|
+
id: guild.id,
|
|
8
|
+
name: guild.name,
|
|
9
|
+
slug: normalizeDiscordSlug(guild.name)
|
|
10
|
+
}] : []);
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region extensions/discord/src/resolve-allowlist-common.ts
|
|
14
|
+
function resolveDiscordAllowlistToken(token) {
|
|
15
|
+
return normalizeDiscordToken(token, "channels.discord.token");
|
|
16
|
+
}
|
|
17
|
+
function filterDiscordGuilds(guilds, params) {
|
|
18
|
+
if (params.guildId) return guilds.filter((guild) => guild.id === params.guildId);
|
|
19
|
+
if (params.guildName) {
|
|
20
|
+
const slug = normalizeDiscordSlug(params.guildName);
|
|
21
|
+
const match = slug ? guilds.find((guild) => guild.slug === slug) : void 0;
|
|
22
|
+
return match ? [match] : [];
|
|
23
|
+
}
|
|
24
|
+
return guilds;
|
|
25
|
+
}
|
|
26
|
+
function parseDiscordAllowlistInput(raw, kind) {
|
|
27
|
+
const trimmed = raw.trim();
|
|
28
|
+
if (!trimmed) return {};
|
|
29
|
+
const mention = trimmed.match(kind === "channel" ? /^<#(\d+)>$/ : /^<@!?(\d+)>$/);
|
|
30
|
+
if (mention) return { id: mention[1] };
|
|
31
|
+
const prefixed = trimmed.match(kind === "channel" ? /^(?:channel:|discord:)?(\d+)$/i : /^(?:user:|discord:)?(\d+)$/i);
|
|
32
|
+
if (prefixed) return { id: prefixed[1] };
|
|
33
|
+
if (kind === "channel") {
|
|
34
|
+
const guildPrefix = trimmed.match(/^(?:guild:|server:)?(\d+)$/i);
|
|
35
|
+
if (guildPrefix) return {
|
|
36
|
+
guildId: guildPrefix[1],
|
|
37
|
+
guildOnly: true
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
const split = trimmed.includes("/") ? trimmed.split("/") : trimmed.split("#");
|
|
41
|
+
if (split.length >= 2) {
|
|
42
|
+
const guild = split[0]?.trim();
|
|
43
|
+
const name = split.slice(1).join("#").trim();
|
|
44
|
+
if (kind === "channel" && !name) return guild ? {
|
|
45
|
+
guild,
|
|
46
|
+
guildOnly: true
|
|
47
|
+
} : {};
|
|
48
|
+
if (guild && /^\d+$/.test(guild)) return kind === "channel" && /^\d+$/.test(name) ? {
|
|
49
|
+
guildId: guild,
|
|
50
|
+
id: name
|
|
51
|
+
} : {
|
|
52
|
+
guildId: guild,
|
|
53
|
+
name
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
guild,
|
|
57
|
+
name
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return kind === "channel" ? {
|
|
61
|
+
guild: trimmed,
|
|
62
|
+
guildOnly: true
|
|
63
|
+
} : { name: trimmed.replace(/^@/, "") };
|
|
64
|
+
}
|
|
65
|
+
//#endregion
|
|
66
|
+
export { listGuilds as i, parseDiscordAllowlistInput as n, resolveDiscordAllowlistToken as r, filterDiscordGuilds as t };
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-B4FMCO8f.mjs";
|
|
2
|
+
import { A as isDiscordThreadChannelType, o as normalizeDiscordSlug } from "./allow-list-B_ToXtew.mjs";
|
|
3
|
+
import { n as DiscordApiError, r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-CtmE1OUN.mjs";
|
|
4
|
+
import { i as listGuilds, n as parseDiscordAllowlistInput, r as resolveDiscordAllowlistToken, t as filterDiscordGuilds } from "./resolve-allowlist-common-DNSsUQRF.mjs";
|
|
5
|
+
//#region extensions/discord/src/resolve-channels.ts
|
|
6
|
+
var resolve_channels_exports = /* @__PURE__ */ __exportAll({ resolveDiscordChannelAllowlist: () => resolveDiscordChannelAllowlist });
|
|
7
|
+
async function listGuildChannels(token, fetcher, guildId) {
|
|
8
|
+
return (await fetchDiscord(`/guilds/${guildId}/channels`, token, fetcher, { timeoutMs: DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS })).map((channel) => {
|
|
9
|
+
const archived = channel.thread_metadata?.archived;
|
|
10
|
+
return {
|
|
11
|
+
id: typeof channel.id === "string" ? channel.id : "",
|
|
12
|
+
name: typeof channel.name === "string" ? channel.name : "",
|
|
13
|
+
guildId,
|
|
14
|
+
type: channel.type,
|
|
15
|
+
archived
|
|
16
|
+
};
|
|
17
|
+
}).filter((channel) => Boolean(channel.id) && Boolean(channel.name));
|
|
18
|
+
}
|
|
19
|
+
async function fetchChannel(token, fetcher, channelId) {
|
|
20
|
+
let raw;
|
|
21
|
+
try {
|
|
22
|
+
raw = await fetchDiscord(`/channels/${channelId}`, token, fetcher, { timeoutMs: DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS });
|
|
23
|
+
} catch (err) {
|
|
24
|
+
if (err instanceof DiscordApiError && err.status === 403) return { status: "forbidden" };
|
|
25
|
+
if (err instanceof DiscordApiError && err.status === 404) return { status: "not-found" };
|
|
26
|
+
throw err;
|
|
27
|
+
}
|
|
28
|
+
if (!raw || typeof raw.guild_id !== "string" || typeof raw.id !== "string") return { status: "invalid" };
|
|
29
|
+
return {
|
|
30
|
+
status: "found",
|
|
31
|
+
channel: {
|
|
32
|
+
id: raw.id,
|
|
33
|
+
name: typeof raw.name === "string" ? raw.name : "",
|
|
34
|
+
guildId: raw.guild_id,
|
|
35
|
+
type: raw.type
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function preferActiveMatch(candidates) {
|
|
40
|
+
const scored = candidates.map((channel) => {
|
|
41
|
+
const isThread = isDiscordThreadChannelType(channel.type);
|
|
42
|
+
return {
|
|
43
|
+
channel,
|
|
44
|
+
score: (Boolean(channel.archived) ? 0 : 2) + (isThread ? 0 : 1)
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
scored.sort((a, b) => b.score - a.score);
|
|
48
|
+
return scored[0]?.channel ?? candidates[0];
|
|
49
|
+
}
|
|
50
|
+
function resolvedChannelResult(input, channel, guildName) {
|
|
51
|
+
return {
|
|
52
|
+
input,
|
|
53
|
+
resolved: true,
|
|
54
|
+
guildId: channel.guildId,
|
|
55
|
+
guildName,
|
|
56
|
+
channelId: channel.id,
|
|
57
|
+
channelName: channel.name,
|
|
58
|
+
archived: channel.archived
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
async function resolveDiscordChannelAllowlist(params) {
|
|
62
|
+
const token = resolveDiscordAllowlistToken(params.token);
|
|
63
|
+
if (!token) return params.entries.map((input) => ({
|
|
64
|
+
input,
|
|
65
|
+
resolved: false
|
|
66
|
+
}));
|
|
67
|
+
const fetcher = params.fetcher ?? fetch;
|
|
68
|
+
const guilds = await listGuilds(token, fetcher, { timeoutMs: DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS });
|
|
69
|
+
const channelsByGuild = /* @__PURE__ */ new Map();
|
|
70
|
+
const getChannels = (guildId) => {
|
|
71
|
+
const existing = channelsByGuild.get(guildId);
|
|
72
|
+
if (existing) return existing;
|
|
73
|
+
const promise = listGuildChannels(token, fetcher, guildId);
|
|
74
|
+
channelsByGuild.set(guildId, promise);
|
|
75
|
+
return promise;
|
|
76
|
+
};
|
|
77
|
+
async function matchingChannels(guildId, query, matchId = false) {
|
|
78
|
+
const channels = await getChannels(guildId);
|
|
79
|
+
if (matchId && /^\d+$/.test(query)) {
|
|
80
|
+
const ids = channels.filter((channel) => channel.id === query);
|
|
81
|
+
if (ids.length) return ids;
|
|
82
|
+
}
|
|
83
|
+
const slug = normalizeDiscordSlug(query);
|
|
84
|
+
return channels.filter((channel) => normalizeDiscordSlug(channel.name) === slug);
|
|
85
|
+
}
|
|
86
|
+
const resolveEntry = async (input) => {
|
|
87
|
+
const parsed = parseDiscordAllowlistInput(input, "channel");
|
|
88
|
+
const unresolved = {
|
|
89
|
+
input,
|
|
90
|
+
resolved: false
|
|
91
|
+
};
|
|
92
|
+
if (parsed.guildOnly) {
|
|
93
|
+
const guild = filterDiscordGuilds(guilds, {
|
|
94
|
+
guildId: parsed.guildId,
|
|
95
|
+
guildName: parsed.guild
|
|
96
|
+
})[0];
|
|
97
|
+
return {
|
|
98
|
+
input,
|
|
99
|
+
resolved: Boolean(guild),
|
|
100
|
+
guildId: guild ? guild.id : parsed.guildId,
|
|
101
|
+
guildName: guild ? guild.name : parsed.guild
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
if (parsed.id) {
|
|
105
|
+
const channelId = parsed.id;
|
|
106
|
+
const result = await fetchChannel(token, fetcher, channelId);
|
|
107
|
+
if (result.status === "found") {
|
|
108
|
+
const channel = result.channel;
|
|
109
|
+
const guild = guilds.find((entry) => entry.id === channel.guildId);
|
|
110
|
+
if (parsed.guildId && parsed.guildId !== channel.guildId) return {
|
|
111
|
+
...unresolved,
|
|
112
|
+
guildId: parsed.guildId,
|
|
113
|
+
guildName: guilds.find((entry) => entry.id === parsed.guildId)?.name,
|
|
114
|
+
channelId,
|
|
115
|
+
channelName: channel.name,
|
|
116
|
+
note: guild?.name ? `channel belongs to guild ${guild.name}` : "channel belongs to a different guild"
|
|
117
|
+
};
|
|
118
|
+
return resolvedChannelResult(input, channel, guild?.name);
|
|
119
|
+
}
|
|
120
|
+
if (result.status === "not-found" && parsed.guildId) {
|
|
121
|
+
const guild = guilds.find((entry) => entry.id === parsed.guildId);
|
|
122
|
+
const match = guild && preferActiveMatch(await matchingChannels(guild.id, channelId));
|
|
123
|
+
if (match) return resolvedChannelResult(input, match, guild?.name);
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
...unresolved,
|
|
127
|
+
guildId: parsed.guildId,
|
|
128
|
+
channelId
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
const guildScoped = Boolean(parsed.guildId || parsed.guild);
|
|
132
|
+
const guild = guildScoped ? filterDiscordGuilds(guilds, {
|
|
133
|
+
guildId: parsed.guildId,
|
|
134
|
+
guildName: parsed.guild
|
|
135
|
+
})[0] : void 0;
|
|
136
|
+
const channelName = guildScoped ? parsed.name?.trim() : input.trim().replace(/^#/, "");
|
|
137
|
+
if (guildScoped && (!guild || !channelName)) return {
|
|
138
|
+
...unresolved,
|
|
139
|
+
guildId: parsed.guildId,
|
|
140
|
+
guildName: parsed.guild,
|
|
141
|
+
channelName: channelName ?? parsed.name
|
|
142
|
+
};
|
|
143
|
+
if (!channelName) return {
|
|
144
|
+
...unresolved,
|
|
145
|
+
channelName
|
|
146
|
+
};
|
|
147
|
+
let candidates = [];
|
|
148
|
+
for (const candidateGuild of guild ? [guild] : guilds) candidates = candidates.concat(await matchingChannels(candidateGuild.id, channelName, guildScoped));
|
|
149
|
+
const match = preferActiveMatch(candidates);
|
|
150
|
+
if (match) {
|
|
151
|
+
const matchedGuild = guild ?? guilds.find((entry) => entry.id === match.guildId);
|
|
152
|
+
return {
|
|
153
|
+
...resolvedChannelResult(input, match, matchedGuild?.name),
|
|
154
|
+
...!guildScoped ? { note: candidates.length > 1 && matchedGuild?.name ? `matched multiple; chose ${matchedGuild.name}` : void 0 } : {}
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
return guild ? {
|
|
158
|
+
...unresolved,
|
|
159
|
+
guildId: guild.id,
|
|
160
|
+
guildName: guild.name,
|
|
161
|
+
channelName: parsed.name,
|
|
162
|
+
note: `channel not found in guild ${guild.name}`
|
|
163
|
+
} : {
|
|
164
|
+
...unresolved,
|
|
165
|
+
channelName
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
const results = [];
|
|
169
|
+
for (const input of params.entries) results.push(await resolveEntry(input));
|
|
170
|
+
return results;
|
|
171
|
+
}
|
|
172
|
+
//#endregion
|
|
173
|
+
export { resolve_channels_exports as n, resolveDiscordChannelAllowlist as t };
|