@openclaw/discord 2026.8.33 → 2026.8.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.setup/{activities-api-C-Bsnq1G.mjs → activities-api-BwQKkvff.mjs} +4 -4
- package/dist/.setup/{api-BPmtSfv2.mjs → api-kTDbK4de.mjs} +1 -1
- package/dist/.setup/{approval-handler.runtime-Bs_TXgLF.mjs → approval-handler.runtime-BDfIYRq2.mjs} +16 -10
- package/dist/.setup/{audit-ZQTgYzB4.mjs → audit-CKa5IoCq.mjs} +4 -4
- package/dist/.setup/{channel-DF2ExUs2.mjs → channel-CZSRIHJh.mjs} +21 -17
- package/dist/.setup/{channel-actions.runtime-jRU56t8E.mjs → channel-actions.runtime-BN2Bo6so.mjs} +7 -7
- package/dist/.setup/{retry-after-BrLjLUJi.mjs → channel-type-CGDUPxwc.mjs} +7 -1
- package/dist/.setup/{channel.setup-0Wxa3OWc.mjs → channel.setup-Bur0l9L5.mjs} +3 -3
- package/dist/.setup/{components-CEeBxgcs.mjs → components-CoCQebYz.mjs} +3 -3
- package/dist/.setup/{conversation-binding-route-B9XcnpJU.mjs → conversation-binding-route-lGfxhTC8.mjs} +1 -1
- package/dist/.setup/{directory-config-Dc3B-ZMl.mjs → directory-config-DCfqBbC0.mjs} +1 -1
- package/dist/.setup/{directory-live-N2I3Zs-M.mjs → directory-live-D12MauCI.mjs} +2 -2
- package/dist/.setup/{doctor-BHWMlh0v.mjs → doctor-BFwyA5iJ.mjs} +2 -2
- package/dist/.setup/{handle-action.guild-admin-Da1BoWav.mjs → handle-action.guild-admin-DlRmtY7d.mjs} +2 -2
- package/dist/.setup/{message-handler-BUf5UZ99.mjs → message-handler-csC1_h15.mjs} +6 -11
- package/dist/.setup/{message-handler.preflight-D1Gr8s9O.mjs → message-handler.preflight-D6m727PE.mjs} +11 -11
- package/dist/.setup/{message-handler.process-B4cKeEIn.mjs → message-handler.process-CDCvR5h9.mjs} +18 -12
- package/dist/.setup/{message-text-DSUwjMvz.mjs → message-text-D1pWUazL.mjs} +1 -1
- package/dist/.setup/{outbound-adapter-Bt2FeOIt.mjs → outbound-adapter-Chm8qvn4.mjs} +17 -8
- package/dist/.setup/{outbound-components-BfHsZg_Z.mjs → outbound-components-BBZ6nUHC.mjs} +3 -3
- package/dist/.setup/{outbound-session-route-CbGbV68Y.mjs → outbound-session-route-0ulhwPFj.mjs} +6 -3
- package/dist/.setup/{pluralkit-CypgBmxZ.mjs → pluralkit-CqssqANl.mjs} +1 -1
- package/dist/.setup/{probe-nNUYDl3D.mjs → probe-C-h4at-8.mjs} +1 -1
- package/dist/.setup/{probe.runtime-E8rurbhe.mjs → probe.runtime-Bo5mMeDP.mjs} +1 -1
- package/dist/.setup/{provider-Doz9PQWC.mjs → provider-Ba4-fuFV.mjs} +22 -22
- package/dist/.setup/{provider-session.runtime-CKfWV4ar.mjs → provider-session.runtime-BpjJX34f.mjs} +3 -3
- package/dist/.setup/provider.runtime-CKbLUNMq.mjs +2 -0
- package/dist/.setup/{realtime-session.runtime-Daa6MqqD.mjs → realtime-session.runtime-CNbzjoNe.mjs} +1 -1
- package/dist/.setup/{resolve-allowlist-common-BxhPJmek.mjs → resolve-allowlist-common-DSui4O22.mjs} +1 -1
- package/dist/.setup/{resolve-channels-Dzpy_xQQ.mjs → resolve-channels-BKEOjdaq.mjs} +4 -4
- package/dist/.setup/{resolve-users-CuMowsQo.mjs → resolve-users-4wQGN81h.mjs} +3 -3
- package/dist/.setup/{retry-B_XP5NOZ.mjs → retry-BtpfSmcV.mjs} +2 -2
- package/dist/.setup/{runtime-BfZLEPgp.mjs → runtime-BYnanhCN.mjs} +8 -8
- package/dist/.setup/{runtime-DpP83aPR.mjs → runtime-CF--tPzY.mjs} +1 -1
- package/dist/.setup/{send-CymvczbX.mjs → send-jx1xq6VI.mjs} +63 -50
- package/dist/.setup/{send.components-CYpxNGMy.mjs → send.components-C85HkVgh.mjs} +4 -4
- package/dist/.setup/{send.outbound-DR2oYnMr.mjs → send.outbound-Cne1E1Ys.mjs} +3 -3
- package/dist/.setup/{send.shared-3gLZcqCz.mjs → send.shared-BljlFDUk.mjs} +12 -9
- package/dist/.setup/setup-plugin-api-CbpX72Q5.mjs +3 -0
- package/dist/.setup/{shared-BatfFi3a.mjs → shared-DZqXK-Da.mjs} +1 -1
- package/dist/.setup/{subagent-hooks-D78_6mH2.mjs → subagent-hooks-CIfMjUwr.mjs} +2 -2
- package/dist/.setup/{system-events-CpvWZtoY.mjs → system-events-CLIJ2rLL.mjs} +1 -1
- package/dist/.setup/{target-resolver-C1JWPpuA.mjs → target-resolver-8yRFu_yi.mjs} +2 -2
- package/dist/.setup/targets-ueZDqOW4.mjs +3 -0
- package/dist/.setup/{thread-bindings-DB2lxpj7.mjs → thread-bindings-W-yX7LUM.mjs} +3 -3
- package/dist/.setup/{thread-bindings.manager-BgOMPrjG.mjs → thread-bindings.manager-DWsWOJ_n.mjs} +5 -5
- package/dist/.setup/{threading-GYQaIegI.mjs → threading-BF7weZ9x.mjs} +4 -4
- package/dist/.setup/{transcripts-source-Cd4F1k_2.mjs → transcripts-source-Cdn3N3o6.mjs} +1 -1
- package/dist/.setup/{typing-Br2kUYWE.mjs → typing--DRxDu9D.mjs} +1 -1
- package/dist/.setup/{voice-runtime-Ca2A-GG0.mjs → voice-runtime-DeuqoHm9.mjs} +4 -4
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +1 -1
- package/dist/api.js +14 -14
- package/dist/channel-plugin-api.js +1 -1
- package/dist/directory-contract-api.js +1 -1
- package/dist/index.js +1 -1
- package/dist/runtime-api.js +16 -16
- package/dist/setup-entry.js +1 -1
- package/dist/setup-plugin-api.js +1 -1
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/transcripts-source-api.js +1 -1
- package/package.json +4 -4
- package/dist/.setup/channel-type-CVLZyGYS.mjs +0 -7
- package/dist/.setup/provider.runtime-D3LY9lWO.mjs +0 -2
- package/dist/.setup/setup-plugin-api-FH_1XPpk.mjs +0 -3
- package/dist/.setup/targets-BdyllneU.mjs +0 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { v as resolveDiscordChannelId$1 } from "./retry-
|
|
2
|
-
import { S as parseDiscordActivityCustomId, i as buildDiscordPresentationComponents } from "./components-
|
|
1
|
+
import { v as resolveDiscordChannelId$1 } from "./retry-BtpfSmcV.mjs";
|
|
2
|
+
import { S as parseDiscordActivityCustomId, i as buildDiscordPresentationComponents } from "./components-CoCQebYz.mjs";
|
|
3
3
|
import { c as resolveDiscordAccount } from "./accounts-CwJQoLjM.mjs";
|
|
4
|
-
import { r as sendDiscordComponentMessage } from "./send.components-
|
|
5
|
-
import { r as setDiscordActivitiesRuntime, t as DiscordActivitiesRuntime } from "./runtime-
|
|
4
|
+
import { r as sendDiscordComponentMessage } from "./send.components-C85HkVgh.mjs";
|
|
5
|
+
import { r as setDiscordActivitiesRuntime, t as DiscordActivitiesRuntime } from "./runtime-CF--tPzY.mjs";
|
|
6
6
|
import fs from "node:fs/promises";
|
|
7
7
|
import { logError } from "openclaw/plugin-sdk/logging-core";
|
|
8
8
|
import { resolveRequestClientIp } from "openclaw/plugin-sdk/webhook-ingress";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as parseDiscordRetryAfterBodySeconds } from "./channel-type-CGDUPxwc.mjs";
|
|
2
2
|
import { redactToolPayloadText } from "openclaw/plugin-sdk/logging-core";
|
|
3
3
|
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
4
4
|
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
package/dist/.setup/{approval-handler.runtime-Bs_TXgLF.mjs → approval-handler.runtime-BDfIYRq2.mjs}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Dt as deleteChannelMessage, _t as stripUndefinedFields, ct as Row, et as Button, ft as TextDisplay, kt as editChannelMessage, nt as Container, q as serializePayload, ut as Separator, wt as createChannelMessage, yt as createUserDmChannel } from "./retry-
|
|
2
|
-
import { s as buildExecApprovalCustomId } from "./components-
|
|
3
|
-
import { N as createDiscordClient, O as createDiscordMessageNonce } from "./send.shared-
|
|
4
|
-
import { S as isDiscordExecApprovalClientEnabled, n as DISCORD_APPROVAL_ALLOWED_MENTIONS, r as formatDiscordApprovalDisplayValue } from "./outbound-session-route-
|
|
5
|
-
import { a as shouldHandleDiscordApprovalRequest } from "./channel-
|
|
1
|
+
import { Dt as deleteChannelMessage, _t as stripUndefinedFields, ct as Row, et as Button, ft as TextDisplay, kt as editChannelMessage, nt as Container, q as serializePayload, ut as Separator, wt as createChannelMessage, yt as createUserDmChannel } from "./retry-BtpfSmcV.mjs";
|
|
2
|
+
import { s as buildExecApprovalCustomId } from "./components-CoCQebYz.mjs";
|
|
3
|
+
import { N as createDiscordClient, O as createDiscordMessageNonce } from "./send.shared-BljlFDUk.mjs";
|
|
4
|
+
import { S as isDiscordExecApprovalClientEnabled, n as DISCORD_APPROVAL_ALLOWED_MENTIONS, r as formatDiscordApprovalDisplayValue } from "./outbound-session-route-0ulhwPFj.mjs";
|
|
5
|
+
import { a as shouldHandleDiscordApprovalRequest } from "./channel-CZSRIHJh.mjs";
|
|
6
6
|
import { logDebug, logError } from "openclaw/plugin-sdk/logging-core";
|
|
7
7
|
import { ButtonStyle } from "discord-api-types/v10";
|
|
8
8
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -52,7 +52,7 @@ var ExecApprovalContainer = class extends DiscordUiContainer {
|
|
|
52
52
|
divider: true,
|
|
53
53
|
spacing: "small"
|
|
54
54
|
}));
|
|
55
|
-
components.push(new TextDisplay(`### Command\n\`\`\`\n${params.commandPreview}\n\`\`\``));
|
|
55
|
+
components.push(new TextDisplay(`### ${params.commandLabel ?? "Command"}\n\`\`\`\n${params.commandPreview}\n\`\`\``));
|
|
56
56
|
if (params.commandSecondaryPreview) components.push(new TextDisplay(`### Shell Preview\n\`\`\`\n${params.commandSecondaryPreview}\n\`\`\``));
|
|
57
57
|
if (params.metadataLines?.length) components.push(new TextDisplay(params.metadataLines.join("\n")));
|
|
58
58
|
if (params.actionRow) components.push(params.actionRow);
|
|
@@ -140,15 +140,16 @@ function resolveCommandPreviews(commandText, commandPreview, maxChars, secondary
|
|
|
140
140
|
function createApprovalContainer(params) {
|
|
141
141
|
const { view } = params;
|
|
142
142
|
const plugin = view.approvalKind === "plugin";
|
|
143
|
+
const systemAgent = view.approvalKind === "system-agent";
|
|
143
144
|
const pending = view.phase === "pending";
|
|
144
|
-
const approvalLabel = plugin ? "Plugin" : "Exec";
|
|
145
|
+
const approvalLabel = plugin ? "Plugin" : systemAgent ? "OpenClaw Change" : "Exec";
|
|
145
146
|
const { commandPreview, commandSecondaryPreview } = plugin ? {
|
|
146
147
|
commandPreview: formatCommandPreview(view.title, 700),
|
|
147
148
|
commandSecondaryPreview: formatOptionalCommandPreview(view.description, 1e3)
|
|
148
149
|
} : resolveCommandPreviews(view.commandText, view.commandPreview, pending ? 1e3 : 500, pending ? 500 : 300);
|
|
149
|
-
const decisionLabel = view.phase !== "resolved" ? void 0 : view.decision === "allow-once" ? "Allowed (once)" : view.decision === "allow-always" ? "Allowed (always)" : "Denied";
|
|
150
|
+
const decisionLabel = view.phase !== "resolved" ? void 0 : systemAgent && view.terminalStatus === "cancelled" ? "Cancelled" : systemAgent && view.applicationStatus === "applied" ? "Applied" : systemAgent && view.applicationStatus === "not-applied" ? "Not applied" : view.decision === "allow-once" ? "Allowed (once)" : view.decision === "allow-always" ? "Allowed (always)" : "Denied";
|
|
150
151
|
const title = pending ? `${approvalLabel} Approval Required` : `${approvalLabel} Approval: ${view.phase === "expired" ? "Expired" : decisionLabel}`;
|
|
151
|
-
const description = pending ? plugin ? "A plugin action needs your approval." : "A command needs your approval." : view.phase === "expired" ? "This approval request has expired." : view.resolvedBy ? `Resolved by ${formatDiscordApprovalDisplayValue(view.resolvedBy)}` : "Resolved";
|
|
152
|
+
const description = pending ? plugin ? "A plugin action needs your approval." : systemAgent ? "An OpenClaw change needs your approval." : "A command needs your approval." : view.phase === "expired" ? "This approval request has expired." : view.resolvedBy ? `Resolved by ${formatDiscordApprovalDisplayValue(view.resolvedBy)}` : "Resolved";
|
|
152
153
|
const accentColor = view.phase === "expired" ? "#99AAB5" : view.phase === "resolved" ? view.decision === "deny" ? "#ED4245" : view.decision === "allow-always" ? "#5865F2" : "#57F287" : plugin ? view.severity === "critical" ? "#ED4245" : view.severity === "info" ? "#5865F2" : "#FAA61A" : "#FFA500";
|
|
153
154
|
const approvalId = formatDiscordApprovalDisplayValue(view.approvalId);
|
|
154
155
|
const footer = pending ? `Expires <t:${Math.max(0, Math.floor(view.expiresAtMs / 1e3))}:R> · ID: ${approvalId}` : `ID: ${approvalId}`;
|
|
@@ -157,6 +158,7 @@ function createApprovalContainer(params) {
|
|
|
157
158
|
accountId: params.accountId,
|
|
158
159
|
title,
|
|
159
160
|
description,
|
|
161
|
+
commandLabel: systemAgent ? "Change" : "Command",
|
|
160
162
|
commandPreview,
|
|
161
163
|
commandSecondaryPreview,
|
|
162
164
|
metadataLines: buildApprovalMetadataLines(view.metadata),
|
|
@@ -196,7 +198,11 @@ async function finalizeMessage(params) {
|
|
|
196
198
|
}
|
|
197
199
|
}
|
|
198
200
|
const discordApprovalNativeRuntime = createChannelApprovalNativeRuntimeAdapter({
|
|
199
|
-
eventKinds: [
|
|
201
|
+
eventKinds: [
|
|
202
|
+
"exec",
|
|
203
|
+
"plugin",
|
|
204
|
+
"system-agent"
|
|
205
|
+
],
|
|
200
206
|
availability: {
|
|
201
207
|
isConfigured: (params) => {
|
|
202
208
|
const resolved = resolveHandlerContext(params);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { on as __exportAll } from "./retry-
|
|
2
|
-
import { x as fetchChannelPermissionsDiscord } from "./send.shared-
|
|
1
|
+
import { on as __exportAll } from "./retry-BtpfSmcV.mjs";
|
|
2
|
+
import { x as fetchChannelPermissionsDiscord } from "./send.shared-BljlFDUk.mjs";
|
|
3
3
|
import { t as inspectDiscordAccount } from "./account-inspect-BwQj24ht.mjs";
|
|
4
|
-
import "./send-
|
|
5
|
-
import { _ as auditDiscordChannelPermissionsWithFetcher, v as collectDiscordAuditChannelIdsForAccount } from "./outbound-session-route-
|
|
4
|
+
import "./send-jx1xq6VI.mjs";
|
|
5
|
+
import { _ as auditDiscordChannelPermissionsWithFetcher, v as collectDiscordAuditChannelIdsForAccount } from "./outbound-session-route-0ulhwPFj.mjs";
|
|
6
6
|
//#region extensions/discord/src/audit.ts
|
|
7
7
|
var audit_exports = /* @__PURE__ */ __exportAll({
|
|
8
8
|
auditDiscordChannelPermissions: () => auditDiscordChannelPermissions,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { _ as parseDiscordTarget, h as normalizeDiscordMessagingTarget, m as looksLikeDiscordTargetId } from "./retry-
|
|
1
|
+
import { _ as parseDiscordTarget, h as normalizeDiscordMessagingTarget, m as looksLikeDiscordTargetId } from "./retry-BtpfSmcV.mjs";
|
|
2
2
|
import { c as resolveDiscordAccount, i as listDiscordStartupAccountIds, l as resolveDiscordAccountAllowFrom, r as listDiscordAccountIds, s as resolveDefaultDiscordAccountId } from "./accounts-CwJQoLjM.mjs";
|
|
3
3
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
|
|
4
4
|
import { u as withAbortTimeout } from "./timeouts-D86uWLt_.mjs";
|
|
5
|
-
import { C as shouldSuppressLocalDiscordExecApprovalPrompt, D as isChannelExecApprovalClientEnabledFromConfig, E as createChannelNativeOriginTargetResolver, O as matchesApprovalRequestFilters, S as isDiscordExecApprovalClientEnabled, T as createChannelApproverDmTargetResolver, b as getDiscordExecApprovalApprovers, d as resolveDiscordCurrentConversationIdentity, f as resolveDiscordRuntimeBindingConversationId, p as discordMessageActions, s as resolveDiscordConversationRoute, t as resolveDiscordOutboundSessionRoute, w as createApproverRestrictedNativeApprovalCapability, x as isDiscordExecApprovalApprover, y as resolveRequiredDiscordChannelPermissions } from "./outbound-session-route-
|
|
6
|
-
import { a as discordSecurityAdapter, c as buildTokenChannelStatusSummary, i as discordSetupContract, l as projectCredentialSnapshotFields, n as discordConfigAdapter, o as DEFAULT_ACCOUNT_ID, s as PAIRING_APPROVED_MESSAGE, t as createDiscordPluginBase, u as resolveConfiguredFromCredentialStatuses } from "./shared-
|
|
5
|
+
import { C as shouldSuppressLocalDiscordExecApprovalPrompt, D as isChannelExecApprovalClientEnabledFromConfig, E as createChannelNativeOriginTargetResolver, O as matchesApprovalRequestFilters, S as isDiscordExecApprovalClientEnabled, T as createChannelApproverDmTargetResolver, b as getDiscordExecApprovalApprovers, d as resolveDiscordCurrentConversationIdentity, f as resolveDiscordRuntimeBindingConversationId, p as discordMessageActions, s as resolveDiscordConversationRoute, t as resolveDiscordOutboundSessionRoute, w as createApproverRestrictedNativeApprovalCapability, x as isDiscordExecApprovalApprover, y as resolveRequiredDiscordChannelPermissions } from "./outbound-session-route-0ulhwPFj.mjs";
|
|
6
|
+
import { a as discordSecurityAdapter, c as buildTokenChannelStatusSummary, i as discordSetupContract, l as projectCredentialSnapshotFields, n as discordConfigAdapter, o as DEFAULT_ACCOUNT_ID, s as PAIRING_APPROVED_MESSAGE, t as createDiscordPluginBase, u as resolveConfiguredFromCredentialStatuses } from "./shared-DZqXK-Da.mjs";
|
|
7
7
|
import { r as openDiscordCommandDeployHashStore } from "./command-deploy-store-DFkBTViB.mjs";
|
|
8
|
-
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-
|
|
8
|
+
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-lGfxhTC8.mjs";
|
|
9
9
|
import { n as setThreadBindingMaxAgeBySessionKey, t as setThreadBindingIdleTimeoutBySessionKey } from "./thread-bindings.session-updates-D04Avc2y.mjs";
|
|
10
|
-
import { n as discordOutbound } from "./outbound-adapter-
|
|
10
|
+
import { n as discordOutbound } from "./outbound-adapter-Chm8qvn4.mjs";
|
|
11
11
|
import { t as normalizeExplicitDiscordSessionKey } from "./session-key-normalization-wJgsKPNF.mjs";
|
|
12
12
|
import { t as defaultTopLevelPlacement } from "./thread-binding-api-BDZJD4na.mjs";
|
|
13
13
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
@@ -180,7 +180,11 @@ function createDiscordApprovalCapability(configOverride) {
|
|
|
180
180
|
resolveApproverDmTargets: createDiscordApproverDmTargetResolver(configOverride),
|
|
181
181
|
notifyOriginWhenDmOnly: true,
|
|
182
182
|
nativeRuntime: createLazyChannelApprovalNativeRuntimeAdapter({
|
|
183
|
-
eventKinds: [
|
|
183
|
+
eventKinds: [
|
|
184
|
+
"exec",
|
|
185
|
+
"plugin",
|
|
186
|
+
"system-agent"
|
|
187
|
+
],
|
|
184
188
|
isConfigured: ({ cfg, accountId }) => isDiscordExecApprovalClientEnabled({
|
|
185
189
|
cfg,
|
|
186
190
|
accountId,
|
|
@@ -192,7 +196,7 @@ function createDiscordApprovalCapability(configOverride) {
|
|
|
192
196
|
request,
|
|
193
197
|
configOverride
|
|
194
198
|
}),
|
|
195
|
-
load: async () => (await import("./approval-handler.runtime-
|
|
199
|
+
load: async () => (await import("./approval-handler.runtime-BDfIYRq2.mjs")).discordApprovalNativeRuntime
|
|
196
200
|
})
|
|
197
201
|
});
|
|
198
202
|
}
|
|
@@ -299,22 +303,22 @@ function resolveDiscordInboundConversation(params) {
|
|
|
299
303
|
}
|
|
300
304
|
//#endregion
|
|
301
305
|
//#region extensions/discord/src/channel.loaders.ts
|
|
302
|
-
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-
|
|
303
|
-
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-
|
|
304
|
-
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-
|
|
305
|
-
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-
|
|
306
|
-
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-
|
|
307
|
-
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-
|
|
308
|
-
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-
|
|
306
|
+
const loadDiscordDirectoryConfigModule = createLazyRuntimeModule(() => import("./directory-config-DCfqBbC0.mjs").then((n) => n.t));
|
|
307
|
+
const loadDiscordResolveChannelsModule = createLazyRuntimeModule(() => import("./resolve-channels-BKEOjdaq.mjs").then((n) => n.n));
|
|
308
|
+
const loadDiscordResolveUsersModule = createLazyRuntimeModule(() => import("./resolve-users-4wQGN81h.mjs").then((n) => n.n));
|
|
309
|
+
const loadDiscordThreadBindingsManagerModule = createLazyRuntimeModule(() => import("./thread-bindings.manager-DWsWOJ_n.mjs").then((n) => n.i));
|
|
310
|
+
const loadDiscordTargetResolverModule = createLazyRuntimeModule(() => import("./target-resolver-8yRFu_yi.mjs").then((n) => n.r));
|
|
311
|
+
const loadDiscordProviderRuntime = createLazyRuntimeModule(() => import("./provider.runtime-CKbLUNMq.mjs"));
|
|
312
|
+
const loadDiscordProbeRuntime = createLazyRuntimeModule(() => import("./probe.runtime-Bo5mMeDP.mjs"));
|
|
309
313
|
async function probeDiscordStatusAccount(params) {
|
|
310
314
|
const startedAtMs = Date.now();
|
|
311
315
|
const runtime = await loadDiscordProbeRuntime();
|
|
312
316
|
const remainingMs = Math.max(1, params.timeoutMs - Math.max(0, Date.now() - startedAtMs));
|
|
313
317
|
return await runtime.probeDiscord(params.token, remainingMs, { includeApplication: true });
|
|
314
318
|
}
|
|
315
|
-
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-
|
|
316
|
-
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-
|
|
317
|
-
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-
|
|
319
|
+
const loadDiscordAuditModule = createLazyRuntimeModule(() => import("./audit-CKa5IoCq.mjs").then((n) => n.n));
|
|
320
|
+
const loadDiscordSendModule = createLazyRuntimeModule(() => import("./send-jx1xq6VI.mjs").then((n) => n.t));
|
|
321
|
+
const loadDiscordDirectoryLiveModule = createLazyRuntimeModule(() => import("./directory-live-D12MauCI.mjs").then((n) => n.t));
|
|
318
322
|
//#endregion
|
|
319
323
|
//#region extensions/discord/src/conversation-route-owner.ts
|
|
320
324
|
function inspectDiscordConversationRouteOwner(params) {
|
package/dist/.setup/{channel-actions.runtime-jRU56t8E.mjs → channel-actions.runtime-BN2Bo6so.mjs}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { _ as parseDiscordTarget, v as resolveDiscordChannelId } from "./retry-
|
|
2
|
-
import { i as buildDiscordPresentationComponents, m as coerceDiscordComponentParam, r as buildDiscordInteractiveComponents } from "./components-
|
|
3
|
-
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-
|
|
4
|
-
import "./targets-
|
|
1
|
+
import { _ as parseDiscordTarget, v as resolveDiscordChannelId } from "./retry-BtpfSmcV.mjs";
|
|
2
|
+
import { i as buildDiscordPresentationComponents, m as coerceDiscordComponentParam, r as buildDiscordInteractiveComponents } from "./components-CoCQebYz.mjs";
|
|
3
|
+
import { a as readDiscordAutoArchiveDurationParam, t as handleDiscordAction } from "./runtime-BYnanhCN.mjs";
|
|
4
|
+
import "./targets-ueZDqOW4.mjs";
|
|
5
5
|
import "../action-runtime-api.js";
|
|
6
|
-
import { h as discordInboundEventDelivery } from "./outbound-session-route-
|
|
7
|
-
import { r as isDiscordComponentSpecWithinMessageLimit, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-
|
|
8
|
-
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-
|
|
6
|
+
import { h as discordInboundEventDelivery } from "./outbound-session-route-0ulhwPFj.mjs";
|
|
7
|
+
import { r as isDiscordComponentSpecWithinMessageLimit, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-BBZ6nUHC.mjs";
|
|
8
|
+
import { t as tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin-DlRmtY7d.mjs";
|
|
9
9
|
import { n as notifyDiscordActiveTurnThreadCreated, r as notifyDiscordActiveTurnThreadReplyDelivered } from "./active-turn-thread-route-fmHl1HNd.mjs";
|
|
10
10
|
import { normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
11
11
|
import { adaptMessagePresentationForChannel, normalizeLegacyInteractiveReply, normalizeMessagePresentation, renderMessagePresentationFallbackText } from "openclaw/plugin-sdk/interactive-runtime";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ChannelType } from "discord-api-types/v10";
|
|
1
2
|
import { asFiniteNumberInRange, parseStrictFiniteNumber } from "openclaw/plugin-sdk/number-runtime";
|
|
2
3
|
//#region extensions/discord/src/retry-after.ts
|
|
3
4
|
const RETRY_AFTER_BODY_SECONDS_RE = /^(?:\d+\.?\d*|\.\d+)$/;
|
|
@@ -10,4 +11,9 @@ function parseDiscordRetryAfterBodySeconds(value) {
|
|
|
10
11
|
});
|
|
11
12
|
}
|
|
12
13
|
//#endregion
|
|
13
|
-
|
|
14
|
+
//#region extensions/discord/src/channel-type.ts
|
|
15
|
+
function isDiscordThreadChannelType(channelType) {
|
|
16
|
+
return channelType === ChannelType.AnnouncementThread || channelType === ChannelType.PublicThread || channelType === ChannelType.PrivateThread;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { parseDiscordRetryAfterBodySeconds as n, isDiscordThreadChannelType as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { _ as inspectDiscordAccountTokenState, h as resolveDiscordToken, l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId, u as resolveDiscordAccountConfig } from "./accounts-CwJQoLjM.mjs";
|
|
2
|
-
import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-
|
|
3
|
-
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-
|
|
4
|
-
import { t as resolveDiscordUserAllowlist } from "./resolve-users-
|
|
2
|
+
import { i as discordSetupContract, t as createDiscordPluginBase } from "./shared-DZqXK-Da.mjs";
|
|
3
|
+
import { t as resolveDiscordChannelAllowlist } from "./resolve-channels-BKEOjdaq.mjs";
|
|
4
|
+
import { t as resolveDiscordUserAllowlist } from "./resolve-users-4wQGN81h.mjs";
|
|
5
5
|
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { resolveBasicAllowFromEntries } from "openclaw/plugin-sdk/allow-from";
|
|
@@ -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-BtpfSmcV.mjs";
|
|
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";
|
|
@@ -856,7 +856,7 @@ function encodeBoundedDiscordApprovalCustomId(action) {
|
|
|
856
856
|
});
|
|
857
857
|
}
|
|
858
858
|
function buildDiscordApprovalCustomId(action) {
|
|
859
|
-
if (!action.approvalId || action.approvalKind !== "exec" && action.approvalKind !== "plugin" || action.decision !== "allow-once" && action.decision !== "allow-always" && action.decision !== "deny") return;
|
|
859
|
+
if (!action.approvalId || action.approvalKind !== "exec" && action.approvalKind !== "plugin" && action.approvalKind !== "system-agent" || action.decision !== "allow-once" && action.decision !== "allow-always" && action.decision !== "deny") return;
|
|
860
860
|
return encodeBoundedDiscordApprovalCustomId(action);
|
|
861
861
|
}
|
|
862
862
|
function buildExecApprovalCustomId(approvalId, approvalKind, decision) {
|
|
@@ -880,7 +880,7 @@ function parseExecApprovalData(data) {
|
|
|
880
880
|
const rawId = coerce(data.id);
|
|
881
881
|
const rawKind = coerce(data.kind);
|
|
882
882
|
const rawAction = coerce(data.action);
|
|
883
|
-
if (!rawId || rawKind !== "exec" && rawKind !== "plugin" || !rawAction) return null;
|
|
883
|
+
if (!rawId || rawKind !== "exec" && rawKind !== "plugin" && rawKind !== "system-agent" || !rawAction) return null;
|
|
884
884
|
if (rawAction !== "allow-once" && rawAction !== "allow-always" && rawAction !== "deny") return null;
|
|
885
885
|
const approvalId = decodeCustomIdValue(rawId);
|
|
886
886
|
if (!approvalId) return null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-
|
|
1
|
+
import { l as shouldIgnoreStaleDiscordRouteBinding } from "./outbound-session-route-0ulhwPFj.mjs";
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import { on as __exportAll } from "./retry-
|
|
1
|
+
import { on as __exportAll } from "./retry-BtpfSmcV.mjs";
|
|
2
2
|
import { l as resolveDiscordAccountAllowFrom, o as mergeDiscordAccountConfig, s as resolveDefaultDiscordAccountId } from "./accounts-CwJQoLjM.mjs";
|
|
3
3
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
4
4
|
import { createResolvedDirectoryEntriesLister } from "openclaw/plugin-sdk/directory-config-runtime";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { on as __exportAll } from "./retry-
|
|
1
|
+
import { on as __exportAll } from "./retry-BtpfSmcV.mjs";
|
|
2
2
|
import { c as resolveDiscordAccount, m as normalizeDiscordToken } from "./accounts-CwJQoLjM.mjs";
|
|
3
|
-
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-
|
|
3
|
+
import { r as fetchDiscord, t as DISCORD_DIRECTORY_LOOKUP_TIMEOUT_MS } from "./api-kTDbK4de.mjs";
|
|
4
4
|
import { a as normalizeDiscordSlug } from "./allow-list-C2JuH-R0.mjs";
|
|
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";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { s as resolveDefaultDiscordAccountId } from "./accounts-CwJQoLjM.mjs";
|
|
2
|
-
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-
|
|
2
|
+
import { t as discordVoiceTranscriptsSourceProvider } from "./transcripts-source-Cdn3N3o6.mjs";
|
|
3
3
|
import { t as inspectDiscordAccount } from "./account-inspect-BwQj24ht.mjs";
|
|
4
|
-
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-
|
|
4
|
+
import { r as DISCORD_LEGACY_CONFIG_RULES } from "./shared-DZqXK-Da.mjs";
|
|
5
5
|
import { n as normalizeCompatibilityConfig } from "./doctor-contract-Co5vRCZ6.mjs";
|
|
6
6
|
import { t as isDiscordMutableAllowEntry } from "./security-doctor-nGgPm65L.mjs";
|
|
7
7
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
@@ -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-BYnanhCN.mjs";
|
|
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-0ulhwPFj.mjs";
|
|
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";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as getDiscordRuntime } from "./runtime-DgnVQ7zW.mjs";
|
|
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 { f as resolveDiscordReferencedReplyMessageId, h as resolveDiscordMessageChannelId, i as resolveDiscordMessageText, l as hasDiscordMessageStickers, p as resolveDiscordCdnPolicy } from "./message-text-
|
|
2
|
+
import { c as resolveDiscordChannelInfoSafe, d as resolveDiscordChannelParentSafe, l as resolveDiscordChannelNameSafe, s as resolveDiscordChannelIdSafe } from "./thread-bindings.manager-DWsWOJ_n.mjs";
|
|
3
|
+
import { v as mapGatewayDispatchData } from "./provider-Ba4-fuFV.mjs";
|
|
4
|
+
import { f as resolveDiscordReferencedReplyMessageId, h as resolveDiscordMessageChannelId, i as resolveDiscordMessageText, l as hasDiscordMessageStickers, p as resolveDiscordCdnPolicy } from "./message-text-D1pWUazL.mjs";
|
|
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";
|
|
@@ -249,7 +249,7 @@ function applyImplicitReplyBatchGate(ctx, replyToMode, isBatched) {
|
|
|
249
249
|
}
|
|
250
250
|
//#endregion
|
|
251
251
|
//#region extensions/discord/src/monitor/message-run-queue.ts
|
|
252
|
-
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-
|
|
252
|
+
const loadMessageProcessRuntime = createLazyRuntimeModule(() => import("./message-handler.process-CDCvR5h9.mjs"));
|
|
253
253
|
async function processDiscordQueuedMessage(params) {
|
|
254
254
|
const abortSignal = params.job.runtime.abortSignal && params.lifecycleSignal ? AbortSignal.any([params.job.runtime.abortSignal, params.lifecycleSignal]) : params.job.runtime.abortSignal ?? params.lifecycleSignal;
|
|
255
255
|
try {
|
|
@@ -336,7 +336,7 @@ function createDiscordMessageRunQueue(params) {
|
|
|
336
336
|
}
|
|
337
337
|
//#endregion
|
|
338
338
|
//#region extensions/discord/src/monitor/message-dispatcher.ts
|
|
339
|
-
const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-
|
|
339
|
+
const loadMessagePreflightRuntime = createLazyRuntimeModule(() => import("./message-handler.preflight-D6m727PE.mjs"));
|
|
340
340
|
function isNonEmptyString(value) {
|
|
341
341
|
return typeof value === "string" && value.length > 0;
|
|
342
342
|
}
|
|
@@ -474,12 +474,7 @@ function createDiscordMessageDispatcher(params) {
|
|
|
474
474
|
}
|
|
475
475
|
applyImplicitReplyBatchGate(ctx, params.replyToMode, true);
|
|
476
476
|
const ids = entries.map((entry) => entry.data.message?.id).filter(isNonEmptyString);
|
|
477
|
-
if (ids.length > 0)
|
|
478
|
-
const ctxBatch = ctx;
|
|
479
|
-
ctxBatch.MessageSids = ids;
|
|
480
|
-
ctxBatch.MessageSidFirst = ids[0];
|
|
481
|
-
ctxBatch.MessageSidLast = ids[ids.length - 1];
|
|
482
|
-
}
|
|
477
|
+
if (ids.length > 0) ctx.sourceMessageIds = ids;
|
|
483
478
|
messageRunQueue.enqueue(buildDiscordInboundJob(ctx, { ingressSettlement: ingress }));
|
|
484
479
|
} catch (error) {
|
|
485
480
|
if (abortSignal?.aborted) {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { W as Message, jt as getChannelMessage, y as discord_exports } from "./retry-
|
|
1
|
+
import { W as Message, jt as getChannelMessage, y as discord_exports } from "./retry-BtpfSmcV.mjs";
|
|
2
|
+
import { t as isDiscordThreadChannelType } from "./channel-type-CGDUPxwc.mjs";
|
|
2
3
|
import { s as resolveDefaultDiscordAccountId } from "./accounts-CwJQoLjM.mjs";
|
|
3
4
|
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.mjs";
|
|
4
|
-
import { t as isDiscordThreadChannelType } from "./channel-type-CVLZyGYS.mjs";
|
|
5
5
|
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-D86uWLt_.mjs";
|
|
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 { 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-
|
|
6
|
+
import { a as buildDiscordRoutePeer, c as resolveDiscordEffectiveRoute, f as resolveDiscordRuntimeBindingConversationId, s as resolveDiscordConversationRoute, u as resolveDiscordConversationIdentity } from "./outbound-session-route-0ulhwPFj.mjs";
|
|
7
|
+
import { t as resolveDiscordConversationBindingRoute } from "./conversation-binding-route-lGfxhTC8.mjs";
|
|
8
|
+
import { c as resolveDiscordChannelInfoSafe, l as resolveDiscordChannelNameSafe } from "./thread-bindings.manager-DWsWOJ_n.mjs";
|
|
9
|
+
import { S as resolveDiscordTextCommandAccess, _ as handleDiscordDmCommandDecision, n as resolveDiscordPreflightChannelAccess, x as resolveDiscordDmCommandAccess } from "./provider-Ba4-fuFV.mjs";
|
|
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-D1pWUazL.mjs";
|
|
11
11
|
import { n as resolveDiscordWebhookId, t as resolveDiscordSenderIdentity } from "./sender-identity-DirkiBy8.mjs";
|
|
12
12
|
import { t as createDiscordHistorySenderProvenance } from "./message-handler.history-CJOsN9w5.mjs";
|
|
13
13
|
import { logDebug } from "openclaw/plugin-sdk/logging-core";
|
|
@@ -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-jx1xq6VI.mjs").then((n) => n.t));
|
|
33
33
|
function resolveDiscordDmPairingSenderId(sender) {
|
|
34
34
|
return sender.isPluralKit ? `pk:${sender.id}` : sender.id;
|
|
35
35
|
}
|
|
@@ -424,10 +424,10 @@ function logDiscordPreflightInboundSummary(params) {
|
|
|
424
424
|
}
|
|
425
425
|
//#endregion
|
|
426
426
|
//#region extensions/discord/src/monitor/message-handler.preflight-runtime.ts
|
|
427
|
-
const loadPluralKitRuntime = createLazyRuntimeModule(() => import("./pluralkit-
|
|
427
|
+
const loadPluralKitRuntime = createLazyRuntimeModule(() => import("./pluralkit-CqssqANl.mjs").then((n) => n.n));
|
|
428
428
|
const loadPreflightAudioRuntime = createLazyRuntimeModule(() => import("./preflight-audio-DrnqFA8U.mjs"));
|
|
429
|
-
const loadSystemEventsRuntime = createLazyRuntimeModule(() => import("./system-events-
|
|
430
|
-
const loadDiscordThreadingRuntime = createLazyRuntimeModule(() => import("./threading-
|
|
429
|
+
const loadSystemEventsRuntime = createLazyRuntimeModule(() => import("./system-events-CLIJ2rLL.mjs"));
|
|
430
|
+
const loadDiscordThreadingRuntime = createLazyRuntimeModule(() => import("./threading-BF7weZ9x.mjs").then((n) => n.t));
|
|
431
431
|
function isPreflightAborted(abortSignal) {
|
|
432
432
|
return Boolean(abortSignal?.aborted);
|
|
433
433
|
}
|
package/dist/.setup/{message-handler.process-B4cKeEIn.mjs → message-handler.process-CDCvR5h9.mjs}
RENAMED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { Dt as deleteChannelMessage, a as chunkDiscordTextWithMode, kt as editChannelMessage, v as resolveDiscordChannelId, wt as createChannelMessage, y as discord_exports } from "./retry-
|
|
1
|
+
import { Dt as deleteChannelMessage, a as chunkDiscordTextWithMode, kt as editChannelMessage, v as resolveDiscordChannelId, wt as createChannelMessage, y as discord_exports } from "./retry-BtpfSmcV.mjs";
|
|
2
2
|
import { p as resolveDiscordMaxLinesPerMessage } from "./accounts-CwJQoLjM.mjs";
|
|
3
3
|
import { C as resolveTimestampMs, a as normalizeDiscordSlug, r as normalizeDiscordAllowList } from "./allow-list-C2JuH-R0.mjs";
|
|
4
|
-
import { F as createDiscordRuntimeAccountContext, P as createDiscordRestClient, d as resolveDiscordTargetChannelId, k as resolveDiscordMessageFlags } from "./send.shared-
|
|
5
|
-
import { i as discordTextHasBroadcastMention } from "./send.outbound-
|
|
6
|
-
import { a as removeReactionDiscord, f as editMessageDiscord, r as reactMessageDiscord } from "./send-
|
|
4
|
+
import { F as createDiscordRuntimeAccountContext, P as createDiscordRestClient, d as resolveDiscordTargetChannelId, k as resolveDiscordMessageFlags } from "./send.shared-BljlFDUk.mjs";
|
|
5
|
+
import { i as discordTextHasBroadcastMention } from "./send.outbound-Cne1E1Ys.mjs";
|
|
6
|
+
import { a as removeReactionDiscord, f as editMessageDiscord, r as reactMessageDiscord } from "./send-jx1xq6VI.mjs";
|
|
7
7
|
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS, t as DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS } from "./timeouts-D86uWLt_.mjs";
|
|
8
|
-
import "./targets-
|
|
9
|
-
import { a as buildDiscordRoutePeer, h as discordInboundEventDelivery, u as resolveDiscordConversationIdentity } from "./outbound-session-route-
|
|
10
|
-
import { t as DISCORD_TEXT_CHUNK_LIMIT } from "./outbound-adapter-
|
|
11
|
-
import { a as formatDiscordReplySkip, c as buildGuildLabel, g as createDiscordSupplementalContextAccessChecker, h as buildDiscordInboundAccessContext, i as formatDiscordReplyDeliveryFailure, l as resolveReplyContext, o as sanitizeDiscordFrontChannelReplyPayloads, r as deliverDiscordReply, s as buildDirectLabel } from "./provider-
|
|
12
|
-
import { a as formatDiscordMediaText, c as resolveReferencedReplyMediaList, i as resolveDiscordMessageText, u as resolveDiscordMessageStickers } from "./message-text-
|
|
13
|
-
import { a as resolveDiscordThreadStarter, n as resolveDiscordAutoThreadReplyPlan } from "./threading-
|
|
8
|
+
import "./targets-ueZDqOW4.mjs";
|
|
9
|
+
import { a as buildDiscordRoutePeer, h as discordInboundEventDelivery, u as resolveDiscordConversationIdentity } from "./outbound-session-route-0ulhwPFj.mjs";
|
|
10
|
+
import { t as DISCORD_TEXT_CHUNK_LIMIT } from "./outbound-adapter-Chm8qvn4.mjs";
|
|
11
|
+
import { a as formatDiscordReplySkip, c as buildGuildLabel, g as createDiscordSupplementalContextAccessChecker, h as buildDiscordInboundAccessContext, i as formatDiscordReplyDeliveryFailure, l as resolveReplyContext, o as sanitizeDiscordFrontChannelReplyPayloads, r as deliverDiscordReply, s as buildDirectLabel } from "./provider-Ba4-fuFV.mjs";
|
|
12
|
+
import { a as formatDiscordMediaText, c as resolveReferencedReplyMediaList, i as resolveDiscordMessageText, u as resolveDiscordMessageStickers } from "./message-text-D1pWUazL.mjs";
|
|
13
|
+
import { a as resolveDiscordThreadStarter, n as resolveDiscordAutoThreadReplyPlan } from "./threading-BF7weZ9x.mjs";
|
|
14
14
|
import { n as resolveDiscordWebhookId } from "./sender-identity-DirkiBy8.mjs";
|
|
15
15
|
import { t as beginDiscordActiveTurnThreadRoute } from "./active-turn-thread-route-fmHl1HNd.mjs";
|
|
16
16
|
import { n as filterDiscordHistoryEntriesForContext, t as createDiscordHistorySenderProvenance } from "./message-handler.history-CJOsN9w5.mjs";
|
|
17
|
-
import { t as sendTyping } from "./typing
|
|
17
|
+
import { t as sendTyping } from "./typing--DRxDu9D.mjs";
|
|
18
18
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
19
19
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
20
20
|
import { buildAgentSessionKey, resolveThreadSessionKeys } from "openclaw/plugin-sdk/routing";
|
|
@@ -24,6 +24,7 @@ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
|
24
24
|
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
25
25
|
import { resolveChunkMode } from "openclaw/plugin-sdk/reply-chunking";
|
|
26
26
|
import { convertMarkdownTables, stripInlineDirectiveTagsForDelivery, stripReasoningTagsFromText } from "openclaw/plugin-sdk/text-chunking";
|
|
27
|
+
import { resolveBatchedReplyThreadingPolicy } from "openclaw/plugin-sdk/reply-reference";
|
|
27
28
|
import { bindIngressLifecycleToReplyOptions, createChannelMessageReplyPipeline, createChannelProgressDraftCompositor, createFinalizableDraftStreamControlsForState, createTypingCallbacks, defineFinalizableLivePreviewAdapter, deliverWithFinalizableLivePreviewAdapter, resolveChannelDraftStreamingChunking, resolveChannelMessageSourceReplyDeliveryMode, resolveChannelPreviewStreamMode, resolveChannelStreamingBlockEnabled, resolveChannelStreamingPreviewCommandText, resolveChannelStreamingProgressNarration, resolveTranscriptBackedChannelFinalText } from "openclaw/plugin-sdk/channel-outbound";
|
|
28
29
|
import { getAgentScopedMediaLocalRoots } from "openclaw/plugin-sdk/media-runtime";
|
|
29
30
|
import { evaluateSupplementalContextVisibility } from "openclaw/plugin-sdk/security-runtime";
|
|
@@ -296,6 +297,7 @@ async function buildDiscordMessageProcessContext(params) {
|
|
|
296
297
|
parentId: conversationParentId,
|
|
297
298
|
threadId: threadChannel?.id ?? autoThreadContext?.createdThreadId ?? void 0
|
|
298
299
|
});
|
|
300
|
+
const batchMessageIds = ctx.sourceMessageIds && ctx.sourceMessageIds.length > 1 ? [...ctx.sourceMessageIds] : void 0;
|
|
299
301
|
const ctxPayload = await (ctx.buildContext ?? buildChannelInboundEventContext)({
|
|
300
302
|
channelIngress,
|
|
301
303
|
channel: "discord",
|
|
@@ -303,7 +305,7 @@ async function buildDiscordMessageProcessContext(params) {
|
|
|
303
305
|
contextVisibility: contextVisibilityMode,
|
|
304
306
|
accountId: route.accountId,
|
|
305
307
|
messageId: canonicalMessageId ?? message.id,
|
|
306
|
-
messageIdFull: canonicalMessageId && canonicalMessageId !== message.id ? message.id : void 0,
|
|
308
|
+
messageIdFull: canonicalMessageId && canonicalMessageId !== message.id ? ctx.sourceMessageIds?.at(-1) ?? message.id : void 0,
|
|
307
309
|
timestamp: resolveTimestampMs(message.timestamp),
|
|
308
310
|
from: effectiveFrom,
|
|
309
311
|
sender: {
|
|
@@ -394,6 +396,10 @@ async function buildDiscordMessageProcessContext(params) {
|
|
|
394
396
|
groupSystemPrompt: isGuildMessage ? groupSystemPrompt : void 0
|
|
395
397
|
},
|
|
396
398
|
extra: {
|
|
399
|
+
MessageSids: batchMessageIds,
|
|
400
|
+
MessageSidFirst: batchMessageIds?.[0],
|
|
401
|
+
MessageSidLast: batchMessageIds?.at(-1),
|
|
402
|
+
ReplyThreading: resolveBatchedReplyThreadingPolicy(replyToMode, batchMessageIds !== void 0),
|
|
397
403
|
...preflightAudioTranscript !== void 0 ? { Transcript: preflightAudioTranscript } : {},
|
|
398
404
|
GroupSubject: isDirectMessage ? void 0 : groupChannel,
|
|
399
405
|
GroupChannel: groupChannel,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as resolveDiscordChannelInfoSafe } from "./thread-bindings.manager-
|
|
1
|
+
import { c as resolveDiscordChannelInfoSafe } from "./thread-bindings.manager-DWsWOJ_n.mjs";
|
|
2
2
|
import { ComponentType, StickerFormatType } from "discord-api-types/v10";
|
|
3
3
|
import { asDateTimestampMs, resolveExpiresAtMsFromDurationMs } from "openclaw/plugin-sdk/number-runtime";
|
|
4
4
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as chunkDiscordTextWithMode, f as resolveDiscordReplyReference, g as normalizeDiscordOutboundTarget, l as toDiscordOutboundDeliveryResult, o as createDiscordSendReceipt, r as hasDiscordMessageCreateAmbiguity, s as createDiscordSendReceiptFromResults } from "./retry-
|
|
1
|
+
import { a as chunkDiscordTextWithMode, f as resolveDiscordReplyReference, g as normalizeDiscordOutboundTarget, l as toDiscordOutboundDeliveryResult, o as createDiscordSendReceipt, r as hasDiscordMessageCreateAmbiguity, s as createDiscordSendReceiptFromResults } from "./retry-BtpfSmcV.mjs";
|
|
2
2
|
import { t as createDiscordActionGate } from "./accounts-CwJQoLjM.mjs";
|
|
3
|
-
import { g as notifyDiscordInboundEventOutboundPayloadSuccess, h as discordInboundEventDelivery, r as formatDiscordApprovalDisplayValue } from "./outbound-session-route-
|
|
4
|
-
import { a as sendDiscordComponentMessageLazy, i as resolveDiscordComponentSpec, n as buildDiscordPresentationPayload, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-
|
|
3
|
+
import { g as notifyDiscordInboundEventOutboundPayloadSuccess, h as discordInboundEventDelivery, r as formatDiscordApprovalDisplayValue } from "./outbound-session-route-0ulhwPFj.mjs";
|
|
4
|
+
import { a as sendDiscordComponentMessageLazy, i as resolveDiscordComponentSpec, n as buildDiscordPresentationPayload, t as DISCORD_PRESENTATION_CAPABILITIES } from "./outbound-components-BBZ6nUHC.mjs";
|
|
5
5
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
6
6
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { getReplyPayloadTtsSupplement, resolvePayloadMediaUrls, sendPayloadMediaSequenceOrFallback, sendTextMediaPayload } from "openclaw/plugin-sdk/reply-payload";
|
|
@@ -60,7 +60,7 @@ function normalizeDiscordApprovalPayload(payload) {
|
|
|
60
60
|
}
|
|
61
61
|
//#endregion
|
|
62
62
|
//#region extensions/discord/src/outbound-send-context.ts
|
|
63
|
-
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-
|
|
63
|
+
const loadDiscordSendRuntime = createLazyRuntimeModule(() => import("./send-jx1xq6VI.mjs").then((n) => n.t));
|
|
64
64
|
function resolveDiscordOutboundTarget(params) {
|
|
65
65
|
if (params.threadId == null) return params.to;
|
|
66
66
|
const threadId = normalizeOptionalStringifiedId(params.threadId) ?? "";
|
|
@@ -279,9 +279,10 @@ async function sendDiscordOutboundPayload(params) {
|
|
|
279
279
|
//#endregion
|
|
280
280
|
//#region extensions/discord/src/outbound-adapter.ts
|
|
281
281
|
const DISCORD_TEXT_CHUNK_LIMIT = 2e3;
|
|
282
|
+
const DISCORD_PRECHUNK_MAX_LINES = Number.MAX_SAFE_INTEGER;
|
|
282
283
|
const log = createSubsystemLogger("discord/outbound");
|
|
283
|
-
const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-
|
|
284
|
-
const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-
|
|
284
|
+
const loadDiscordThreadBindings = createLazyRuntimeModule(() => import("./thread-bindings-W-yX7LUM.mjs").then((n) => n.t));
|
|
285
|
+
const loadDiscordComponentSendRuntime = createLazyRuntimeModule(() => import("./send.components-C85HkVgh.mjs").then((n) => n.i));
|
|
285
286
|
function resolveDiscordWebhookIdentity(params) {
|
|
286
287
|
const usernameRaw = normalizeOptionalString(params.identity?.name);
|
|
287
288
|
const fallbackUsername = normalizeOptionalString(params.binding.label) ?? params.binding.agentId;
|
|
@@ -310,7 +311,12 @@ async function maybeSendDiscordWebhookText(params) {
|
|
|
310
311
|
accountId: binding.accountId,
|
|
311
312
|
threadId: binding.threadId,
|
|
312
313
|
cfg: params.cfg,
|
|
313
|
-
replyTo:
|
|
314
|
+
replyTo: resolveDiscordReplyReference({
|
|
315
|
+
replyToId: params.replyToId,
|
|
316
|
+
replyToIdSource: params.replyToIdSource,
|
|
317
|
+
replyToMode: params.replyToMode
|
|
318
|
+
}),
|
|
319
|
+
maxLinesPerMessage: params.maxLinesPerMessage,
|
|
314
320
|
username: persona.username,
|
|
315
321
|
avatarUrl: persona.avatarUrl,
|
|
316
322
|
onPlatformSendDispatch: params.onPlatformSendDispatch,
|
|
@@ -349,7 +355,7 @@ const discordOutbound = {
|
|
|
349
355
|
deliveryMode: "direct",
|
|
350
356
|
chunker: (text, limit, ctx) => chunkDiscordTextWithMode(text, {
|
|
351
357
|
maxChars: limit,
|
|
352
|
-
maxLines: ctx?.formatting?.maxLinesPerMessage
|
|
358
|
+
maxLines: ctx?.formatting?.maxLinesPerMessage ?? DISCORD_PRECHUNK_MAX_LINES
|
|
353
359
|
}),
|
|
354
360
|
textChunkLimit: DISCORD_TEXT_CHUNK_LIMIT,
|
|
355
361
|
pollMaxOptions: 10,
|
|
@@ -389,6 +395,9 @@ const discordOutbound = {
|
|
|
389
395
|
accountId: ctx.accountId,
|
|
390
396
|
identity: ctx.identity,
|
|
391
397
|
replyToId: ctx.replyToId,
|
|
398
|
+
replyToIdSource: ctx.replyToIdSource,
|
|
399
|
+
replyToMode: ctx.replyToMode,
|
|
400
|
+
maxLinesPerMessage: ctx.formatting?.maxLinesPerMessage,
|
|
392
401
|
onPlatformSendDispatch: ctx.onPlatformSendDispatch ? async () => {
|
|
393
402
|
webhookSelected = true;
|
|
394
403
|
await ctx.onPlatformSendDispatch?.();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as readDiscordComponentSpec } from "./components-
|
|
1
|
+
import { h as readDiscordComponentSpec } from "./components-CoCQebYz.mjs";
|
|
2
2
|
import { resolveAskUserQuestionOptionIndices } from "openclaw/plugin-sdk/reply-payload";
|
|
3
3
|
import { createLazyRuntimeModule, createLazyRuntimeNamedExport } from "openclaw/plugin-sdk/lazy-runtime";
|
|
4
4
|
//#region extensions/discord/src/outbound-components.ts
|
|
@@ -31,11 +31,11 @@ const DISCORD_PRESENTATION_CAPABILITIES = {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
const loadDiscordComponentSend = createLazyRuntimeNamedExport(() => import("./send.components-
|
|
34
|
+
const loadDiscordComponentSend = createLazyRuntimeNamedExport(() => import("./send.components-C85HkVgh.mjs").then((n) => n.i), "sendDiscordComponentMessage");
|
|
35
35
|
async function sendDiscordComponentMessageLazy(...args) {
|
|
36
36
|
return await (await loadDiscordComponentSend())(...args);
|
|
37
37
|
}
|
|
38
|
-
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./components-
|
|
38
|
+
const loadDiscordSharedInteractive = createLazyRuntimeModule(() => import("./components-CoCQebYz.mjs").then((n) => n.a));
|
|
39
39
|
function addPayloadTextFallback(spec, payload) {
|
|
40
40
|
return spec.text ? spec : {
|
|
41
41
|
...spec,
|
package/dist/.setup/{outbound-session-route-CbGbV68Y.mjs → outbound-session-route-0ulhwPFj.mjs}
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { _ as parseDiscordTarget, h as normalizeDiscordMessagingTarget } from "./retry-
|
|
2
|
-
import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-
|
|
1
|
+
import { _ as parseDiscordTarget, h as normalizeDiscordMessagingTarget } from "./retry-BtpfSmcV.mjs";
|
|
2
|
+
import { h as readDiscordComponentSpec, m as coerceDiscordComponentParam } from "./components-CoCQebYz.mjs";
|
|
3
|
+
import { t as isDiscordThreadChannelType } from "./channel-type-CGDUPxwc.mjs";
|
|
3
4
|
import { c as resolveDiscordAccount, r as listDiscordAccountIds, t as createDiscordActionGate } from "./accounts-CwJQoLjM.mjs";
|
|
4
5
|
import { t as inspectDiscordAccount } from "./account-inspect-BwQj24ht.mjs";
|
|
5
6
|
import { ChannelType } from "discord-api-types/v10";
|
|
@@ -77,6 +78,7 @@ function shouldSuppressLocalDiscordExecApprovalPrompt(params) {
|
|
|
77
78
|
//#endregion
|
|
78
79
|
//#region extensions/discord/src/audit-core.ts
|
|
79
80
|
const REQUIRED_TEXT_CHANNEL_PERMISSIONS = ["ViewChannel", "SendMessages"];
|
|
81
|
+
const REQUIRED_THREAD_CHANNEL_PERMISSIONS = ["ViewChannel", "SendMessagesInThreads"];
|
|
80
82
|
const REQUIRED_VOICE_CHANNEL_PERMISSIONS = [
|
|
81
83
|
"ViewChannel",
|
|
82
84
|
"Connect",
|
|
@@ -85,6 +87,7 @@ const REQUIRED_VOICE_CHANNEL_PERMISSIONS = [
|
|
|
85
87
|
"ReadMessageHistory"
|
|
86
88
|
];
|
|
87
89
|
function resolveRequiredDiscordChannelPermissions(channelType) {
|
|
90
|
+
if (isDiscordThreadChannelType(channelType)) return [...REQUIRED_THREAD_CHANNEL_PERMISSIONS];
|
|
88
91
|
if (channelType === ChannelType.GuildVoice || channelType === ChannelType.GuildStageVoice) return [...REQUIRED_VOICE_CHANNEL_PERMISSIONS];
|
|
89
92
|
return [...REQUIRED_TEXT_CHANNEL_PERMISSIONS];
|
|
90
93
|
}
|
|
@@ -265,7 +268,7 @@ function matchesCurrentDiscordThread(params) {
|
|
|
265
268
|
if (!requestedTarget) return false;
|
|
266
269
|
return [params.toolContext.currentChannelId, params.toolContext.currentMessagingTarget].some((currentTarget) => currentTarget !== void 0 && normalizeDiscordMessagingTarget(currentTarget) === requestedTarget);
|
|
267
270
|
}
|
|
268
|
-
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./channel-actions.runtime-
|
|
271
|
+
const loadDiscordChannelActionsRuntime = createLazyRuntimeModule(() => import("./channel-actions.runtime-BN2Bo6so.mjs"));
|
|
269
272
|
function listDiscoverableDiscordAccounts(cfg) {
|
|
270
273
|
return listDiscordAccountIds(cfg).map((accountId) => inspectDiscordAccount({
|
|
271
274
|
cfg,
|