@openclaw/discord 2026.6.5 → 2026.6.6-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/action-runtime-api.js +1 -1
- package/dist/api.js +13 -13
- package/dist/{approval-handler.runtime-DQiJ1Z0k.js → approval-handler.runtime-B3gyUd-L.js} +3 -3
- package/dist/{audit-eI8e8RpG.js → audit-BlfewK04.js} +3 -3
- package/dist/{channel-rVB2j2W5.js → channel-D1F1Rd9W.js} +15 -15
- package/dist/{channel-actions-BaPDAWN_.js → channel-actions-mj6l-3MR.js} +6 -3
- package/dist/{channel-actions.runtime-BEMDJjP1.js → channel-actions.runtime-VhdpzLxz.js} +5 -5
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.setup-BX7g7pL-.js → channel.setup-By5cfELZ.js} +2 -2
- package/dist/{components-CCbYVuVr.js → components-D-CYw0-b.js} +1 -1
- package/dist/contract-api.js +1 -7
- package/dist/{conversation-identity-CEP1KbK0.js → conversation-identity-CKzQAqFF.js} +2 -2
- package/dist/{directory-config-j1bfTue_.js → directory-config-Bu7FYOsl.js} +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/{directory-live-BjBs64RV.js → directory-live-LjENjK6L.js} +1 -1
- package/dist/{handle-action.guild-admin-CqUsOA2L.js → handle-action.guild-admin-CqDSVry3.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/legacy-state-migrations-api.js +1 -1
- package/dist/{manager.runtime-DyYIi2by.js → manager.runtime-BGJHboPr.js} +3 -3
- package/dist/{message-handler-BVIAmV5J.js → message-handler-CSLoBcem.js} +7 -7
- package/dist/{message-handler.preflight-BwvDbPNH.js → message-handler.preflight-Bd7_OArA.js} +20 -11
- package/dist/{message-handler.process-fTJCmd5o.js → message-handler.process-VFjwLei2.js} +21 -27
- package/dist/{message-utils-ZTGvA2L8.js → message-utils-Bx993JLN.js} +2 -2
- package/dist/{outbound-adapter-Bt6-9M13.js → outbound-adapter-CmN7ao1t.js} +6 -6
- package/dist/{pluralkit-BEEldePl.js → pluralkit-SYmlmerw.js} +1 -1
- package/dist/{provider-BzydhoOf.js → provider-TciPJrrX.js} +19 -19
- package/dist/{provider-session.runtime-CXhifSRN.js → provider-session.runtime-BevqNU6t.js} +3 -3
- package/dist/provider.runtime-DEIIsrzu.js +2 -0
- package/dist/{resolve-channels-DLNfxFQP.js → resolve-channels-Rautpk8n.js} +1 -1
- package/dist/{resolve-users-QTyD8qgI.js → resolve-users-Bw7vvtsi.js} +1 -1
- package/dist/{runtime-Dds0Ww1n.js → runtime-CTEQkMzj.js} +7 -7
- package/dist/runtime-api.actions.js +2 -2
- package/dist/runtime-api.js +22 -22
- package/dist/runtime-api.lookup.js +4 -4
- package/dist/runtime-api.monitor-XwB3ioXs.js +6 -0
- package/dist/runtime-api.monitor.js +6 -6
- package/dist/runtime-api.send.js +5 -5
- package/dist/runtime-api.threads.js +5 -5
- package/dist/{send-CyyRF1yd.js → send-zGsXF-up.js} +3 -3
- package/dist/{send.components-a9JQeeH5.js → send.components-ktzrUTkt.js} +4 -4
- package/dist/{send.outbound-DhMLobqR.js → send.outbound-C8oC51um.js} +3 -3
- package/dist/{send.receipt-Z8V6yMOY.js → send.receipt-DsQWEQ2O.js} +65 -6
- package/dist/{send.shared-B3QxPnR3.js → send.shared-Dvo2ZCVG.js} +2 -2
- package/dist/session-binding-contract-api.js +2 -0
- package/dist/setup-plugin-api.js +1 -1
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/{subagent-hooks-nBcp0iGm.js → subagent-hooks-kjrWDeDg.js} +2 -2
- package/dist/{system-events-NnSID6Q5.js → system-events-CvU3Aduf.js} +1 -1
- package/dist/{target-resolver-BKGK0ftO.js → target-resolver-DMPTzuo7.js} +2 -2
- package/dist/targets-CKaNidbk.js +3 -0
- package/dist/{thread-bindings-Tfr_vFxk.js → thread-bindings-DO32M2kW.js} +6 -6
- package/dist/{thread-bindings.discord-api-CfDs1lWu.js → thread-bindings.discord-api-304M1PMr.js} +5 -5
- package/dist/{thread-bindings.manager-CRc4hYr1.js → thread-bindings.manager-C9YT7wF2.js} +4 -4
- package/dist/{thread-bindings.session-updates-DeMxmcXB.js → thread-bindings.session-updates-Chs3HgGa.js} +1 -1
- package/dist/{thread-bindings.state-CVLF7gJH.js → thread-bindings.state-iSWjCYjB.js} +9 -8
- package/dist/timeouts-C5TBc_9x.js +106 -0
- package/dist/timeouts.js +1 -1
- package/dist/{transcripts-source-Cegx0wdw.js → transcripts-source-Chy2OrO_.js} +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/dist/{typing-C7RXECnL.js → typing-BaivbXIG.js} +2 -2
- package/npm-shrinkwrap.json +3 -3
- package/package.json +4 -4
- package/dist/provider.runtime-_cUqt2ma.js +0 -2
- package/dist/runtime-api.monitor-DuIuN9Ro.js +0 -6
- package/dist/targets-Cv797U29.js +0 -3
- package/dist/timeouts-CEJ3--Uw.js +0 -55
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Ht as parseDiscordTarget, Wt as __exportAll } from "./send.receipt-
|
|
2
|
-
import "./targets-
|
|
3
|
-
import { A as shouldPersistBindingMutations, C as resolveThreadBindingIdleTimeoutMs$1, D as saveBindingsToDisk, E as resolveThreadBindingMaxAgeMs$1, T as resolveThreadBindingMaxAgeExpiresAt, d as isRecentlyUnboundThreadWebhookMessage, g as rememberRecentUnboundWebhookEcho, h as normalizeThreadId, n as MANAGERS_BY_ACCOUNT_ID, t as BINDINGS_BY_THREAD_ID, u as getThreadBindingToken, w as resolveThreadBindingInactivityExpiresAt, y as removeBindingRecord } from "./thread-bindings.state-
|
|
4
|
-
import { n as setThreadBindingMaxAgeBySessionKey, r as resolveBindingIdsForTargetSession, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-
|
|
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-
|
|
1
|
+
import { Ht as parseDiscordTarget, Wt as __exportAll } from "./send.receipt-DsQWEQ2O.js";
|
|
2
|
+
import "./targets-CKaNidbk.js";
|
|
3
|
+
import { A as shouldPersistBindingMutations, C as resolveThreadBindingIdleTimeoutMs$1, D as saveBindingsToDisk, E as resolveThreadBindingMaxAgeMs$1, T as resolveThreadBindingMaxAgeExpiresAt, d as isRecentlyUnboundThreadWebhookMessage, g as rememberRecentUnboundWebhookEcho, h as normalizeThreadId, n as MANAGERS_BY_ACCOUNT_ID, t as BINDINGS_BY_THREAD_ID, u as getThreadBindingToken, w as resolveThreadBindingInactivityExpiresAt, y as removeBindingRecord } from "./thread-bindings.state-iSWjCYjB.js";
|
|
4
|
+
import { n as setThreadBindingMaxAgeBySessionKey, r as resolveBindingIdsForTargetSession, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-Chs3HgGa.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-304M1PMr.js";
|
|
6
|
+
import { i as testing, n as createThreadBindingManager, r as getThreadBindingManager, t as createNoopThreadBindingManager } from "./thread-bindings.manager-C9YT7wF2.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-CfDs1lWu.js → thread-bindings.discord-api-304M1PMr.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
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-
|
|
5
|
-
import { M as toReusableWebhookKey, _ as rememberReusableWebhook, i as REUSABLE_WEBHOOKS_BY_ACCOUNT_CHANNEL, t as BINDINGS_BY_THREAD_ID } from "./thread-bindings.state-
|
|
1
|
+
import { Ut as resolveDiscordChannelId, pt as getChannel, tt as createChannelWebhook } from "./send.receipt-DsQWEQ2O.js";
|
|
2
|
+
import { I as createDiscordRestClient } from "./send.shared-Dvo2ZCVG.js";
|
|
3
|
+
import { c as sendWebhookMessageDiscord, u as createThreadDiscord } from "./send-zGsXF-up.js";
|
|
4
|
+
import { t as sendMessageDiscord } from "./send.outbound-C8oC51um.js";
|
|
5
|
+
import { M as toReusableWebhookKey, _ as rememberReusableWebhook, i as REUSABLE_WEBHOOKS_BY_ACCOUNT_CHANNEL, t as BINDINGS_BY_THREAD_ID } from "./thread-bindings.state-iSWjCYjB.js";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { ChannelType } from "discord-api-types/v10";
|
|
8
8
|
import { parseStrictNonNegativeInteger } from "openclaw/plugin-sdk/number-runtime";
|
|
@@ -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-
|
|
3
|
-
import { C as resolveThreadBindingIdleTimeoutMs$1, D as saveBindingsToDisk, E as resolveThreadBindingMaxAgeMs$1, F as THREAD_BINDINGS_SWEEP_INTERVAL_MS, N as DEFAULT_THREAD_BINDING_IDLE_TIMEOUT_MS, O as setBindingRecord, S as resolveBindingRecordKey, T as resolveThreadBindingMaxAgeExpiresAt, b as resetThreadBindingsForTests, c as ensureBindingsLoaded, g as rememberRecentUnboundWebhookEcho, h as normalizeThreadId, k as shouldDefaultPersist, l as forgetThreadBindingToken, m as normalizeThreadBindingDurationMs, n as MANAGERS_BY_ACCOUNT_ID, p as normalizeTargetKind, 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 rememberThreadBindingToken, w as resolveThreadBindingInactivityExpiresAt, x as resolveBindingIdsForSession, y as removeBindingRecord } from "./thread-bindings.state-
|
|
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-
|
|
1
|
+
import { Ut as resolveDiscordChannelId, Wt as __exportAll, pt as getChannel } from "./send.receipt-DsQWEQ2O.js";
|
|
2
|
+
import { I as createDiscordRestClient } from "./send.shared-Dvo2ZCVG.js";
|
|
3
|
+
import { C as resolveThreadBindingIdleTimeoutMs$1, D as saveBindingsToDisk, E as resolveThreadBindingMaxAgeMs$1, F as THREAD_BINDINGS_SWEEP_INTERVAL_MS, N as DEFAULT_THREAD_BINDING_IDLE_TIMEOUT_MS, O as setBindingRecord, S as resolveBindingRecordKey, T as resolveThreadBindingMaxAgeExpiresAt, b as resetThreadBindingsForTests, c as ensureBindingsLoaded, g as rememberRecentUnboundWebhookEcho, h as normalizeThreadId, k as shouldDefaultPersist, l as forgetThreadBindingToken, m as normalizeThreadBindingDurationMs, n as MANAGERS_BY_ACCOUNT_ID, p as normalizeTargetKind, 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 rememberThreadBindingToken, w as resolveThreadBindingInactivityExpiresAt, x as resolveBindingIdsForSession, y as removeBindingRecord } from "./thread-bindings.state-iSWjCYjB.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-304M1PMr.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";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as shouldPersistBindingMutations, D as saveBindingsToDisk, O as setBindingRecord, c as ensureBindingsLoaded, t as BINDINGS_BY_THREAD_ID, x as resolveBindingIdsForSession } from "./thread-bindings.state-
|
|
1
|
+
import { A as shouldPersistBindingMutations, D as saveBindingsToDisk, O as setBindingRecord, c as ensureBindingsLoaded, t as BINDINGS_BY_THREAD_ID, x as resolveBindingIdsForSession } from "./thread-bindings.state-iSWjCYjB.js";
|
|
2
2
|
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
3
3
|
//#region extensions/discord/src/monitor/thread-bindings.session-shared.ts
|
|
4
4
|
function normalizeNonNegativeMs(raw) {
|
|
@@ -114,23 +114,24 @@ function normalizePersistedBinding(threadIdKey, raw) {
|
|
|
114
114
|
migratedIdleTimeoutMs = 0;
|
|
115
115
|
migratedMaxAgeMs = Math.max(1, legacyExpiresAt - Math.max(0, baseBoundAt));
|
|
116
116
|
}
|
|
117
|
-
|
|
117
|
+
const record = {
|
|
118
118
|
accountId,
|
|
119
119
|
channelId,
|
|
120
120
|
threadId,
|
|
121
121
|
targetKind,
|
|
122
122
|
targetSessionKey,
|
|
123
123
|
agentId,
|
|
124
|
-
label,
|
|
125
|
-
webhookId,
|
|
126
|
-
webhookToken,
|
|
127
124
|
boundBy,
|
|
128
125
|
boundAt,
|
|
129
|
-
lastActivityAt
|
|
130
|
-
idleTimeoutMs: migratedIdleTimeoutMs,
|
|
131
|
-
maxAgeMs: migratedMaxAgeMs,
|
|
132
|
-
metadata
|
|
126
|
+
lastActivityAt
|
|
133
127
|
};
|
|
128
|
+
if (label !== void 0) record.label = label;
|
|
129
|
+
if (webhookId !== void 0) record.webhookId = webhookId;
|
|
130
|
+
if (webhookToken !== void 0) record.webhookToken = webhookToken;
|
|
131
|
+
if (migratedIdleTimeoutMs !== void 0) record.idleTimeoutMs = migratedIdleTimeoutMs;
|
|
132
|
+
if (migratedMaxAgeMs !== void 0) record.maxAgeMs = migratedMaxAgeMs;
|
|
133
|
+
if (metadata !== void 0) record.metadata = metadata;
|
|
134
|
+
return record;
|
|
134
135
|
}
|
|
135
136
|
function normalizeThreadBindingDurationMs(raw, defaultsTo) {
|
|
136
137
|
if (typeof raw !== "number" || !Number.isFinite(raw)) return defaultsTo;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
2
|
+
//#region extensions/discord/src/monitor/timeouts.ts
|
|
3
|
+
const DISCORD_DEFAULT_LISTENER_TIMEOUT_MS = 12e4;
|
|
4
|
+
const DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS = 30 * 6e4;
|
|
5
|
+
const DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS = 6e4;
|
|
6
|
+
const DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS = 12e4;
|
|
7
|
+
/** @deprecated Discord listener timeouts are compatibility-only. */
|
|
8
|
+
function normalizeDiscordListenerTimeoutMs(raw) {
|
|
9
|
+
if (!Number.isFinite(raw) || (raw ?? 0) <= 0) return DISCORD_DEFAULT_LISTENER_TIMEOUT_MS;
|
|
10
|
+
return resolveTimerTimeoutMs(raw, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, 1e3);
|
|
11
|
+
}
|
|
12
|
+
/** @deprecated Discord no longer applies channel-owned inbound run timeouts. */
|
|
13
|
+
function normalizeDiscordInboundWorkerTimeoutMs(raw) {
|
|
14
|
+
if (raw === 0) return;
|
|
15
|
+
if (typeof raw !== "number" || !Number.isFinite(raw) || raw < 0) return DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS;
|
|
16
|
+
return resolveTimerTimeoutMs(raw, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, 1);
|
|
17
|
+
}
|
|
18
|
+
/** @deprecated Compatibility helper for old Discord timeout integrations. */
|
|
19
|
+
function isAbortError(error) {
|
|
20
|
+
if (typeof error !== "object" || error === null) return false;
|
|
21
|
+
return "name" in error && String(error.name) === "AbortError";
|
|
22
|
+
}
|
|
23
|
+
function mergeAbortSignals(signals) {
|
|
24
|
+
const activeSignals = signals.filter((signal) => Boolean(signal));
|
|
25
|
+
if (activeSignals.length === 0) return;
|
|
26
|
+
if (activeSignals.length === 1) return activeSignals[0];
|
|
27
|
+
if (typeof AbortSignal.any === "function") return AbortSignal.any(activeSignals);
|
|
28
|
+
const fallbackController = new AbortController();
|
|
29
|
+
for (const signal of activeSignals) if (signal.aborted) {
|
|
30
|
+
fallbackController.abort();
|
|
31
|
+
return fallbackController.signal;
|
|
32
|
+
}
|
|
33
|
+
const abortFallback = () => {
|
|
34
|
+
fallbackController.abort();
|
|
35
|
+
for (const signal of activeSignals) signal.removeEventListener("abort", abortFallback);
|
|
36
|
+
};
|
|
37
|
+
for (const signal of activeSignals) signal.addEventListener("abort", abortFallback, { once: true });
|
|
38
|
+
return fallbackController.signal;
|
|
39
|
+
}
|
|
40
|
+
/** @deprecated Discord no longer uses this for channel-owned message run timeouts. */
|
|
41
|
+
async function runDiscordTaskWithTimeout(params) {
|
|
42
|
+
const timeoutMs = params.timeoutMs === void 0 ? void 0 : resolveTimerTimeoutMs(params.timeoutMs, 0, 0);
|
|
43
|
+
const timeoutAbortController = timeoutMs ? new AbortController() : void 0;
|
|
44
|
+
const mergedAbortSignal = mergeAbortSignals([...params.abortSignals ?? [], timeoutAbortController?.signal]);
|
|
45
|
+
let timedOut = false;
|
|
46
|
+
let timeoutHandle = null;
|
|
47
|
+
const runPromise = params.run(mergedAbortSignal).catch((error) => {
|
|
48
|
+
if (!timedOut) throw error;
|
|
49
|
+
if (timeoutAbortController?.signal.aborted && isAbortError(error)) {
|
|
50
|
+
params.onAbortAfterTimeout?.();
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
params.onErrorAfterTimeout?.(error);
|
|
54
|
+
});
|
|
55
|
+
try {
|
|
56
|
+
if (!timeoutMs) {
|
|
57
|
+
await runPromise;
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
const timeoutPromise = new Promise((resolve) => {
|
|
61
|
+
timeoutHandle = setTimeout(() => resolve("timeout"), timeoutMs);
|
|
62
|
+
timeoutHandle.unref?.();
|
|
63
|
+
});
|
|
64
|
+
if (await Promise.race([runPromise.then(() => "completed"), timeoutPromise]) === "timeout") {
|
|
65
|
+
timedOut = true;
|
|
66
|
+
timeoutAbortController?.abort();
|
|
67
|
+
await params.onTimeout(timeoutMs);
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
return false;
|
|
71
|
+
} finally {
|
|
72
|
+
if (timeoutHandle) clearTimeout(timeoutHandle);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async function raceWithTimeout(params) {
|
|
76
|
+
const timeoutMs = resolveTimerTimeoutMs(params.timeoutMs, 1);
|
|
77
|
+
let timeoutTimer;
|
|
78
|
+
const timeoutPromise = new Promise((resolve) => {
|
|
79
|
+
timeoutTimer = setTimeout(() => resolve(params.onTimeout()), timeoutMs);
|
|
80
|
+
timeoutTimer.unref?.();
|
|
81
|
+
});
|
|
82
|
+
try {
|
|
83
|
+
return await Promise.race([params.promise, timeoutPromise]);
|
|
84
|
+
} finally {
|
|
85
|
+
if (timeoutTimer) clearTimeout(timeoutTimer);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async function withAbortTimeout(params) {
|
|
89
|
+
const timeoutMs = resolveTimerTimeoutMs(params.timeoutMs, 1);
|
|
90
|
+
const controller = new AbortController();
|
|
91
|
+
let timeoutTimer;
|
|
92
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
93
|
+
timeoutTimer = setTimeout(() => {
|
|
94
|
+
controller.abort();
|
|
95
|
+
reject(params.createTimeoutError());
|
|
96
|
+
}, timeoutMs);
|
|
97
|
+
timeoutTimer.unref?.();
|
|
98
|
+
});
|
|
99
|
+
try {
|
|
100
|
+
return await Promise.race([params.run(controller.signal), timeoutPromise]);
|
|
101
|
+
} finally {
|
|
102
|
+
if (timeoutTimer) clearTimeout(timeoutTimer);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//#endregion
|
|
106
|
+
export { isAbortError as a, normalizeDiscordListenerTimeoutMs as c, withAbortTimeout as d, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS as i, raceWithTimeout as l, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS as n, mergeAbortSignals as o, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS as r, normalizeDiscordInboundWorkerTimeoutMs as s, DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS as t, runDiscordTaskWithTimeout as u };
|
package/dist/timeouts.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-
|
|
1
|
+
import { i as DISCORD_DEFAULT_LISTENER_TIMEOUT_MS, n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, r as DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-C5TBc_9x.js";
|
|
2
2
|
export { DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Wt as __exportAll } from "./send.receipt-
|
|
1
|
+
import { Wt as __exportAll } from "./send.receipt-DsQWEQ2O.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-Chy2OrO_.js";
|
|
2
2
|
export { discordVoiceTranscriptsSourceProvider };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Wt as __exportAll, bt as sendChannelTyping } from "./send.receipt-
|
|
2
|
-
import {
|
|
1
|
+
import { Wt as __exportAll, bt as sendChannelTyping } from "./send.receipt-DsQWEQ2O.js";
|
|
2
|
+
import { l as raceWithTimeout } from "./timeouts-C5TBc_9x.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;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/discord",
|
|
3
|
-
"version": "2026.6.
|
|
3
|
+
"version": "2026.6.6-beta.2",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@openclaw/discord",
|
|
9
|
-
"version": "2026.6.
|
|
9
|
+
"version": "2026.6.6-beta.2",
|
|
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.6.
|
|
19
|
+
"openclaw": ">=2026.6.6-beta.2"
|
|
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.6.
|
|
3
|
+
"version": "2026.6.6-beta.2",
|
|
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.6.
|
|
19
|
+
"openclaw": ">=2026.6.6-beta.2"
|
|
20
20
|
},
|
|
21
21
|
"peerDependenciesMeta": {
|
|
22
22
|
"openclaw": {
|
|
@@ -63,10 +63,10 @@
|
|
|
63
63
|
"allowInvalidConfigRecovery": true
|
|
64
64
|
},
|
|
65
65
|
"compat": {
|
|
66
|
-
"pluginApi": ">=2026.6.
|
|
66
|
+
"pluginApi": ">=2026.6.6-beta.2"
|
|
67
67
|
},
|
|
68
68
|
"build": {
|
|
69
|
-
"openclawVersion": "2026.6.
|
|
69
|
+
"openclawVersion": "2026.6.6-beta.2"
|
|
70
70
|
},
|
|
71
71
|
"release": {
|
|
72
72
|
"publishToClawHub": true,
|
package/dist/targets-Cv797U29.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
2
|
-
//#region extensions/discord/src/monitor/timeouts.ts
|
|
3
|
-
const DISCORD_DEFAULT_LISTENER_TIMEOUT_MS = 12e4;
|
|
4
|
-
const DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS = 30 * 6e4;
|
|
5
|
-
const DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS = 6e4;
|
|
6
|
-
const DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS = 12e4;
|
|
7
|
-
function mergeAbortSignals(signals) {
|
|
8
|
-
const activeSignals = signals.filter((signal) => Boolean(signal));
|
|
9
|
-
if (activeSignals.length === 0) return;
|
|
10
|
-
if (activeSignals.length === 1) return activeSignals[0];
|
|
11
|
-
if (typeof AbortSignal.any === "function") return AbortSignal.any(activeSignals);
|
|
12
|
-
const fallbackController = new AbortController();
|
|
13
|
-
for (const signal of activeSignals) if (signal.aborted) {
|
|
14
|
-
fallbackController.abort();
|
|
15
|
-
return fallbackController.signal;
|
|
16
|
-
}
|
|
17
|
-
const abortFallback = () => {
|
|
18
|
-
fallbackController.abort();
|
|
19
|
-
for (const signal of activeSignals) signal.removeEventListener("abort", abortFallback);
|
|
20
|
-
};
|
|
21
|
-
for (const signal of activeSignals) signal.addEventListener("abort", abortFallback, { once: true });
|
|
22
|
-
return fallbackController.signal;
|
|
23
|
-
}
|
|
24
|
-
async function raceWithTimeout(params) {
|
|
25
|
-
const timeoutMs = resolveTimerTimeoutMs(params.timeoutMs, 1);
|
|
26
|
-
let timeoutTimer;
|
|
27
|
-
const timeoutPromise = new Promise((resolve) => {
|
|
28
|
-
timeoutTimer = setTimeout(() => resolve(params.onTimeout()), timeoutMs);
|
|
29
|
-
timeoutTimer.unref?.();
|
|
30
|
-
});
|
|
31
|
-
try {
|
|
32
|
-
return await Promise.race([params.promise, timeoutPromise]);
|
|
33
|
-
} finally {
|
|
34
|
-
if (timeoutTimer) clearTimeout(timeoutTimer);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
async function withAbortTimeout(params) {
|
|
38
|
-
const timeoutMs = resolveTimerTimeoutMs(params.timeoutMs, 1);
|
|
39
|
-
const controller = new AbortController();
|
|
40
|
-
let timeoutTimer;
|
|
41
|
-
const timeoutPromise = new Promise((_, reject) => {
|
|
42
|
-
timeoutTimer = setTimeout(() => {
|
|
43
|
-
controller.abort();
|
|
44
|
-
reject(params.createTimeoutError());
|
|
45
|
-
}, timeoutMs);
|
|
46
|
-
timeoutTimer.unref?.();
|
|
47
|
-
});
|
|
48
|
-
try {
|
|
49
|
-
return await Promise.race([params.run(controller.signal), timeoutPromise]);
|
|
50
|
-
} finally {
|
|
51
|
-
if (timeoutTimer) clearTimeout(timeoutTimer);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
//#endregion
|
|
55
|
-
export { mergeAbortSignals as a, DISCORD_DEFAULT_LISTENER_TIMEOUT_MS as i, DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS as n, raceWithTimeout as o, DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS as r, withAbortTimeout as s, DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS as t };
|