@openclaw/discord 2026.9.1-beta.1 → 2026.9.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-BY-ve3yH.js +45 -0
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-CfQ-vSyf.js → accounts-CwJQoLjM.js} +89 -45
- package/dist/action-runtime-api.js +1 -1
- package/dist/{activities-api-q-9PaaHH.js → activities-api-E-segZn6.js} +30 -17
- package/dist/activities-api.js +1 -1
- package/dist/{allow-list-BDMimASD.js → allow-list-C2JuH-R0.js} +10 -6
- package/dist/{api-DNVbJyEy.js → api-BfmEP6wp.js} +6 -5
- package/dist/api.js +18 -18
- package/dist/{approval-handler.runtime-B7qhK3fR.js → approval-handler.runtime-CW5k3mSa.js} +19 -12
- package/dist/{audit-CBEv_ERu.js → audit-B9rydv5a.js} +8 -7
- package/dist/{channel-Dx1tMTfx.js → channel-D93LnbTE.js} +29 -23
- package/dist/{channel-actions.runtime-CLWWu9nC.js → channel-actions.runtime-DMFv4doE.js} +16 -13
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-DOzXS2Pk.js → channel.setup-DTL7kPOM.js} +18 -18
- package/dist/{components-B9V5o361.js → components-DmXYIQ26.js} +111 -149
- package/dist/{config-schema-BR13IAx6.js → config-schema-B797-Spt.js} +19 -12
- package/dist/{conversation-binding-route-DJYrY2TQ.js → conversation-binding-route-24afmvEC.js} +1 -1
- package/dist/{directory-config-BK6eqekJ.js → directory-config-BD4YL7wT.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-DSAJSrJk.js → directory-live-BrFVc1Ds.js} +4 -4
- package/dist/{doctor-Cm7Y1pJ2.js → doctor-BUB41_lr.js} +5 -5
- package/dist/{doctor-contract-DsWvKIXF.js → doctor-contract-Co5vRCZ6.js} +9 -6
- package/dist/doctor-contract-api.js +3 -2
- package/dist/{handle-action.guild-admin-BdwCRHmm.js → handle-action.guild-admin-B0egstYq.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/ingress-identity-BCzfPPYM.js +60 -0
- package/dist/{message-handler-BXpWZyni.js → message-handler-Qdw9c0j4.js} +14 -10
- package/dist/{message-handler.preflight-Ba5LAY_X.js → message-handler.preflight-Dxi2yBfR.js} +41 -101
- package/dist/{message-handler.process-3HEzmemS.js → message-handler.process-BYDjtxZJ.js} +83 -109
- package/dist/{message-text-aiwO5R2F.js → message-text-BRVqYm-t.js} +11 -6
- package/dist/{outbound-adapter-BE4jSq2d.js → outbound-adapter-DEhthWTk.js} +52 -67
- package/dist/{outbound-components-oLpg8Qzb.js → outbound-components-DehyxvA4.js} +5 -4
- package/dist/{outbound-session-route-Cg15ZFJd.js → outbound-session-route-BFGRF9fE.js} +55 -12
- package/dist/{owner-access-UlYi9t0M.js → owner-access-yc1sX7Gx.js} +7 -6
- package/dist/{pluralkit-Tiyl70dx.js → pluralkit-XmmAHoV6.js} +2 -2
- package/dist/{probe-n6ZXxK8V.js → probe-3ovFAp3b.js} +3 -3
- package/dist/{probe.runtime-CN4bdPfZ.js → probe.runtime-BckHn3cJ.js} +1 -1
- package/dist/{provider-B11xwilq.js → provider-DuDtKbF8.js} +294 -131
- package/dist/{provider-session.runtime-B9xe-Qaf.js → provider-session.runtime-BA2BPyZ4.js} +3 -3
- package/dist/provider.runtime-Db8YwZBv.js +2 -0
- package/dist/{realtime-session.runtime-CU8IQUS-.js → realtime-session.runtime-DgSbX6ay.js} +103 -163
- package/dist/{resolve-allowlist-common-BLoYaxEG.js → resolve-allowlist-common-BJ5UZNNT.js} +3 -3
- package/dist/{resolve-channels-C2sT_n67.js → resolve-channels-CYseD5Uw.js} +4 -4
- package/dist/{resolve-users-CzpjLwjy.js → resolve-users-DrmhDrqm.js} +5 -4
- package/dist/{retry-Cv4jCU5Z.js → retry-BNCxiyyR.js} +120 -32
- package/dist/{retry-after-DdLPmPoa.js → retry-after-BrLjLUJi.js} +2 -1
- package/dist/{runtime-BHrTlFkf.js → runtime-BbWNtfyq.js} +127 -93
- package/dist/{runtime-CY4PRMF-.js → runtime-DB7Fb6AU.js} +2 -2
- package/dist/runtime-api.js +19 -19
- package/dist/{secret-config-contract-B3i6WxV5.js → secret-config-contract-DFu9hfU8.js} +14 -6
- package/dist/secret-contract-api.js +1 -1
- package/dist/{security-audit-BfJhAXZp.js → security-audit-DKfK-iPY.js} +10 -11
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/{security-audit.runtime-BVKF9VtY.js → security-audit.runtime-sKZyKgpx.js} +1 -1
- package/dist/{send-C49MFF9j.js → send-BnTEIeLE.js} +132 -100
- package/dist/{send.components-DKKAw5VX.js → send.components-BWVEcjRP.js} +21 -15
- package/dist/{send.outbound-zam0TrZx.js → send.outbound-b5xwHTlL.js} +35 -22
- package/dist/{send.shared-JjljcV4O.js → send.shared-5vxBTagO.js} +25 -18
- package/dist/{sender-identity-BJtfyise.js → sender-identity-Dt0imZyY.js} +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-_5EcP4jW.js → shared-BSJWHEMA.js} +20 -14
- package/dist/{subagent-hooks-DQzvOptn.js → subagent-hooks-IzQKX4RQ.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{system-events-C7yxaHWP.js → system-events-BOiDS8b3.js} +2 -2
- package/dist/{target-resolver-vxIh6O3-.js → target-resolver-BVI8xSSC.js} +6 -5
- package/dist/targets-DbxVbq8k.js +3 -0
- package/dist/{thread-bindings-DW5F9vat.js → thread-bindings-D7mcaXQC.js} +6 -5
- package/dist/{thread-bindings.manager-ByOtwjo_.js → thread-bindings.manager-B1oySiVc.js} +37 -28
- package/dist/{thread-bindings.session-updates-CJb-BpPL.js → thread-bindings.session-updates-CC7HoQvt.js} +2 -1
- package/dist/{threading-agH1T_6s.js → threading-OQnL-0Zx.js} +8 -6
- package/dist/{timeouts-B9cy6RvQ.js → timeouts-D86uWLt_.js} +1 -1
- package/dist/{transcripts-source-BR11iHA4.js → transcripts-source-D8lH7AkN.js} +9 -4
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-Dc_YMY2e.js → typing-C9q0AQMb.js} +2 -2
- package/dist/{voice-runtime-DIeaa8fJ.js → voice-runtime-Dfhjh1tV.js} +433 -93
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/README.md +1 -1
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/conforms.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/package.json +3 -3
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubArray.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubObject.d.ts +2 -0
- package/node_modules/@discord/embedded-app-sdk/node_modules/@types/lodash/stubString.d.ts +2 -0
- package/node_modules/typebox/build/format/email.mjs +1 -1
- package/node_modules/typebox/build/format/idna/idn-hostname.mjs +19 -1
- package/node_modules/typebox/package.json +1 -1
- package/openclaw.plugin.json +14 -6
- package/package.json +6 -5
- package/skills/discord/SKILL.md +1 -1
- package/dist/account-inspect-BDfKyuvL.js +0 -89
- package/dist/provider.runtime-DiYaHvOz.js +0 -2
- package/dist/sdk-runtime-4geQHtXc.js +0 -338
- package/dist/targets-CtTKvntJ.js +0 -3
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { P as createDiscordRestClient } from "./send.shared-
|
|
3
|
-
import { t as sendMessageDiscord } from "./send.outbound-
|
|
1
|
+
import { jt as getChannel, sn as __exportAll, t as canFallbackDiscordWebhookSend, y as resolveDiscordChannelId, yt as createChannelWebhook } from "./retry-BNCxiyyR.js";
|
|
2
|
+
import { P as createDiscordRestClient } from "./send.shared-5vxBTagO.js";
|
|
3
|
+
import { t as sendMessageDiscord } from "./send.outbound-b5xwHTlL.js";
|
|
4
4
|
import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.js";
|
|
5
|
-
import { c as sendWebhookMessageDiscord, u as createThreadDiscord } from "./send-
|
|
5
|
+
import { c as sendWebhookMessageDiscord, u as createThreadDiscord } from "./send-BnTEIeLE.js";
|
|
6
6
|
import { A as toReusableWebhookKey, C as resolveThreadBindingMaxAgeExpiresAt, D as shouldDefaultPersist, E as setBindingRecord, S as resolveThreadBindingInactivityExpiresAt, T as saveBindingsToDisk, _ as rememberThreadBindingToken, b as resolveBindingRecordKey, c as ensureBindingsLoaded, f as normalizeTargetKind, g as rememberReusableWebhook, h as refreshUnboundThreadWebhookIdentity, i as REUSABLE_WEBHOOKS_BY_ACCOUNT_CHANNEL, l as forgetThreadBindingToken, m as normalizeThreadId, n as MANAGERS_BY_ACCOUNT_ID, p as normalizeThreadBindingDurationMs, r as PERSIST_BY_ACCOUNT_ID, s as THREAD_BINDING_TOUCH_PERSIST_MIN_INTERVAL_MS, t as BINDINGS_BY_THREAD_ID, u as getThreadBindingToken, v as removeBindingRecord, w as resolveThreadBindingMaxAgeMs$1, x as resolveThreadBindingIdleTimeoutMs$1, y as resolveBindingIdsForSession } from "./thread-bindings.state-D8OMdk4O.js";
|
|
7
7
|
import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
8
8
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
9
9
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
10
|
import { getRuntimeConfigSnapshot } from "openclaw/plugin-sdk/runtime-config-snapshot";
|
|
11
|
-
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
11
|
+
import { createSubsystemLogger, logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
12
12
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
13
13
|
import { SYSTEM_MARK } from "openclaw/plugin-sdk/text-chunking";
|
|
14
14
|
import { formatThreadBindingDurationLabel, registerSessionBindingAdapter, resolveThreadBindingConversationIdFromBindingId, resolveThreadBindingFarewellText, resolveThreadBindingIntroText, resolveThreadBindingThreadName, unregisterSessionBindingAdapter } from "openclaw/plugin-sdk/conversation-runtime";
|
|
15
|
-
import {
|
|
15
|
+
import { resolveSessionAgentIdStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
16
16
|
//#region extensions/discord/src/monitor/thread-bindings.persona.ts
|
|
17
17
|
const THREAD_BINDING_PERSONA_MAX_CHARS = 80;
|
|
18
18
|
function normalizePersonaLabel(value) {
|
|
@@ -20,7 +20,8 @@ function normalizePersonaLabel(value) {
|
|
|
20
20
|
return value.replace(/\s+/g, " ").trim() || void 0;
|
|
21
21
|
}
|
|
22
22
|
function resolveThreadBindingPersona(params) {
|
|
23
|
-
|
|
23
|
+
const base = normalizePersonaLabel(params.label) || normalizePersonaLabel(params.agentId) || "agent";
|
|
24
|
+
return truncateUtf16Safe(`${SYSTEM_MARK} ${base}`, THREAD_BINDING_PERSONA_MAX_CHARS);
|
|
24
25
|
}
|
|
25
26
|
function resolveThreadBindingPersonaFromRecord(record) {
|
|
26
27
|
return resolveThreadBindingPersona({
|
|
@@ -92,9 +93,10 @@ function resolveDiscordChannelInfoSafe(channel) {
|
|
|
92
93
|
//#endregion
|
|
93
94
|
//#region extensions/discord/src/monitor/thread-bindings.types.ts
|
|
94
95
|
const THREAD_BINDINGS_SWEEP_INTERVAL_MS = 12e4;
|
|
95
|
-
const DEFAULT_THREAD_BINDING_IDLE_TIMEOUT_MS =
|
|
96
|
+
const DEFAULT_THREAD_BINDING_IDLE_TIMEOUT_MS = 864e5;
|
|
96
97
|
//#endregion
|
|
97
98
|
//#region extensions/discord/src/monitor/thread-bindings.discord-api.ts
|
|
99
|
+
const log = createSubsystemLogger("discord/thread-bindings");
|
|
98
100
|
function buildThreadTarget(threadId) {
|
|
99
101
|
return /^(channel:|user:)/i.test(threadId) ? threadId : `channel:${threadId}`;
|
|
100
102
|
}
|
|
@@ -154,7 +156,12 @@ async function maybeSendBindingMessage(params) {
|
|
|
154
156
|
});
|
|
155
157
|
return;
|
|
156
158
|
} catch (err) {
|
|
157
|
-
|
|
159
|
+
const fallbackToBot = canFallbackDiscordWebhookSend(err);
|
|
160
|
+
log.warn("discord thread binding webhook send failed", {
|
|
161
|
+
error: summarizeDiscordError(err),
|
|
162
|
+
fallbackToBot
|
|
163
|
+
});
|
|
164
|
+
if (!fallbackToBot) return;
|
|
158
165
|
}
|
|
159
166
|
try {
|
|
160
167
|
await sendMessageDiscord(buildThreadTarget(record.threadId), text, {
|
|
@@ -232,11 +239,12 @@ async function resolveChannelIdForBinding(params) {
|
|
|
232
239
|
}
|
|
233
240
|
async function createThreadForBinding(params) {
|
|
234
241
|
try {
|
|
235
|
-
|
|
242
|
+
const created = await createThreadDiscord(params.channelId, { name: params.threadName }, {
|
|
236
243
|
cfg: params.cfg,
|
|
237
244
|
accountId: params.accountId,
|
|
238
245
|
token: params.token
|
|
239
|
-
})
|
|
246
|
+
});
|
|
247
|
+
return (normalizeOptionalString(created?.id) ?? "") || null;
|
|
240
248
|
} catch (err) {
|
|
241
249
|
logVerbose(`discord thread binding auto-thread create failed for ${params.channelId}: ${summarizeDiscordError(err)}`);
|
|
242
250
|
return null;
|
|
@@ -400,12 +408,6 @@ var thread_bindings_manager_exports = /* @__PURE__ */ __exportAll({
|
|
|
400
408
|
createThreadBindingManager: () => createThreadBindingManager,
|
|
401
409
|
getThreadBindingManager: () => getThreadBindingManager
|
|
402
410
|
});
|
|
403
|
-
function registerManager(manager) {
|
|
404
|
-
MANAGERS_BY_ACCOUNT_ID.set(manager.accountId, manager);
|
|
405
|
-
}
|
|
406
|
-
function unregisterManager(accountId, manager) {
|
|
407
|
-
if (MANAGERS_BY_ACCOUNT_ID.get(accountId) === manager) MANAGERS_BY_ACCOUNT_ID.delete(accountId);
|
|
408
|
-
}
|
|
409
411
|
function createNoopManager(accountIdRaw) {
|
|
410
412
|
return {
|
|
411
413
|
accountId: normalizeAccountId(accountIdRaw),
|
|
@@ -447,13 +449,14 @@ function createThreadBindingManager(params) {
|
|
|
447
449
|
const maxAgeMs = normalizeThreadBindingDurationMs(params.maxAgeMs, 0);
|
|
448
450
|
const resolveCurrentCfg = () => getRuntimeConfigSnapshot() ?? params.cfg;
|
|
449
451
|
const resolveCurrentToken = () => getThreadBindingToken(accountId) ?? params.token;
|
|
452
|
+
const getCurrentBinding = (threadId) => MANAGERS_BY_ACCOUNT_ID.get(accountId) === manager ? manager.getByThreadId(threadId) : void 0;
|
|
450
453
|
let sweepTimer = null;
|
|
451
454
|
const runSweepOnce = async () => {
|
|
452
455
|
const bindings = manager.listBindings();
|
|
453
456
|
if (bindings.length === 0) return;
|
|
454
457
|
let rest = null;
|
|
455
458
|
for (const snapshotBinding of bindings) {
|
|
456
|
-
const binding =
|
|
459
|
+
const binding = getCurrentBinding(snapshotBinding.threadId);
|
|
457
460
|
if (!binding) continue;
|
|
458
461
|
const now = Date.now();
|
|
459
462
|
const inactivityExpiresAt = resolveThreadBindingInactivityExpiresAt({
|
|
@@ -496,8 +499,9 @@ function createThreadBindingManager(params) {
|
|
|
496
499
|
}
|
|
497
500
|
if (isDirectConversationBindingId(binding.threadId)) continue;
|
|
498
501
|
if (!rest) try {
|
|
502
|
+
const cfg = resolveCurrentCfg();
|
|
499
503
|
rest = createDiscordRestClient({
|
|
500
|
-
cfg
|
|
504
|
+
cfg,
|
|
501
505
|
accountId,
|
|
502
506
|
token: resolveCurrentToken()
|
|
503
507
|
}).rest;
|
|
@@ -506,6 +510,7 @@ function createThreadBindingManager(params) {
|
|
|
506
510
|
}
|
|
507
511
|
try {
|
|
508
512
|
const channel = await getChannel(rest, binding.threadId);
|
|
513
|
+
if (getCurrentBinding(binding.threadId) !== binding) continue;
|
|
509
514
|
if (!channel || typeof channel !== "object") {
|
|
510
515
|
logVerbose(`discord thread binding sweep probe returned invalid payload for ${binding.threadId}`);
|
|
511
516
|
continue;
|
|
@@ -516,6 +521,7 @@ function createThreadBindingManager(params) {
|
|
|
516
521
|
sendFarewell: true
|
|
517
522
|
});
|
|
518
523
|
} catch (err) {
|
|
524
|
+
if (getCurrentBinding(binding.threadId) !== binding) continue;
|
|
519
525
|
if (isDiscordThreadGoneError(err)) {
|
|
520
526
|
logVerbose(`discord thread binding sweep removing stale binding ${binding.threadId}: ${summarizeDiscordError(err)}`);
|
|
521
527
|
manager.unbindThread({
|
|
@@ -604,6 +610,7 @@ function createThreadBindingManager(params) {
|
|
|
604
610
|
const targetSessionKey = normalizeOptionalString(bindParams.targetSessionKey) ?? "";
|
|
605
611
|
if (!targetSessionKey) return null;
|
|
606
612
|
const targetKind = normalizeTargetKind(bindParams.targetKind, targetSessionKey);
|
|
613
|
+
const previous = existingValue?.targetSessionKey === targetSessionKey && existingValue.targetKind === targetKind ? existingValue : void 0;
|
|
607
614
|
let webhookId = normalizeOptionalString(bindParams.webhookId) ?? normalizeOptionalString(existingValue?.webhookId) ?? "";
|
|
608
615
|
let webhookToken = normalizeOptionalString(bindParams.webhookToken) ?? normalizeOptionalString(existingValue?.webhookToken) ?? "";
|
|
609
616
|
if (!directConversationBinding && (!webhookId || !webhookToken)) {
|
|
@@ -631,22 +638,22 @@ function createThreadBindingManager(params) {
|
|
|
631
638
|
threadId,
|
|
632
639
|
targetKind,
|
|
633
640
|
targetSessionKey,
|
|
634
|
-
agentId: normalizeOptionalString(bindParams.agentId) ?? normalizeOptionalString(
|
|
641
|
+
agentId: normalizeOptionalString(bindParams.agentId) ?? normalizeOptionalString(previous?.agentId) ?? resolveSessionAgentIdStrict({
|
|
635
642
|
config: cfg,
|
|
636
643
|
sessionKey: targetSessionKey
|
|
637
644
|
}),
|
|
638
|
-
label: normalizeOptionalString(bindParams.label) ?? normalizeOptionalString(
|
|
645
|
+
label: normalizeOptionalString(bindParams.label) ?? normalizeOptionalString(previous?.label),
|
|
639
646
|
webhookId: webhookId || void 0,
|
|
640
647
|
webhookToken: webhookToken || void 0,
|
|
641
|
-
boundBy: normalizeOptionalString(bindParams.boundBy) ?? normalizeOptionalString(
|
|
648
|
+
boundBy: normalizeOptionalString(bindParams.boundBy) ?? normalizeOptionalString(previous?.boundBy) ?? "system",
|
|
642
649
|
boundAt: now,
|
|
643
650
|
lastActivityAt: now,
|
|
644
651
|
idleTimeoutMs: typeof existingValue?.idleTimeoutMs === "number" ? existingValue.idleTimeoutMs : idleTimeoutMs,
|
|
645
652
|
maxAgeMs: typeof existingValue?.maxAgeMs === "number" ? existingValue.maxAgeMs : maxAgeMs,
|
|
646
|
-
metadata:
|
|
647
|
-
...
|
|
653
|
+
metadata: {
|
|
654
|
+
...previous?.metadata,
|
|
648
655
|
...bindParams.metadata
|
|
649
|
-
}
|
|
656
|
+
}
|
|
650
657
|
};
|
|
651
658
|
setBindingRecord(record);
|
|
652
659
|
if (persist) saveBindingsToDisk();
|
|
@@ -719,13 +726,15 @@ function createThreadBindingManager(params) {
|
|
|
719
726
|
clearInterval(sweepTimer);
|
|
720
727
|
sweepTimer = null;
|
|
721
728
|
}
|
|
722
|
-
|
|
729
|
+
if (MANAGERS_BY_ACCOUNT_ID.get(accountId) === manager) {
|
|
730
|
+
MANAGERS_BY_ACCOUNT_ID.delete(accountId);
|
|
731
|
+
forgetThreadBindingToken(accountId);
|
|
732
|
+
}
|
|
723
733
|
unregisterSessionBindingAdapter({
|
|
724
734
|
channel: "discord",
|
|
725
735
|
accountId,
|
|
726
736
|
adapter: sessionBindingAdapter
|
|
727
737
|
});
|
|
728
|
-
forgetThreadBindingToken(accountId);
|
|
729
738
|
}
|
|
730
739
|
};
|
|
731
740
|
if (params.enableSweeper !== false) {
|
|
@@ -745,7 +754,7 @@ function createThreadBindingManager(params) {
|
|
|
745
754
|
resolveCurrentToken
|
|
746
755
|
});
|
|
747
756
|
registerSessionBindingAdapter(sessionBindingAdapter);
|
|
748
|
-
|
|
757
|
+
MANAGERS_BY_ACCOUNT_ID.set(accountId, manager);
|
|
749
758
|
return manager;
|
|
750
759
|
}
|
|
751
760
|
function createNoopThreadBindingManager(accountId) {
|
|
@@ -9,9 +9,10 @@ function resolveBindingIdsForTargetSession(params) {
|
|
|
9
9
|
ensureBindingsLoaded();
|
|
10
10
|
const targetSessionKey = params.targetSessionKey.trim();
|
|
11
11
|
if (!targetSessionKey) return [];
|
|
12
|
+
const accountId = params.accountId ? normalizeAccountId(params.accountId) : void 0;
|
|
12
13
|
return resolveBindingIdsForSession({
|
|
13
14
|
targetSessionKey,
|
|
14
|
-
accountId
|
|
15
|
+
accountId,
|
|
15
16
|
targetKind: params.targetKind
|
|
16
17
|
});
|
|
17
18
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Et as createThread, I as DiscordError, Mt as getChannelMessage, b as discord_exports, kt as editChannel, sn as __exportAll } from "./retry-BNCxiyyR.js";
|
|
2
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-
|
|
4
|
-
import { a as formatDiscordMediaText,
|
|
3
|
+
import { d as resolveDiscordChannelParentSafe, l as resolveDiscordChannelNameSafe, s as resolveDiscordChannelIdSafe, u as resolveDiscordChannelParentIdSafe } from "./thread-bindings.manager-B1oySiVc.js";
|
|
4
|
+
import { a as formatDiscordMediaText, h as resolveDiscordMessageChannelId, m as resolveDiscordChannelInfo, n as resolveDiscordForwardedMessagesTextFromSnapshots, t as resolveDiscordEmbedText } from "./message-text-BRVqYm-t.js";
|
|
5
5
|
import { buildAgentSessionKey } from "openclaw/plugin-sdk/routing";
|
|
6
6
|
import { normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
@@ -100,8 +100,8 @@ function normalizeTitleContextField(raw, maxChars) {
|
|
|
100
100
|
}
|
|
101
101
|
//#endregion
|
|
102
102
|
//#region extensions/discord/src/monitor/threading.cache.ts
|
|
103
|
-
const DISCORD_THREAD_STARTER_CACHE_TTL_MS =
|
|
104
|
-
const DISCORD_THREAD_STARTER_NEGATIVE_CACHE_TTL_MS =
|
|
103
|
+
const DISCORD_THREAD_STARTER_CACHE_TTL_MS = 3e5;
|
|
104
|
+
const DISCORD_THREAD_STARTER_NEGATIVE_CACHE_TTL_MS = 3e4;
|
|
105
105
|
const DISCORD_THREAD_STARTER_CACHE_MAX = 500;
|
|
106
106
|
const DISCORD_THREAD_STARTER_CACHE = /* @__PURE__ */ new Map();
|
|
107
107
|
function getCachedThreadStarter(key, now) {
|
|
@@ -266,7 +266,9 @@ function resolveDiscordReplyTarget(opts) {
|
|
|
266
266
|
return opts.hasReplied ? void 0 : replyToId;
|
|
267
267
|
}
|
|
268
268
|
function sanitizeDiscordThreadName(rawName, fallbackId) {
|
|
269
|
-
|
|
269
|
+
const baseSource = rawName.replace(/<@!?\d+>/g, "").replace(/<@&\d+>/g, "").replace(/<#\d+>/g, "").replace(/\s+/g, " ").trim() || `Thread ${fallbackId}`;
|
|
270
|
+
const base = truncateUtf16Safe(baseSource, 80);
|
|
271
|
+
return truncateUtf16Safe(base, 100) || `Thread ${fallbackId}`;
|
|
270
272
|
}
|
|
271
273
|
function resolveDiscordReplyDeliveryPlan(params) {
|
|
272
274
|
const originalReplyTarget = params.replyTarget;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
2
2
|
//#region extensions/discord/src/monitor/timeouts.ts
|
|
3
3
|
const DISCORD_DEFAULT_LISTENER_TIMEOUT_MS = 12e4;
|
|
4
|
-
const DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS =
|
|
4
|
+
const DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS = 18e5;
|
|
5
5
|
const DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS = 6e4;
|
|
6
6
|
const DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS = 12e4;
|
|
7
7
|
/** @deprecated Discord listener timeouts are compatibility-only. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as listEnabledDiscordAccounts, c as resolveDiscordAccount } from "./accounts-
|
|
3
|
-
import { n as resolveDiscordVoiceEnabled, r as authorizeDiscordVoiceIngress, t as resolveDiscordVoiceAccess } from "./owner-access-
|
|
1
|
+
import { sn as __exportAll } from "./retry-BNCxiyyR.js";
|
|
2
|
+
import { a as listEnabledDiscordAccounts, c as resolveDiscordAccount } from "./accounts-CwJQoLjM.js";
|
|
3
|
+
import { n as resolveDiscordVoiceEnabled, r as authorizeDiscordVoiceIngress, t as resolveDiscordVoiceAccess } from "./owner-access-yc1sX7Gx.js";
|
|
4
4
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
5
5
|
import { summarizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
@@ -205,7 +205,12 @@ const discordVoiceTranscriptsSourceProvider = {
|
|
|
205
205
|
channelId
|
|
206
206
|
}, { transcripts: {
|
|
207
207
|
sessionId: request.session.sessionId,
|
|
208
|
-
onUtterance: request.onUtterance
|
|
208
|
+
onUtterance: request.onUtterance,
|
|
209
|
+
onStop: () => request.onStatus?.({
|
|
210
|
+
sessionId: request.session.sessionId,
|
|
211
|
+
active: false,
|
|
212
|
+
source: request.session.source
|
|
213
|
+
})
|
|
209
214
|
} });
|
|
210
215
|
if (!joined.ok) return {
|
|
211
216
|
ok: false,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-
|
|
1
|
+
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-D8lH7AkN.js";
|
|
2
2
|
//#region extensions/discord/transcripts-source-api.ts
|
|
3
3
|
function registerDiscordTranscriptSourceProvider(api) {
|
|
4
4
|
api.registerTranscriptSourceProvider(discordVoiceTranscriptsSourceProvider);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { c as raceWithTimeout } from "./timeouts-
|
|
1
|
+
import { sn as __exportAll, zt as sendChannelTyping } from "./retry-BNCxiyyR.js";
|
|
2
|
+
import { c as raceWithTimeout } from "./timeouts-D86uWLt_.js";
|
|
3
3
|
//#region extensions/discord/src/monitor/typing.ts
|
|
4
4
|
var typing_exports = /* @__PURE__ */ __exportAll({ sendTyping: () => sendTyping });
|
|
5
5
|
const DISCORD_TYPING_START_TIMEOUT_MS = 5e3;
|