@openclaw/discord 2026.5.31-beta.2 → 2026.5.31-beta.3
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/action-runtime-api.js +1 -1
- package/dist/{allow-list-BnkWtVpA.js → allow-list-C-MqM-B_.js} +1 -1
- package/dist/api.js +12 -12
- package/dist/{approval-handler.runtime-DSFfzXpo.js → approval-handler.runtime-DQiJ1Z0k.js} +3 -3
- package/dist/{audit-kgIklCyI.js → audit-eI8e8RpG.js} +3 -3
- package/dist/{channel-D0gX0yj6.js → channel-CEcqsGv4.js} +18 -18
- package/dist/{channel-actions-DDoc4V7x.js → channel-actions-BaPDAWN_.js} +2 -2
- package/dist/{channel-actions.runtime-CqZfnMaA.js → channel-actions.runtime-BEMDJjP1.js} +5 -5
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-BNZm3eed.js → channel.setup-DbGXTREm.js} +2 -2
- package/dist/{components-DcLQ2JkV.js → components-CCbYVuVr.js} +66 -27
- package/dist/contract-api.js +2 -2
- package/dist/{conversation-identity-BURFgcfI.js → conversation-identity-CEP1KbK0.js} +2 -2
- package/dist/{directory-config-B9Jw1Q2R.js → directory-config-j1bfTue_.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-CDWUg-nA.js → directory-live-BjBs64RV.js} +2 -2
- package/dist/{handle-action.guild-admin-Dpa-kUzu.js → handle-action.guild-admin-CqUsOA2L.js} +3 -3
- package/dist/index.js +1 -1
- package/dist/{manager.runtime-BWBENHRA.js → manager.runtime-GXQRqG8a.js} +7 -7
- package/dist/{message-handler-HO8BbZmQ.js → message-handler-CNU-L8ef.js} +6 -6
- package/dist/{message-handler.preflight-DxHBPQvD.js → message-handler.preflight-DaQIDMY6.js} +12 -12
- package/dist/{message-handler.process-Cq3j7A9k.js → message-handler.process-B61wYezH.js} +18 -17
- package/dist/{message-utils-D_3KTxh_.js → message-utils-C3eyx-ih.js} +1 -1
- package/dist/{outbound-adapter-BkPkILpq.js → outbound-adapter-C6Da39L-.js} +6 -6
- package/dist/{pluralkit-Ds9aZAM4.js → pluralkit-BEEldePl.js} +1 -1
- package/dist/{provider-BK8hjk_y.js → provider-CHlc1TDX.js} +32 -28
- package/dist/{provider-session.runtime-CYMFlLg9.js → provider-session.runtime-BO12DuAF.js} +3 -3
- package/dist/provider.runtime-BTiF5ENi.js +2 -0
- package/dist/{resolve-allowlist-common-BIf3417N.js → resolve-allowlist-common-B3p7cT8F.js} +1 -1
- package/dist/{resolve-channels-DK-3f_aA.js → resolve-channels-DLNfxFQP.js} +3 -3
- package/dist/{resolve-users-DUDPsfWt.js → resolve-users-QTyD8qgI.js} +2 -2
- package/dist/{runtime-Blf_d9E7.js → runtime-Dds0Ww1n.js} +8 -8
- package/dist/runtime-api.actions.js +2 -2
- package/dist/runtime-api.js +19 -19
- package/dist/runtime-api.lookup.js +4 -4
- package/dist/runtime-api.monitor-BfCA2SYy.js +6 -0
- package/dist/runtime-api.monitor.js +5 -5
- package/dist/runtime-api.send.js +5 -5
- package/dist/runtime-api.threads.js +3 -3
- package/dist/{send-BHkA8a-k.js → send-CyyRF1yd.js} +3 -3
- package/dist/{send.components-CUHzDapa.js → send.components-a9JQeeH5.js} +4 -4
- package/dist/{send.outbound-DSKZbjML.js → send.outbound-DhMLobqR.js} +3 -3
- package/dist/{send.receipt-CjsWpitW.js → send.receipt-Z8V6yMOY.js} +38 -11
- package/dist/{send.shared-Cluujl6W.js → send.shared-B3QxPnR3.js} +5 -5
- package/dist/{sender-identity-BFp5w0F8.js → sender-identity-CEsfDF0L.js} +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{subagent-hooks-7jAn9HT5.js → subagent-hooks-65qGV_Ft.js} +2 -2
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{system-events-BjuNA9Zs.js → system-events-NnSID6Q5.js} +2 -2
- package/dist/{target-resolver-BYuWNVQp.js → target-resolver-BKGK0ftO.js} +2 -2
- package/dist/targets-Cv797U29.js +3 -0
- package/dist/{thread-bindings-CKruJE91.js → thread-bindings-BesPuVYd.js} +4 -4
- package/dist/{thread-bindings.discord-api-BjLUwwSP.js → thread-bindings.discord-api-D8MZQPER.js} +4 -4
- package/dist/{thread-bindings.manager-Dji7SZHG.js → thread-bindings.manager-DbgHc5KB.js} +19 -19
- package/dist/{transcripts-source-O73_YIDs.js → transcripts-source-Cegx0wdw.js} +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-CKW0i8du.js → typing-C7RXECnL.js} +1 -1
- package/npm-shrinkwrap.json +3 -3
- package/package.json +4 -4
- package/dist/provider.runtime-RfQSSM_v.js +0 -2
- package/dist/runtime-api.monitor-LVbgPRHA.js +0 -6
- package/dist/targets-BNDUOdvI.js +0 -3
|
@@ -395,10 +395,10 @@ const optionComparisonOmittedFields = new Set([
|
|
|
395
395
|
"name_localized"
|
|
396
396
|
]);
|
|
397
397
|
const nullableLocalizationFields = new Set(["description_localizations", "name_localizations"]);
|
|
398
|
-
function stableComparableObject(value,
|
|
398
|
+
function stableComparableObject(value, pathValue = []) {
|
|
399
399
|
if (Array.isArray(value)) {
|
|
400
|
-
const normalized = value.map((entry) => stableComparableObject(entry,
|
|
401
|
-
const key =
|
|
400
|
+
const normalized = value.map((entry) => stableComparableObject(entry, pathValue));
|
|
401
|
+
const key = pathValue.at(-1);
|
|
402
402
|
if (key && unorderedCommandArrayFields.has(key) && normalized.every((entry) => typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean")) return normalized.toSorted((left, right) => String(left).localeCompare(String(right)));
|
|
403
403
|
return normalized;
|
|
404
404
|
}
|
|
@@ -406,13 +406,13 @@ function stableComparableObject(value, path = []) {
|
|
|
406
406
|
return Object.fromEntries(Object.entries(value).filter(([key, entry]) => {
|
|
407
407
|
if (entry === void 0) return false;
|
|
408
408
|
if (entry === null && nullableLocalizationFields.has(key)) return false;
|
|
409
|
-
if (
|
|
409
|
+
if (pathValue.includes("options") && optionComparisonOmittedFields.has(key)) return false;
|
|
410
410
|
if ((key === "required" || key === "autocomplete") && entry === false) return false;
|
|
411
411
|
return true;
|
|
412
|
-
}).toSorted(([a], [b]) => a.localeCompare(b)).map(([key, entry]) => [key, shouldNormalizeDescriptionValue(
|
|
412
|
+
}).toSorted(([a], [b]) => a.localeCompare(b)).map(([key, entry]) => [key, shouldNormalizeDescriptionValue(pathValue, key, entry) ? normalizeDescriptionForComparison(entry) : stableComparableObject(entry, [...pathValue, key])]));
|
|
413
413
|
}
|
|
414
|
-
function shouldNormalizeDescriptionValue(
|
|
415
|
-
return typeof entry === "string" && (key === "description" ||
|
|
414
|
+
function shouldNormalizeDescriptionValue(pathLocal, key, entry) {
|
|
415
|
+
return typeof entry === "string" && (key === "description" || pathLocal.at(-1) === "description_localizations");
|
|
416
416
|
}
|
|
417
417
|
/**
|
|
418
418
|
* Normalize a Discord command description for equality comparison.
|
|
@@ -1096,10 +1096,16 @@ function channelFactory(clientForTest, channelData, _partial) {
|
|
|
1096
1096
|
//#endregion
|
|
1097
1097
|
//#region extensions/discord/src/internal/entity-cache.ts
|
|
1098
1098
|
const DEFAULT_REST_CACHE_TTL_MS = 3e4;
|
|
1099
|
+
const DEFAULT_MAX_ENTRIES = 5e3;
|
|
1100
|
+
const DEFAULT_SWEEP_INTERVAL_MS = 3e4;
|
|
1099
1101
|
var DiscordEntityCache = class {
|
|
1100
1102
|
constructor(params) {
|
|
1101
1103
|
this.params = params;
|
|
1102
1104
|
this.entries = /* @__PURE__ */ new Map();
|
|
1105
|
+
this.lastSweepAt = 0;
|
|
1106
|
+
}
|
|
1107
|
+
get size() {
|
|
1108
|
+
return this.entries.size;
|
|
1103
1109
|
}
|
|
1104
1110
|
async fetchUser(id) {
|
|
1105
1111
|
return await this.fetchCached(`user:${id}`, async () => {
|
|
@@ -1157,13 +1163,34 @@ var DiscordEntityCache = class {
|
|
|
1157
1163
|
const value = await fetcher();
|
|
1158
1164
|
if (ttl > 0) {
|
|
1159
1165
|
const expiresAt = resolveExpiresAtMsFromDurationMs(ttl, { nowMs: rawNow });
|
|
1160
|
-
if (expiresAt !== void 0)
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1166
|
+
if (expiresAt !== void 0) {
|
|
1167
|
+
if (now !== void 0) this.maybeSweepExpired(now);
|
|
1168
|
+
this.entries.set(key, {
|
|
1169
|
+
expiresAt,
|
|
1170
|
+
value
|
|
1171
|
+
});
|
|
1172
|
+
this.enforceMaxEntries();
|
|
1173
|
+
}
|
|
1164
1174
|
}
|
|
1165
1175
|
return value;
|
|
1166
1176
|
}
|
|
1177
|
+
maybeSweepExpired(now) {
|
|
1178
|
+
const interval = this.params.sweepIntervalMs ?? DEFAULT_SWEEP_INTERVAL_MS;
|
|
1179
|
+
if (now - this.lastSweepAt < interval) return;
|
|
1180
|
+
this.lastSweepAt = now;
|
|
1181
|
+
for (const [key, entry] of this.entries) if (entry.expiresAt <= now) this.entries.delete(key);
|
|
1182
|
+
}
|
|
1183
|
+
enforceMaxEntries() {
|
|
1184
|
+
const max = this.params.maxEntries ?? DEFAULT_MAX_ENTRIES;
|
|
1185
|
+
if (this.entries.size <= max) return;
|
|
1186
|
+
const toRemove = this.entries.size - max;
|
|
1187
|
+
let removed = 0;
|
|
1188
|
+
for (const key of this.entries.keys()) {
|
|
1189
|
+
if (removed >= toRemove) break;
|
|
1190
|
+
this.entries.delete(key);
|
|
1191
|
+
removed += 1;
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1167
1194
|
get rest() {
|
|
1168
1195
|
return typeof this.params.rest === "function" ? this.params.rest() : this.params.rest;
|
|
1169
1196
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { At as getGuildMember, M as Embed, S as RateLimitError, b as RequestClient, j as serializePayload, kt as getGuild, nt as createUserDmChannel, pt as getChannel, rt as getCurrentUser, s as chunkDiscordTextWithMode, st as createChannelMessage } from "./send.receipt-
|
|
1
|
+
import { At as getGuildMember, M as Embed, S as RateLimitError, b as RequestClient, j as serializePayload, kt as getGuild, nt as createUserDmChannel, pt as getChannel, rt as getCurrentUser, s as chunkDiscordTextWithMode, st as createChannelMessage } from "./send.receipt-Z8V6yMOY.js";
|
|
2
2
|
import { a as mergeDiscordAccountConfig, p as normalizeDiscordToken, s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
|
-
import { t as parseAndResolveDiscordTarget } from "./target-resolver-
|
|
3
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-BKGK0ftO.js";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
6
6
|
import { ChannelType, MessageFlags, PermissionFlagsBits } from "discord-api-types/v10";
|
|
@@ -255,12 +255,12 @@ async function fetchBotUserId(rest) {
|
|
|
255
255
|
return me.id;
|
|
256
256
|
}
|
|
257
257
|
function resolveMemberGuildPermissionBits(params) {
|
|
258
|
-
const
|
|
259
|
-
const everyoneRole =
|
|
258
|
+
const rolesByIdLocal = new Map((params.guild.roles ?? []).map((role) => [role.id, role]));
|
|
259
|
+
const everyoneRole = rolesByIdLocal.get(params.guild.id);
|
|
260
260
|
let permissions = 0n;
|
|
261
261
|
if (everyoneRole?.permissions) permissions = addPermissionBits(permissions, everyoneRole.permissions);
|
|
262
262
|
for (const roleId of params.member.roles ?? []) {
|
|
263
|
-
const role =
|
|
263
|
+
const role = rolesByIdLocal.get(roleId);
|
|
264
264
|
if (role?.permissions) permissions = addPermissionBits(permissions, role.permissions);
|
|
265
265
|
}
|
|
266
266
|
return permissions;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as formatDiscordUserTag } from "./allow-list-
|
|
1
|
+
import { b as formatDiscordUserTag } from "./allow-list-C-MqM-B_.js";
|
|
2
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
//#region extensions/discord/src/monitor/sender-identity.ts
|
|
4
4
|
function resolveDiscordWebhookId(message) {
|
package/dist/setup-plugin-api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as discordSetupPlugin } from "./channel.setup-
|
|
1
|
+
import { t as discordSetupPlugin } from "./channel.setup-DbGXTREm.js";
|
|
2
2
|
export { discordSetupPlugin };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-Z8V6yMOY.js";
|
|
2
2
|
import { s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
|
-
import { n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey } from "./thread-bindings-
|
|
3
|
+
import { n as autoBindSpawnedDiscordSubagent, o as unbindThreadBindingsBySessionKey, r as listThreadBindingsBySessionKey } from "./thread-bindings-BesPuVYd.js";
|
|
4
4
|
import { normalizeOptionalLowercaseString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { formatThreadBindingDisabledError, formatThreadBindingSpawnDisabledError, resolveThreadBindingSpawnPolicy } from "openclaw/plugin-sdk/conversation-runtime";
|
|
6
6
|
//#region extensions/discord/src/subagent-hooks.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//#region extensions/discord/subagent-hooks-api.ts
|
|
2
2
|
let discordSubagentHooksPromise = null;
|
|
3
3
|
function loadDiscordSubagentHooksModule() {
|
|
4
|
-
discordSubagentHooksPromise ??= import("./subagent-hooks-
|
|
4
|
+
discordSubagentHooksPromise ??= import("./subagent-hooks-65qGV_Ft.js").then((n) => n.i);
|
|
5
5
|
return discordSubagentHooksPromise;
|
|
6
6
|
}
|
|
7
7
|
function registerDiscordSubagentHooks(api) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as discord_exports } from "./send.receipt-
|
|
2
|
-
import { b as formatDiscordUserTag } from "./allow-list-
|
|
1
|
+
import { c as discord_exports } from "./send.receipt-Z8V6yMOY.js";
|
|
2
|
+
import { b as formatDiscordUserTag } from "./allow-list-C-MqM-B_.js";
|
|
3
3
|
//#region extensions/discord/src/monitor/system-events.ts
|
|
4
4
|
function resolveDiscordSystemEvent(message, location) {
|
|
5
5
|
switch (message.type) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Ht as parseDiscordTarget, Wt as __exportAll, r as allowFromContainsDiscordUserId } from "./send.receipt-
|
|
1
|
+
import { Ht as parseDiscordTarget, Wt as __exportAll, r as allowFromContainsDiscordUserId } from "./send.receipt-Z8V6yMOY.js";
|
|
2
2
|
import { c as resolveDiscordAccountAllowFrom, s as resolveDiscordAccount } from "./accounts-P19jm1lf.js";
|
|
3
|
-
import { i as rememberDiscordDirectoryUser, r as listDiscordDirectoryPeersLive } from "./directory-live-
|
|
3
|
+
import { i as rememberDiscordDirectoryUser, r as listDiscordDirectoryPeersLive } from "./directory-live-BjBs64RV.js";
|
|
4
4
|
import { buildMessagingTarget } from "openclaw/plugin-sdk/channel-targets";
|
|
5
5
|
//#region extensions/discord/src/send-target-parsing.ts
|
|
6
6
|
const parseDiscordSendTarget = (raw, options = {}) => parseDiscordTarget(raw, options);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Ht as parseDiscordTarget, Wt as __exportAll } from "./send.receipt-
|
|
2
|
-
import "./targets-
|
|
1
|
+
import { Ht as parseDiscordTarget, Wt as __exportAll } from "./send.receipt-Z8V6yMOY.js";
|
|
2
|
+
import "./targets-Cv797U29.js";
|
|
3
3
|
import { C as resolveThreadBindingMaxAgeMs$1, O as shouldPersistBindingMutations, S as resolveThreadBindingMaxAgeExpiresAt, T as saveBindingsToDisk, b as resolveThreadBindingIdleTimeoutMs$1, c as getThreadBindingToken, f as normalizeThreadId, g as removeBindingRecord, l as isRecentlyUnboundThreadWebhookMessage, n as MANAGERS_BY_ACCOUNT_ID, p as rememberRecentUnboundWebhookEcho, t as BINDINGS_BY_THREAD_ID, x as resolveThreadBindingInactivityExpiresAt } from "./thread-bindings.state-DYp4FVEB.js";
|
|
4
4
|
import { n as setThreadBindingMaxAgeBySessionKey, r as resolveBindingIdsForTargetSession, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-DoDFvU_h.js";
|
|
5
|
-
import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadName, g as resolveThreadBindingPersonaFromRecord, h as resolveThreadBindingPersona, s as resolveChannelIdForBinding, y as resolveThreadBindingIntroText } from "./thread-bindings.discord-api-
|
|
6
|
-
import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-
|
|
5
|
+
import { _ as formatThreadBindingDurationLabel, b as resolveThreadBindingThreadName, g as resolveThreadBindingPersonaFromRecord, h as resolveThreadBindingPersona, s as resolveChannelIdForBinding, y as resolveThreadBindingIntroText } from "./thread-bindings.discord-api-D8MZQPER.js";
|
|
6
|
+
import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-DbgHc5KB.js";
|
|
7
7
|
import { normalizeOptionalLowercaseString, normalizeOptionalString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
9
9
|
import { resolveThreadBindingIdleTimeoutMs, resolveThreadBindingMaxAgeMs, resolveThreadBindingsEnabled } from "openclaw/plugin-sdk/conversation-runtime";
|
package/dist/{thread-bindings.discord-api-BjLUwwSP.js → thread-bindings.discord-api-D8MZQPER.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Ut as resolveDiscordChannelId, pt as getChannel, tt as createChannelWebhook } from "./send.receipt-
|
|
2
|
-
import { I as createDiscordRestClient } from "./send.shared-
|
|
3
|
-
import { c as sendWebhookMessageDiscord, u as createThreadDiscord } from "./send-
|
|
4
|
-
import { t as sendMessageDiscord } from "./send.outbound-
|
|
1
|
+
import { Ut as resolveDiscordChannelId, pt as getChannel, tt as createChannelWebhook } from "./send.receipt-Z8V6yMOY.js";
|
|
2
|
+
import { I as createDiscordRestClient } from "./send.shared-B3QxPnR3.js";
|
|
3
|
+
import { c as sendWebhookMessageDiscord, u as createThreadDiscord } from "./send-CyyRF1yd.js";
|
|
4
|
+
import { t as sendMessageDiscord } from "./send.outbound-DhMLobqR.js";
|
|
5
5
|
import { i as REUSABLE_WEBHOOKS_BY_ACCOUNT_CHANNEL, k as toReusableWebhookKey, m as rememberReusableWebhook, t as BINDINGS_BY_THREAD_ID } from "./thread-bindings.state-DYp4FVEB.js";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { ChannelType } from "discord-api-types/v10";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Ut as resolveDiscordChannelId, Wt as __exportAll, pt as getChannel } from "./send.receipt-
|
|
2
|
-
import { I as createDiscordRestClient } from "./send.shared-
|
|
1
|
+
import { Ut as resolveDiscordChannelId, Wt as __exportAll, pt as getChannel } from "./send.receipt-Z8V6yMOY.js";
|
|
2
|
+
import { I as createDiscordRestClient } from "./send.shared-B3QxPnR3.js";
|
|
3
3
|
import { A as DEFAULT_THREAD_BINDING_IDLE_TIMEOUT_MS, C as resolveThreadBindingMaxAgeMs$1, D as shouldDefaultPersist, E as setBindingRecord, M as THREAD_BINDINGS_SWEEP_INTERVAL_MS, S as resolveThreadBindingMaxAgeExpiresAt, T as saveBindingsToDisk, _ as resetThreadBindingsForTests, a as THREAD_BINDING_TOUCH_PERSIST_MIN_INTERVAL_MS, b as resolveThreadBindingIdleTimeoutMs$1, c as getThreadBindingToken, d as normalizeThreadBindingDurationMs, f as normalizeThreadId, g as removeBindingRecord, h as rememberThreadBindingToken, n as MANAGERS_BY_ACCOUNT_ID, o as ensureBindingsLoaded, p as rememberRecentUnboundWebhookEcho, r as PERSIST_BY_ACCOUNT_ID, s as forgetThreadBindingToken, t as BINDINGS_BY_THREAD_ID, u as normalizeTargetKind, v as resolveBindingIdsForSession, w as resolveThreadBindingsPath, x as resolveThreadBindingInactivityExpiresAt, y as resolveBindingRecordKey } from "./thread-bindings.state-DYp4FVEB.js";
|
|
4
|
-
import { a as isThreadArchived, b as resolveThreadBindingThreadName, c as summarizeDiscordError, i as isDiscordThreadGoneError, n as createWebhookForChannel, o as maybeSendBindingMessage, r as findReusableWebhook, s as resolveChannelIdForBinding, t as createThreadForBinding, v as resolveThreadBindingFarewellText } from "./thread-bindings.discord-api-
|
|
4
|
+
import { a as isThreadArchived, b as resolveThreadBindingThreadName, c as summarizeDiscordError, i as isDiscordThreadGoneError, n as createWebhookForChannel, o as maybeSendBindingMessage, r as findReusableWebhook, s as resolveChannelIdForBinding, t as createThreadForBinding, v as resolveThreadBindingFarewellText } from "./thread-bindings.discord-api-D8MZQPER.js";
|
|
5
5
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { normalizeAccountId, resolveAgentIdFromSessionKey } from "openclaw/plugin-sdk/routing";
|
|
7
7
|
import { getRuntimeConfigSnapshot } from "openclaw/plugin-sdk/runtime-config-snapshot";
|
|
@@ -327,13 +327,13 @@ function createThreadBindingManager(params) {
|
|
|
327
327
|
threadId: touchParams.threadId
|
|
328
328
|
});
|
|
329
329
|
if (!key) return null;
|
|
330
|
-
const
|
|
331
|
-
if (!
|
|
330
|
+
const existingResult = BINDINGS_BY_THREAD_ID.get(key);
|
|
331
|
+
if (!existingResult || existingResult.accountId !== accountId) return null;
|
|
332
332
|
const now = Date.now();
|
|
333
333
|
const at = typeof touchParams.at === "number" && Number.isFinite(touchParams.at) ? Math.max(0, Math.floor(touchParams.at)) : now;
|
|
334
334
|
const nextRecord = {
|
|
335
|
-
...
|
|
336
|
-
lastActivityAt: Math.max(
|
|
335
|
+
...existingResult,
|
|
336
|
+
lastActivityAt: Math.max(existingResult.lastActivityAt || 0, at)
|
|
337
337
|
};
|
|
338
338
|
setBindingRecord(nextRecord);
|
|
339
339
|
if (touchParams.persist ?? persist) saveBindingsToDisk({ minIntervalMs: THREAD_BINDING_TOUCH_PERSIST_MIN_INTERVAL_MS });
|
|
@@ -368,12 +368,12 @@ function createThreadBindingManager(params) {
|
|
|
368
368
|
channelId: bindParams.channelId
|
|
369
369
|
}) ?? "";
|
|
370
370
|
if (!channelId) return null;
|
|
371
|
-
const
|
|
371
|
+
const existingValue = manager.getByThreadId(threadId);
|
|
372
372
|
const targetSessionKey = normalizeOptionalString(bindParams.targetSessionKey) ?? "";
|
|
373
373
|
if (!targetSessionKey) return null;
|
|
374
374
|
const targetKind = normalizeTargetKind(bindParams.targetKind, targetSessionKey);
|
|
375
|
-
let webhookId = normalizeOptionalString(bindParams.webhookId) ?? normalizeOptionalString(
|
|
376
|
-
let webhookToken = normalizeOptionalString(bindParams.webhookToken) ?? normalizeOptionalString(
|
|
375
|
+
let webhookId = normalizeOptionalString(bindParams.webhookId) ?? normalizeOptionalString(existingValue?.webhookId) ?? "";
|
|
376
|
+
let webhookToken = normalizeOptionalString(bindParams.webhookToken) ?? normalizeOptionalString(existingValue?.webhookToken) ?? "";
|
|
377
377
|
if (!directConversationBinding && (!webhookId || !webhookToken)) {
|
|
378
378
|
const cachedWebhook = findReusableWebhook({
|
|
379
379
|
accountId,
|
|
@@ -399,19 +399,19 @@ function createThreadBindingManager(params) {
|
|
|
399
399
|
threadId,
|
|
400
400
|
targetKind,
|
|
401
401
|
targetSessionKey,
|
|
402
|
-
agentId: normalizeOptionalString(bindParams.agentId) ?? normalizeOptionalString(
|
|
403
|
-
label: normalizeOptionalString(bindParams.label) ?? normalizeOptionalString(
|
|
402
|
+
agentId: normalizeOptionalString(bindParams.agentId) ?? normalizeOptionalString(existingValue?.agentId) ?? resolveAgentIdFromSessionKey(targetSessionKey),
|
|
403
|
+
label: normalizeOptionalString(bindParams.label) ?? normalizeOptionalString(existingValue?.label),
|
|
404
404
|
webhookId: webhookId || void 0,
|
|
405
405
|
webhookToken: webhookToken || void 0,
|
|
406
|
-
boundBy: normalizeOptionalString(bindParams.boundBy) ?? normalizeOptionalString(
|
|
406
|
+
boundBy: normalizeOptionalString(bindParams.boundBy) ?? normalizeOptionalString(existingValue?.boundBy) ?? "system",
|
|
407
407
|
boundAt: now,
|
|
408
408
|
lastActivityAt: now,
|
|
409
|
-
idleTimeoutMs: typeof
|
|
410
|
-
maxAgeMs: typeof
|
|
409
|
+
idleTimeoutMs: typeof existingValue?.idleTimeoutMs === "number" ? existingValue.idleTimeoutMs : idleTimeoutMs,
|
|
410
|
+
maxAgeMs: typeof existingValue?.maxAgeMs === "number" ? existingValue.maxAgeMs : maxAgeMs,
|
|
411
411
|
metadata: bindParams.metadata && typeof bindParams.metadata === "object" ? {
|
|
412
|
-
...
|
|
412
|
+
...existingValue?.metadata,
|
|
413
413
|
...bindParams.metadata
|
|
414
|
-
} :
|
|
414
|
+
} : existingValue?.metadata ? { ...existingValue.metadata } : void 0
|
|
415
415
|
};
|
|
416
416
|
setBindingRecord(record);
|
|
417
417
|
if (persist) saveBindingsToDisk();
|
|
@@ -429,8 +429,8 @@ function createThreadBindingManager(params) {
|
|
|
429
429
|
threadId: unbindParams.threadId
|
|
430
430
|
});
|
|
431
431
|
if (!bindingKey) return null;
|
|
432
|
-
const
|
|
433
|
-
if (!
|
|
432
|
+
const existingLocal = BINDINGS_BY_THREAD_ID.get(bindingKey);
|
|
433
|
+
if (!existingLocal || existingLocal.accountId !== accountId) return null;
|
|
434
434
|
const removed = removeBindingRecord(bindingKey);
|
|
435
435
|
if (!removed) return null;
|
|
436
436
|
rememberRecentUnboundWebhookEcho(removed);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-Z8V6yMOY.js";
|
|
2
2
|
//#region extensions/discord/src/voice/transcripts-source.ts
|
|
3
3
|
var transcripts_source_exports = /* @__PURE__ */ __exportAll({
|
|
4
4
|
discordVoiceTranscriptsSourceProvider: () => discordVoiceTranscriptsSourceProvider,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-
|
|
1
|
+
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-Cegx0wdw.js";
|
|
2
2
|
export { discordVoiceTranscriptsSourceProvider };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Wt as __exportAll, bt as sendChannelTyping } from "./send.receipt-
|
|
1
|
+
import { Wt as __exportAll, bt as sendChannelTyping } from "./send.receipt-Z8V6yMOY.js";
|
|
2
2
|
import { o as raceWithTimeout } from "./timeouts-CEJ3--Uw.js";
|
|
3
3
|
//#region extensions/discord/src/monitor/typing.ts
|
|
4
4
|
var typing_exports = /* @__PURE__ */ __exportAll({ sendTyping: () => sendTyping });
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/discord",
|
|
3
|
-
"version": "2026.5.31-beta.
|
|
3
|
+
"version": "2026.5.31-beta.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/discord",
|
|
9
|
-
"version": "2026.5.31-beta.
|
|
9
|
+
"version": "2026.5.31-beta.3",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@discordjs/voice": "0.19.2",
|
|
12
12
|
"discord-api-types": "0.38.48",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"ws": "8.21.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"openclaw": ">=2026.5.31-beta.
|
|
19
|
+
"openclaw": ">=2026.5.31-beta.3"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
22
22
|
"openclaw": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/discord",
|
|
3
|
-
"version": "2026.5.31-beta.
|
|
3
|
+
"version": "2026.5.31-beta.3",
|
|
4
4
|
"description": "OpenClaw Discord channel plugin for channels, DMs, commands, and app events.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"ws": "8.21.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"openclaw": ">=2026.5.31-beta.
|
|
19
|
+
"openclaw": ">=2026.5.31-beta.3"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
22
22
|
"openclaw": {
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
"allowInvalidConfigRecovery": true
|
|
64
64
|
},
|
|
65
65
|
"compat": {
|
|
66
|
-
"pluginApi": ">=2026.5.31-beta.
|
|
66
|
+
"pluginApi": ">=2026.5.31-beta.3"
|
|
67
67
|
},
|
|
68
68
|
"build": {
|
|
69
|
-
"openclawVersion": "2026.5.31-beta.
|
|
69
|
+
"openclawVersion": "2026.5.31-beta.3"
|
|
70
70
|
},
|
|
71
71
|
"release": {
|
|
72
72
|
"publishToClawHub": true,
|
package/dist/targets-BNDUOdvI.js
DELETED