@openclaw/discord 2026.11.7 → 2026.11.10-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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-C3j0qLDp.mjs → allow-list-CkqpzPvP.mjs} +4 -8
- package/dist/.setup/{api-DYRggUgK.mjs → api-C4j_kC-2.mjs} +4 -6
- package/dist/.setup/{approval-handler.runtime-BN4W1r0o.mjs → approval-handler.runtime-DXzPFNvC.mjs} +10 -10
- package/dist/.setup/{approval-message-updates-DKsCfxSW.mjs → approval-message-updates-DqOXxPss.mjs} +3 -4
- package/dist/.setup/{audit-BL6EoUun.mjs → audit-B9vk3V2z.mjs} +6 -7
- package/dist/.setup/{channel-DdI2l55_.mjs → channel-CKffiPiV.mjs} +38 -41
- package/dist/.setup/{channel-access-9cyzozUP.mjs → channel-access-DhJhVrdZ.mjs} +1 -2
- package/dist/.setup/{channel.setup-kNWMxlgu.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-C1Phe3uw.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-K_jFbvi5.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-CY2-qrHI.mjs → directory-live-B9UoQG9g.mjs} +9 -64
- package/dist/.setup/{discord-BRVFhk09.mjs → discord-cXPUdHQi.mjs} +98 -77
- package/dist/.setup/{doctor-RqH-6JB0.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-BSnrns-F.mjs → guilds-DYBhgnfq.mjs} +3 -4
- package/dist/.setup/{handle-action-uD87h2FK.mjs → handle-action-El1ok7Ak.mjs} +13 -12
- package/dist/.setup/{handle-action.guild-admin-CqBx_3mG.mjs → handle-action.guild-admin-CxYfg02j.mjs} +7 -5
- package/dist/.setup/identity-link-B7KOBo_l.mjs +74 -0
- package/dist/.setup/{listeners-DnHLrLIN.mjs → listeners-DIyynRvV.mjs} +2 -3
- package/dist/.setup/{live-policy-config-y0Qy36X3.mjs → live-policy-config-DjIHWFla.mjs} +3 -5
- package/dist/.setup/{message-handler-CWL_u0X8.mjs → message-handler-DP3cAQCZ.mjs} +18 -17
- package/dist/.setup/{message-handler.preflight-83tpEdBG.mjs → message-handler.preflight-S5yc9UdR.mjs} +20 -27
- package/dist/.setup/{message-handler.preflight-pluralkit-Dhcx7Ifz.mjs → message-handler.preflight-pluralkit-BFntgVKc.mjs} +10 -14
- package/dist/.setup/{message-handler.process-BC-wNZwK.mjs → message-handler.process-bXE_4sq5.mjs} +56 -67
- package/dist/.setup/oauth-http-DdVyzSbo.mjs +40 -0
- package/dist/.setup/{outbound-payload-CK3_bDvK.mjs → outbound-payload-Dh6xCO6z.mjs} +18 -13
- package/dist/.setup/{outbound-session-route-Ay_DnOOl.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-CbDJojNV.mjs → probe-CfGMZwFD.mjs} +5 -6
- package/dist/.setup/{provider-CRb3Myky.mjs → provider-BA4ysXXm.mjs} +200 -249
- package/dist/.setup/{provider-session.runtime-3cZpps3H.mjs → provider-session.runtime-Cr2oPicL.mjs} +3 -3
- package/dist/.setup/provider.runtime-D4BlQKDq.mjs +1 -0
- package/dist/.setup/{proxy-fetch-BzXwBAXt.mjs → proxy-fetch-B8cK6FLQ.mjs} +1 -2
- package/dist/.setup/{realtime-session.runtime-BRYpjS9P.mjs → realtime-session.runtime-DQvAKxj9.mjs} +15 -25
- package/dist/.setup/{receive-recovery-C3Ks4wAQ.mjs → receive-recovery-DV_v5ROf.mjs} +3 -6
- package/dist/.setup/{resolve-allowlist-common-B-S0wRIw.mjs → resolve-allowlist-common-CYdqBUgV.mjs} +3 -4
- package/dist/.setup/{resolve-channels-g16NM6Ho.mjs → resolve-channels-BNnyfCR8.mjs} +6 -7
- package/dist/.setup/{resolve-users-DAfOOXdy.mjs → resolve-users-CDMAGrzv.mjs} +5 -6
- package/dist/.setup/{rolldown-runtime-B4FMCO8f.mjs → rolldown-runtime-nwUcYXjP.mjs} +1 -2
- package/dist/.setup/{runtime--HZ9r3tF.mjs → runtime-CkeNX7ic.mjs} +59 -50
- 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-CtvwfZQ2.mjs → send-DKzwsZkm.mjs} +26 -31
- package/dist/.setup/{send.components-CtLtE0yD.mjs → send.components-CIZALYDP.mjs} +12 -14
- package/dist/.setup/{send.outbound-D58xXPgs.mjs → send.outbound-cQ4Ohmsc.mjs} +11 -16
- package/dist/.setup/send.permissions-BvH_Dr8p.mjs +369 -0
- package/dist/.setup/{send.receipt-DLOV4qx6.mjs → send.receipt-CZ7ks6g7.mjs} +64 -17
- package/dist/.setup/send.shared-D2lh737v.mjs +259 -0
- package/dist/.setup/{sender-identity-BbA7FNbr.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-Dv2DamaK.mjs → shared-Bf7ifHlc.mjs} +14 -17
- package/dist/.setup/{shared-interactive-DmzaoKOM.mjs → shared-interactive-DKBw4SNV.mjs} +7 -12
- package/dist/.setup/{subagent-hooks-yT45eTyz.mjs → subagent-hooks-CVmIOrAR.mjs} +4 -5
- package/dist/.setup/{system-events-Dlzp9Jcj.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-BzaZPBm9.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-DRWhgKCc.mjs → thread-bindings-DTHVdmvF.mjs} +7 -10
- package/dist/.setup/{thread-bindings.manager-CWJKirn1.mjs → thread-bindings.manager-6EnH3YZh.mjs} +45 -30
- package/dist/.setup/{thread-bindings.session-updates-DzJrXc4w.mjs → thread-bindings.session-updates-BPO6pPzd.mjs} +9 -12
- package/dist/.setup/{threading-BbsPuT5G.mjs → threading-PC3IIaHd.mjs} +5 -7
- package/dist/.setup/{timeouts-cIxzatmv.mjs → timeouts-CT9hnmo4.mjs} +1 -2
- package/dist/.setup/{transcripts-source-DIW1fU_P.mjs → transcripts-source-C3F_ErM1.mjs} +20 -33
- package/dist/.setup/{typing-CNlSKY5S.mjs → typing-DAv4S2fI.mjs} +2 -3
- package/dist/.setup/{voice-runtime-oJ6BZs5D.mjs → voice-runtime-CZGbraKC.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/provider.runtime-tmkt3QOg.mjs +0 -1
- package/dist/.setup/send.shared-B_KKRrD7.mjs +0 -589
- package/dist/.setup/setup-plugin-api-ty5RJrMy.mjs +0 -2
|
@@ -0,0 +1,369 @@
|
|
|
1
|
+
import { h as normalizeDiscordToken, l as resolveDiscordAccount, s as mergeDiscordAccountConfig } from "./accounts-DtjvhJUj.mjs";
|
|
2
|
+
import { A as getThreadMember, N as getGuild, O as getChannel, P as getGuildMember, R as RequestClient, b as getCurrentUser } from "./discord-cXPUdHQi.mjs";
|
|
3
|
+
import { w as isDiscordThreadChannelType } from "./allow-list-CkqpzPvP.mjs";
|
|
4
|
+
import { y as createDiscordRetryRunner } from "./send.receipt-CZ7ks6g7.mjs";
|
|
5
|
+
import { t as resolveDiscordProxyFetchForAccount } from "./proxy-fetch-B8cK6FLQ.mjs";
|
|
6
|
+
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
7
|
+
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
8
|
+
import { ChannelType, PermissionFlagsBits } from "discord-api-types/v10";
|
|
9
|
+
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
|
|
10
|
+
// extensions/discord/src/monitor/gateway-registry.ts
|
|
11
|
+
/**
|
|
12
|
+
* Module-level registry of active Discord GatewayPlugin instances.
|
|
13
|
+
* Bridges the gap between agent tool handlers (which only have REST access)
|
|
14
|
+
* and the gateway WebSocket (needed for operations like updatePresence).
|
|
15
|
+
* Follows the same pattern as presence-cache.ts.
|
|
16
|
+
*/
|
|
17
|
+
const gatewayRegistry = /* @__PURE__ */ new Map();
|
|
18
|
+
const DEFAULT_ACCOUNT_KEY = "\0__default__";
|
|
19
|
+
function registerGateway(accountId, gateway) {
|
|
20
|
+
gatewayRegistry.set(accountId ?? DEFAULT_ACCOUNT_KEY, gateway);
|
|
21
|
+
}
|
|
22
|
+
function unregisterGateway(accountId) {
|
|
23
|
+
gatewayRegistry.delete(accountId ?? DEFAULT_ACCOUNT_KEY);
|
|
24
|
+
}
|
|
25
|
+
function getGateway(accountId) {
|
|
26
|
+
return gatewayRegistry.get(accountId ?? DEFAULT_ACCOUNT_KEY);
|
|
27
|
+
}
|
|
28
|
+
function clearGateways() {
|
|
29
|
+
gatewayRegistry.clear();
|
|
30
|
+
}
|
|
31
|
+
// extensions/discord/src/client.ts
|
|
32
|
+
function createDiscordRuntimeAccountContext(params) {
|
|
33
|
+
return {
|
|
34
|
+
cfg: params.cfg,
|
|
35
|
+
accountId: normalizeAccountId(params.accountId)
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function resolveDiscordClientAccountContext(opts) {
|
|
39
|
+
const resolvedCfg = requireRuntimeConfig(opts.cfg, "Discord client");
|
|
40
|
+
const accountId = normalizeAccountId(opts.accountId);
|
|
41
|
+
const config = mergeDiscordAccountConfig(resolvedCfg, accountId);
|
|
42
|
+
const account = {
|
|
43
|
+
accountId,
|
|
44
|
+
enabled: resolvedCfg.channels?.discord?.enabled !== false && config.enabled !== false,
|
|
45
|
+
name: normalizeOptionalString(config.name),
|
|
46
|
+
token: "",
|
|
47
|
+
tokenSource: "none",
|
|
48
|
+
tokenStatus: "missing",
|
|
49
|
+
config
|
|
50
|
+
};
|
|
51
|
+
return {
|
|
52
|
+
cfg: resolvedCfg,
|
|
53
|
+
account,
|
|
54
|
+
proxyFetch: resolveDiscordProxyFetchForAccount(account, resolvedCfg)
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function resolveToken(account) {
|
|
58
|
+
const fallback = normalizeDiscordToken(account.token, "channels.discord.token");
|
|
59
|
+
if (!fallback) {
|
|
60
|
+
if (account.tokenStatus === "configured_unavailable") throw new Error(`Discord bot token configured for account "${account.accountId}" is unavailable; resolve SecretRefs against the active runtime snapshot before using this account.`);
|
|
61
|
+
throw new Error(`Discord bot token missing for account "${account.accountId}" (set discord.accounts.${account.accountId}.token or DISCORD_BOT_TOKEN for default).`);
|
|
62
|
+
}
|
|
63
|
+
return fallback;
|
|
64
|
+
}
|
|
65
|
+
function createDiscordRestClient(opts) {
|
|
66
|
+
const explicitToken = normalizeDiscordToken(opts.token, "channels.discord.token");
|
|
67
|
+
const proxyContext = resolveDiscordClientAccountContext(opts);
|
|
68
|
+
const resolvedCfg = proxyContext.cfg;
|
|
69
|
+
const account = explicitToken ? proxyContext.account : resolveDiscordAccount({
|
|
70
|
+
cfg: resolvedCfg,
|
|
71
|
+
accountId: opts.accountId
|
|
72
|
+
});
|
|
73
|
+
const token = explicitToken ?? resolveToken(account);
|
|
74
|
+
const { rest, signal, callerSignal, timeoutMs } = opts;
|
|
75
|
+
if (rest) return {
|
|
76
|
+
token,
|
|
77
|
+
rest,
|
|
78
|
+
account
|
|
79
|
+
};
|
|
80
|
+
const proxyFetch = proxyContext.proxyFetch ?? resolveDiscordProxyFetchForAccount(account, resolvedCfg);
|
|
81
|
+
return {
|
|
82
|
+
token,
|
|
83
|
+
rest: new RequestClient(token, {
|
|
84
|
+
...proxyFetch ? { fetch: proxyFetch } : {},
|
|
85
|
+
...signal ? { signal } : {},
|
|
86
|
+
...callerSignal ? { callerSignal } : {},
|
|
87
|
+
...timeoutMs !== void 0 ? { timeout: timeoutMs } : {}
|
|
88
|
+
}),
|
|
89
|
+
account
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
function createDiscordClient(opts) {
|
|
93
|
+
const { token, rest, account: restAccount } = createDiscordRestClient(opts);
|
|
94
|
+
const account = normalizeDiscordToken(opts.token, "channels.discord.token") ? resolveDiscordAccount({
|
|
95
|
+
cfg: opts.cfg,
|
|
96
|
+
accountId: opts.accountId
|
|
97
|
+
}) : restAccount;
|
|
98
|
+
return {
|
|
99
|
+
token,
|
|
100
|
+
rest,
|
|
101
|
+
request: createDiscordRetryRunner({
|
|
102
|
+
retry: opts.retry,
|
|
103
|
+
verbose: opts.verbose,
|
|
104
|
+
signal: opts.signal && opts.callerSignal ? AbortSignal.any([opts.signal, opts.callerSignal]) : opts.callerSignal ?? opts.signal,
|
|
105
|
+
isGatewayDisconnected: () => {
|
|
106
|
+
const gateway = getGateway(restAccount.accountId);
|
|
107
|
+
return gateway !== void 0 && !gateway.isConnected;
|
|
108
|
+
}
|
|
109
|
+
}),
|
|
110
|
+
account
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
function resolveDiscordRest(opts) {
|
|
114
|
+
return createDiscordRestClient(opts).rest;
|
|
115
|
+
}
|
|
116
|
+
// extensions/discord/src/send.permissions.ts
|
|
117
|
+
const PERMISSION_ENTRIES = Object.entries(PermissionFlagsBits).filter(([, value]) => typeof value === "bigint");
|
|
118
|
+
const ALL_PERMISSIONS = PERMISSION_ENTRIES.reduce((acc, [, value]) => acc | value, 0n);
|
|
119
|
+
const ADMINISTRATOR_BIT = PermissionFlagsBits.Administrator;
|
|
120
|
+
function addPermissionBits(base, add) {
|
|
121
|
+
return base | BigInt(add || "0");
|
|
122
|
+
}
|
|
123
|
+
function removePermissionBits(base, deny) {
|
|
124
|
+
return base & ~BigInt(deny || "0");
|
|
125
|
+
}
|
|
126
|
+
function bitfieldToPermissions(bitfield) {
|
|
127
|
+
return PERMISSION_ENTRIES.filter(([, value]) => (bitfield & value) === value).map(([name]) => name).toSorted();
|
|
128
|
+
}
|
|
129
|
+
function hasAdministrator(bitfield) {
|
|
130
|
+
return (bitfield & ADMINISTRATOR_BIT) === ADMINISTRATOR_BIT;
|
|
131
|
+
}
|
|
132
|
+
function hasPermissionBit(bitfield, permission) {
|
|
133
|
+
return (bitfield & permission) === permission;
|
|
134
|
+
}
|
|
135
|
+
async function fetchBotUserId(rest) {
|
|
136
|
+
const me = await getCurrentUser(rest);
|
|
137
|
+
if (!me?.id) throw new Error("Failed to resolve bot user id");
|
|
138
|
+
return me.id;
|
|
139
|
+
}
|
|
140
|
+
function resolveMemberGuildPermissionBits(params) {
|
|
141
|
+
let permissions = addPermissionBits(0n, params.roles.get(params.guildId)?.permissions);
|
|
142
|
+
for (const roleId of params.member.roles ?? []) permissions = addPermissionBits(permissions, params.roles.get(roleId)?.permissions);
|
|
143
|
+
return permissions;
|
|
144
|
+
}
|
|
145
|
+
function rolesById(guild) {
|
|
146
|
+
return new Map((guild.roles ?? []).map((role) => [role.id, role]));
|
|
147
|
+
}
|
|
148
|
+
function rolePosition(role) {
|
|
149
|
+
return typeof role?.position === "number" ? role.position : -1;
|
|
150
|
+
}
|
|
151
|
+
function highestMemberRolePosition(roles, member) {
|
|
152
|
+
return Math.max(...(member.roles ?? []).map((roleId) => rolePosition(roles.get(roleId))), 0);
|
|
153
|
+
}
|
|
154
|
+
function resolveMemberChannelPermissionBits(params) {
|
|
155
|
+
let permissions = resolveMemberGuildPermissionBits({
|
|
156
|
+
guildId: params.guildId,
|
|
157
|
+
roles: rolesById(params.guild),
|
|
158
|
+
member: params.member
|
|
159
|
+
});
|
|
160
|
+
if (hasAdministrator(permissions)) return ALL_PERMISSIONS;
|
|
161
|
+
const overwrites = "permission_overwrites" in params.channel ? params.channel.permission_overwrites ?? [] : [];
|
|
162
|
+
for (const overwrite of overwrites) if (overwrite.id === params.guildId) {
|
|
163
|
+
permissions = removePermissionBits(permissions, overwrite.deny);
|
|
164
|
+
permissions = addPermissionBits(permissions, overwrite.allow);
|
|
165
|
+
}
|
|
166
|
+
let roleDeny = 0n;
|
|
167
|
+
let roleAllow = 0n;
|
|
168
|
+
for (const overwrite of overwrites) if (params.member.roles?.includes(overwrite.id)) {
|
|
169
|
+
roleDeny = addPermissionBits(roleDeny, overwrite.deny);
|
|
170
|
+
roleAllow = addPermissionBits(roleAllow, overwrite.allow);
|
|
171
|
+
}
|
|
172
|
+
permissions = permissions & ~roleDeny | roleAllow;
|
|
173
|
+
for (const overwrite of overwrites) if (overwrite.id === params.userId) {
|
|
174
|
+
permissions = removePermissionBits(permissions, overwrite.deny);
|
|
175
|
+
permissions = addPermissionBits(permissions, overwrite.allow);
|
|
176
|
+
}
|
|
177
|
+
return permissions;
|
|
178
|
+
}
|
|
179
|
+
async function resolveChannelPermissionSubject(rest, channel) {
|
|
180
|
+
const channelType = "type" in channel ? channel.type : void 0;
|
|
181
|
+
const parentId = "parent_id" in channel ? channel.parent_id : void 0;
|
|
182
|
+
if (isDiscordThreadChannelType(channelType) && parentId) return await getChannel(rest, parentId);
|
|
183
|
+
return channel;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Fetch guild-level permissions for a user. This does not include channel-specific overwrites.
|
|
187
|
+
*/
|
|
188
|
+
async function fetchMemberGuildPermissionsDiscord(guildId, userId, opts) {
|
|
189
|
+
const rest = resolveDiscordRest(opts);
|
|
190
|
+
try {
|
|
191
|
+
const [guild, member] = await Promise.all([getGuild(rest, guildId), getGuildMember(rest, guildId, userId)]);
|
|
192
|
+
if (guild.owner_id === userId) return ALL_PERMISSIONS;
|
|
193
|
+
return resolveMemberGuildPermissionBits({
|
|
194
|
+
guildId,
|
|
195
|
+
roles: rolesById(guild),
|
|
196
|
+
member
|
|
197
|
+
});
|
|
198
|
+
} catch {
|
|
199
|
+
return null;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
async function checkMemberChannelPermissions(guildId, channelId, userId, opts, check) {
|
|
203
|
+
const rest = resolveDiscordRest(opts);
|
|
204
|
+
try {
|
|
205
|
+
const channel = await getChannel(rest, channelId);
|
|
206
|
+
const permissionChannel = await resolveChannelPermissionSubject(rest, channel);
|
|
207
|
+
if (!("guild_id" in permissionChannel) || permissionChannel.guild_id !== guildId) return false;
|
|
208
|
+
const [guild, member] = await Promise.all([getGuild(rest, guildId), getGuildMember(rest, guildId, userId)]);
|
|
209
|
+
if (guild.owner_id === userId) return true;
|
|
210
|
+
return await check(resolveMemberChannelPermissionBits({
|
|
211
|
+
guildId,
|
|
212
|
+
userId,
|
|
213
|
+
guild,
|
|
214
|
+
member,
|
|
215
|
+
channel: permissionChannel
|
|
216
|
+
}), channel, rest);
|
|
217
|
+
} catch {
|
|
218
|
+
return false;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
async function canViewChannel(permissions, channel, rest, userId) {
|
|
222
|
+
if (!hasPermissionBit(permissions, PermissionFlagsBits.ViewChannel)) return false;
|
|
223
|
+
if (channel.type === ChannelType.PrivateThread) {
|
|
224
|
+
if (!hasPermissionBit(permissions, PermissionFlagsBits.ManageThreads)) try {
|
|
225
|
+
await getThreadMember(rest, channel.id, userId);
|
|
226
|
+
} catch {
|
|
227
|
+
return false;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
return true;
|
|
231
|
+
}
|
|
232
|
+
async function canViewDiscordGuildChannel(guildId, channelId, userId, opts) {
|
|
233
|
+
return checkMemberChannelPermissions(guildId, channelId, userId, opts, (permissions, channel, rest) => canViewChannel(permissions, channel, rest, userId));
|
|
234
|
+
}
|
|
235
|
+
/** Fresh facts for one fork qualification; callers must not retain them for creation. */
|
|
236
|
+
async function fetchThreadForkPermissionsDiscord(guildId, source, parent, userId, opts) {
|
|
237
|
+
opts.signal?.throwIfAborted();
|
|
238
|
+
const rest = resolveDiscordRest(opts);
|
|
239
|
+
const [guild, requester, botId] = await Promise.all([
|
|
240
|
+
getGuild(rest, guildId),
|
|
241
|
+
getGuildMember(rest, guildId, userId),
|
|
242
|
+
fetchBotUserId(rest)
|
|
243
|
+
]);
|
|
244
|
+
opts.signal?.throwIfAborted();
|
|
245
|
+
const bot = await getGuildMember(rest, guildId, botId);
|
|
246
|
+
opts.signal?.throwIfAborted();
|
|
247
|
+
const requesterPermissions = guild.owner_id === userId ? ALL_PERMISSIONS : resolveMemberChannelPermissionBits({
|
|
248
|
+
guildId,
|
|
249
|
+
userId,
|
|
250
|
+
guild,
|
|
251
|
+
member: requester,
|
|
252
|
+
channel: parent
|
|
253
|
+
});
|
|
254
|
+
const requesterCanRead = hasPermissionBit(requesterPermissions, PermissionFlagsBits.ReadMessageHistory) && await canViewChannel(requesterPermissions, source, rest, userId);
|
|
255
|
+
opts.signal?.throwIfAborted();
|
|
256
|
+
return {
|
|
257
|
+
requesterCanRead,
|
|
258
|
+
botPermissions: bitfieldToPermissions(resolveMemberChannelPermissionBits({
|
|
259
|
+
guildId,
|
|
260
|
+
userId: botId,
|
|
261
|
+
guild,
|
|
262
|
+
member: bot,
|
|
263
|
+
channel: parent
|
|
264
|
+
}))
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Returns true when the user has ADMINISTRATOR or any required permission bit
|
|
269
|
+
* after applying channel/category overwrites.
|
|
270
|
+
*/
|
|
271
|
+
async function hasAnyChannelPermissionDiscord(guildId, channelId, userId, requiredPermissions, opts) {
|
|
272
|
+
return checkMemberChannelPermissions(guildId, channelId, userId, opts, (permissions) => requiredPermissions.some((permission) => hasPermissionBit(permissions, permission)));
|
|
273
|
+
}
|
|
274
|
+
async function canManageGuildMemberRoleDiscord(guildId, senderUserId, targetUserId, roleId, opts, requirements) {
|
|
275
|
+
const rest = resolveDiscordRest(opts);
|
|
276
|
+
try {
|
|
277
|
+
const [guild, senderMember, targetMember] = await Promise.all([
|
|
278
|
+
getGuild(rest, guildId),
|
|
279
|
+
getGuildMember(rest, guildId, senderUserId),
|
|
280
|
+
getGuildMember(rest, guildId, targetUserId)
|
|
281
|
+
]);
|
|
282
|
+
if (guild.owner_id === senderUserId) return true;
|
|
283
|
+
if (guild.owner_id === targetUserId) return false;
|
|
284
|
+
const roles = rolesById(guild);
|
|
285
|
+
const targetRole = roles.get(roleId);
|
|
286
|
+
const targetRolePosition = rolePosition(targetRole);
|
|
287
|
+
if (targetRolePosition < 0) return false;
|
|
288
|
+
const senderPermissions = resolveMemberGuildPermissionBits({
|
|
289
|
+
guildId,
|
|
290
|
+
roles,
|
|
291
|
+
member: senderMember
|
|
292
|
+
});
|
|
293
|
+
if (requirements?.assignablePermissionCeiling && !hasAdministrator(senderPermissions) && (BigInt(targetRole?.permissions ?? "0") & ~senderPermissions) !== 0n) return false;
|
|
294
|
+
const senderHighestRolePosition = highestMemberRolePosition(roles, senderMember);
|
|
295
|
+
if (senderHighestRolePosition <= targetRolePosition) return false;
|
|
296
|
+
return senderHighestRolePosition > highestMemberRolePosition(roles, targetMember);
|
|
297
|
+
} catch {
|
|
298
|
+
return false;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
async function canManageGuildRoleDiscord(guildId, senderUserId, roleId, opts) {
|
|
302
|
+
const rest = resolveDiscordRest(opts);
|
|
303
|
+
try {
|
|
304
|
+
const [guild, senderMember] = await Promise.all([getGuild(rest, guildId), getGuildMember(rest, guildId, senderUserId)]);
|
|
305
|
+
const roles = rolesById(guild);
|
|
306
|
+
const targetRole = roles.get(roleId);
|
|
307
|
+
if (!targetRole) return null;
|
|
308
|
+
if (guild.owner_id === senderUserId) return true;
|
|
309
|
+
return highestMemberRolePosition(roles, senderMember) > rolePosition(targetRole);
|
|
310
|
+
} catch {
|
|
311
|
+
return false;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Returns true when the user has ADMINISTRATOR or the required permission bits.
|
|
316
|
+
*/
|
|
317
|
+
async function hasGuildPermissionsDiscord(guildId, userId, requiredPermissions, match, opts) {
|
|
318
|
+
const permissions = await fetchMemberGuildPermissionsDiscord(guildId, userId, opts);
|
|
319
|
+
return permissions !== null && (hasAdministrator(permissions) || requiredPermissions[match]((permission) => hasPermissionBit(permissions, permission)));
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Returns true when the user has ADMINISTRATOR or any required permission bit.
|
|
323
|
+
*/
|
|
324
|
+
async function hasAnyGuildPermissionDiscord(guildId, userId, requiredPermissions, opts) {
|
|
325
|
+
return await hasGuildPermissionsDiscord(guildId, userId, requiredPermissions, "some", opts);
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Returns true when the user has ADMINISTRATOR or all required permission bits.
|
|
329
|
+
*/
|
|
330
|
+
async function hasAllGuildPermissionsDiscord(guildId, userId, requiredPermissions, opts) {
|
|
331
|
+
return await hasGuildPermissionsDiscord(guildId, userId, requiredPermissions, "every", opts);
|
|
332
|
+
}
|
|
333
|
+
async function fetchChannelPermissionsDiscord(channelId, opts) {
|
|
334
|
+
opts.signal?.throwIfAborted();
|
|
335
|
+
const rest = resolveDiscordRest(opts);
|
|
336
|
+
const channel = await getChannel(rest, channelId);
|
|
337
|
+
opts.signal?.throwIfAborted();
|
|
338
|
+
const channelType = "type" in channel ? channel.type : void 0;
|
|
339
|
+
const permissionChannel = await resolveChannelPermissionSubject(rest, channel);
|
|
340
|
+
opts.signal?.throwIfAborted();
|
|
341
|
+
const guildId = "guild_id" in permissionChannel ? permissionChannel.guild_id : void 0;
|
|
342
|
+
if (!guildId) return {
|
|
343
|
+
channelId,
|
|
344
|
+
permissions: [],
|
|
345
|
+
raw: "0",
|
|
346
|
+
isDm: true,
|
|
347
|
+
channelType
|
|
348
|
+
};
|
|
349
|
+
const botId = await fetchBotUserId(rest);
|
|
350
|
+
opts.signal?.throwIfAborted();
|
|
351
|
+
const [guild, member] = await Promise.all([getGuild(rest, guildId), getGuildMember(rest, guildId, botId)]);
|
|
352
|
+
opts.signal?.throwIfAborted();
|
|
353
|
+
const permissions = resolveMemberChannelPermissionBits({
|
|
354
|
+
guildId,
|
|
355
|
+
userId: botId,
|
|
356
|
+
guild,
|
|
357
|
+
member,
|
|
358
|
+
channel: permissionChannel
|
|
359
|
+
});
|
|
360
|
+
return {
|
|
361
|
+
channelId,
|
|
362
|
+
guildId,
|
|
363
|
+
permissions: bitfieldToPermissions(permissions),
|
|
364
|
+
raw: permissions.toString(),
|
|
365
|
+
isDm: false,
|
|
366
|
+
channelType
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
export { registerGateway as _, fetchMemberGuildPermissionsDiscord as a, hasAnyChannelPermissionDiscord as c, createDiscordRestClient as d, createDiscordRuntimeAccountContext as f, getGateway as g, clearGateways as h, fetchChannelPermissionsDiscord as i, hasAnyGuildPermissionDiscord as l, resolveDiscordRest as m, canManageGuildRoleDiscord as n, fetchThreadForkPermissionsDiscord as o, resolveDiscordClientAccountContext as p, canViewDiscordGuildChannel as r, hasAllGuildPermissionsDiscord as s, canManageGuildMemberRoleDiscord as t, createDiscordClient as u, unregisterGateway as v };
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import { B as RateLimitError } from "./discord-
|
|
2
|
-
import { t as parseDiscordTarget } from "./target-parsing-
|
|
1
|
+
import { B as RateLimitError } from "./discord-cXPUdHQi.mjs";
|
|
2
|
+
import { t as parseDiscordTarget } from "./target-parsing-BiuhcK9Q.mjs";
|
|
3
3
|
import { collectErrorGraphCandidates, extractErrorCode, formatErrorMessage, readErrorName } from "openclaw/plugin-sdk/error-runtime";
|
|
4
4
|
import { sleepWithAbort } from "openclaw/plugin-sdk/runtime-env";
|
|
5
|
+
import { normalizeAccountId } from "openclaw/plugin-sdk/routing";
|
|
6
|
+
import { normalizeOptionalString, normalizeOptionalStringifiedId } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
7
|
import { expectDefined } from "openclaw/plugin-sdk/expect-runtime";
|
|
6
8
|
import { parseStrictNonNegativeInteger, resolveIntegerOption } from "openclaw/plugin-sdk/number-runtime";
|
|
7
9
|
import { chunkByParagraph } from "openclaw/plugin-sdk/reply-chunking";
|
|
8
10
|
import { chunkTextForOutbound, findCodeRegions } from "openclaw/plugin-sdk/text-chunking";
|
|
9
11
|
import { classifyTransientNetworkErrorCode, createChannelApiRetryRunner, resolveRetryConfig, retryAsync } from "openclaw/plugin-sdk/retry-runtime";
|
|
10
12
|
import { isSingleUseReplyToMode } from "openclaw/plugin-sdk/reply-reference";
|
|
13
|
+
import { pruneMapToMaxSize } from "openclaw/plugin-sdk/collection-runtime";
|
|
11
14
|
import { createMessageReceiptFromOutboundResults } from "openclaw/plugin-sdk/channel-outbound";
|
|
12
15
|
import { attachChannelToResults } from "openclaw/plugin-sdk/channel-send-result";
|
|
13
|
-
|
|
16
|
+
// packages/normalization-core/src/utf16-slice.ts
|
|
14
17
|
function isHighSurrogate(codeUnit) {
|
|
15
18
|
return codeUnit >= 55296 && codeUnit <= 56319;
|
|
16
19
|
}
|
|
@@ -23,8 +26,7 @@ function avoidTrailingHighSurrogateBreak(text, start, end) {
|
|
|
23
26
|
const adjusted = end - 1;
|
|
24
27
|
return adjusted > start ? adjusted : end + 1;
|
|
25
28
|
}
|
|
26
|
-
|
|
27
|
-
//#region packages/normalization-core/src/grapheme.ts
|
|
29
|
+
// packages/normalization-core/src/grapheme.ts
|
|
28
30
|
let graphemeSegmenter;
|
|
29
31
|
function getGraphemeSegmenter() {
|
|
30
32
|
graphemeSegmenter ??= new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
@@ -48,8 +50,7 @@ function findGraphemeChunkEnd(text, start, maxEnd, preferredEnd = maxEnd, allowP
|
|
|
48
50
|
if (end <= start && preferred < hardEnd) end = hardEnd === text.length ? hardEnd : segments.containing(hardEnd)?.index ?? hardEnd;
|
|
49
51
|
return end > start ? end : allowPartial ? avoidTrailingHighSurrogateBreak(text, start, hardEnd) : start;
|
|
50
52
|
}
|
|
51
|
-
|
|
52
|
-
//#region extensions/discord/src/chunk.ts
|
|
53
|
+
// extensions/discord/src/chunk.ts
|
|
53
54
|
const DEFAULT_MAX_CHARS = 2e3;
|
|
54
55
|
const DEFAULT_MAX_LINES = 17;
|
|
55
56
|
const REASONING_ITALICS_MARKER_CHARS = 2;
|
|
@@ -364,8 +365,7 @@ function createDiscordRanges(source, maxChars, maxLines) {
|
|
|
364
365
|
cutBoundary
|
|
365
366
|
};
|
|
366
367
|
}
|
|
367
|
-
|
|
368
|
-
//#region extensions/discord/src/retry.ts
|
|
368
|
+
// extensions/discord/src/retry.ts
|
|
369
369
|
const DISCORD_RETRY_DEFAULTS = {
|
|
370
370
|
attempts: 3,
|
|
371
371
|
minDelayMs: 500,
|
|
@@ -459,8 +459,7 @@ function createDiscordRetryRunner(params) {
|
|
|
459
459
|
})(runRequest, label);
|
|
460
460
|
};
|
|
461
461
|
}
|
|
462
|
-
|
|
463
|
-
//#region extensions/discord/src/reply-reference.ts
|
|
462
|
+
// extensions/discord/src/reply-reference.ts
|
|
464
463
|
function resolveDiscordReplyReference(params) {
|
|
465
464
|
if (!params.replyToId) return;
|
|
466
465
|
const singleUse = params.replyToIdSource !== "explicit" && params.replyToMode !== void 0 && isSingleUseReplyToMode(params.replyToMode);
|
|
@@ -478,8 +477,58 @@ function createReusableDiscordReplyReference(messageId) {
|
|
|
478
477
|
function resolveDiscordReplyMessageId(reply, isFirst) {
|
|
479
478
|
return reply && (isFirst || reply.scope === "all") ? reply.messageId : void 0;
|
|
480
479
|
}
|
|
481
|
-
|
|
482
|
-
|
|
480
|
+
// extensions/discord/src/directory-cache-state.ts
|
|
481
|
+
const discordDirectoryCacheState = { handlesByAccount: /* @__PURE__ */ new Map() };
|
|
482
|
+
// extensions/discord/src/directory-cache.ts
|
|
483
|
+
const DISCORD_DIRECTORY_CACHE_MAX_ENTRIES = 4e3;
|
|
484
|
+
const DISCORD_DISCRIMINATOR_SUFFIX = /#\d{4}$/;
|
|
485
|
+
function normalizeDiscordSnowflake(value) {
|
|
486
|
+
const text = normalizeOptionalStringifiedId(value) ?? "";
|
|
487
|
+
if (!/^\d+$/.test(text)) return null;
|
|
488
|
+
return text;
|
|
489
|
+
}
|
|
490
|
+
function normalizeDiscordHandleKey(raw) {
|
|
491
|
+
let handle = normalizeOptionalString(raw) ?? "";
|
|
492
|
+
if (!handle) return null;
|
|
493
|
+
if (handle.startsWith("@")) handle = normalizeOptionalString(handle.slice(1)) ?? "";
|
|
494
|
+
if (!handle || /\s/.test(handle)) return null;
|
|
495
|
+
return handle.toLowerCase();
|
|
496
|
+
}
|
|
497
|
+
function ensureAccountCache(accountId) {
|
|
498
|
+
const cacheKey = normalizeAccountId(accountId);
|
|
499
|
+
const existing = discordDirectoryCacheState.handlesByAccount.get(cacheKey);
|
|
500
|
+
if (existing) return existing;
|
|
501
|
+
const created = /* @__PURE__ */ new Map();
|
|
502
|
+
discordDirectoryCacheState.handlesByAccount.set(cacheKey, created);
|
|
503
|
+
return created;
|
|
504
|
+
}
|
|
505
|
+
function setCacheEntry(cache, key, userId) {
|
|
506
|
+
const previous = cache.get(key);
|
|
507
|
+
cache.delete(key);
|
|
508
|
+
cache.set(key, previous === void 0 || previous === userId ? userId : null);
|
|
509
|
+
pruneMapToMaxSize(cache, DISCORD_DIRECTORY_CACHE_MAX_ENTRIES);
|
|
510
|
+
}
|
|
511
|
+
function rememberDiscordDirectoryUser(params) {
|
|
512
|
+
const userId = normalizeDiscordSnowflake(params.userId);
|
|
513
|
+
if (!userId) return;
|
|
514
|
+
const cache = ensureAccountCache(params.accountId);
|
|
515
|
+
for (const candidate of params.handles) {
|
|
516
|
+
if (typeof candidate !== "string") continue;
|
|
517
|
+
const handle = normalizeDiscordHandleKey(candidate);
|
|
518
|
+
if (!handle) continue;
|
|
519
|
+
setCacheEntry(cache, handle, userId);
|
|
520
|
+
const withoutDiscriminator = handle.replace(DISCORD_DISCRIMINATOR_SUFFIX, "");
|
|
521
|
+
if (withoutDiscriminator && withoutDiscriminator !== handle) setCacheEntry(cache, withoutDiscriminator, userId);
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
function resolveDiscordDirectoryUserId(params) {
|
|
525
|
+
const cache = discordDirectoryCacheState.handlesByAccount.get(normalizeAccountId(params.accountId));
|
|
526
|
+
if (!cache) return;
|
|
527
|
+
const handle = normalizeDiscordHandleKey(params.handle);
|
|
528
|
+
if (!handle) return;
|
|
529
|
+
return cache.get(handle) ?? void 0;
|
|
530
|
+
}
|
|
531
|
+
// extensions/discord/src/normalize.ts
|
|
483
532
|
function normalizeDiscordMessagingTarget(raw) {
|
|
484
533
|
return parseDiscordTarget(raw, { defaultKind: "channel" })?.normalized;
|
|
485
534
|
}
|
|
@@ -524,8 +573,7 @@ function looksLikeDiscordTargetId(raw) {
|
|
|
524
573
|
const trimmed = raw.trim();
|
|
525
574
|
return /^<@!?\d+>$/.test(trimmed) || /^(?:(?:user|channel|discord):\d+|discord:(?:user|channel):\d+)$/i.test(trimmed) || /^\d{6,}$/.test(trimmed);
|
|
526
575
|
}
|
|
527
|
-
|
|
528
|
-
//#region extensions/discord/src/send.receipt.ts
|
|
576
|
+
// extensions/discord/src/send.receipt.ts
|
|
529
577
|
function toDiscordOutboundDeliveryResult(result) {
|
|
530
578
|
const { channelId, ...delivery } = result;
|
|
531
579
|
return {
|
|
@@ -588,5 +636,4 @@ function createDiscordSendResult(params) {
|
|
|
588
636
|
})
|
|
589
637
|
};
|
|
590
638
|
}
|
|
591
|
-
|
|
592
|
-
export { recordDiscordMessageCreateAmbiguity as _, allowFromContainsDiscordUserId as a, normalizeDiscordMessagingTarget as c, resolveDiscordReplyMessageId as d, resolveDiscordReplyReference as f, hasDiscordMessageCreateAmbiguity as g, createDiscordRetryRunner as h, toDiscordOutboundDeliveryResult as i, normalizeDiscordOutboundTarget as l, classifyDiscordDeliveryFailure as m, createDiscordSendReceiptFromResults as n, looksLikeDiscordTargetId as o, canFallbackDiscordWebhookSend as p, createDiscordSendResult as r, matchesDiscordToolContextTarget as s, createDiscordSendReceipt as t, createReusableDiscordReplyReference as u, chunkDiscordTextWithMode as v, findGraphemeChunkEnd as y };
|
|
639
|
+
export { findGraphemeChunkEnd as C, chunkDiscordTextWithMode as S, canFallbackDiscordWebhookSend as _, allowFromContainsDiscordUserId as a, hasDiscordMessageCreateAmbiguity as b, normalizeDiscordMessagingTarget as c, normalizeDiscordSnowflake as d, rememberDiscordDirectoryUser as f, resolveDiscordReplyReference as g, resolveDiscordReplyMessageId as h, toDiscordOutboundDeliveryResult as i, normalizeDiscordOutboundTarget as l, createReusableDiscordReplyReference as m, createDiscordSendReceiptFromResults as n, looksLikeDiscordTargetId as o, resolveDiscordDirectoryUserId as p, createDiscordSendResult as r, matchesDiscordToolContextTarget as s, createDiscordSendReceipt as t, normalizeDiscordHandleKey as u, classifyDiscordDeliveryFailure as v, recordDiscordMessageCreateAmbiguity as x, createDiscordRetryRunner as y };
|