@openclaw/discord 2026.8.1 → 2026.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account-inspect-BY-ve3yH.js +45 -0
- package/dist/account-inspect-api.js +1 -1
- package/dist/{accounts-CfQ-vSyf.js → accounts-CwJQoLjM.js} +89 -45
- package/dist/action-runtime-api.js +1 -1
- package/dist/{activities-api-Dl-TOyOX.js → activities-api-CkKcHUB6.js} +14 -13
- 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 +17 -17
- package/dist/{approval-handler.runtime-q4Zqo44V.js → approval-handler.runtime-DZM6Kt1Z.js} +8 -7
- package/dist/{audit-DgrvFPGt.js → audit-DIbQA4VT.js} +8 -7
- package/dist/{channel-BsQUalPw.js → channel-CarzU3bg.js} +24 -22
- package/dist/{channel-actions.runtime-UMGGIfSy.js → channel-actions.runtime-B2wMqeVK.js} +13 -11
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-rPs4dsk_.js → channel.setup-z_ewMVa9.js} +18 -18
- package/dist/{components-Dk35LTf_.js → components-gvRA0oaI.js} +1 -1
- package/dist/{config-schema-CxPqtVI1.js → config-schema-B797-Spt.js} +5 -4
- package/dist/{conversation-binding-route-BjvX4e35.js → conversation-binding-route-DPpBRpYI.js} +1 -1
- package/dist/{directory-config-B7DY_pNG.js → directory-config-AA8wQx0D.js} +2 -2
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-DuAXKkan.js → directory-live-D_kFz_Fj.js} +4 -4
- package/dist/{doctor-zQTtn6hm.js → doctor-QQTOkBfW.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-DZewwLr1.js → handle-action.guild-admin-Cc88ZGon.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{ingress-identity-CzZKcPK8.js → ingress-identity-BCzfPPYM.js} +1 -1
- package/dist/{message-handler-C5By3yl5.js → message-handler-CAeEpqWo.js} +14 -10
- package/dist/{message-handler.preflight-DrszWuHw.js → message-handler.preflight-CoKoE3dY.js} +24 -19
- package/dist/{message-handler.process-DyFPDLCt.js → message-handler.process-cdIJ_fDT.js} +56 -74
- package/dist/{message-text-Ca8M6TU8.js → message-text-C0K4-fkg.js} +9 -4
- package/dist/{outbound-adapter-Dif8p481.js → outbound-adapter-Ch0At5Ra.js} +34 -24
- package/dist/{outbound-components-wjv7yyAj.js → outbound-components-Bnt_7x7r.js} +3 -3
- package/dist/{outbound-session-route-Bn4uXaoE.js → outbound-session-route-CzzerX2K.js} +10 -7
- package/dist/{owner-access-UlYi9t0M.js → owner-access-yc1sX7Gx.js} +7 -6
- package/dist/{pluralkit-9EuEN4UD.js → pluralkit-B3cUVI7i.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-LXiOcJrH.js → provider-CjI8BSzS.js} +97 -76
- package/dist/{provider-session.runtime-DSNe7r2W.js → provider-session.runtime-DdKRMcE9.js} +3 -3
- package/dist/provider.runtime-Bo1WbLLr.js +2 -0
- package/dist/{realtime-session.runtime-DOViOIjY.js → realtime-session.runtime-37IC-p5K.js} +5 -5
- package/dist/{resolve-allowlist-common-BLoYaxEG.js → resolve-allowlist-common-BJ5UZNNT.js} +3 -3
- package/dist/{resolve-channels-D2yl_2CN.js → resolve-channels-BexR2eUn.js} +4 -4
- package/dist/{resolve-users-BLxfqajZ.js → resolve-users-BtXBCH5W.js} +5 -4
- package/dist/{retry-after-DdLPmPoa.js → retry-after-BrLjLUJi.js} +2 -1
- package/dist/{retry-DqHCW6PV.js → retry-t5RcEsPk.js} +37 -29
- package/dist/{runtime-DrxVBTtp.js → runtime-BNlDfLwS.js} +2 -2
- package/dist/{runtime-BYamRVPN.js → runtime-DydyfxST.js} +126 -92
- 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/{send-UJHiAm4C.js → send-mTKSBdmZ.js} +76 -48
- package/dist/{send.components-CrBJpGT_.js → send.components-nsPnc7kK.js} +20 -14
- package/dist/{send.outbound-D7JYmfm9.js → send.outbound-CaOs9Zy1.js} +34 -20
- package/dist/{send.shared-DZJ1akvQ.js → send.shared-BJHt0Vyf.js} +24 -17
- package/dist/{sender-identity-BJtfyise.js → sender-identity-Dt0imZyY.js} +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{shared-Dii2HTn7.js → shared-BNesVA4P.js} +17 -14
- package/dist/{subagent-hooks-JyGrtQIl.js → subagent-hooks-IeZVPLGj.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{system-events-BEmcj4xJ.js → system-events-Be5EJI3b.js} +2 -2
- package/dist/{target-resolver-V-IYae6s.js → target-resolver-C0MnwEki.js} +6 -5
- package/dist/targets-DQSye1Rv.js +3 -0
- package/dist/{thread-bindings-DvYP79fy.js → thread-bindings-wECUSIIG.js} +6 -5
- package/dist/{thread-bindings.manager-Clm77DBM.js → thread-bindings.manager-B-3UHCc1.js} +28 -25
- package/dist/{thread-bindings.session-updates-CJb-BpPL.js → thread-bindings.session-updates-CC7HoQvt.js} +2 -1
- package/dist/{threading-CXuu_7o9.js → threading-te5ADPQI.js} +8 -6
- package/dist/{timeouts-B9cy6RvQ.js → timeouts-D86uWLt_.js} +1 -1
- package/dist/{transcripts-source-BLEMH_yi.js → transcripts-source-DkUhR7YK.js} +3 -3
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-B9snnwMe.js → typing-DAwJF5VT.js} +2 -2
- package/dist/{voice-runtime-DY6_o73o.js → voice-runtime-COyYYTDD.js} +348 -14
- 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 +2 -2
- package/package.json +5 -5
- package/dist/account-inspect-BDfKyuvL.js +0 -89
- package/dist/provider.runtime-DiInaDXO.js +0 -2
- package/dist/sdk-runtime-6tfgYDjY.js +0 -338
- package/dist/targets-CQp53cGj.js +0 -3
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { h as resolveDiscordToken, l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig } from "./accounts-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-BLxfqajZ.js";
|
|
1
|
+
import { _ as inspectDiscordAccountTokenState, h as resolveDiscordToken, l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig } from "./accounts-CwJQoLjM.js";
|
|
2
|
+
import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-BNesVA4P.js";
|
|
3
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-BexR2eUn.js";
|
|
4
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-BtXBCH5W.js";
|
|
6
5
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
7
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
7
|
import { resolveBasicAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
|
@@ -279,22 +278,23 @@ async function resolveDiscordGroupAllowlist(params) {
|
|
|
279
278
|
})
|
|
280
279
|
});
|
|
281
280
|
}
|
|
281
|
+
const discordSetupWizard = createDiscordSetupWizardBase({
|
|
282
|
+
promptAllowFrom: promptDiscordAllowFrom,
|
|
283
|
+
resolveAllowFromEntries: async ({ cfg, accountId, credentialValues, entries }) => await resolveDiscordAllowFromEntries({
|
|
284
|
+
token: resolveDiscordToken(cfg, { accountId }).token || (typeof credentialValues.token === "string" ? credentialValues.token : ""),
|
|
285
|
+
entries
|
|
286
|
+
}),
|
|
287
|
+
resolveGroupAllowlist: async ({ cfg, accountId, credentialValues, entries }) => await resolveDiscordGroupAllowlist({
|
|
288
|
+
cfg,
|
|
289
|
+
accountId,
|
|
290
|
+
credentialValues,
|
|
291
|
+
entries
|
|
292
|
+
})
|
|
293
|
+
});
|
|
282
294
|
//#endregion
|
|
283
295
|
//#region extensions/discord/src/channel.setup.ts
|
|
284
296
|
const discordSetupPlugin = { ...createDiscordPluginBase({
|
|
285
|
-
setupWizard:
|
|
286
|
-
promptAllowFrom: promptDiscordAllowFrom,
|
|
287
|
-
resolveAllowFromEntries: async ({ cfg, accountId, credentialValues, entries }) => await resolveDiscordAllowFromEntries({
|
|
288
|
-
token: resolveDiscordToken(cfg, { accountId }).token || (typeof credentialValues.token === "string" ? credentialValues.token : ""),
|
|
289
|
-
entries
|
|
290
|
-
}),
|
|
291
|
-
resolveGroupAllowlist: async ({ cfg, accountId, credentialValues, entries }) => await resolveDiscordGroupAllowlist({
|
|
292
|
-
cfg,
|
|
293
|
-
accountId,
|
|
294
|
-
credentialValues,
|
|
295
|
-
entries
|
|
296
|
-
})
|
|
297
|
-
}),
|
|
297
|
+
setupWizard: discordSetupWizard,
|
|
298
298
|
setupContract: discordSetupContract
|
|
299
299
|
}) };
|
|
300
300
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as TextInput, Q as RadioGroup, X as Label, Y as CheckboxGroup, Z as Modal, at as MediaGallery, ct as Row, dt as StringSelectMenu, et as Button, ft as TextDisplay, gt as parseCustomId, it as LinkButton, lt as Section, mt as UserSelectMenu, nt as Container, on as __exportAll, ot as MentionableSelectMenu, pt as Thumbnail, rt as File, st as RoleSelectMenu, tt as ChannelSelectMenu, ut as Separator } from "./retry-
|
|
1
|
+
import { $ as TextInput, Q as RadioGroup, X as Label, Y as CheckboxGroup, Z as Modal, at as MediaGallery, ct as Row, dt as StringSelectMenu, et as Button, ft as TextDisplay, gt as parseCustomId, it as LinkButton, lt as Section, mt as UserSelectMenu, nt as Container, on as __exportAll, ot as MentionableSelectMenu, pt as Thumbnail, rt as File, st as RoleSelectMenu, tt as ChannelSelectMenu, ut as Separator } from "./retry-t5RcEsPk.js";
|
|
2
2
|
import { ButtonStyle, MessageFlags, TextInputStyle } from "discord-api-types/v10";
|
|
3
3
|
import crypto from "node:crypto";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -57,11 +57,11 @@ const discordChannelConfigUiHints = {
|
|
|
57
57
|
},
|
|
58
58
|
"threadBindings.enabled": {
|
|
59
59
|
label: "Discord Thread Binding Enabled",
|
|
60
|
-
help: "Enable Discord thread
|
|
60
|
+
help: "Enable Discord thread-bound session spawning, routing, and delivery. Overrides session.threadBindings.enabled when set."
|
|
61
61
|
},
|
|
62
62
|
"threadBindings.idleHours": {
|
|
63
63
|
label: "Discord Thread Binding Idle Timeout (hours)",
|
|
64
|
-
help: "Inactivity window in hours for Discord thread-bound sessions
|
|
64
|
+
help: "Inactivity window in hours for Discord thread-bound sessions. Set 0 to disable idle expiry (default: 24). Overrides session.threadBindings.idleHours when set."
|
|
65
65
|
},
|
|
66
66
|
"threadBindings.maxAgeHours": {
|
|
67
67
|
label: "Discord Thread Binding Max Age (hours)",
|
|
@@ -514,7 +514,7 @@ const DiscordAccountSchemaBase = z.object({
|
|
|
514
514
|
execApprovals: buildChannelExecApprovalsSchema(DiscordIdSchema, { cleanupAfterResolve: z.boolean().optional() }),
|
|
515
515
|
agentComponents: z.object({
|
|
516
516
|
enabled: z.boolean().optional(),
|
|
517
|
-
ttlMs: z.number().int().positive().max(
|
|
517
|
+
ttlMs: z.number().int().positive().max(864e5).optional()
|
|
518
518
|
}).strict().optional(),
|
|
519
519
|
slashCommand: z.object({ ephemeral: z.boolean().optional() }).strict().optional(),
|
|
520
520
|
threadBindings: z.object({
|
|
@@ -663,6 +663,7 @@ const DiscordConfigSchemaBase = DiscordAccountSchemaBase.safeExtend({
|
|
|
663
663
|
});
|
|
664
664
|
}
|
|
665
665
|
});
|
|
666
|
-
const
|
|
666
|
+
const DiscordConfigSchema = z.preprocess(normalizeShippedDiscordDmAliases, DiscordConfigSchemaBase);
|
|
667
|
+
const DiscordChannelConfigSchema = buildChannelConfigSchema(DiscordConfigSchema, { uiHints: discordChannelConfigUiHints });
|
|
667
668
|
//#endregion
|
|
668
669
|
export { DiscordChannelConfigSchema as t };
|
package/dist/{conversation-binding-route-BjvX4e35.js → conversation-binding-route-DPpBRpYI.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-
|
|
1
|
+
import { l as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-CzzerX2K.js";
|
|
2
2
|
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
|
|
3
3
|
import { resolveConfiguredBindingRoute, resolveRuntimeConversationBindingRoute } from "openclaw/plugin-sdk/conversation-binding-runtime";
|
|
4
4
|
//#region extensions/discord/src/monitor/conversation-binding-route.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { on as __exportAll } from "./retry-
|
|
2
|
-
import { l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId } from "./accounts-
|
|
1
|
+
import { on as __exportAll } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId } from "./accounts-CwJQoLjM.js";
|
|
3
3
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
4
4
|
import { createResolvedDirectoryEntriesLister } from "openclaw/plugin-sdk/directory-config-runtime";
|
|
5
5
|
//#region extensions/discord/src/directory-config.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-
|
|
1
|
+
import { n as listDiscordDirectoryGroupsFromConfig, r as listDiscordDirectoryPeersFromConfig } from "./directory-config-AA8wQx0D.js";
|
|
2
2
|
//#region extensions/discord/directory-contract-api.ts
|
|
3
3
|
const discordDirectoryContractPlugin = {
|
|
4
4
|
id: "discord",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { on as __exportAll } from "./retry-
|
|
2
|
-
import { c as resolveDiscordAccount, m as normalizeDiscordToken } from "./accounts-
|
|
3
|
-
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-
|
|
4
|
-
import { a as normalizeDiscordSlug } from "./allow-list-
|
|
1
|
+
import { on as __exportAll } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { c as resolveDiscordAccount, m as normalizeDiscordToken } from "./accounts-CwJQoLjM.js";
|
|
3
|
+
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-BfmEP6wp.js";
|
|
4
|
+
import { a as normalizeDiscordSlug } from "./allow-list-C2JuH-R0.js";
|
|
5
5
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
6
6
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
//#region extensions/discord/src/directory-cache-state.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { s as resolveDefaultDiscordAccountId } from "./accounts-
|
|
2
|
-
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-
|
|
3
|
-
import { t as inspectDiscordAccount } from "./account-inspect-
|
|
4
|
-
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-
|
|
5
|
-
import { n as normalizeCompatibilityConfig } from "./doctor-contract-
|
|
1
|
+
import { s as resolveDefaultDiscordAccountId } from "./accounts-CwJQoLjM.js";
|
|
2
|
+
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-DkUhR7YK.js";
|
|
3
|
+
import { t as inspectDiscordAccount } from "./account-inspect-BY-ve3yH.js";
|
|
4
|
+
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-BNesVA4P.js";
|
|
5
|
+
import { n as normalizeCompatibilityConfig } from "./doctor-contract-Co5vRCZ6.js";
|
|
6
6
|
import { t as isDiscordMutableAllowEntry } from "./security-doctor-nGgPm65L.js";
|
|
7
7
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
8
8
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -65,7 +65,8 @@ function hasLegacyDiscordGuildChannelAgentId(value) {
|
|
|
65
65
|
});
|
|
66
66
|
}
|
|
67
67
|
function hasUnsupportedRealtimeWakeNamesInVoice(value) {
|
|
68
|
-
const
|
|
68
|
+
const voice = asObjectRecord(value);
|
|
69
|
+
const wakeNames = asObjectRecord(voice?.realtime)?.wakeNames;
|
|
69
70
|
return Array.isArray(wakeNames) ? wakeNames.length === 0 || wakeNames.some((wakeName) => typeof wakeName === "string" && !isSupportedRealtimeVoiceActivationName(wakeName)) : false;
|
|
70
71
|
}
|
|
71
72
|
function hasUnsupportedDiscordRealtimeWakeNames(value) {
|
|
@@ -274,7 +275,8 @@ const legacyConfigRules = [
|
|
|
274
275
|
],
|
|
275
276
|
message: "channels.discord.accounts.<id>.voice.tts.<provider> keys (openai/elevenlabs/microsoft/edge) are legacy; use channels.discord.accounts.<id>.voice.tts.providers.<provider>. Run \"openclaw doctor --fix\".",
|
|
276
277
|
match: (value) => hasLegacyAccountStreamingAliases(value, (accountValue) => {
|
|
277
|
-
|
|
278
|
+
const account = asObjectRecord(accountValue);
|
|
279
|
+
return hasLegacyTtsProviderKeys(asObjectRecord(account?.voice)?.tts);
|
|
278
280
|
})
|
|
279
281
|
},
|
|
280
282
|
{
|
|
@@ -324,11 +326,12 @@ const legacyConfigRules = [
|
|
|
324
326
|
function normalizeCompatibilityConfig({ cfg }) {
|
|
325
327
|
const changes = [];
|
|
326
328
|
const bindingsToAdd = [];
|
|
329
|
+
const aliases = streamingAliasMigration.normalizeChannelConfig({
|
|
330
|
+
cfg,
|
|
331
|
+
changes
|
|
332
|
+
});
|
|
327
333
|
const tuningKnobs = stripRetiredChannelKeys({
|
|
328
|
-
cfg:
|
|
329
|
-
cfg,
|
|
330
|
-
changes
|
|
331
|
-
}).config,
|
|
334
|
+
cfg: aliases.config,
|
|
332
335
|
channelId: "discord",
|
|
333
336
|
keys: RETIRED_TUNING_KEYS,
|
|
334
337
|
scope: "root-and-accounts"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as DISCORD_COMMAND_DEPLOY_HASH_NAMESPACE, t as DISCORD_COMMAND_DEPLOY_HASH_MAX_ENTRIES } from "./command-deploy-store-DFkBTViB.js";
|
|
2
2
|
import { a as THREAD_BINDINGS_MAX_ENTRIES, d as normalizePersistedBinding, k as toBindingRecordKey, o as THREAD_BINDINGS_NAMESPACE } from "./thread-bindings.state-D8OMdk4O.js";
|
|
3
|
-
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-
|
|
3
|
+
import { n as normalizeCompatibilityConfig, t as legacyConfigRules } from "./doctor-contract-Co5vRCZ6.js";
|
|
4
4
|
import { i as sanitizeRecentModels, r as preferenceTimestampMs, t as buildPreferenceModelKey } from "./model-picker-preference-primitives-BHT1LkR_.js";
|
|
5
5
|
import { MAX_DATE_TIMESTAMP_MS, timestampMsToIsoString } from "openclaw/plugin-sdk/number-runtime";
|
|
6
6
|
import path from "node:path";
|
|
@@ -37,7 +37,8 @@ function normalizeLegacyPreferenceKey(key) {
|
|
|
37
37
|
}
|
|
38
38
|
function legacyUpdatedAtForIndex(updatedAt, index, total) {
|
|
39
39
|
const baseMs = preferenceTimestampMs(updatedAt);
|
|
40
|
-
|
|
40
|
+
const shiftedMs = Math.min(baseMs + Math.max(0, total), MAX_DATE_TIMESTAMP_MS) - Math.max(0, index);
|
|
41
|
+
return timestampMsToIsoString(shiftedMs) ?? timestampMsToIsoString(baseMs) ?? timestampMsToIsoString(Math.max(0, total - index)) ?? "1970-01-01T00:00:00.000Z";
|
|
41
42
|
}
|
|
42
43
|
function readFiniteNumberField(entry, key) {
|
|
43
44
|
const value = entry[key];
|
package/dist/{handle-action.guild-admin-DZewwLr1.js → handle-action.guild-admin-Cc88ZGon.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as readDiscordChannelMoveParams, n as isDiscordModerationAction, o as readDiscordChannelCreateParams, r as readDiscordModerationCommand, s as readDiscordChannelEditParams, t as handleDiscordAction } from "./runtime-
|
|
1
|
+
import { c as readDiscordChannelMoveParams, n as isDiscordModerationAction, o as readDiscordChannelCreateParams, r as readDiscordModerationCommand, s as readDiscordChannelEditParams, t as handleDiscordAction } from "./runtime-DydyfxST.js";
|
|
2
2
|
import "./action-runtime-api.js";
|
|
3
|
-
import { m as isTrustedRequesterGuildAdminAction } from "./outbound-session-route-
|
|
3
|
+
import { m as isTrustedRequesterGuildAdminAction } from "./outbound-session-route-CzzerX2K.js";
|
|
4
4
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
|
|
6
6
|
import { readNonNegativeIntegerParam, readPositiveIntegerParam, readStringArrayParam, readStringParam } from "openclaw/plugin-sdk/agent-runtime";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as registerDiscordActivities } from "./activities-api-
|
|
1
|
+
import { t as registerDiscordActivities } from "./activities-api-CkKcHUB6.js";
|
|
2
2
|
import { registerDiscordSubagentHooks } from "./subagent-hooks-api.js";
|
|
3
3
|
import { registerDiscordTranscriptSourceProvider } from "./transcripts-source-api.js";
|
|
4
4
|
import { defineBundledChannelEntry } from "openclaw/plugin-sdk/channel-entry-contract";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as normalizeDiscordAllowList } from "./allow-list-
|
|
1
|
+
import { r as normalizeDiscordAllowList } from "./allow-list-C2JuH-R0.js";
|
|
2
2
|
import { defineStableChannelIngressIdentity } from "openclaw/plugin-sdk/channel-ingress-runtime";
|
|
3
3
|
//#region extensions/discord/src/monitor/ingress-identity.ts
|
|
4
4
|
const DISCORD_ALLOW_LIST_PREFIXES = [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.js";
|
|
2
|
-
import { c as resolveDiscordChannelInfoSafe, d as resolveDiscordChannelParentSafe, l as resolveDiscordChannelNameSafe, s as resolveDiscordChannelIdSafe } from "./thread-bindings.manager-
|
|
3
|
-
import { v as mapGatewayDispatchData } from "./provider-
|
|
4
|
-
import {
|
|
2
|
+
import { c as resolveDiscordChannelInfoSafe, d as resolveDiscordChannelParentSafe, l as resolveDiscordChannelNameSafe, s as resolveDiscordChannelIdSafe } from "./thread-bindings.manager-B-3UHCc1.js";
|
|
3
|
+
import { v as mapGatewayDispatchData } from "./provider-CjI8BSzS.js";
|
|
4
|
+
import { f as resolveDiscordReferencedReplyMessageId, h as resolveDiscordMessageChannelId, i as resolveDiscordMessageText, l as hasDiscordMessageStickers, p as resolveDiscordCdnPolicy } from "./message-text-C0K4-fkg.js";
|
|
5
5
|
import { logDebug } from "openclaw/plugin-sdk/logging-core";
|
|
6
6
|
import { GatewayDispatchEvents } from "discord-api-types/v10";
|
|
7
7
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -58,8 +58,9 @@ function isDiscordAuthenticationFailure(error) {
|
|
|
58
58
|
return false;
|
|
59
59
|
}
|
|
60
60
|
function createDiscordIngressMonitor(params) {
|
|
61
|
+
const queue = params.queue ?? getDiscordRuntime().state.openChannelIngressQueue({ accountId: params.accountId });
|
|
61
62
|
const monitor = createChannelIngressMonitor({
|
|
62
|
-
queue
|
|
63
|
+
queue,
|
|
63
64
|
inspect: inspectDiscordMessage,
|
|
64
65
|
payload: {
|
|
65
66
|
version: DISCORD_INGRESS_PAYLOAD_VERSION,
|
|
@@ -170,9 +171,9 @@ function normalizeDiscordThreadChannel(threadChannel) {
|
|
|
170
171
|
}
|
|
171
172
|
//#endregion
|
|
172
173
|
//#region extensions/discord/src/monitor/message-avatar.ts
|
|
173
|
-
const DISCORD_AVATAR_MAX_BYTES =
|
|
174
|
+
const DISCORD_AVATAR_MAX_BYTES = 262144;
|
|
174
175
|
const DISCORD_AVATAR_CACHE_MAX_ENTRIES = 128;
|
|
175
|
-
const DISCORD_GUILD_ICON_TTL_MS =
|
|
176
|
+
const DISCORD_GUILD_ICON_TTL_MS = 3e5;
|
|
176
177
|
function setBoundedEntry(map, key, value) {
|
|
177
178
|
map.delete(key);
|
|
178
179
|
map.set(key, value);
|
|
@@ -248,7 +249,7 @@ function applyImplicitReplyBatchGate(ctx, replyToMode, isBatched) {
|
|
|
248
249
|
}
|
|
249
250
|
//#endregion
|
|
250
251
|
//#region extensions/discord/src/monitor/message-run-queue.ts
|
|
251
|
-
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-
|
|
252
|
+
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-cdIJ_fDT.js"));
|
|
252
253
|
async function processDiscordQueuedMessage(params) {
|
|
253
254
|
const abortSignal = params.job.runtime.abortSignal && params.lifecycleSignal ? AbortSignal.any([params.job.runtime.abortSignal, params.lifecycleSignal]) : params.job.runtime.abortSignal ?? params.lifecycleSignal;
|
|
254
255
|
try {
|
|
@@ -335,7 +336,7 @@ function createDiscordMessageRunQueue(params) {
|
|
|
335
336
|
}
|
|
336
337
|
//#endregion
|
|
337
338
|
//#region extensions/discord/src/monitor/message-dispatcher.ts
|
|
338
|
-
const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-
|
|
339
|
+
const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-CoKoE3dY.js"));
|
|
339
340
|
function isNonEmptyString(value) {
|
|
340
341
|
return typeof value === "string" && value.length > 0;
|
|
341
342
|
}
|
|
@@ -365,7 +366,9 @@ function createDiscordMessageDispatcher(params) {
|
|
|
365
366
|
message,
|
|
366
367
|
eventChannelId: entry.data.channel_id
|
|
367
368
|
});
|
|
368
|
-
|
|
369
|
+
if (!channelId) return null;
|
|
370
|
+
const replyTargetId = resolveDiscordReferencedReplyMessageId(message);
|
|
371
|
+
return `discord:${params.accountId}:${channelId}:${authorId}:reply:${replyTargetId ?? "none"}`;
|
|
369
372
|
};
|
|
370
373
|
const { debouncer } = createChannelInboundDebouncer({
|
|
371
374
|
cfg: params.cfg,
|
|
@@ -374,8 +377,9 @@ function createDiscordMessageDispatcher(params) {
|
|
|
374
377
|
shouldDebounce: (entry) => {
|
|
375
378
|
const message = entry.data.message;
|
|
376
379
|
if (!message) return false;
|
|
380
|
+
const baseText = resolveDiscordMessageText(message, { includeForwarded: false });
|
|
377
381
|
return shouldDebounceTextInbound({
|
|
378
|
-
text:
|
|
382
|
+
text: baseText,
|
|
379
383
|
cfg: params.cfg,
|
|
380
384
|
hasMedia: message.attachments && message.attachments.length > 0 || hasDiscordMessageStickers(message)
|
|
381
385
|
});
|
package/dist/{message-handler.preflight-DrszWuHw.js → message-handler.preflight-CoKoE3dY.js}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { W as Message, jt as getChannelMessage, y as discord_exports } from "./retry-
|
|
2
|
-
import { s as resolveDefaultDiscordAccountId } from "./accounts-
|
|
3
|
-
import { C as resolveTimestampMs, S as resolveDiscordSystemLocation, _ as resolveDiscordShouldRequireMention, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, f as resolveDiscordGuildEntry, i as normalizeDiscordDisplaySlug, p as resolveDiscordMemberAccessState, x as formatDiscordUserTag } from "./allow-list-
|
|
1
|
+
import { W as Message, jt as getChannelMessage, y as discord_exports } from "./retry-t5RcEsPk.js";
|
|
2
|
+
import { s as resolveDefaultDiscordAccountId } from "./accounts-CwJQoLjM.js";
|
|
3
|
+
import { C as resolveTimestampMs, S as resolveDiscordSystemLocation, _ as resolveDiscordShouldRequireMention, a as normalizeDiscordSlug, c as resolveDiscordChannelConfigWithFallback, f as resolveDiscordGuildEntry, i as normalizeDiscordDisplaySlug, p as resolveDiscordMemberAccessState, x as formatDiscordUserTag } from "./allow-list-C2JuH-R0.js";
|
|
4
4
|
import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.js";
|
|
5
|
-
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-
|
|
6
|
-
import { a as buildDiscordRoutePeer, c as resolveDiscordEffectiveRoute, f as resolveDiscordRuntimeBindingConversationId, s as resolveDiscordConversationRoute, u as resolveDiscordConversationIdentity } from "./outbound-session-route-
|
|
7
|
-
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-
|
|
8
|
-
import { c as resolveDiscordChannelInfoSafe, l as resolveDiscordChannelNameSafe } from "./thread-bindings.manager-
|
|
9
|
-
import { S as resolveDiscordTextCommandAccess, _ as handleDiscordDmCommandDecision, n as resolveDiscordPreflightChannelAccess, x as resolveDiscordDmCommandAccess } from "./provider-
|
|
10
|
-
import {
|
|
11
|
-
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-
|
|
5
|
+
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-D86uWLt_.js";
|
|
6
|
+
import { a as buildDiscordRoutePeer, c as resolveDiscordEffectiveRoute, f as resolveDiscordRuntimeBindingConversationId, s as resolveDiscordConversationRoute, u as resolveDiscordConversationIdentity } from "./outbound-session-route-CzzerX2K.js";
|
|
7
|
+
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-DPpBRpYI.js";
|
|
8
|
+
import { c as resolveDiscordChannelInfoSafe, l as resolveDiscordChannelNameSafe } from "./thread-bindings.manager-B-3UHCc1.js";
|
|
9
|
+
import { S as resolveDiscordTextCommandAccess, _ as handleDiscordDmCommandDecision, n as resolveDiscordPreflightChannelAccess, x as resolveDiscordDmCommandAccess } from "./provider-CjI8BSzS.js";
|
|
10
|
+
import { d as resolveDiscordReferencedReplyMessage, h as resolveDiscordMessageChannelId, i as resolveDiscordMessageText, m as resolveDiscordChannelInfo, o as resolveForwardedMediaList, r as resolveDiscordMessageHistoryText, s as resolveMediaList, u as resolveDiscordMessageStickers } from "./message-text-C0K4-fkg.js";
|
|
11
|
+
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-Dt0imZyY.js";
|
|
12
12
|
import { t as createDiscordHistorySenderProvenance } from "./message-handler.history-CJOsN9w5.js";
|
|
13
13
|
import { logDebug } from "openclaw/plugin-sdk/logging-core";
|
|
14
14
|
import { MessageReferenceType, MessageType } from "discord-api-types/v10";
|
|
@@ -29,7 +29,7 @@ import { shouldHandleTextCommands } from "openclaw/plugin-sdk/command-surface";
|
|
|
29
29
|
import { createChannelHistoryWindow } from "openclaw/plugin-sdk/reply-history";
|
|
30
30
|
//#region extensions/discord/src/monitor/message-handler.dm-preflight.ts
|
|
31
31
|
const loadConversationRuntime$1 = createLazyRuntimeModule(() => import("openclaw/plugin-sdk/conversation-binding-runtime"));
|
|
32
|
-
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-
|
|
32
|
+
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-mTKSBdmZ.js").then((n) => n.t));
|
|
33
33
|
function resolveDiscordDmPairingSenderId(sender) {
|
|
34
34
|
return sender.isPluralKit ? `pk:${sender.id}` : sender.id;
|
|
35
35
|
}
|
|
@@ -415,7 +415,8 @@ function buildDiscordPreflightHistoryEntry(params) {
|
|
|
415
415
|
//#region extensions/discord/src/monitor/message-handler.preflight-logging.ts
|
|
416
416
|
function logDiscordPreflightChannelConfig(params) {
|
|
417
417
|
if (!shouldLogVerbose()) return;
|
|
418
|
-
|
|
418
|
+
const channelConfigSummary = params.channelConfig ? `allowed=${params.channelConfig.allowed} enabled=${params.channelConfig.enabled ?? "unset"} requireMention=${params.channelConfig.requireMention ?? "unset"} ignoreOtherMentions=${params.channelConfig.ignoreOtherMentions ?? "unset"} matchKey=${params.channelConfig.matchKey ?? "none"} matchSource=${params.channelConfig.matchSource ?? "none"} users=${params.channelConfig.users?.length ?? 0} roles=${params.channelConfig.roles?.length ?? 0} skills=${params.channelConfig.skills?.length ?? 0}` : "none";
|
|
419
|
+
logDebug(`[discord-preflight] channelConfig=${channelConfigSummary} channelMatchMeta=${params.channelMatchMeta} channelId=${params.channelId}`);
|
|
419
420
|
}
|
|
420
421
|
function logDiscordPreflightInboundSummary(params) {
|
|
421
422
|
if (!shouldLogVerbose()) return;
|
|
@@ -423,10 +424,10 @@ function logDiscordPreflightInboundSummary(params) {
|
|
|
423
424
|
}
|
|
424
425
|
//#endregion
|
|
425
426
|
//#region extensions/discord/src/monitor/message-handler.preflight-runtime.ts
|
|
426
|
-
const loadPluralKitRuntime = createLazyRuntimeModule(() => import("./pluralkit-
|
|
427
|
+
const loadPluralKitRuntime = createLazyRuntimeModule(() => import("./pluralkit-B3cUVI7i.js").then((n) => n.n));
|
|
427
428
|
const loadPreflightAudioRuntime = createLazyRuntimeModule(() => import("./preflight-audio-DrnqFA8U.js"));
|
|
428
|
-
const loadSystemEventsRuntime = createLazyRuntimeModule(() => import("./system-events-
|
|
429
|
-
const loadDiscordThreadingRuntime = createLazyRuntimeModule(() => import("./threading-
|
|
429
|
+
const loadSystemEventsRuntime = createLazyRuntimeModule(() => import("./system-events-Be5EJI3b.js"));
|
|
430
|
+
const loadDiscordThreadingRuntime = createLazyRuntimeModule(() => import("./threading-te5ADPQI.js").then((n) => n.t));
|
|
430
431
|
function isPreflightAborted(abortSignal) {
|
|
431
432
|
return Boolean(abortSignal?.aborted);
|
|
432
433
|
}
|
|
@@ -526,7 +527,7 @@ async function resolveDiscordPreflightRoute(params) {
|
|
|
526
527
|
//#endregion
|
|
527
528
|
//#region extensions/discord/src/monitor/message-handler.preflight.ts
|
|
528
529
|
const DISCORD_HISTORY_MEDIA_MAX_ATTACHMENTS = 4;
|
|
529
|
-
const DISCORD_HISTORY_MEDIA_MAX_BYTES =
|
|
530
|
+
const DISCORD_HISTORY_MEDIA_MAX_BYTES = 10485760;
|
|
530
531
|
const DISCORD_HISTORY_MEDIA_IDLE_TIMEOUT_MS = 1e3;
|
|
531
532
|
const DISCORD_HISTORY_MEDIA_TOTAL_TIMEOUT_MS = 3e3;
|
|
532
533
|
function resolveDiscordPreflightConversationKind(params) {
|
|
@@ -982,9 +983,13 @@ async function preflightDiscordMessage(params) {
|
|
|
982
983
|
}
|
|
983
984
|
}
|
|
984
985
|
const ignoreOtherMentions = channelConfig?.ignoreOtherMentions ?? guildInfo?.ignoreOtherMentions ?? false;
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
986
|
+
const referencedReply = resolveDiscordReferencedReplyMessage(message);
|
|
987
|
+
const referencedWebhookId = referencedReply ? resolveDiscordWebhookId(referencedReply) : null;
|
|
988
|
+
const referencedAuthor = referencedReply?.author;
|
|
989
|
+
const replyTargetsOtherBot = Boolean(botId) && Boolean(referencedAuthor?.bot) && referencedAuthor?.id !== botId && !referencedWebhookId;
|
|
990
|
+
if (isGuildMessage && ignoreOtherMentions && (hasUserOrRoleMention || replyTargetsOtherBot) && !wasMentioned && !mentionDecision.implicitMention) {
|
|
991
|
+
logDebug(`[discord-preflight] drop: addressed-to-other`);
|
|
992
|
+
logVerbose(`discord: drop guild message (addressed to another identity, ignoreOtherMentions=true, botId=${botId})`);
|
|
988
993
|
await recordDiscordPendingHistoryEntry({
|
|
989
994
|
preflight: params,
|
|
990
995
|
historyKey: messageChannelId,
|