docs: document discord extension sources

This commit is contained in:
Peter Steinberger
2026-06-04 22:06:01 -04:00
parent efd1a9ace6
commit 23716de446
532 changed files with 534 additions and 6 deletions

View File

@@ -1,3 +1,4 @@
// Diagnostics Prometheus tests cover service plugin behavior.
import type { DiagnosticEventPrivateData } from "openclaw/plugin-sdk/diagnostic-runtime";
// Diagnostics Prometheus tests cover service plugin behavior.
import { describe, expect, it, vi } from "vitest";

View File

@@ -1,3 +1,4 @@
// Discord API module exposes the plugin public contract.
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import { inspectDiscordAccount } from "./src/account-inspect.js";

View File

@@ -1 +1,2 @@
// Discord API module exposes the plugin public contract.
export { handleDiscordAction } from "./src/actions/runtime.js";

View File

@@ -1,3 +1,4 @@
// Discord API module exposes the plugin public contract.
export { discordPlugin } from "./src/channel.js";
export { discordSetupPlugin } from "./src/channel.setup.js";
export {

View File

@@ -1 +1,2 @@
// Discord API module exposes the plugin public contract.
export { DiscordChannelConfigSchema } from "./src/config-schema.js";

View File

@@ -1,3 +1,4 @@
// Discord API module exposes the plugin public contract.
export {
buildChannelConfigSchema,
DiscordConfigSchema,

View File

@@ -1,3 +1,4 @@
// Discord helper module supports configured state behavior.
export function hasDiscordConfiguredState(params: { env?: NodeJS.ProcessEnv }): boolean {
return (
typeof params.env?.DISCORD_BOT_TOKEN === "string" &&

View File

@@ -1,3 +1,4 @@
// Discord API module exposes the plugin public contract.
export { createThreadBindingManager } from "./src/monitor/thread-bindings.manager.js";
export { testing as discordThreadBindingTesting } from "./src/monitor/thread-bindings.manager.js";
export {

View File

@@ -1,12 +1,10 @@
// Discord API module exposes the plugin public contract.
import {
listDiscordDirectoryGroupsFromConfig,
listDiscordDirectoryPeersFromConfig,
} from "./src/directory-config.js";
export {
listDiscordDirectoryGroupsFromConfig,
listDiscordDirectoryPeersFromConfig,
};
export { listDiscordDirectoryGroupsFromConfig, listDiscordDirectoryPeersFromConfig };
export const discordDirectoryContractPlugin = {
id: "discord",

View File

@@ -1 +1,2 @@
// Discord API module exposes the plugin public contract.
export { normalizeCompatibilityConfig, legacyConfigRules } from "./src/doctor-contract.js";

View File

@@ -1,3 +1,4 @@
// Discord tests cover index plugin behavior.
import { assertBundledChannelEntries } from "openclaw/plugin-sdk/channel-test-helpers";
import { describe } from "vitest";
import entry from "./index.js";

View File

@@ -1,3 +1,4 @@
// Discord plugin entrypoint registers its OpenClaw integration.
import { defineBundledChannelEntry } from "openclaw/plugin-sdk/channel-entry-contract";
import { registerDiscordSubagentHooks } from "./subagent-hooks-api.js";
import { discordVoiceTranscriptsSourceProvider } from "./transcripts-source-api.js";

View File

@@ -1 +1,2 @@
// Discord API module exposes the plugin public contract.
export { detectDiscordLegacyStateMigrations } from "./src/monitor/model-picker-preferences-migrations.js";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements runtime api.actions behavior.
export { handleDiscordAction } from "./src/actions/runtime.js";
export {
isDiscordModerationAction,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements runtime api.lookup behavior.
export { auditDiscordChannelPermissions, collectDiscordAuditChannelIds } from "./src/audit.js";
export {
listDiscordDirectoryGroupsLive,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements runtime api.monitor behavior.
export {
allowListMatches,
buildDiscordMediaPayload,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements runtime api.send behavior.
export {
resolveDiscordOutboundSessionRoute,
type ResolveDiscordOutboundSessionRouteParams,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements runtime api.threads behavior.
export {
testing as __testing,
testing,

View File

@@ -1,3 +1,4 @@
// Discord API module exposes the plugin public contract.
export {
discordMessageActions,
handleDiscordAction,

View File

@@ -1,3 +1,4 @@
// Discord API module exposes the plugin public contract.
export {
collectRuntimeConfigAssignments,
secretTargetRegistryEntries,

View File

@@ -1 +1,2 @@
// Discord API module exposes the plugin public contract.
export { collectDiscordSecurityAuditFindings } from "./src/security-audit.js";

View File

@@ -1,3 +1,4 @@
// Discord API module exposes the plugin public contract.
export {
collectUnsupportedSecretRefConfigCandidates,
unsupportedSecretRefSurfacePatterns,

View File

@@ -1 +1,2 @@
// Discord API module exposes the plugin public contract.
export { normalizeExplicitDiscordSessionKey } from "./src/session-key-normalization.js";

View File

@@ -1,3 +1,4 @@
// Discord tests cover setup entry plugin behavior.
import { describe, expect, it } from "vitest";
import setupEntry from "./setup-entry.js";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements setup entry behavior.
import { defineBundledChannelSetupEntry } from "openclaw/plugin-sdk/channel-entry-contract";
export default defineBundledChannelSetupEntry({

View File

@@ -1,3 +1,4 @@
// Discord tests cover account inspect plugin behavior.
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import { describe, expect, it } from "vitest";
import { inspectDiscordAccount } from "./account-inspect.js";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements account inspect behavior.
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/account-id";
import { normalizeSecretInputString } from "openclaw/plugin-sdk/secret-input";
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements account token inspect behavior.
import {
hasConfiguredSecretInput,
normalizeSecretInputString,

View File

@@ -1,3 +1,4 @@
// Discord tests cover accounts plugin behavior.
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import {
clearRuntimeConfigSnapshot,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements accounts behavior.
import {
createAccountActionGate,
createAccountListHelpers,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements handle action.guild admin behavior.
import type { AgentToolResult } from "openclaw/plugin-sdk/agent-core";
import {
readNonNegativeIntegerParam,

View File

@@ -1,3 +1,4 @@
// Discord tests cover handle action plugin behavior.
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import { beforeEach, describe, expect, it, vi } from "vitest";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements handle action behavior.
import type { AgentToolResult } from "openclaw/plugin-sdk/agent-core";
import {
readPositiveIntegerParam,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements runtime.guild behavior.
import { ChannelType, PermissionFlagsBits } from "discord-api-types/v10";
import type { AgentToolResult } from "openclaw/plugin-sdk/agent-core";
import { resolveDefaultDiscordAccountId } from "../accounts.js";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements runtime.messaging.messages behavior.
import {
jsonResult,
readPositiveIntegerParam,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements runtime.messaging.reactions behavior.
import {
jsonResult,
readPositiveIntegerParam,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements runtime.messaging behavior.
import { readDiscordComponentSpec } from "../components.js";
import type { OpenClawConfig } from "../runtime-api.js";
import { sendDiscordComponentMessage } from "../send.components.js";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements runtime.messaging.send behavior.
import { formatErrorMessage } from "openclaw/plugin-sdk/error-runtime";
import {
assertMediaNotDataUrl,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements runtime.messaging.shared behavior.
import { resolveOpenProviderRuntimeGroupPolicy } from "openclaw/plugin-sdk/runtime-group-policy";
import { mergeDiscordAccountConfig, resolveDefaultDiscordAccountId } from "../accounts.js";
import { createDiscordRuntimeAccountContext } from "../client.js";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements runtime.messaging behavior.
import type { AgentToolResult } from "openclaw/plugin-sdk/agent-core";
import type { ActionGate, DiscordActionConfig, OpenClawConfig } from "../runtime-api.js";
import { handleDiscordMessageManagementAction } from "./runtime.messaging.messages.js";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements runtime.moderation shared behavior.
import { PermissionFlagsBits } from "discord-api-types/v10";
import { readNonNegativeIntegerParam, readStringParam } from "../runtime-api.js";

View File

@@ -1,3 +1,4 @@
// Discord tests cover runtime.moderation.authz plugin behavior.
import { PermissionFlagsBits } from "discord-api-types/v10";
import type { DiscordActionConfig } from "openclaw/plugin-sdk/config-contracts";
import { beforeEach, describe, expect, it, vi } from "vitest";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements runtime.moderation behavior.
import type { AgentToolResult } from "openclaw/plugin-sdk/agent-core";
import {
type ActionGate,

View File

@@ -1,3 +1,4 @@
// Discord tests cover runtime.presence plugin behavior.
import type { DiscordActionConfig } from "openclaw/plugin-sdk/config-contracts";
import { beforeEach, describe, expect, it, vi } from "vitest";
import type { GatewayPlugin } from "../internal/gateway.js";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements runtime.presence behavior.
import type { AgentToolResult } from "openclaw/plugin-sdk/agent-core";
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
import type { Activity, UpdatePresenceData } from "../internal/gateway.js";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements runtime.shared behavior.
import {
parseAvailableTags,
readNonNegativeIntegerParam,

View File

@@ -1,3 +1,4 @@
// Discord tests cover runtime plugin behavior.
import { ChannelType, PermissionFlagsBits } from "discord-api-types/v10";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import type { DiscordActionConfig } from "openclaw/plugin-sdk/config-contracts";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements runtime behavior.
import type { AgentToolResult } from "openclaw/plugin-sdk/agent-core";
import { createDiscordActionGate } from "../accounts.js";
import { readStringParam, type OpenClawConfig } from "../runtime-api.js";

View File

@@ -1,3 +1,4 @@
// Discord tests cover api barrel plugin behavior.
import { readFileSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";

View File

@@ -1,3 +1,4 @@
// Discord tests cover api plugin behavior.
import { MAX_TIMER_TIMEOUT_MS } from "openclaw/plugin-sdk/number-runtime";
import { withFetchPreconnect } from "openclaw/plugin-sdk/test-env";
import { beforeEach, describe, expect, it, vi } from "vitest";

View File

@@ -1,3 +1,4 @@
// Discord API module exposes the plugin public contract.
import { resolveFetch } from "openclaw/plugin-sdk/fetch-runtime";
import { resolveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
import {

View File

@@ -1,3 +1,4 @@
// Discord tests cover approval handler plugin behavior.
import { describe, expect, it } from "vitest";
import { discordApprovalNativeRuntime } from "./approval-handler.runtime.js";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements approval handler behavior.
import { ButtonStyle } from "discord-api-types/v10";
import type {
ChannelApprovalCapabilityHandlerContext,

View File

@@ -1,3 +1,4 @@
// Discord tests cover approval native plugin behavior.
import fs from "node:fs";
import os from "node:os";
import path from "node:path";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements approval native behavior.
import { createLazyChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-adapter-runtime";
import type { ChannelApprovalNativeRuntimeAdapter } from "openclaw/plugin-sdk/approval-handler-runtime";
import { resolveApprovalRequestSessionConversation } from "openclaw/plugin-sdk/approval-native-runtime";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements approval runtime behavior.
export {
isChannelExecApprovalClientEnabledFromConfig,
matchesApprovalRequestFilters,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements approval shared behavior.
import { doesApprovalRequestMatchChannelAccount } from "openclaw/plugin-sdk/approval-native-runtime";
import type {
ExecApprovalRequest,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements audit core behavior.
import { ChannelType } from "discord-api-types/v10";
import type {
DiscordGuildChannelConfig,

View File

@@ -1,3 +1,4 @@
// Discord tests cover audit plugin behavior.
import { ChannelType } from "discord-api-types/v10";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import { beforeEach, describe, expect, it, vi } from "vitest";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements audit behavior.
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import { inspectDiscordAccount } from "./account-inspect.js";
import {

View File

@@ -1,3 +1,4 @@
// Discord tests cover channel actions.contract plugin behavior.
import { installChannelActionsContractSuite } from "openclaw/plugin-sdk/channel-test-helpers";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import { describe } from "vitest";

View File

@@ -1 +1,2 @@
// Discord plugin module implements channel actions behavior.
export { handleDiscordMessageAction } from "./actions/handle-action.js";

View File

@@ -1,3 +1,4 @@
// Discord tests cover channel actions plugin behavior.
import type { ChannelMessageActionContext } from "openclaw/plugin-sdk/channel-contract";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import { withEnv } from "openclaw/plugin-sdk/test-env";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements channel actions behavior.
import { createUnionActionGate } from "openclaw/plugin-sdk/channel-actions";
import type {
ChannelMessageActionAdapter,

View File

@@ -1,3 +1,4 @@
// Discord API module exposes the plugin public contract.
export { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
export {
buildTokenChannelStatusSummary,

View File

@@ -1,3 +1,4 @@
// Discord tests cover channel.conversation plugin behavior.
import { describe, expect, it } from "vitest";
import {
matchDiscordAcpConversation,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements channel.conversation behavior.
import {
normalizeLowercaseStringOrEmpty,
normalizeOptionalStringifiedId,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements channel.loaders behavior.
import { createLazyRuntimeModule } from "openclaw/plugin-sdk/lazy-runtime";
let discordProviderRuntimePromise:

View File

@@ -1,3 +1,4 @@
// Discord tests cover channel.message adapter plugin behavior.
import {
verifyChannelMessageAdapterCapabilityProofs,
verifyChannelMessageLiveCapabilityAdapterProofs,

View File

@@ -1 +1,2 @@
// Discord plugin module implements channel behavior.
export { discordSetupWizard } from "./setup-surface.js";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements channel.setup behavior.
import type { ResolvedDiscordAccount } from "./accounts.js";
import type { ChannelPlugin } from "./channel-api.js";
import { discordSetupWizard } from "./channel.runtime.js";

View File

@@ -1,3 +1,4 @@
// Discord tests cover channel plugin behavior.
import { readFile } from "node:fs/promises";
import { resolve } from "node:path";
import { ChannelType } from "discord-api-types/v10";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements channel behavior.
import {
buildLegacyDmAccountAllowlistAdapter,
createAccountScopedAllowlistNameResolver,

View File

@@ -1,3 +1,4 @@
// Discord tests cover chunk plugin behavior.
import { countLines, hasBalancedFences } from "openclaw/plugin-sdk/test-fixtures";
import { describe, expect, it } from "vitest";
import { chunkDiscordText, chunkDiscordTextWithMode } from "./chunk.js";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements chunk behavior.
import { resolveIntegerOption } from "openclaw/plugin-sdk/number-runtime";
import { chunkMarkdownTextWithMode, type ChunkMode } from "openclaw/plugin-sdk/reply-chunking";

View File

@@ -1,3 +1,4 @@
// Discord tests cover client.proxy plugin behavior.
import http from "node:http";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import { fetch as undiciFetch } from "undici";

View File

@@ -1,3 +1,4 @@
// Discord tests cover client plugin behavior.
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import { afterEach, describe, expect, it, vi } from "vitest";
import { createDiscordRestClient } from "./client.js";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements client behavior.
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import { requireRuntimeConfig } from "openclaw/plugin-sdk/plugin-config-runtime";
import type { RetryConfig, RetryRunner } from "openclaw/plugin-sdk/retry-runtime";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements component custom id behavior.
import { parseCustomId, type ComponentParserResult } from "./internal/discord.js";
export const DISCORD_COMPONENT_CUSTOM_ID_KEY = "occomp";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements components registry behavior.
import { resolveGlobalMap } from "openclaw/plugin-sdk/global-singleton";
import {
asDateTimestampMs,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements components.builders behavior.
import crypto from "node:crypto";
import { ButtonStyle, MessageFlags } from "discord-api-types/v10";
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements components.modal behavior.
import {
buildDiscordModalCustomId as buildDiscordModalCustomIdImpl,
parseDiscordModalCustomIdForInteraction as parseDiscordModalCustomIdForInteractionImpl,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements components.parse behavior.
import { ButtonStyle, TextInputStyle } from "discord-api-types/v10";
import { normalizeLowercaseStringOrEmpty } from "openclaw/plugin-sdk/string-coerce-runtime";
import type {

View File

@@ -1,3 +1,4 @@
// Discord tests cover components plugin behavior.
import { ButtonStyle, MessageFlags } from "discord-api-types/v10";
import { MAX_DATE_TIMESTAMP_MS } from "openclaw/plugin-sdk/number-runtime";
import { beforeAll, beforeEach, describe, expect, it, vi } from "vitest";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements components behavior.
export {
DISCORD_COMPONENT_CUSTOM_ID_KEY,
DISCORD_MODAL_CUSTOM_ID_KEY,

View File

@@ -1,3 +1,4 @@
// Discord type declarations define plugin contracts.
import type { TopLevelComponents } from "./internal/discord.js";
export type DiscordComponentButtonStyle = "primary" | "secondary" | "success" | "danger" | "link";

View File

@@ -1,3 +1,4 @@
// Discord tests cover config schema plugin behavior.
import { describe, expect, it } from "vitest";
import { DiscordConfigSchema } from "../config-api.js";

View File

@@ -1,3 +1,4 @@
// Discord helper module supports config schema behavior.
import { buildChannelConfigSchema, DiscordConfigSchema } from "../config-api.js";
import { discordChannelConfigUiHints } from "./config-ui-hints.js";

View File

@@ -1,3 +1,4 @@
// Discord helper module supports config ui hints behavior.
import type { ChannelConfigUiHint } from "openclaw/plugin-sdk/channel-core";
export const discordChannelConfigUiHints = {

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements conversation identity behavior.
import {
normalizeOptionalLowercaseString,
normalizeOptionalString,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements delivery retry behavior.
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import {
resolveRetryConfig,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements directory cache behavior.
import { DEFAULT_ACCOUNT_ID, normalizeAccountId } from "openclaw/plugin-sdk/routing";
import {
normalizeLowercaseStringOrEmpty,

View File

@@ -1,3 +1,4 @@
// Discord helper module supports directory config behavior.
import { normalizeAccountId } from "openclaw/plugin-sdk/account-id";
import {
createResolvedDirectoryEntriesLister,

View File

@@ -1,3 +1,4 @@
// Discord tests cover directory contract plugin behavior.
import type { BaseProbeResult, BaseTokenResolution } from "openclaw/plugin-sdk/channel-contract";
import { expectDirectoryIds } from "openclaw/plugin-sdk/channel-test-helpers";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";

View File

@@ -1,3 +1,4 @@
// Discord tests cover directory live plugin behavior.
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import type { DirectoryConfigParams } from "openclaw/plugin-sdk/directory-runtime";
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements directory live behavior.
import type {
ChannelDirectoryEntry,
DirectoryConfigParams,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements doctor contract behavior.
import type {
ChannelDoctorConfigMutation,
ChannelDoctorLegacyConfigRule,

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements doctor shared behavior.
import type { ChannelDoctorLegacyConfigRule } from "openclaw/plugin-sdk/channel-contract";
// Runtime config loading already normalizes these aliases without rewriting the

View File

@@ -1,3 +1,4 @@
// Discord tests cover doctor plugin behavior.
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import { describe, expect, it } from "vitest";
import {

View File

@@ -1,3 +1,4 @@
// Discord plugin module implements doctor behavior.
import type { ChannelDoctorAdapter } from "openclaw/plugin-sdk/channel-contract";
import type { OpenClawConfig } from "openclaw/plugin-sdk/config-contracts";
import { collectProviderDangerousNameMatchingScopes } from "openclaw/plugin-sdk/runtime-doctor";

Some files were not shown because too many files have changed in this diff Show More