@openclaw/discord 2026.11.5 → 2026.11.10-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -0
- package/dist/.setup/{account-inspect-DGkdWwix.mjs → account-inspect-CSz5Qodj.mjs} +2 -3
- package/dist/.setup/{accounts-C_25wyxC.mjs → accounts-DtjvhJUj.mjs} +4 -8
- package/dist/.setup/{active-turn-thread-route-KvRTAVE3.mjs → active-turn-thread-route-DkPnk2x8.mjs} +1 -2
- package/dist/.setup/{allow-list-BXrS8-R9.mjs → allow-list-CkqpzPvP.mjs} +5 -9
- package/dist/.setup/{api-BlBD4ism.mjs → api-C4j_kC-2.mjs} +4 -6
- package/dist/.setup/{approval-handler.runtime-o2N6GRFH.mjs → approval-handler.runtime-DjtQbUPp.mjs} +10 -10
- package/dist/.setup/{approval-message-updates-DKsCfxSW.mjs → approval-message-updates-DqOXxPss.mjs} +3 -4
- package/dist/.setup/{audit-5b-FXj9R.mjs → audit-B9vk3V2z.mjs} +6 -7
- package/dist/.setup/{channel-CplVDtyZ.mjs → channel-Cihfaj84.mjs} +38 -41
- package/dist/.setup/{channel-access-9cyzozUP.mjs → channel-access-DhJhVrdZ.mjs} +1 -2
- package/dist/.setup/{channel.setup-B3MtmBQG.mjs → channel.setup-DmGdG9BH.mjs} +7 -10
- package/dist/.setup/{command-deploy-store-DFkBTViB.mjs → command-deploy-store-DPWiBMks.mjs} +1 -2
- package/dist/.setup/{command-owners-C7rUdqUX.mjs → command-owners-BzlhNBxA.mjs} +1 -2
- package/dist/.setup/{components-YCvQ6YLS.mjs → components-GePlato3.mjs} +10 -16
- package/dist/.setup/{components.base-CiS0h_XP.mjs → components.base-C5sAPHe4.mjs} +1 -2
- package/dist/.setup/config-DDwcUaxT.mjs +20 -0
- package/dist/.setup/{config-schema-BNKN1cu5.mjs → config-schema-D3M1livr.mjs} +5 -7
- package/dist/.setup/{conversation-binding-route-kCTw8cij.mjs → conversation-binding-route-CAaWWJdQ.mjs} +2 -3
- package/dist/.setup/conversation-fork-B6PiUuln.mjs +197 -0
- package/dist/.setup/{directory-config-Ble81PWH.mjs → directory-config-BXJuh9-J.mjs} +3 -4
- package/dist/.setup/directory-live-B9UoQG9g.mjs +90 -0
- package/dist/.setup/{discord-DGVSguhx.mjs → discord-cXPUdHQi.mjs} +98 -77
- package/dist/.setup/{doctor-eujgbnpZ.mjs → doctor-MTAWTgRa.mjs} +7 -8
- package/dist/.setup/{doctor-contract-Bwv8EuQ_.mjs → doctor-contract-Dstl3cMg.mjs} +2 -3
- package/dist/.setup/{endpoint-runtime-lf4DeLas.mjs → endpoint-runtime-BM3x-m6O.mjs} +1 -2
- package/dist/.setup/{guilds-eDq22iSM.mjs → guilds-DYBhgnfq.mjs} +3 -4
- package/dist/.setup/{handle-action-CktwmzMz.mjs → handle-action-El1ok7Ak.mjs} +13 -12
- package/dist/.setup/{handle-action.guild-admin-WLQ7fRqI.mjs → handle-action.guild-admin-CxYfg02j.mjs} +7 -5
- package/dist/.setup/identity-link-B7KOBo_l.mjs +74 -0
- package/dist/.setup/{listeners-Df8lx3vK.mjs → listeners-DIyynRvV.mjs} +2 -3
- package/dist/.setup/{live-policy-config-DiBVuaU6.mjs → live-policy-config-DjIHWFla.mjs} +3 -5
- package/dist/.setup/{message-handler-DeoWTD-4.mjs → message-handler-BoQcvdfV.mjs} +18 -17
- package/dist/.setup/{message-handler.preflight-DKOjgF0z.mjs → message-handler.preflight-C7uhmcsV.mjs} +20 -27
- package/dist/.setup/{message-handler.preflight-pluralkit-CYZfXXb6.mjs → message-handler.preflight-pluralkit-BFntgVKc.mjs} +10 -14
- package/dist/.setup/{message-handler.process-RKRgMCJy.mjs → message-handler.process-B29pkCxQ.mjs} +54 -66
- package/dist/.setup/oauth-http-DdVyzSbo.mjs +40 -0
- package/dist/.setup/{outbound-payload-BaZmjewa.mjs → outbound-payload-Dh6xCO6z.mjs} +18 -13
- package/dist/.setup/{outbound-session-route-Cgx4i9cS.mjs → outbound-session-route-G_fK5RAh.mjs} +22 -34
- package/dist/.setup/{output-activity-uBpMSX75.mjs → output-activity-CDgs2s3O.mjs} +1 -2
- package/dist/.setup/{pluralkit-B64dfq_j.mjs → pluralkit-DcXbHTpQ.mjs} +2 -3
- package/dist/.setup/{preflight-audio-C6QtD6HX.mjs → preflight-audio-r4BbaJxh.mjs} +1 -2
- package/dist/.setup/{presence-cache-Dq-3nH7R.mjs → presence-cache-B3xj3b0l.mjs} +1 -2
- package/dist/.setup/{probe-DezB-6xz.mjs → probe-CfGMZwFD.mjs} +5 -6
- package/dist/.setup/{provider-D63dgDSw.mjs → provider-CnDxdXUm.mjs} +252 -246
- package/dist/.setup/{provider-session.runtime-ePktW62k.mjs → provider-session.runtime-CCBGrm-d.mjs} +3 -3
- package/dist/.setup/provider.runtime-BoSMAwDb.mjs +1 -0
- package/dist/.setup/{proxy-fetch-BzXwBAXt.mjs → proxy-fetch-B8cK6FLQ.mjs} +1 -2
- package/dist/.setup/{realtime-session.runtime-rlZ3WzwC.mjs → realtime-session.runtime-OD95VAEG.mjs} +15 -25
- package/dist/.setup/{receive-recovery-C3Ks4wAQ.mjs → receive-recovery-DV_v5ROf.mjs} +3 -6
- package/dist/.setup/{resolve-allowlist-common-Bk8Fj6Ik.mjs → resolve-allowlist-common-CYdqBUgV.mjs} +3 -4
- package/dist/.setup/{resolve-channels-Bp8frXvc.mjs → resolve-channels-BNnyfCR8.mjs} +10 -9
- package/dist/.setup/{resolve-users-Cvcj22sG.mjs → resolve-users-CDMAGrzv.mjs} +5 -6
- package/dist/.setup/{rolldown-runtime-B4FMCO8f.mjs → rolldown-runtime-nwUcYXjP.mjs} +1 -2
- package/dist/.setup/{runtime-BJaCvlmq.mjs → runtime-CkeNX7ic.mjs} +62 -51
- package/dist/.setup/{runtime-BMgTyuwg.mjs → runtime-DSaHEGJd.mjs} +4 -24
- package/dist/.setup/{runtime-DgnVQ7zW.mjs → runtime-DcBvHOm1.mjs} +1 -2
- package/dist/.setup/{runtime-doctor-migrations-BPV-R4G9.mjs → runtime-doctor-migrations-BpV1jKk0.mjs} +5 -9
- package/dist/.setup/{secret-config-contract-B1kE4sDv.mjs → secret-config-contract-CP6teHec.mjs} +1 -2
- package/dist/.setup/{security-audit-BFT84Uny.mjs → security-audit-CTwisG7c.mjs} +3 -4
- package/dist/.setup/{security-contract-DNyyjTZZ.mjs → security-contract-D-o0iWDk.mjs} +1 -2
- package/dist/.setup/{security-doctor-nGgPm65L.mjs → security-doctor-4s7omTZd.mjs} +1 -2
- package/dist/.setup/{send-CVW7V-VZ.mjs → send-DKzwsZkm.mjs} +28 -32
- package/dist/.setup/{send.components-C8YXdnO_.mjs → send.components-CIZALYDP.mjs} +12 -14
- package/dist/.setup/{send.outbound-Uzcmh3Yd.mjs → send.outbound-cQ4Ohmsc.mjs} +11 -16
- package/dist/.setup/send.permissions-BvH_Dr8p.mjs +369 -0
- package/dist/.setup/{send.receipt-NZDOTZBU.mjs → send.receipt-CZ7ks6g7.mjs} +64 -17
- package/dist/.setup/send.shared-D2lh737v.mjs +259 -0
- package/dist/.setup/{sender-identity-76HFb8eK.mjs → sender-identity-Dt5ELjRN.mjs} +2 -3
- package/dist/.setup/{session-contract-BO5tlIdl.mjs → session-contract-Bq71MS78.mjs} +1 -2
- package/dist/.setup/{session-key-normalization-CCHGNSQw.mjs → session-key-normalization-Cfvze5hd.mjs} +1 -2
- package/dist/.setup/setup-plugin-api-BJt8tAAC.mjs +2 -0
- package/dist/.setup/{shared-yDUSExm2.mjs → shared-Bf7ifHlc.mjs} +14 -17
- package/dist/.setup/{shared-interactive-DmzaoKOM.mjs → shared-interactive-DKBw4SNV.mjs} +7 -12
- package/dist/.setup/{subagent-hooks-CDkdHQyy.mjs → subagent-hooks-CVmIOrAR.mjs} +4 -5
- package/dist/.setup/{system-events-yfWz150v.mjs → system-events-DB6p2H4l.mjs} +3 -4
- package/dist/.setup/{target-parsing-C-HyNxcE.mjs → target-parsing-BiuhcK9Q.mjs} +1 -2
- package/dist/.setup/{target-resolver-BOOzqxxM.mjs → target-resolver-48znkzky.mjs} +6 -7
- package/dist/.setup/{thread-binding-api-BDZJD4na.mjs → thread-binding-api-Drd4Zu-5.mjs} +1 -2
- package/dist/.setup/{thread-bindings-zce4cpu_.mjs → thread-bindings-DTHVdmvF.mjs} +7 -10
- package/dist/.setup/{thread-bindings.manager-NywKzUtc.mjs → thread-bindings.manager-6EnH3YZh.mjs} +45 -30
- package/dist/.setup/{thread-bindings.session-updates-D0j7oh8S.mjs → thread-bindings.session-updates-BPO6pPzd.mjs} +9 -12
- package/dist/.setup/{threading-DodLYDt-.mjs → threading-PC3IIaHd.mjs} +5 -7
- package/dist/.setup/{timeouts-cIxzatmv.mjs → timeouts-CT9hnmo4.mjs} +1 -2
- package/dist/.setup/{transcripts-source-ie9GBWaU.mjs → transcripts-source-C3F_ErM1.mjs} +33 -46
- package/dist/.setup/{typing-CNlSKY5S.mjs → typing-DAv4S2fI.mjs} +2 -3
- package/dist/.setup/{voice-runtime-Dc8Su9Cm.mjs → voice-runtime-CzV3fXxV.mjs} +28 -46
- package/dist/.source-module-urls/d6c089460280c5a04184542d6712e04545caeb1ebb290d3504377b4cc5e22fea.json +1 -1
- package/dist/account-inspect-api.js +2 -3
- package/dist/action-runtime-api.js +1 -1
- package/dist/activities-api.js +10 -50
- package/dist/api.js +21 -22
- package/dist/assets/embedded-app-sdk.mjs +1 -1
- package/dist/channel-config-api.js +1 -1
- package/dist/channel-plugin-api.js +1 -1
- package/dist/contract-api.js +1 -1
- package/dist/directory-contract-api.js +2 -3
- package/dist/doctor-contract-api.js +7 -8
- package/dist/index.js +1 -2
- package/dist/runtime-api.js +23 -22
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/security-audit-contract-api.js +1 -1
- package/dist/security-contract-api.js +1 -1
- package/dist/session-key-api.js +1 -1
- package/dist/setup-entry.js +2 -3
- package/dist/setup-plugin-api.js +1 -1
- package/dist/src/voice/audio-worker.runtime.js +14 -26
- package/dist/subagent-hooks-api.js +2 -3
- package/dist/thread-binding-api.js +1 -1
- package/dist/transcripts-source-api.js +2 -3
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.cjs +2 -3
- package/node_modules/@discord/embedded-app-sdk/output/lib/zod/lib/index.mjs +2 -3
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/package.json +2 -2
- package/node_modules/@types/node/zlib.d.ts +752 -0
- package/node_modules/typebox/build/format/date_time.d.mts +2 -1
- package/node_modules/typebox/build/format/date_time.mjs +12 -3
- package/node_modules/typebox/package.json +1 -1
- package/openclaw.plugin.json +7 -2
- package/package.json +5 -5
- package/dist/.setup/directory-live-DH3tpS3x.mjs +0 -144
- package/dist/.setup/provider.runtime-DcNkwhPW.mjs +0 -1
- package/dist/.setup/send.shared-a_6Oeyg1.mjs +0 -589
- package/dist/.setup/setup-plugin-api-BExhGEhL.mjs +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as __reExport, t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
|
|
1
|
+
import { n as __reExport, t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
// packages/normalization-core/src/record-coerce.ts
|
|
3
3
|
/** Type guard for non-array object records at browser-safe boundaries. */
|
|
4
4
|
function isRecord(value) {
|
|
5
5
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -8,8 +8,7 @@ function isRecord(value) {
|
|
|
8
8
|
function asNullableRecord(value) {
|
|
9
9
|
return isRecord(value) ? value : null;
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
//#region src/config/channel-config-normalization.ts
|
|
11
|
+
// src/config/channel-config-normalization.ts
|
|
13
12
|
/** Applies one channel-specific doctor migration to every object-shaped account. */
|
|
14
13
|
function normalizeChannelAccounts(params) {
|
|
15
14
|
const rawAccounts = asNullableRecord(params.entry.accounts);
|
|
@@ -85,8 +84,7 @@ function normalizeChannelConfigEntries(params) {
|
|
|
85
84
|
changes
|
|
86
85
|
};
|
|
87
86
|
}
|
|
88
|
-
|
|
89
|
-
//#region src/plugin-sdk/legacy-webhook-listener-migration.ts
|
|
87
|
+
// src/plugin-sdk/legacy-webhook-listener-migration.ts
|
|
90
88
|
/** Preserve explicitly configured webhook listeners while moving ingress onto Gateway routes. */
|
|
91
89
|
function createLegacyWebhookListenerDoctorContract(params) {
|
|
92
90
|
const portKey = params.portKey ?? "webhookPort";
|
|
@@ -156,10 +154,8 @@ function createLegacyWebhookListenerDoctorContract(params) {
|
|
|
156
154
|
}
|
|
157
155
|
};
|
|
158
156
|
}
|
|
159
|
-
|
|
160
|
-
//#region \0openclaw:bundled-sdk:openclaw/plugin-sdk/runtime-doctor-migrations
|
|
157
|
+
// \0openclaw:bundled-sdk:openclaw/plugin-sdk/runtime-doctor-migrations
|
|
161
158
|
var runtime_doctor_migrations_exports = /* @__PURE__ */ __exportAll({ createLegacyWebhookListenerDoctorContract: () => createLegacyWebhookListenerDoctorContract });
|
|
162
159
|
import * as import_openclaw_plugin_sdk_runtime_doctor_migrations from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
163
160
|
__reExport(runtime_doctor_migrations_exports, import_openclaw_plugin_sdk_runtime_doctor_migrations);
|
|
164
|
-
//#endregion
|
|
165
161
|
export { runtime_doctor_migrations_exports as t };
|
package/dist/.setup/{secret-config-contract-B1kE4sDv.mjs → secret-config-contract-CP6teHec.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
|
|
2
2
|
import { collectNestedChannelFieldAssignments, collectSimpleChannelFieldAssignments, createChannelSecretTargetRegistryEntries, getChannelRecord, hasConfiguredSecretInputValue, isBaseFieldActiveForChannelSurface, isEnabledFlag, isRecord, resolveChannelAccountSurface } from "openclaw/plugin-sdk/channel-secret-basic-runtime";
|
|
3
3
|
import { collectNestedChannelTtsAssignments } from "openclaw/plugin-sdk/channel-secret-tts-runtime";
|
|
4
|
-
|
|
4
|
+
// extensions/discord/src/secret-config-contract.ts
|
|
5
5
|
function discordRealtimeVoiceSecretOwnerId(accountId, providerId) {
|
|
6
6
|
return `discord:voice:realtime:${normalizeAccountId(accountId)}:${providerId}`;
|
|
7
7
|
}
|
|
@@ -69,5 +69,4 @@ function collectRuntimeConfigAssignments(params) {
|
|
|
69
69
|
accountInactiveReason: "Discord account is disabled, voice is disabled, or voice mode is stt-tts for this account."
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
//#endregion
|
|
73
72
|
export { discordRealtimeVoiceSecretOwnerId as n, secretTargetRegistryEntries as r, collectRuntimeConfigAssignments as t };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import { t as isDiscordMutableAllowEntry } from "./security-doctor-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { t as isDiscordMutableAllowEntry } from "./security-doctor-4s7omTZd.mjs";
|
|
3
3
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { readChannelAllowFromStore } from "openclaw/plugin-sdk/conversation-runtime";
|
|
5
5
|
import { coerceNativeSetting, normalizeAllowFromList } from "openclaw/plugin-sdk/channel-policy";
|
|
6
6
|
import { isDangerousNameMatchingEnabled } from "openclaw/plugin-sdk/dangerous-name-runtime";
|
|
7
7
|
import { resolveNativeCommandsEnabled, resolveNativeSkillsEnabled } from "openclaw/plugin-sdk/native-command-config-runtime";
|
|
8
|
-
|
|
8
|
+
// extensions/discord/src/security-audit.ts
|
|
9
9
|
var security_audit_exports = /* @__PURE__ */ __exportAll({ collectDiscordSecurityAuditFindings: () => collectDiscordSecurityAuditFindings });
|
|
10
10
|
function isWildcardEntry(value) {
|
|
11
11
|
return String(value).trim() === "*";
|
|
@@ -116,5 +116,4 @@ async function collectDiscordSecurityAuditFindings(params) {
|
|
|
116
116
|
});
|
|
117
117
|
return findings;
|
|
118
118
|
}
|
|
119
|
-
//#endregion
|
|
120
119
|
export { security_audit_exports as n, collectDiscordSecurityAuditFindings as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
|
-
|
|
2
|
+
// extensions/discord/src/security-contract.ts
|
|
3
3
|
const unsupportedSecretRefSurfacePatterns = ["channels.discord.threadBindings.webhookToken", "channels.discord.accounts.*.threadBindings.webhookToken"];
|
|
4
4
|
function collectUnsupportedSecretRefConfigCandidates(raw) {
|
|
5
5
|
if (!isRecord(raw) || !isRecord(raw.channels) || !isRecord(raw.channels.discord)) return [];
|
|
@@ -15,5 +15,4 @@ function collectUnsupportedSecretRefConfigCandidates(raw) {
|
|
|
15
15
|
for (const [accountId, account] of Object.entries(isRecord(discord.accounts) ? discord.accounts : {})) addCandidate(account, `channels.discord.accounts.${accountId}`);
|
|
16
16
|
return candidates;
|
|
17
17
|
}
|
|
18
|
-
//#endregion
|
|
19
18
|
export { unsupportedSecretRefSurfacePatterns as n, collectUnsupportedSecretRefConfigCandidates as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { buildMutableAllowEntryDetector } from "openclaw/plugin-sdk/channel-policy";
|
|
2
|
-
|
|
2
|
+
// extensions/discord/src/security-doctor.ts
|
|
3
3
|
const isDiscordMutableAllowEntry = buildMutableAllowEntryDetector({ stableIdPattern: /^(?:\d+|<@!?\d+>|(?:discord|user|pk):.+)$/ });
|
|
4
|
-
//#endregion
|
|
5
4
|
export { isDiscordMutableAllowEntry as t };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import { B as RateLimitError, C as listMessageReactionUsers, D as editChannelMessage, E as deleteChannelMessage, F as getGuildVoiceState, G as readRetryAfter, H as isUnknownDiscordVoiceStateError, I as listGuildEmojis, J as stripUndefinedFields, L as DISCORD_REST_TIMEOUT_MS, M as unpinChannelMessage, N as getGuild, O as getChannel, P as getGuildMember, S as deleteOwnMessageReaction, T as createThread, U as readDiscordCode, V as isUnknownDiscordMessageError, W as readDiscordMessage, j as pinChannelMessage, k as getChannelMessage, q as withDiscordRequestAuthority, w as createChannelMessage, x as createOwnMessageReaction, z as DiscordError } from "./discord-
|
|
4
|
-
import { C as parseDiscordRetryAfterBodySeconds } from "./allow-list-
|
|
5
|
-
import {
|
|
6
|
-
import { n as getDiscordEndpointRuntime, r as resolveDiscordEndpointAttachmentGuard } from "./endpoint-runtime-
|
|
7
|
-
import { o as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { n as
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { a as fetchMemberGuildPermissionsDiscord, c as hasAnyChannelPermissionDiscord, i as fetchChannelPermissionsDiscord, l as hasAnyGuildPermissionDiscord, m as resolveDiscordRest, n as canManageGuildRoleDiscord, p as resolveDiscordClientAccountContext, r as canViewDiscordGuildChannel, s as hasAllGuildPermissionsDiscord, t as canManageGuildMemberRoleDiscord, u as createDiscordClient } from "./send.permissions-BvH_Dr8p.mjs";
|
|
3
|
+
import { B as RateLimitError, C as listMessageReactionUsers, D as editChannelMessage, E as deleteChannelMessage, F as getGuildVoiceState, G as readRetryAfter, H as isUnknownDiscordVoiceStateError, I as listGuildEmojis, J as stripUndefinedFields, L as DISCORD_REST_TIMEOUT_MS, M as unpinChannelMessage, N as getGuild, O as getChannel, P as getGuildMember, S as deleteOwnMessageReaction, T as createThread, U as readDiscordCode, V as isUnknownDiscordMessageError, W as readDiscordMessage, j as pinChannelMessage, k as getChannelMessage, q as withDiscordRequestAuthority, w as createChannelMessage, x as createOwnMessageReaction, z as DiscordError } from "./discord-cXPUdHQi.mjs";
|
|
4
|
+
import { C as parseDiscordRetryAfterBodySeconds } from "./allow-list-CkqpzPvP.mjs";
|
|
5
|
+
import { S as chunkDiscordTextWithMode, n as createDiscordSendReceiptFromResults, r as createDiscordSendResult, v as classifyDiscordDeliveryFailure, x as recordDiscordMessageCreateAmbiguity, y as createDiscordRetryRunner } from "./send.receipt-CZ7ks6g7.mjs";
|
|
6
|
+
import { n as getDiscordEndpointRuntime, r as resolveDiscordEndpointAttachmentGuard } from "./endpoint-runtime-BM3x-m6O.mjs";
|
|
7
|
+
import { C as resolveDiscordSuppressEmbeds, a as normalizeEmojiName, b as resolveDiscordMessageFlags, c as resolveChannelId, d as sendDiscordChunks, g as DiscordSendError, h as DISCORD_MAX_STICKER_BYTES, m as DISCORD_MAX_EVENT_COVER_BYTES, n as buildDiscordTextChunks, o as normalizeReactionEmoji, p as DISCORD_MAX_EMOJI_BYTES, r as buildReactionIdentifier, t as buildDiscordSendError, y as createDiscordMessageNonce } from "./send.shared-D2lh737v.mjs";
|
|
8
|
+
import { o as parseDiscordHttpErrorBody } from "./api-C4j_kC-2.mjs";
|
|
9
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-48znkzky.mjs";
|
|
10
|
+
import { a as prepareDiscordOutboundText, n as sendPollDiscord, r as sendStickerDiscord, t as sendMessageDiscord } from "./send.outbound-cQ4Ohmsc.mjs";
|
|
11
|
+
import { n as DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS } from "./timeouts-CT9hnmo4.mjs";
|
|
11
12
|
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
|
|
12
13
|
import { resolvePreferredOpenClawTmpDir, withTempWorkspace } from "openclaw/plugin-sdk/temp-path";
|
|
13
14
|
import { normalizeLowercaseStringOrEmpty, normalizeOptionalLowercaseString, normalizeOptionalString, normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
@@ -26,7 +27,7 @@ import { buildTimeoutAbortSignal } from "openclaw/plugin-sdk/extension-shared";
|
|
|
26
27
|
import fs from "node:fs/promises";
|
|
27
28
|
import path from "node:path";
|
|
28
29
|
import { writeExternalFileWithinRoot } from "openclaw/plugin-sdk/security-runtime";
|
|
29
|
-
|
|
30
|
+
// extensions/discord/src/send.channels.ts
|
|
30
31
|
async function createChannelDiscord(payload, opts) {
|
|
31
32
|
const rest = resolveDiscordRest(opts);
|
|
32
33
|
const body = stripUndefinedFields({
|
|
@@ -51,7 +52,8 @@ async function editChannelDiscord(payload, opts) {
|
|
|
51
52
|
archived: payload.archived,
|
|
52
53
|
locked: payload.locked,
|
|
53
54
|
auto_archive_duration: payload.autoArchiveDuration,
|
|
54
|
-
available_tags: payload.availableTags
|
|
55
|
+
available_tags: payload.availableTags,
|
|
56
|
+
applied_tags: payload.appliedTags
|
|
55
57
|
});
|
|
56
58
|
return await rest.patch(Routes.channel(payload.channelId), { body });
|
|
57
59
|
}
|
|
@@ -86,8 +88,7 @@ async function removeChannelPermissionDiscord(channelId, targetId, opts) {
|
|
|
86
88
|
await resolveDiscordRest(opts).delete(Routes.channelPermission(channelId, targetId));
|
|
87
89
|
return { ok: true };
|
|
88
90
|
}
|
|
89
|
-
|
|
90
|
-
//#region extensions/discord/src/send.emojis-stickers.ts
|
|
91
|
+
// extensions/discord/src/send.emojis-stickers.ts
|
|
91
92
|
const DISCORD_IMAGE_UPLOAD_TYPES = [
|
|
92
93
|
"image/png",
|
|
93
94
|
"image/jpeg",
|
|
@@ -145,8 +146,7 @@ async function uploadStickerDiscord(payload, opts) {
|
|
|
145
146
|
}
|
|
146
147
|
});
|
|
147
148
|
}
|
|
148
|
-
|
|
149
|
-
//#region extensions/discord/src/send.guild.ts
|
|
149
|
+
// extensions/discord/src/send.guild.ts
|
|
150
150
|
function readDiscordResource(read) {
|
|
151
151
|
return async (id, opts) => await read(resolveDiscordRest(opts), id);
|
|
152
152
|
}
|
|
@@ -225,8 +225,7 @@ async function banMemberDiscord(payload, opts) {
|
|
|
225
225
|
});
|
|
226
226
|
return { ok: true };
|
|
227
227
|
}
|
|
228
|
-
|
|
229
|
-
//#region extensions/discord/src/send.messages.ts
|
|
228
|
+
// extensions/discord/src/send.messages.ts
|
|
230
229
|
const DISCORD_THREAD_TRANSPORT_ONLY_MAX_LINES = Number.MAX_SAFE_INTEGER;
|
|
231
230
|
function resolveDiscordThreadStarterMessageId(thread) {
|
|
232
231
|
const starterMessage = "message" in thread ? thread.message : void 0;
|
|
@@ -315,17 +314,20 @@ async function deleteMessageDiscord(channelId, messageId, opts) {
|
|
|
315
314
|
}, "message-delete");
|
|
316
315
|
return { ok: true };
|
|
317
316
|
}
|
|
318
|
-
async function listPinsDiscord(channelId, opts) {
|
|
317
|
+
async function listPinsDiscord(channelId, opts, limit) {
|
|
319
318
|
const rest = resolveDiscordRest(opts);
|
|
320
319
|
const messages = [];
|
|
321
320
|
let before;
|
|
322
321
|
while (true) {
|
|
323
322
|
const page = await rest.get(Routes.channelMessagesPins(channelId), {
|
|
324
|
-
limit: 50,
|
|
323
|
+
limit: limit === void 0 ? 50 : Math.min(50, limit - messages.length),
|
|
325
324
|
...before ? { before } : {}
|
|
326
325
|
});
|
|
327
326
|
messages.push(...page.items.map((pin) => pin.message));
|
|
328
|
-
if (!page.has_more
|
|
327
|
+
if (!page.has_more || limit !== void 0 && messages.length >= limit) {
|
|
328
|
+
if (limit !== void 0 && messages.length > limit) messages.length = limit;
|
|
329
|
+
return messages;
|
|
330
|
+
}
|
|
329
331
|
const nextBefore = page.items.at(-1)?.pinned_at;
|
|
330
332
|
if (!nextBefore || nextBefore === before) throw new Error("Discord pin pagination did not advance.");
|
|
331
333
|
before = nextBefore;
|
|
@@ -428,8 +430,7 @@ async function searchMessagesDiscord(query, opts) {
|
|
|
428
430
|
assertDiscordSearchResponse(result);
|
|
429
431
|
return result;
|
|
430
432
|
}
|
|
431
|
-
|
|
432
|
-
//#region extensions/discord/src/send.webhook.ts
|
|
433
|
+
// extensions/discord/src/send.webhook.ts
|
|
433
434
|
const DISCORD_WEBHOOK_ERROR_BODY_LIMIT_BYTES = 8192;
|
|
434
435
|
const DISCORD_WEBHOOK_TIMEOUT_MS = DISCORD_REST_TIMEOUT_MS;
|
|
435
436
|
function throwIfWebhookDeadlineExpired(signal) {
|
|
@@ -547,8 +548,7 @@ async function sendWebhookMessageDiscord(text, opts) {
|
|
|
547
548
|
deadline.cleanup();
|
|
548
549
|
}
|
|
549
550
|
}
|
|
550
|
-
|
|
551
|
-
//#region extensions/discord/src/send.voice.ts
|
|
551
|
+
// extensions/discord/src/send.voice.ts
|
|
552
552
|
const WAVEFORM_SAMPLES = 256;
|
|
553
553
|
const DISCORD_OPUS_SAMPLE_RATE_HZ = 48e3;
|
|
554
554
|
const DISCORD_VOICE_ERROR_BODY_LIMIT_BYTES = 8192;
|
|
@@ -860,8 +860,7 @@ async function sendVoiceMessageDiscord(to, audioPath, opts) {
|
|
|
860
860
|
});
|
|
861
861
|
});
|
|
862
862
|
}
|
|
863
|
-
|
|
864
|
-
//#region extensions/discord/src/send.typing.ts
|
|
863
|
+
// extensions/discord/src/send.typing.ts
|
|
865
864
|
async function sendTypingDiscord(channelId, opts) {
|
|
866
865
|
await resolveDiscordRest(opts).post(Routes.channelTyping(channelId));
|
|
867
866
|
return {
|
|
@@ -869,8 +868,7 @@ async function sendTypingDiscord(channelId, opts) {
|
|
|
869
868
|
channelId
|
|
870
869
|
};
|
|
871
870
|
}
|
|
872
|
-
|
|
873
|
-
//#region extensions/discord/src/send.reactions.ts
|
|
871
|
+
// extensions/discord/src/send.reactions.ts
|
|
874
872
|
function reactionMutation(operation, label) {
|
|
875
873
|
return async (channelId, messageId, emoji, opts) => {
|
|
876
874
|
const { rest, request } = createDiscordClient(opts);
|
|
@@ -926,8 +924,7 @@ async function fetchReactionsDiscord(channelId, messageId, opts) {
|
|
|
926
924
|
}
|
|
927
925
|
return summaries;
|
|
928
926
|
}
|
|
929
|
-
|
|
930
|
-
//#region extensions/discord/src/send.ts
|
|
927
|
+
// extensions/discord/src/send.ts
|
|
931
928
|
var send_exports = /* @__PURE__ */ __exportAll({
|
|
932
929
|
DiscordSendError: () => DiscordSendError,
|
|
933
930
|
DiscordThreadInitialMessageError: () => DiscordThreadInitialMessageError,
|
|
@@ -983,5 +980,4 @@ var send_exports = /* @__PURE__ */ __exportAll({
|
|
|
983
980
|
uploadEmojiDiscord: () => uploadEmojiDiscord,
|
|
984
981
|
uploadStickerDiscord: () => uploadStickerDiscord
|
|
985
982
|
});
|
|
986
|
-
//#endregion
|
|
987
983
|
export { listScheduledEventsDiscord as A, moveChannelDiscord as B, fetchChannelInfoDiscord as C, fetchVoiceStatusDiscord as D, fetchRoleInfoDiscord as E, uploadEmojiDiscord as F, setChannelPermissionDiscord as H, uploadStickerDiscord as I, createChannelDiscord as L, resolveEventCoverImage as M, timeoutMemberDiscord as N, kickMemberDiscord as O, listGuildEmojisDiscord as P, deleteChannelDiscord as R, createScheduledEventDiscord as S, fetchMemberInfoDiscord as T, removeChannelPermissionDiscord as V, readMessagesDiscord as _, removeReactionDiscord as a, addRoleDiscord as b, sendWebhookMessageDiscord as c, deleteMessageDiscord as d, editMessageDiscord as f, pinMessageDiscord as g, listThreadsDiscord as h, removeOwnReactionsDiscord as i, removeRoleDiscord as j, listGuildChannelsDiscord as k, DiscordThreadInitialMessageError as l, listPinsDiscord as m, fetchReactionsDiscord as n, sendTypingDiscord as o, fetchMessageDiscord as p, reactMessageDiscord as r, sendVoiceMessageDiscord as s, send_exports as t, createThreadDiscord as u, searchMessagesDiscord as v, fetchGuildInfoDiscord as w, banMemberDiscord as x, unpinMessageDiscord as y, editChannelDiscord as z };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import { D as editChannelMessage, f as serializePayload, q as withDiscordRequestAuthority, w as createChannelMessage } from "./discord-
|
|
4
|
-
import { r as createDiscordSendResult } from "./send.receipt-
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { u as createDiscordClient } from "./send.permissions-BvH_Dr8p.mjs";
|
|
3
|
+
import { D as editChannelMessage, f as serializePayload, q as withDiscordRequestAuthority, w as createChannelMessage } from "./discord-cXPUdHQi.mjs";
|
|
4
|
+
import { r as createDiscordSendResult } from "./send.receipt-CZ7ks6g7.mjs";
|
|
5
|
+
import { _ as SUPPRESS_NOTIFICATIONS_FLAG, c as resolveChannelId, l as resolveDiscordChannel, t as buildDiscordSendError, y as createDiscordMessageNonce } from "./send.shared-D2lh737v.mjs";
|
|
6
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-48znkzky.mjs";
|
|
7
|
+
import { t as sendMessageDiscord } from "./send.outbound-cQ4Ohmsc.mjs";
|
|
8
|
+
import { a as buildDiscordComponentMessage, u as resolveDiscordComponentAttachmentName } from "./components-GePlato3.mjs";
|
|
9
|
+
import { n as getOptionalDiscordRuntime } from "./runtime-DcBvHOm1.mjs";
|
|
9
10
|
import { hasNonEmptyString, uniqueStrings } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
10
11
|
import { ChannelType } from "discord-api-types/v10";
|
|
11
12
|
import { loadOutboundMediaFromUrl } from "openclaw/plugin-sdk/outbound-media";
|
|
@@ -16,7 +17,7 @@ import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runt
|
|
|
16
17
|
import { extensionForMime } from "openclaw/plugin-sdk/media-mime";
|
|
17
18
|
import { createPluginStateErrorReporter } from "openclaw/plugin-sdk/plugin-state-runtime";
|
|
18
19
|
import { createAsyncLock } from "openclaw/plugin-sdk/async-lock-runtime";
|
|
19
|
-
|
|
20
|
+
// extensions/discord/src/components-registry-state.ts
|
|
20
21
|
const discordComponentRegistryState = resolveGlobalSingleton(Symbol.for("openclaw.discord.componentRegistryState"), () => ({
|
|
21
22
|
withRegistryLock: createAsyncLock(),
|
|
22
23
|
componentEntries: /* @__PURE__ */ new Map(),
|
|
@@ -31,8 +32,7 @@ const discordComponentRegistryState = resolveGlobalSingleton(Symbol.for("opencla
|
|
|
31
32
|
state.persistentModalStore = void 0;
|
|
32
33
|
state.persistentRegistryDisabled = false;
|
|
33
34
|
}));
|
|
34
|
-
|
|
35
|
-
//#region extensions/discord/src/components-registry.ts
|
|
35
|
+
// extensions/discord/src/components-registry.ts
|
|
36
36
|
const DEFAULT_COMPONENT_TTL_MS = 18e5;
|
|
37
37
|
const PERSISTENT_COMPONENT_NAMESPACE = "discord.components";
|
|
38
38
|
const PERSISTENT_MODAL_NAMESPACE = "discord.modals";
|
|
@@ -227,8 +227,7 @@ async function resolveDiscordModalEntryWithPersistence(params) {
|
|
|
227
227
|
});
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
|
-
|
|
231
|
-
//#region extensions/discord/src/send.components.ts
|
|
230
|
+
// extensions/discord/src/send.components.ts
|
|
232
231
|
var send_components_exports = /* @__PURE__ */ __exportAll({
|
|
233
232
|
editDiscordComponentMessage: () => editDiscordComponentMessage,
|
|
234
233
|
registerBuiltDiscordComponentMessage: () => registerBuiltDiscordComponentMessage,
|
|
@@ -394,5 +393,4 @@ async function writeDiscordComponentMessage(to, spec, opts, messageId) {
|
|
|
394
393
|
});
|
|
395
394
|
return deliveryResult ?? toDeliveryResult();
|
|
396
395
|
}
|
|
397
|
-
//#endregion
|
|
398
396
|
export { registerDiscordComponentEntries as a, send_components_exports as i, registerBuiltDiscordComponentMessage as n, resolveDiscordComponentEntryWithPersistence as o, sendDiscordComponentMessage as r, resolveDiscordModalEntryWithPersistence as s, editDiscordComponentMessage as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import { T as createThread, q as withDiscordRequestAuthority, w as createChannelMessage } from "./discord-
|
|
4
|
-
import { n as createDiscordSendReceiptFromResults, r as createDiscordSendResult, u as
|
|
5
|
-
import {
|
|
6
|
-
import { t as parseAndResolveDiscordTarget } from "./target-resolver-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-nwUcYXjP.mjs";
|
|
2
|
+
import { u as createDiscordClient } from "./send.permissions-BvH_Dr8p.mjs";
|
|
3
|
+
import { T as createThread, q as withDiscordRequestAuthority, w as createChannelMessage } from "./discord-cXPUdHQi.mjs";
|
|
4
|
+
import { d as normalizeDiscordSnowflake, m as createReusableDiscordReplyReference, n as createDiscordSendReceiptFromResults, p as resolveDiscordDirectoryUserId, r as createDiscordSendResult, u as normalizeDiscordHandleKey } from "./send.receipt-CZ7ks6g7.mjs";
|
|
5
|
+
import { C as resolveDiscordSuppressEmbeds, S as resolveDiscordSendEmbeds, b as resolveDiscordMessageFlags, c as resolveChannelId, d as sendDiscordChunks, f as sendDiscordMedia, i as normalizeDiscordPollInput, l as resolveDiscordChannel, n as buildDiscordTextChunks, s as normalizeStickerIds, t as buildDiscordSendError, v as buildDiscordMessageRequest, x as resolveDiscordSendComponents, y as createDiscordMessageNonce } from "./send.shared-D2lh737v.mjs";
|
|
6
|
+
import { t as parseAndResolveDiscordTarget } from "./target-resolver-48znkzky.mjs";
|
|
7
7
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
8
|
import { ChannelType } from "discord-api-types/v10";
|
|
9
9
|
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
@@ -14,7 +14,7 @@ import { truncateUtf16Safe } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
|
14
14
|
import { recordChannelActivity } from "openclaw/plugin-sdk/channel-activity-runtime";
|
|
15
15
|
import { resolveMarkdownTableMode } from "openclaw/plugin-sdk/markdown-table-runtime";
|
|
16
16
|
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
17
|
-
|
|
17
|
+
// extensions/discord/src/url-ranges.ts
|
|
18
18
|
const DISCORD_URL_START_RE = /(?:[A-Za-z][A-Za-z0-9+.-]*:\/\/|www\.|\/\/|mailto:)/giu;
|
|
19
19
|
function findDiscordUrlRanges(markdown) {
|
|
20
20
|
const ranges = [];
|
|
@@ -42,8 +42,7 @@ function findDiscordUrlRanges(markdown) {
|
|
|
42
42
|
}
|
|
43
43
|
return ranges;
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
//#region extensions/discord/src/mentions.ts
|
|
45
|
+
// extensions/discord/src/mentions.ts
|
|
47
46
|
const MENTION_CANDIDATE_PATTERN = /(^|[\s([{"'.,;:!?])@([a-z0-9_.-]{2,32}(?:#[0-9]{4})?)/gi;
|
|
48
47
|
const DISCORD_RESERVED_MENTIONS = /* @__PURE__ */ new Set(["everyone", "here"]);
|
|
49
48
|
const DISCORD_DISCRIMINATOR_SUFFIX = /#\d{4}$/;
|
|
@@ -138,8 +137,7 @@ function rewriteDiscordKnownMentions(text, params) {
|
|
|
138
137
|
function discordTextHasBroadcastMention(text) {
|
|
139
138
|
return DISCORD_BROADCAST_MENTION_PATTERN.test(text);
|
|
140
139
|
}
|
|
141
|
-
|
|
142
|
-
//#region extensions/discord/src/markdown.ts
|
|
140
|
+
// extensions/discord/src/markdown.ts
|
|
143
141
|
const DISCORD_NATIVE_TOKEN_RE = /<a?:[A-Za-z0-9_]+:\d+>|<\/[^>]+:\d+>/giu;
|
|
144
142
|
function normalizeDiscordBold(markdown) {
|
|
145
143
|
if (!markdown.includes("__")) return markdown;
|
|
@@ -288,8 +286,7 @@ function normalizeDiscordBold(markdown) {
|
|
|
288
286
|
function renderDiscordMarkdown(markdown, tableMode) {
|
|
289
287
|
return normalizeDiscordBold(convertMarkdownTables(markdown, tableMode));
|
|
290
288
|
}
|
|
291
|
-
|
|
292
|
-
//#region extensions/discord/src/outbound-text.ts
|
|
289
|
+
// extensions/discord/src/outbound-text.ts
|
|
293
290
|
function prepareDiscordOutboundText(text, params) {
|
|
294
291
|
const { account } = params;
|
|
295
292
|
const renderedText = renderDiscordMarkdown(text, params.tableMode ?? resolveMarkdownTableMode({
|
|
@@ -306,8 +303,7 @@ function prepareDiscordOutboundText(text, params) {
|
|
|
306
303
|
})
|
|
307
304
|
};
|
|
308
305
|
}
|
|
309
|
-
|
|
310
|
-
//#region extensions/discord/src/send.outbound.ts
|
|
306
|
+
// extensions/discord/src/send.outbound.ts
|
|
311
307
|
var send_outbound_exports = /* @__PURE__ */ __exportAll({
|
|
312
308
|
sendMessageDiscord: () => sendMessageDiscord,
|
|
313
309
|
sendPollDiscord: () => sendPollDiscord,
|
|
@@ -574,5 +570,4 @@ async function sendDiscordStructuredMessage(to, opts, kind, buildPayload) {
|
|
|
574
570
|
});
|
|
575
571
|
});
|
|
576
572
|
}
|
|
577
|
-
//#endregion
|
|
578
573
|
export { prepareDiscordOutboundText as a, send_outbound_exports as i, sendPollDiscord as n, discordTextHasBroadcastMention as o, sendStickerDiscord as r, formatMention as s, sendMessageDiscord as t };
|