Files
openclaw/extensions/discord/api.ts
Peter Steinberger 6aa27d6ecd refactor: retire August compat windows (embedding API, pi aliases, target parser, spawning hook, setup exports, WhatsApp inbound aliases) (#124416)
* refactor(plugin-sdk): retire embedded Pi aliases

* refactor(channels): retire explicit target compatibility

* refactor(plugins): retire subagent spawning hook

* refactor(plugin-sdk): retire shipped channel setup exports

* refactor(whatsapp): retire inbound callback aliases

Proof: focused build and WhatsApp E2E green; broad WhatsApp suite 188/189 files green. extensions/whatsapp/src/monitor-inbox.policy.test.ts flakes only in the parallel batch and passes isolated (10/10).

* refactor(plugin-sdk): retire memory embedding registrar

Migrate every bundled provider and manifest to registerEmbeddingProvider and contracts.embeddingProviders. Preserve memory-specific batching, local-service acquisition, index identity, and auto-selection through the canonical generic registry adapter, then remove the parallel registrar, registry, diagnostics, contracts, tests, and docs.

* chore(plugin-sdk): tighten retired surface budgets

Pin the post-retirement public SDK surface to 144 entrypoints, 4,312 exports, 2,564 callable exports, and 1,133 deprecated exports; agent-harness-runtime now permits exactly nine deprecated exports.
2026-08-15 22:43:47 -07:00

142 lines
5.3 KiB
TypeScript

// Discord API module exposes the plugin public contract.
export { discordPlugin } from "./src/channel.js";
export { discordSetupPlugin } from "./src/channel.setup.js";
export {
handleDiscordSubagentDeliveryTarget,
handleDiscordSubagentEnded,
} from "./src/subagent-hooks.js";
export { inspectDiscordAccount, type InspectedDiscordAccount } from "./src/account-inspect.js";
export { type DiscordCredentialStatus } from "./src/token.js";
export {
createDiscordActionGate,
listDiscordAccountIds,
listEnabledDiscordAccounts,
mergeDiscordAccountConfig,
type ResolvedDiscordAccount,
resolveDefaultDiscordAccountId,
resolveDiscordAccount,
resolveDiscordAccountConfig,
resolveDiscordMaxLinesPerMessage,
} from "./src/accounts.js";
export { tryHandleDiscordMessageActionGuildAdmin } from "./src/actions/handle-action.guild-admin.js";
export { DiscordApiError, fetchDiscord, requestDiscord } from "./src/api.js";
export { buildDiscordComponentMessage } from "./src/components.js";
type DiscordMessageActionHandler =
typeof import("./src/channel-actions.runtime.js").handleDiscordMessageAction;
// Deprecated compatibility surface for existing @openclaw/discord/api.js consumers.
export const handleDiscordMessageAction: DiscordMessageActionHandler = async (...args) =>
(await import("./src/channel-actions.runtime.js")).handleDiscordMessageAction(...args);
export {
listDiscordDirectoryGroupsFromConfig,
listDiscordDirectoryPeersFromConfig,
} from "./src/directory-config.js";
export {
resolveDiscordGroupRequireMention,
resolveDiscordGroupToolPolicy,
} from "./src/group-policy.js";
export {
looksLikeDiscordTargetId,
normalizeDiscordMessagingTarget,
normalizeDiscordOutboundTarget,
} from "./src/normalize.js";
export { resolveOpenProviderRuntimeGroupPolicy as resolveDiscordRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
export { collectDiscordStatusIssues } from "./src/status-issues.js";
export {
buildDiscordComponentCustomId,
buildDiscordComponentMessageFlags,
buildDiscordInteractiveComponents,
buildDiscordModalCustomId,
createDiscordFormModal,
DISCORD_COMPONENT_ATTACHMENT_PREFIX,
DISCORD_COMPONENT_CUSTOM_ID_KEY,
DISCORD_MODAL_CUSTOM_ID_KEY,
DiscordFormModal,
formatDiscordComponentEventText,
parseDiscordComponentCustomId,
parseDiscordComponentCustomIdForInteraction,
parseDiscordComponentCustomIdForInteraction as parseDiscordComponentCustomIdForCarbon,
parseDiscordModalCustomId,
parseDiscordModalCustomIdForInteraction,
parseDiscordModalCustomIdForInteraction as parseDiscordModalCustomIdForCarbon,
readDiscordComponentSpec,
resolveDiscordComponentAttachmentName,
type ComponentData,
type DiscordComponentBlock,
type DiscordComponentBuildResult,
type DiscordComponentButtonSpec,
type DiscordComponentButtonStyle,
type DiscordComponentEntry,
type DiscordComponentMessageSpec,
type DiscordComponentModalFieldType,
type DiscordComponentSectionAccessory,
type DiscordComponentSelectOption,
type DiscordComponentSelectSpec,
type DiscordComponentSelectType,
type DiscordModalEntry,
type DiscordModalFieldDefinition,
type DiscordModalFieldSpec,
type DiscordModalSpec,
} from "./src/components.js";
export {
getDiscordExecApprovalApprovers,
isDiscordExecApprovalApprover,
isDiscordExecApprovalClientEnabled,
shouldSuppressLocalDiscordExecApprovalPrompt,
} from "./src/exec-approvals.js";
export type {
DiscordInteractiveHandlerContext,
DiscordInteractiveHandlerRegistration,
} from "./src/interactive-dispatch.js";
export {
type DiscordPluralKitConfig,
fetchPluralKitMessageInfo,
type PluralKitMemberInfo,
type PluralKitMessageInfo,
type PluralKitSystemInfo,
} from "./src/pluralkit.js";
export {
fetchDiscordApplicationId,
fetchDiscordApplicationSummary,
parseApplicationIdFromToken,
probeDiscord,
resolveDiscordPrivilegedIntentsFromFlags,
type DiscordApplicationSummary,
type DiscordPrivilegedIntentsSummary,
type DiscordPrivilegedIntentStatus,
type DiscordProbe,
} from "./src/probe.js";
export { normalizeExplicitDiscordSessionKey } from "./src/session-key-normalization.js";
export { parseDiscordSendTarget, type SendDiscordTarget } from "./src/send-target-parsing.js";
export {
parseDiscordTarget,
resolveDiscordChannelId,
resolveDiscordTarget,
type DiscordTarget,
type DiscordTargetKind,
type DiscordTargetParseOptions,
} from "./src/targets.js";
export { collectDiscordSecurityAuditFindings } from "./src/security-audit.js";
export {
DISCORD_ATTACHMENT_IDLE_TIMEOUT_MS,
DISCORD_ATTACHMENT_TOTAL_TIMEOUT_MS,
DISCORD_DEFAULT_INBOUND_WORKER_TIMEOUT_MS,
DISCORD_DEFAULT_LISTENER_TIMEOUT_MS,
} from "./src/monitor/timeouts.js";
/**
* @deprecated Shipped `@openclaw/discord/api` compatibility only. Use native
* `AbortSignal.any` after filtering optional signals. Removal with the next
* plugin-SDK major.
*/
export function mergeAbortSignals(
signals: Array<AbortSignal | undefined>,
): AbortSignal | undefined {
const activeSignals = signals.filter((signal): signal is AbortSignal => Boolean(signal));
return activeSignals.length > 1 ? AbortSignal.any(activeSignals) : activeSignals[0];
}
export type { DiscordSendComponents, DiscordSendEmbeds } from "./src/send.shared.js";
export type { DiscordSendResult } from "./src/send.types.js";
export type { DiscordTokenResolution } from "./src/token.js";